Fetches information of a certain load balancer member.
166092
def show_member(self, member, **_params):
        """"""
        return self.get(self.member_path % (member), params=_params)
64062
def add_pool_member(lb, name, port, pool_name):
    '''
    
    '''
    if __opts__['load_balancers'].get(lb, None):
        (username, password) = list(__opts__['load_balancers'][lb].values())
    else:
        raise Exception('Unable to find `{0}` load balancer'.format(lb))
    F5 = F5Mgmt(lb, username, password)
    F5.add_pool_member(name, port, pool_name)
    return True
987534
def get_lbaas_agent_hosting_loadbalancer(self, loadbalancer, **_params):
        """"""
        return self.get((self.lbaas_loadbalancer_path +
                         self.LOADBALANCER_HOSTING_AGENT) % loadbalancer,
                        params=_params)
810284
private List<JSONObject> findAllMembers(@Nullable String loadBalancerId) throws CloudException, InternalException {
        NovaMethod method = new NovaMethod(getProvider());
        JSONObject result = method.getNetworks(getMembersResource(), null, false, "?tenant_id="+getContext().getAccountNumber());
        List<JSONObject> members = new ArrayList<JSONObject>();
        if( result != null && result.has("members") ) {
            try {
                JSONArray list = result.getJSONArray("members");
                for( int i = 0; i < list.length(); i++ ) {
                    JSONObject member = list.getJSONObject(i);
                    if( (loadBalancerId != null && loadBalancerId.equals(member.optString("pool_id")) )
                        || loadBalancerId == null) {
                        members.add(member);
                    }
                }
            }
            catch( JSONException e ) {
                logger.error("Unable to understand listMembers response: " + e.getMessage());
                throw new CloudException(e);
            }
        }
        return members;
    }
1027791
def _get_all_tags(conn, load_balancer_names=None):
    '''
    
    '''
    params = {}
    if load_balancer_names:
        conn.build_list_params(params, load_balancer_names,
                               'LoadBalancerNames.member.%d')

    tags = conn.get_object(
        'DescribeTags',
        params,
        __utils__['boto_elb_tag.get_tag_descriptions'](),
        verb='POST'
    )
    if tags[load_balancer_names]:
        return tags[load_balancer_names]
    else:
        return None
1301803
def cli(env, identifier, allocation, port, routing_type, routing_method):
    """"""

    mgr = SoftLayer.LoadBalancerManager(env.client)

    _, loadbal_id = loadbal.parse_id(identifier)

    mgr.add_service_group(loadbal_id,
                          allocation=allocation,
                          port=port,
                          routing_type=routing_type,
                          routing_method=routing_method)

    env.fout('Load balancer service group is being added!')
1026323
def get(method, hmc, uri, uri_parms, logon_required):
        """"""
        query_str = uri_parms[0]
        try:
            console = hmc.consoles.lookup_by_oid(None)
        except KeyError:
            raise InvalidResourceError(method, uri)
        result_users = []
        filter_args = parse_query_parms(method, uri, query_str)
        for user in console.users.list(filter_args):
            result_user = {}
            for prop in user.properties:
                if prop in ('object-uri', 'name', 'type'):
                    result_user[prop] = user.properties[prop]
            result_users.append(result_user)
        return {'users': result_users}
176454
def getWorkerInfo(dataTask):
    """"""
    workertime = []
    workertasks = []
    for fichier, vals in dataTask.items():
        if hasattr(vals, 'values'):
            #workers_names.append(fichier)
            # Data from worker
            totaltime = sum([a['executionTime'] for a in vals.values()])
            totaltasks = sum([1 for a in vals.values()])
            workertime.append(totaltime)
            workertasks.append(totaltasks)
    return workertime, workertasks
863639
def cli(env):
    """"""
    mgr = SoftLayer.LoadBalancerManager(env.client)

    routing_methods = mgr.get_routing_methods()
    table = formatting.KeyValueTable(['ID', 'Name'])
    table.align['ID'] = 'l'
    table.align['Name'] = 'l'
    table.sortby = 'ID'
    for routing_method in routing_methods:
        table.add_row([routing_method['id'], routing_method['name']])

    env.fout(table)
