Get cluster member status

    .. versionchanged:: 2015.8.0

    CLI Example:

    .. code-block:: bash

        salt '*' riak.member_status
182342
def member_status():
    '''
    
    '''
    ret = {'membership': {},
           'summary': {'Valid': 0,
                       'Leaving': 0,
                       'Exiting': 0,
                       'Joining': 0,
                       'Down': 0,
                       }}

    out = __execute_cmd('riak-admin', 'member-status')['stdout'].splitlines()

    for line in out:
        if line.startswith(('=', '-', 'Status')):
            continue
        if '/' in line:
            # We're in the summary line
            for item in line.split('/'):
                key, val = item.split(':')
                ret['summary'][key.strip()] = val.strip()

        if len(line.split()) == 4:
            # We're on a node status line
            (status, ring, pending, node) = line.split()

            ret['membership'][node] = {
                'Status': status,
                'Ring': ring,
                'Pending': pending
            }

    return ret
626296
private Version getClusterOrNodeVersion() {
        if (node.getClusterService() != null && !node.getClusterService().getClusterVersion().isUnknown()) {
            return node.getClusterService().getClusterVersion();
        } else {
            String overriddenClusterVersion = node.getProperties().getString(GroupProperty.INIT_CLUSTER_VERSION);
            return (overriddenClusterVersion != null) ? MemberVersion.of(overriddenClusterVersion).asVersion()
                    : node.getVersion().asVersion();
        }
    }
1237434
def primary_status
      session.cluster.with_primary do |primary|
        primary.command(:admin, replSetGetStatus: 1)
      end
    rescue => e
      raise ConnectionFailed, e
    end
1037210
def cluster_commit():
    '''
    
    '''
    ret = {'comment': '', 'success': False}

    cmd = __execute_cmd('riak-admin', 'cluster commit')

    if cmd['retcode'] != 0:
        ret['comment'] = cmd['stdout']
    else:
        ret['comment'] = cmd['stdout']
        ret['success'] = True

    return ret
953485
def get_status(self, hosts, services):
        

        if self.got_business_rule:
            mapping = {
                0: u'OK',
                1: u'WARNING',
                2: u'CRITICAL',
                3: u'UNKNOWN',
                4: u'UNREACHABLE',
            }
            return mapping.get(self.business_rule.get_state(hosts, services), "n/a")

        return self.state
877149
def get_status(self):
        
        logger.debug("get server status")
        server_status = ctypes.c_int()
        cpu_status = ctypes.c_int()
        clients_count = ctypes.c_int()
        error = self.library.Srv_GetStatus(self.pointer, ctypes.byref(server_status),
                                           ctypes.byref(cpu_status),
                                           ctypes.byref(clients_count))
        check_error(error)
        logger.debug("status server %s cpu %s clients %s" %
                     (server_status.value, cpu_status.value,
                      clients_count.value))
        return snap7.snap7types.server_statuses[server_status.value], \
               snap7.snap7types.cpu_statuses[cpu_status.value], \
               clients_count.value
88424
def get_lsf_status():
    
    status_count = {'RUN': 0,
                    'PEND': 0,
                    'SUSP': 0,
                    'USUSP': 0,
                    'NJOB': 0,
                    'UNKNWN': 0}

    try:
        subproc = subprocess.Popen(['bjobs'],
                                   stdout=subprocess.PIPE,
                                   stderr=subprocess.PIPE)
        subproc.stderr.close()
        output = subproc.stdout.readlines()
    except OSError:
        return status_count

    for line in output[1:]:
        line = line.strip().split()
        # Protect against format of multiproc jobs
        if len(line) < 5: 
            continue

        status_count['NJOB'] += 1

        for k in status_count:
            if line[2] == k:
                status_count[k] += 1

    return status_count
933204
def _get_task_statuses(task_ids, cluster):
    
    response = client.describe_tasks(tasks=task_ids, cluster=cluster)

    # Error checking
    if response['failures'] != []:
        raise Exception('There were some failures:\n{0}'.format(
            response['failures']))
    status_code = response['ResponseMetadata']['HTTPStatusCode']
    if status_code != 200:
        msg = 'Task status request received status code {0}:\n{1}'
        raise Exception(msg.format(status_code, response))

    return [t['lastStatus'] for t in response['tasks']]
648917
def ib_group_member_list(self, group_id):
        '''  '''
        req_hook = 'pod/v1/admin/group/' + group_id + '/membership/list'
        req_args = None
        status_code, response = self.__rest__.GET_query(req_hook, req_args)
        self.logger.debug('%s: %s' % (status_code, response))
        return status_code, response
936935
def get_status(self):
        

        try:
            api_response = self.api.read_namespaced_service_status(self.name, self.namespace)
        except ApiException as e:
            raise ConuException(
                "Exception when calling Kubernetes API - read_namespaced_service_status: %s\n" % e)

        return api_response.status
1000971
def get_multizone_status(host, services=None, zconf=None):
    

    try:
        status = status = _get_status(
            host, services, zconf, "/setup/eureka_info?params=multizone")

        dynamic_groups = []
        if 'multizone' in status and 'dynamic_groups' in status['multizone']:
            for group in status['multizone']['dynamic_groups']:
                name = group.get('name', "Unknown group name")
                udn = group.get('uuid', None)
                uuid = None
                if udn:
                    uuid = UUID(udn.replace('-', ''))
                dynamic_groups.append(MultizoneInfo(name, uuid))

        groups = []
        if 'multizone' in status and 'groups' in status['multizone']:
            for group in status['multizone']['groups']:
                name = group.get('name', "Unknown group name")
                udn = group.get('uuid', None)
                uuid = None
                if udn:
                    uuid = UUID(udn.replace('-', ''))
                groups.append(MultizoneInfo(name, uuid))

        return MultizoneStatus(dynamic_groups, groups)

    except (requests.exceptions.RequestException, OSError, ValueError):
        return None
4497
def has_in_members(self, member):
        
        assert isinstance(member, github.NamedUser.NamedUser), member
        status, headers, data = self._requester.requestJson(
            "GET",
            self.url + "/members/" + member._identity
        )
        return status == 204
579118
def kernels_status_cli(self, kernel, kernel_opt=None):
        
        kernel = kernel or kernel_opt
        response = self.kernels_status(kernel)
        status = response['status']
        message = response['failureMessage']
        if message:
            print('%s has status "%s"' % (kernel, status))
            print('Failure message: "%s"' % message)
        else:
            print('%s has status "%s"' % (kernel, status))
1000332
def status():
    '''
    
    '''
    ret = {}

    cmd = __execute_cmd('riak-admin', 'status')

    for i in cmd['stdout'].splitlines():
        if ':' in i:
            (name, val) = i.split(':', 1)
            ret[name.strip()] = val.strip()

    return ret
886777
def secondary_status
      session.cluster.with_secondary do |secondary|
        secondary.command(:admin, replSetGetStatus: 1)
      end
    rescue => e
      raise ConnectionFailed, e
    end
520866
def get_status(self, instance):
        
        status_key, status = self._get_status(instance)
        if status['state'] in ['complete', 'error']:
            cache.delete(status_key)
        return status
157607
def status( update_to = nil )
      resp = send_recv( KJess::Request::Status.new( :update_to => update_to ) )
      raise KJess::ProtocolError, "Status command is not supported" if KJess::Response::ClientError === resp
      return resp.message
    end