Returns a specified local load balancer given the id.

        :param int loadbal_id: The id of the load balancer to retrieve
        :returns: A dictionary containing the details of the load balancer
514220
def get_local_lb(self, loadbal_id, **kwargs):
        

        if 'mask' not in kwargs:
            kwargs['mask'] = ('loadBalancerHardware[datacenter], '
                              'ipAddress, virtualServers[serviceGroups'
                              '[routingMethod,routingType,services'
                              '[healthChecks[type], groupReferences,'
                              ' ipAddress]]]')

        return self.lb_svc.getObject(id=loadbal_id, **kwargs)
838156
def get_replicas(self, service_id: str) -> str:
        
        # Initialising empty list
        replicas = []

        # Raise an exception if we are not a manager
        if not self._manager:
            raise RuntimeError('Only the Swarm manager node can retrieve '
                               'replication level of the service')

        service_tasks = self._client.services.get(service_id).tasks()
        for task in service_tasks:
            if task['Status']['State'] == "running":
                replicas.append(task)
        return len(replicas)
980192
def local_id(self):
        
        return hashlib.sha256(("%s%s" % (
            self.institution.local_id(),
            self.number)).encode()).hexdigest()
1140860
def get(self, id):
        
        url = self._url('%s' % (id))
        return self.client.get(url)
74594
def get(self, id_):
        
        if self.api.queue_exists(id_):
            return Queue(self, {"queue": {"name": id_, "id_": id_}}, key="queue")
        raise exc.NotFound("The queue '%s' does not exist." % id_)
1364004
def get(self, id):
        
        with rconnect() as conn:
            if id is None:
                raise ValueError

            if isinstance(id, uuid.UUID):
                id = str(id)

            if type(id) != str and type(id) != unicode:
                raise ValueError

            try:
                query = self._base().get(id)
                log.debug(query)
                rv = query.run(conn)
            except ReqlOpFailedError as e:
                log.warn(e)
                raise
            except Exception as e:
                log.warn(e)
                raise
            if rv is not None:
                return self._model(rv)

            return None
648589
def list_elb(region, filter_by_kwargs):
    """"""
    conn = boto.ec2.elb.connect_to_region(region)
    instances = conn.get_all_load_balancers()
    return lookup(instances, filter_by=filter_by_kwargs)
226313
def retrieve_loadbalancer_stats(self, loadbalancer, **_params):
        """"""
        return self.get(self.lbaas_loadbalancer_path_stats % (loadbalancer),
                        params=_params)
1294627
def get_load(jid):
    '''
    
    '''
    options = _get_options(ret=None)
    _response = _request("GET", options['url'] + options['db'] + '/' + jid)
    if 'error' in _response:
        log.error('Unable to get JID "%s" : "%s"', jid, _response)
        return {}
    return {_response['id']: _response}
397557
def get_metadata(self, lcid):
        
        if self._metadata is None:
            self._metadata = fetch_rrlyrae_lc_params()
        i = np.where(self._metadata['id'] == lcid)[0]
        if len(i) == 0:
            raise ValueError("invalid lcid: {0}".format(lcid))
        return self._metadata[i[0]]
557880
def get_descriptor_by_id(self, id, is_master_id=None):
        
        route_values = {}
        if id is not None:
            route_values['id'] = self._serialize.url('id', id, 'str')
        query_parameters = {}
        if is_master_id is not None:
            query_parameters['isMasterId'] = self._serialize.query('is_master_id', is_master_id, 'bool')
        response = self._send(http_method='GET',
                              location_id='a230389a-94f2-496c-839f-c929787496dd',
                              version='5.0-preview.1',
                              route_values=route_values,
                              query_parameters=query_parameters)
        return self._deserialize('str', response)
897494
def cli(env, identifier, enabled, port, weight, healthcheck_type, ip_address):
    """"""

    mgr = SoftLayer.LoadBalancerManager(env.client)

    loadbal_id, group_id = loadbal.parse_id(identifier)

    # check if the IP is valid
    ip_address_id = None
    if ip_address:
        ip_service = env.client['Network_Subnet_IpAddress']
        ip_record = ip_service.getByIpAddress(ip_address)
        if len(ip_record) > 0:
            ip_address_id = ip_record['id']

    mgr.add_service(loadbal_id,
                    group_id,
                    ip_address_id=ip_address_id,
                    enabled=enabled,
                    port=port,
                    weight=weight,
                    hc_type=healthcheck_type)
    env.fout('Load balancer service is being added!')
377344
def get_by_id(self, id_networkv4):
        

        uri = 'api/networkv4/%s/' % id_networkv4

        return super(ApiNetworkIPv4, self).get(uri)
1017578
def get(self, collection_id):
        
        url = "/collections/%s" % collection_id
        result = self._get(url)
        return CollectionModel.parse(result)
841837
def _get_one(self, id):
        
        try:
            return self._to_dict(models.User.objects.get(pk=id))
        except models.User.DoesNotExist:
            raise errors.NotFound()
199657
def get_lb_pkgs(self):
        

        _filter = {'items': {'description':
                             utils.query_filter('*Load Balancer*')}}

        packages = self.prod_pkg.getItems(id=0, filter=_filter)
        pkgs = []
        for package in packages:
            if not package['description'].startswith('Global'):
                pkgs.append(package)
        return pkgs
933527
def cancel_lb(self, loadbal_id):
        

        lb_billing = self.lb_svc.getBillingItem(id=loadbal_id)
        billing_id = lb_billing['id']
        billing_item = self.client['Billing_Item']
        return billing_item.cancelService(id=billing_id)