Return the Firewall given its ID.
428728
def get_fw(self, fw_id):
        
        fw = None
        try:
            fw = self.neutronclient.show_firewall(fw_id)
        except Exception as exc:
            LOG.error("Failed to get firewall list for id %(id)s, "
                      "Exc %(exc)s", {'id': fw_id, 'exc': str(exc)})
        return fw
702056
def cli(env, identifier, no_vs, no_hardware):
    """"""

    mgr = SoftLayer.NetworkManager(env.client)

    vlan_id = helpers.resolve_id(mgr.resolve_vlan_ids, identifier, 'VLAN')
    vlan = mgr.get_vlan(vlan_id)

    table = formatting.KeyValueTable(['name', 'value'])
    table.align['name'] = 'r'
    table.align['value'] = 'l'

    table.add_row(['id', vlan['id']])
    table.add_row(['number', vlan['vlanNumber']])
    table.add_row(['datacenter',
                   vlan['primaryRouter']['datacenter']['longName']])
    table.add_row(['primary_router',
                   vlan['primaryRouter']['fullyQualifiedDomainName']])
    table.add_row(['firewall',
                   'Yes' if vlan['firewallInterfaces'] else 'No'])
    subnets = []
    for subnet in vlan.get('subnets', []):
        subnet_table = formatting.KeyValueTable(['name', 'value'])
        subnet_table.align['name'] = 'r'
        subnet_table.align['value'] = 'l'
        subnet_table.add_row(['id', subnet['id']])
        subnet_table.add_row(['identifier', subnet['networkIdentifier']])
        subnet_table.add_row(['netmask', subnet['netmask']])
        subnet_table.add_row(['gateway', subnet.get('gateway', '-')])
        subnet_table.add_row(['type', subnet['subnetType']])
        subnet_table.add_row(['usable ips',
                              subnet['usableIpAddressCount']])
        subnets.append(subnet_table)

    table.add_row(['subnets', subnets])

    server_columns = ['hostname', 'domain', 'public_ip', 'private_ip']

    if not no_vs:
        if vlan.get('virtualGuests'):
            vs_table = formatting.KeyValueTable(server_columns)
            for vsi in vlan['virtualGuests']:
                vs_table.add_row([vsi.get('hostname'),
                                  vsi.get('domain'),
                                  vsi.get('primaryIpAddress'),
                                  vsi.get('primaryBackendIpAddress')])
            table.add_row(['vs', vs_table])
        else:
            table.add_row(['vs', 'none'])

    if not no_hardware:
        if vlan.get('hardware'):
            hw_table = formatting.Table(server_columns)
            for hardware in vlan['hardware']:
                hw_table.add_row([hardware.get('hostname'),
                                  hardware.get('domain'),
                                  hardware.get('primaryIpAddress'),
                                  hardware.get('primaryBackendIpAddress')])
            table.add_row(['hardware', hw_table])
        else:
            table.add_row(['hardware', 'none'])

    env.fout(table)
