Get information and statistics about the server

    CLI Example:

    .. code-block:: bash

        salt '*' redis.info
439907
def info(host=None, port=None, db=None, password=None):
    '''
    
    '''
    server = _connect(host, port, db, password)
    return server.info()
322244
def info(gandi, resource):
    
    output_keys = ['id', 'subject', 'date_created', 'date_expire',
                   'fqdns', 'vhosts']

    result = gandi.hostedcert.infos(resource)
    for num, hcert in enumerate(result):
        if num:
            gandi.separator_line()
        output_hostedcert(gandi, hcert, output_keys)

    return result
75800
def _check_command_stats(self, conn, tags):
        
        try:
            command_stats = conn.info("commandstats")
        except Exception:
            self.warning('Could not retrieve command stats from Redis. INFO COMMANDSTATS only works with Redis >= 2.6.')
            return

        for key, stats in iteritems(command_stats):
            command = key.split('_', 1)[1]
            command_tags = tags + ['command:{}'.format(command)]

            # When `host:` is passed as a command, `calls` ends up having a leading `:`
            # see https://github.com/DataDog/integrations-core/issues/839
            calls = stats.get('calls') if command != 'host' else stats.get(':calls')

            self.gauge('redis.command.calls', calls, tags=command_tags)
            self.gauge('redis.command.usec_per_call', stats['usec_per_call'], tags=command_tags)
1081596
def info(self, cloud=None, api_key=None, version=None, **kwargs):
        
        url_params = {"batch": False, "api_key": api_key, "version": version, "method": "info"}
        return self._api_handler(None, cloud=cloud, api="custom", url_params=url_params, **kwargs)
462868
def info(name):
    '''
    
    '''
    try:
        data = pwd.getpwnam(name)
        ret = {
            'name': data.pw_name,
            'passwd': data.pw_passwd}
    except KeyError:
        return {
            'name': '',
            'passwd': ''}

    if not isinstance(name, six.string_types):
        name = six.text_type(name)
    if ':' in name:
        raise SaltInvocationError('Invalid username \'{0}\''.format(name))

    if __salt__['cmd.has_exec']('pw'):
        change, expire = __salt__['cmd.run_stdout'](
            ['pw', 'usershow', '-n', name],
            python_shell=False).split(':')[5:7]
    elif __grains__['kernel'] in ('NetBSD', 'OpenBSD'):
        try:
            with salt.utils.files.fopen('/etc/master.passwd', 'r') as fp_:
                for line in fp_:
                    line = salt.utils.stringutils.to_unicode(line)
                    if line.startswith('{0}:'.format(name)):
                        key = line.split(':')
                        change, expire = key[5:7]
                        ret['passwd'] = six.text_type(key[1])
                        break
        except IOError:
            change = expire = None
    else:
        change = expire = None

    try:
        ret['change'] = int(change)
    except ValueError:
        pass

    try:
        ret['expire'] = int(expire)
    except ValueError:
        pass

    return ret
275357
def build_info():
    '''
    
    '''
    ret = {'info': []}
    out = __salt__['cmd.run']('{0} -V'.format(__detect_os()))

    for i in out.splitlines():
        if i.startswith('configure argument'):
            ret['build arguments'] = re.findall(r"(?:[^\s]*'.*')|(?:[^\s]+)", i)[2:]
            continue

        ret['info'].append(i)

    return ret
1156158
def can_replicate_commands(self):
        
        if not hasattr(self, '_can_replicate_commands'):
            info = self.redis.info('server')
            version_info = info['redis_version'].split('.')
            major, minor = int(version_info[0]), int(version_info[1])
            result = major > 3 or major == 3 and minor >= 2
            self._can_replicate_commands = result
        return self._can_replicate_commands
368609
def info(rq, ctx, path, interval, raw, only_queues, only_workers, by_queue,
         queues):
    ""
    return ctx.invoke(
        rq_cli.info,
        path=path,
        interval=interval,
        raw=raw,
        only_queues=only_queues,
        only_workers=only_workers,
        by_queue=by_queue,
        queues=queues or rq.queues,
        **shared_options(rq)
    )
525793
def info(self):
        
        pending = 0
        for q in self.queues():
             pending += self.size(q)
        return {
            'pending'   : pending,
            'processed' : Stat('processed',self).get(),
            'queues'    : len(self.queues()),
            'workers'   : len(self.workers()),
            #'working'   : len(self.working()),
            'failed'    : Stat('failed',self).get(),
            'servers'   : ['%s:%s' % (self.host, self.port)]
        }
