Retrieve low-level information about the current swarm.

        Returns:
            A dictionary containing data about the swarm.

        Raises:
            :py:class:`docker.errors.APIError`
                If the server returns an error.
501907
def inspect_swarm(self):
        
        url = self._url('/swarm')
        return self._result(self._get(url), True)
1231548
def swarm(workingDir):
  
  name = os.path.splitext(os.path.basename(workingDir))[0]
  swarmDescriptionFile = os.path.join(workingDir, "swarm_description.json")
  with open(swarmDescriptionFile) as swarmDesc:
    swarmDescription = json.loads(swarmDesc.read())
  print "================================================="
  print "= Swarming on %s data..." % name
  _printSwarmSizeWarning(swarmDescription["swarmSize"])
  print "================================================="
  modelParams = _swarmForBestModelParams(swarmDescription, name, workingDir)
  return modelParams
432924
def get_info(self):
        
        info = {
            "name":     self.name,
            "mode":     self.mode & 0o7777,
            "uid":      self.uid,
            "gid":      self.gid,
            "size":     self.size,
            "mtime":    self.mtime,
            "chksum":   self.chksum,
            "type":     self.type,
            "linkname": self.linkname,
            "uname":    self.uname,
            "gname":    self.gname,
            "devmajor": self.devmajor,
            "devminor": self.devminor
        }

        if info["type"] == DIRTYPE and not info["name"].endswith("/"):
            info["name"] += "/"

        return info
1058761
def get_queue_stats(self):
        '''
        
        '''
        self.logger.debug("Gathering queue based stats")

        the_dict = {}
        keys = self.redis_conn.keys('*:*:queue')
        total_backlog = 0
        for key in keys:
            elements = key.split(":")
            spider = elements[0]
            domain = elements[1]
            spider = 'queue_' + spider

            if spider not in the_dict:
                the_dict[spider] = {
                    'spider_backlog': 0,
                    'num_domains': 0,
                    'domains': []
                }

            count = self.redis_conn.zcard(key)
            total_backlog += count
            the_dict[spider]['spider_backlog'] += count
            the_dict[spider]['num_domains'] += 1
            the_dict[spider]['domains'].append({'domain': domain,
                                                'backlog': count})

        the_dict['total_backlog'] = total_backlog
        ret_dict = {
            'queues': the_dict
        }

        return ret_dict
791002
def get_crawler_stats(self):
        '''
        
        '''
        self.logger.debug("Gathering crawler stats")
        the_dict = {}

        the_dict['spiders'] = self.get_spider_stats()['spiders']
        the_dict['machines'] = self.get_machine_stats()['machines']
        the_dict['queue'] = self.get_queue_stats()['queues']

        return the_dict
855076
def getDict(self):
        
        # We are going to have to return the dict so let's
        # first make sure all of our models are up to date with the values in
        # the GUI right now.
        badList = self.checkSetSaveEntries(doSave=False)
        if badList:
            self.processBadEntries(badList, self.taskName, canCancel=False)
        return self._taskParsObj.dict()
1038663
def to_dict(self):
        
        data = dict()
        data['api_url'] = self.api_url
        data['api_key'] = self.api_key
        data['verifySSL'] = self.verifySSL
        data['client_id'] = self.client_id
        data['client_secret'] = self.client_secret
        data['redirect_url'] = self.redirect_url
        data['token'] = self.token
        data['state'] = self.state
        data['auth_url'] = self.auth_url
        return data
34982
def _get_aggregated_info(self):
        
        agg_results = {}
        for key in self.aggregated_info['occurrences']:
            agg_results[key] = {
                'occurrences': self.aggregated_info['occurrences'].get(key),
                'coverage': (float(self.aggregated_info['occurrences']
                                   .get(key))/float(self.get_metadata('items_count')))*100
            }
        return agg_results
639273
def _GetPluginData(self):
    
    return_dict = {}

    return_dict['Versions'] = [
        ('plaso engine', plaso.__version__),
        ('python', sys.version)]

    hashers_information = hashers_manager.HashersManager.GetHashersInformation()
    parsers_information = parsers_manager.ParsersManager.GetParsersInformation()
    plugins_information = (
        parsers_manager.ParsersManager.GetParserPluginsInformation())
    presets_information = parsers_manager.ParsersManager.GetPresetsInformation()

    return_dict['Hashers'] = hashers_information
    return_dict['Parsers'] = parsers_information
    return_dict['Parser Plugins'] = plugins_information
    return_dict['Parser Presets'] = presets_information

    return return_dict
567208
def data(self):
        
        d = {}
        for name in self.key_names:
            d[name] = self.__dict__.get(name, None)
        return d
1111618
def get_api_params(self):
        
        result = self.params
        if type(result) != dict:
            raise ValueError(
                '{}.params should return dictionary'.format(
                    self.__class__.__name__
                )
            )
        return result
961947
def get(self):
        
        res = self.fs.get_filesystem_details()
        res = res.to_dict()
        self.write(res)
1289110
def get_info(self):
        '''  '''
        return {
            'Connected': self.is_connected(),
            'Port': self.port,
            'Bytes Waiting': self.ser.in_waiting if self.ser else 0
        }
147476
def data(self):
        
        try:
            data = self._data
        except AttributeError:
            data = self._data = json.loads(self.json)
        return data
180642
def get_metadata(self):
        
        inspect_data = self.inspect(refresh=True)
        inspect_to_container_metadata(self.metadata, inspect_data, self.image)

        return self.metadata
870258
def get_dict(self):
        
        return {'hostname': self.get_name(),
                'address':  self.get_address(),
                'protocol': self.get_protocol(),
                'port':     self.get_tcp_port()}
460174
def to_dict(self) -> Dict[str, str]:
        
        return {
            'type': 'remote',
            'name': self.name,
            'location': self.location,
            'url': self.url,
            'version': self.version
        }