198020
def _id(self):
        
        """
        if self.get("id") is not None:
            return self.id
        elif self.get("fingerprint") is not None:
            return self.fingerprint
        else:
            raise TypeError('SSHKey has neither .id nor .fingerprint')
863216
def get_block(self, block_identifier: BlockSpecification) -> Dict:
        """"""
        return self.web3.eth.getBlock(block_identifier)
228361
def find_by_id(self, submission_id):
    
    return self._attacks.get(
        submission_id,
        self._defenses.get(
            submission_id,
            self._targeted_attacks.get(submission_id, None)))
82896
def get_out_net_id(cls, tenant_id):
        
        if 'out' not in cls.ip_db_obj:
            LOG.error("Fabric not prepared for tenant %s", tenant_id)
            return None
        db_obj = cls.ip_db_obj.get('out')
        out_subnet_dict = cls.get_out_ip_addr(tenant_id)
        sub = db_obj.get_subnet(out_subnet_dict.get('subnet'))
        return sub.network_id
180705
public ArrayList<String> ip_firewall_GET(String ip, Boolean enabled, OvhFirewallStateEnum state) throws IOException {
		String qPath = "/ip/{ip}/firewall";
		StringBuilder sb = path(qPath, ip);
		query(sb, "enabled", enabled);
		query(sb, "state", state);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, t2);
	}
967392
def _get_firewall_policy(kwargs):
    '''
    
    '''
    fp_name = kwargs.get('name', None)
    fp_description = kwargs.get('description', None)
    firewallPolicy = FirewallPolicy(
        name=fp_name,
        description=fp_description
    )

    fpr_json = kwargs.get('rules', None)
    jdata = json.loads(fpr_json)
    rules = []
    for fwpr in jdata:
        firewallPolicyRule = FirewallPolicyRule()
        if 'protocol' in fwpr:
            firewallPolicyRule.rule_set['protocol'] = fwpr['protocol']
        if 'port_from' in fwpr:
            firewallPolicyRule.rule_set['port_from'] = fwpr['port_from']
        if 'port_to' in fwpr:
            firewallPolicyRule.rule_set['port_to'] = fwpr['port_to']
        if 'source' in fwpr:
            firewallPolicyRule.rule_set['source'] = fwpr['source']
        if 'action' in fwpr:
            firewallPolicyRule.rule_set['action'] = fwpr['action']
        if 'description' in fwpr:
            firewallPolicyRule.rule_set['description'] = fwpr['description']
        if 'port' in fwpr:
            firewallPolicyRule.rule_set['port'] = fwpr['port']
        rules.append(firewallPolicyRule)

    return {'firewall_policy': firewallPolicy, 'firewall_policy_rules': rules}
604995
def get(self):
        """"""
        q = queue.Queue()

        for u, j, k in urls:
            t = threading.Thread(target=self._get_ip_public, args=(q, u, j, k))
            t.daemon = True
            t.start()

        timer = Timer(self.timeout)
        ip = None
        while not timer.finished() and ip is None:
            if q.qsize() > 0:
                ip = q.get()

        return ', '.join(set([x.strip() for x in ip.split(',')]))
493831
public static Bridge get(final String id) throws Exception {
        
        final BandwidthClient client = BandwidthClient.getInstance();
        return get(client, id); 
    }
771769
public Server getServerById(final String id) {
        for (Server server : SERVERS) {
            if (server.getId().equals(id)) {
                return server;
            }
        }

        return null;
    }
774972
def get_by_id_or_404(self, id, **kwargs):
        """"""
        obj = self.get_by_id(id=id, **kwargs)

        if obj:
            return obj

        raise Http404
637295
def get_gateway_id(self):
        """"""
        info = next(serial.tools.list_ports.grep(self.port), None)
        return info.serial_number if info is not None else None
980035
def cli(env, identifier):
    """"""

    mgr = SoftLayer.FirewallManager(env.client)

    firewall_type, firewall_id = firewall.parse_id(identifier)
    if firewall_type == 'vlan':
        rules = mgr.get_dedicated_fwl_rules(firewall_id)
    else:
        rules = mgr.get_standard_fwl_rules(firewall_id)

    env.fout(get_rules_table(rules))
595223
def get(cls, id):
        '''
        
        '''
        client = cls._new_api_client()
        return client.make_request(cls, 'get', url_params={'id': id})
789505
def get_firewall_rule(self, server_uuid, firewall_rule_position, server_instance=None):
        
        url = '/server/{0}/firewall_rule/{1}'.format(server_uuid, firewall_rule_position)
        res = self.get_request(url)
        return FirewallRule(**res['firewall_rule'])
1165430
def get_id(name=None, cidr=None, tags=None, region=None, key=None, keyid=None,
           profile=None):
    '''
    

    '''

    try:
        return {'id': _get_id(vpc_name=name, cidr=cidr, tags=tags, region=region,
                              key=key, keyid=keyid, profile=profile)}
    except BotoServerError as e:
        return {'error': __utils__['boto.get_error'](e)}