1216594
function (loadBalancer, callback) {
    var self = this,
        loadBalancerId =
          loadBalancer instanceof lb.LoadBalancer ? loadBalancer.id : loadBalancer;

    self._request({
      path: urlJoin(_urlPrefix, loadBalancerId, 'nodes', 'events')
    }, function (err, body) {
      return err
        ? callback(err)
        : callback(err, body.nodeServiceEvents);
    });
  }
731219
def member_info(self, member_id):
        """"""
        server_id = self._servers.host_to_server_id(
            self.member_id_to_host(member_id))
        server_info = self._servers.info(server_id)
        result = {'_id': member_id, 'server_id': server_id,
                  'mongodb_uri': server_info['mongodb_uri'],
                  'procInfo': server_info['procInfo'],
                  'statuses': server_info['statuses']}
        if self.login:
            result['mongodb_auth_uri'] = self.mongodb_auth_uri(
                self._servers.hostname(server_id))
        result['rsInfo'] = {}
        if server_info['procInfo']['alive']:
            # Can't call serverStatus on arbiter when running with auth enabled.
            # (SERVER-5479)
            if self.login or self.auth_key:
                arbiter_ids = [member['_id'] for member in self.arbiters()]
                if member_id in arbiter_ids:
                    result['rsInfo'] = {
                        'arbiterOnly': True, 'secondary': False, 'primary': False}
                    return result
            repl = self.run_command('serverStatus', arg=None, is_eval=False, member_id=member_id)['repl']
            logger.debug("member {member_id} repl info: {repl}".format(**locals()))
            for key in ('votes', 'tags', 'arbiterOnly', 'buildIndexes', 'hidden', 'priority', 'slaveDelay', 'votes', 'secondary'):
                if key in repl:
                    result['rsInfo'][key] = repl[key]
            result['rsInfo']['primary'] = repl.get('ismaster', False)

        return result
1136043
def get_role_members(self, role):
        """"""
        targetRoleDb = AuthGroup.objects(creator=self.client, role=role)
        members = AuthMembership.objects(groups__in=targetRoleDb).only('user')
        return json.loads(members.to_json())
212189
def _get_lb(self, lb_or_id):
        
        if isinstance(lb_or_id, CloudLoadBalancer):
            ret = lb_or_id
        else:
            ret = self.get(lb_or_id)
        return ret
811905
async def fetch_logical_load(self, llid):
        """"""
        url = "https://production.plum.technology/v2/getLogicalLoad"
        data = {"llid": llid}
        return await self.__post(url, data)
809634
private int getDataMemberListIndex(Member member) {
        final Collection<Member> dataMembers = nodeEngine.getClusterService().getMembers(DATA_MEMBER_SELECTOR);
        int index = -1;
        for (Member dataMember : dataMembers) {
            index++;
            if (dataMember.equals(member)) {
                return index;
            }
        }
        return index;
    }
1316260
def check_member_pool(lb, member, pool_name):
    '''
    
    '''
    if __opts__['load_balancers'].get(lb, None):
        (username, password) = list(__opts__['load_balancers'][lb].values())
    else:
        raise Exception('Unable to find `{0}` load balancer'.format(lb))
    F5 = F5Mgmt(lb, username, password)
    return F5.check_member_pool(member, pool_name)
1146376
@Override
	public void pingingloadBalancer(SipLoadBalancer balancerDescription) {
		SipConnector[] sipConnectors = sipService.findSipConnectors();
		for (SipConnector sipConnector : sipConnectors) {
			if(logger.isDebugEnabled()) {
				logger.debug("Comparing Balancer Address " + balancerDescription.getAddress().getHostAddress() +
						" to sipconnector balancer address " + sipConnector.getLoadBalancerAddress());
			}
			if(balancerDescription.getAddress().getHostAddress().equals(sipConnector.getLoadBalancerAddress())
					&& sipConnector.getLoadBalancerCustomInformation() != null
					&& !sipConnector.getLoadBalancerCustomInformation().isEmpty()) {
				balancerDescription.setCustomInfo(sipConnector.getLoadBalancerCustomInformation());
			}
		}
	}