1175771
def server_info(self):
        
        response = self._post(self.apiurl + "/v2/server/info", data={'apikey': self.apikey})

        return self._raise_or_extract(response)
435484
def get_service_info(service_instance):
    '''
    
    '''
    try:
        return service_instance.content.about
    except vim.fault.NoPermission as exc:
        log.exception(exc)
        raise salt.exceptions.VMwareApiError(
            'Not enough permissions. Required privilege: '
            '{0}'.format(exc.privilegeId))
    except vim.fault.VimFault as exc:
        log.exception(exc)
        raise salt.exceptions.VMwareApiError(exc.msg)
    except vmodl.RuntimeFault as exc:
        log.exception(exc)
        raise salt.exceptions.VMwareRuntimeError(exc.msg)
25241
def get_server_info(self):
        
        response = self.get_proto(path='')
        message = rest_pb2.GetApiOverviewResponse()
        message.ParseFromString(response.content)
        return ServerInfo(message)
980917
def _get_connection_info():
    """"""

    info = 'Connection: %s,' % CONN.url
    if CONN.creds is not None:
        info += ' userid=%s,' % CONN.creds[0]
    else:
        info += ' no creds,'

    info += ' cacerts=%s,' % ('sys-default' if CONN.ca_certs is None
                              else CONN.ca_certs)

    info += ' verifycert=%s,' % ('off' if CONN.no_verification else 'on')

    info += ' default-namespace=%s' % CONN.default_namespace
    if CONN.x509 is not None:
        info += ', client-cert=%s' % CONN.x509['cert_file']
        try:
            kf = CONN.x509['key_file']
        except KeyError:
            kf = "none"
        info += ":%s" % kf

    if CONN.timeout is not None:
        info += ', timeout=%s' % CONN.timeout

    # pylint: disable=protected-access
    info += ' stats=%s, ' % ('on' if CONN._statistics else 'off')

    info += 'log=%s' % ('on' if CONN._operation_recorders else 'off')

    if isinstance(CONN, FakedWBEMConnection):
        info += ', mock-server'

    return fill(info, 78, subsequent_indent='    ')
506880
def get_rackspace_info(server_id,
                       region,
                       access_key_id,
                       secret_access_key,
                       username):
    
    nova = connect_to_rackspace(region, access_key_id, secret_access_key)
    server = nova.servers.get(server_id)

    data = {}
    data['id'] = server.id
    # this needs to be tackled
    data['ip_address'] = server.accessIPv4
    data['state'] = server.status
    data['region'] = region
    data['cloud_type'] = 'rackspace'
    data['username'] = username

    # find out the distribution running on the instance
    if username is not None:
        wait_for_ssh(data['ip_address'])
        with settings(host_string=username + '@' + data['ip_address']):
            data['distribution'] = linux_distribution(username,
                                                      data['ip_address'])
            data['os_release'] = os_release(username,
                                            data['ip_address'])

    data['volume'] = ''
    return data
662494
def DbGetServerInfo(self, argin):
        
        self._log.debug("In DbGetServerInfo()")
        return self.db.get_server_info(argin)
812714
def info(name):
    '''
    
    '''
    if not exists(name):
        raise ContainerNotExists("The container (%s) does not exist!" % name)
    cmd = ['lxc-info', '-n', name]
    out = subprocess.check_output(cmd).splitlines()
    info = {}
    for line in out:
        k, v = line.split()
        info[k] = v
    return info
230244
def overview
      data = { :clusters => [], :config => config }

      stats.each do |cluster_name, cluster_data|
        # Setting global server attributes ( like hostname, version etc...)
        unless cluster_data.is_a? Hash
          data[cluster_name] = cluster_data
          next
        end

        #next unless redis? cluster_name # skip memcached clusters

        aliases = node_aliases cluster_name
        cluster = { nodes: [], name: cluster_name }
        cluster_data.each do |node, node_value|
          # Adding node
          if node_value.kind_of? Hash
            node_data = cluster_data[node]
            node = aliases[node] || node
            url = ( node =~ /redis\:\/\// ) ? node : "redis://#{node}"
            info = redis_info(url, config[cluster_name]["redis_auth"])
            cluster[:nodes] << {
              server_url: url, info: info, running: info.any?
            }.merge(node_data)
          else # Cluster attribute
            cluster[node] = node_value
          end
        end
        data[:clusters].push cluster
      end
      data
    end