This function returns a list of all hosting devices monitored
        by this agent
555768
def get_monitored_hosting_devices_info(self, hd_state_filter=None):
        
        wait_time = datetime.timedelta(
            seconds=cfg.CONF.cfg_agent.hosting_device_dead_timeout)
        resp = []
        for hd_id in self.hosting_devices_backlog:
            hd = self.hosting_devices_backlog[hd_id]['hd']

            display_hd = True

            if hd_state_filter is not None:
                if hd['hd_state'] == hd_state_filter:
                    display_hd = True
                else:
                    display_hd = False

            if display_hd:
                created_time = hd['created_at']
                boottime = datetime.timedelta(seconds=hd['booting_time'])
                backlogged_at = hd['backlog_insertion_ts']
                booted_at = created_time + boottime
                dead_at = backlogged_at + wait_time
                resp.append({'host id': hd['id'],
                             'hd_state': hd['hd_state'],
                             'created at': str(created_time),
                             'backlogged at': str(backlogged_at),
                             'estimate booted at': str(booted_at),
                             'considered dead at': str(dead_at)})
            else:
                continue
        return resp
755494
def list(cls, datacenter=None):
        """"""
        options = {}
        if datacenter:
            datacenter_id = int(Datacenter.usable_id(datacenter))
            options['datacenter_id'] = datacenter_id

        return cls.call('hosting.vlan.list', options)
108934
def list(gandi, resource):
    """"""
    keys = gandi.dnssec.list(resource)
    gandi.pretty_echo(keys)

    return keys
208881
def host_events(self, host):
        '''
        
        '''
        all_host_events = filter(lambda x: 'event_data' in x and 'host' in x['event_data'] and x['event_data']['host'] == host,
                                 self.events)
        return all_host_events
1285804
def iter_monitors(self):
        """"""

        for conn_string, events in self._monitors.items():
            for event, handlers in events.items():
                for handler in handlers:
                    yield (conn_string, event, handler)
581517
def get_servers_list(self):
        
        ret = []

        if self.args.browser:
            ret = self.static_server.get_servers_list()
            if self.autodiscover_server is not None:
                ret = self.static_server.get_servers_list() + self.autodiscover_server.get_servers_list()

        return ret
350955
def list_routers_on_l3_agent(self, l3_agent, **_params):
        """"""
        return self.get((self.agent_path + self.L3_ROUTERS) % l3_agent,
                        params=_params)
564858
def getHostsFromPBS():
    """"""
    # See above comment about Counter
    with open(os.environ["PBS_NODEFILE"], 'r') as hosts:
        hostlist = groupTogether(hosts.read().split())
        retVal = []
        for key, group in groupby(hostlist):
            retVal.append((key, len(list(group))))
        return retVal
1125265
def list(host=None, quiet=False, hyper=None):  # pylint: disable=redefined-builtin
    '''
    
    '''
    if quiet:
        log.warning("'quiet' is deprecated. Please migrate to --quiet")
    ret = {}
    client = salt.client.get_local_client(__opts__['conf_file'])
    for info in client.cmd_iter('virtual:physical',
                                'virt.vm_info', tgt_type='grain'):
        if not info:
            continue
        if not isinstance(info, dict):
            continue
        chunk = {}
        id_ = next(six.iterkeys(info))
        if host:
            if host != id_:
                continue
        if not isinstance(info[id_], dict):
            continue
        if 'ret' not in info[id_]:
            continue
        if not isinstance(info[id_]['ret'], dict):
            continue
        data = {}
        for key, val in six.iteritems(info[id_]['ret']):
            if val['state'] in data:
                data[val['state']].append(key)
            else:
                data[val['state']] = [key]
        chunk[id_] = data
        ret.update(chunk)
        if not quiet:
            __jid_event__.fire_event({'data': chunk, 'outputter': 'nested'}, 'progress')

    return ret
756338
def host_list(call=None):
    '''
    
    '''
    if call == 'action':
        raise SaltCloudSystemExit(
            'This function must be called with -f, --function argument.'
        )
    ret = {}
    session = _get_session()
    hosts = session.xenapi.host.get_all()
    for host in hosts:
        host_record = session.xenapi.host.get_record(host)
        ret[host_record['name_label']] = host_record
    return ret
429218
def get_hosts(self):
        
        limited_hosts = {}
        if self.limit is not None:
            # Find hosts and groups of hosts to include
            for include in self.limit['include']:
                # Include whole group
                for hostname in self.hosts_in_group(include):
                    limited_hosts[hostname] = self.hosts[hostname]
                # Include individual host
                if include in self.hosts:
                    limited_hosts[include] = self.hosts[include]
            # Find hosts and groups of hosts to exclude
            for exclude in self.limit["exclude"]:
                # Exclude whole group
                for hostname in self.hosts_in_group(exclude):
                    if hostname in limited_hosts:
                        limited_hosts.pop(hostname)
                # Exclude individual host
                if exclude in limited_hosts:
                    limited_hosts.pop(exclude)

            return limited_hosts
        else:
            # Return all hosts
            return self.hosts
1032705
def list_devices():
    
    devices = []
    all_hids = hid.find_all_hid_devices()
    if all_hids:
        for index, device in enumerate(all_hids):
            for device_name,spec in device_specs.items():
                if device.vendor_id == spec.hid_id[0] and device.product_id == spec.hid_id[1]:
                    devices.append(device_name)                        
    return devices
497202
def get_hosts_info(self):
        
        result = []
        index = 0
        while index < self.host_numbers:
            host = self.get_generic_host_entry(index)
            result.append({
                'ip': host['NewIPAddress'],
                'name': host['NewHostName'],
                'mac': host['NewMACAddress'],
                'status': host['NewActive']})
            index += 1
        return result
1329371
def bots_list(self):
        
        data = self.client.bots()
        return [Bot(item) for item in data]
844046
def list_hosts(kwargs=None, call=None):
    '''
    
    '''
    if call != 'function':
        raise SaltCloudSystemExit(
            'The list_hosts function must be called with '
            '-f or --function.'
        )

    return {'Hosts': salt.utils.vmware.list_hosts(_get_si())}
471005
def list_hosted_services(conn=None, call=None):
    '''
    
    '''
    if call == 'action':
        raise SaltCloudSystemExit(
            'The list_hosted_services function must be called with '
            '-f or --function'
        )

    if not conn:
        conn = get_conn()

    ret = {}
    services = conn.list_hosted_services()
    for service in services:
        props = service.hosted_service_properties
        ret[service.service_name] = {
            'name': service.service_name,
            'url': service.url,
            'affinity_group': props.affinity_group,
            'date_created': props.date_created,
            'date_last_modified': props.date_last_modified,
            'description': props.description,
            'extended_properties': props.extended_properties,
            'label': props.label,
            'location': props.location,
            'status': props.status,
            'deployments': {},
        }
        deployments = conn.get_hosted_service_properties(
            service_name=service.service_name, embed_detail=True
        )
        for deployment in deployments.deployments:
            ret[service.service_name]['deployments'][deployment.name] = {
                'configuration': deployment.configuration,
                'created_time': deployment.created_time,
                'deployment_slot': deployment.deployment_slot,
                'extended_properties': deployment.extended_properties,
                'input_endpoint_list': deployment.input_endpoint_list,
                'label': deployment.label,
                'last_modified_time': deployment.last_modified_time,
                'locked': deployment.locked,
                'name': deployment.name,
                'persistent_vm_downtime_info': deployment.persistent_vm_downtime_info,
                'private_id': deployment.private_id,
                'role_instance_list': {},
                'role_list': {},
                'rollback_allowed': deployment.rollback_allowed,
                'sdk_version': deployment.sdk_version,
                'status': deployment.status,
                'upgrade_domain_count': deployment.upgrade_domain_count,
                'upgrade_status': deployment.upgrade_status,
                'url': deployment.url,
            }
            for role_instance in deployment.role_instance_list:
                ret[service.service_name]['deployments'][deployment.name]['role_instance_list'][role_instance.role_name] = {
                    'fqdn': role_instance.fqdn,
                    'instance_error_code': role_instance.instance_error_code,
                    'instance_fault_domain': role_instance.instance_fault_domain,
                    'instance_name': role_instance.instance_name,
                    'instance_size': role_instance.instance_size,
                    'instance_state_details': role_instance.instance_state_details,
                    'instance_status': role_instance.instance_status,
                    'instance_upgrade_domain': role_instance.instance_upgrade_domain,
                    'ip_address': role_instance.ip_address,
                    'power_state': role_instance.power_state,
                    'role_name': role_instance.role_name,
                }
            for role in deployment.role_list:
                ret[service.service_name]['deployments'][deployment.name]['role_list'][role.role_name] = {
                    'role_name': role.role_name,
                    'os_version': role.os_version,
                }
                role_info = conn.get_role(
                    service_name=service.service_name,
                    deployment_name=deployment.name,
                    role_name=role.role_name,
                )
                ret[service.service_name]['deployments'][deployment.name]['role_list'][role.role_name]['role_info'] = {
                    'availability_set_name': role_info.availability_set_name,
                    'configuration_sets': role_info.configuration_sets,
                    'data_virtual_hard_disks': role_info.data_virtual_hard_disks,
                    'os_version': role_info.os_version,
                    'role_name': role_info.role_name,
                    'role_size': role_info.role_size,
                    'role_type': role_info.role_type,
                }
                ret[service.service_name]['deployments'][deployment.name]['role_list'][role.role_name]['role_info']['os_virtual_hard_disk'] = {
                    'disk_label': role_info.os_virtual_hard_disk.disk_label,
                    'disk_name': role_info.os_virtual_hard_disk.disk_name,
                    'host_caching': role_info.os_virtual_hard_disk.host_caching,
                    'media_link': role_info.os_virtual_hard_disk.media_link,
                    'os': role_info.os_virtual_hard_disk.os,
                    'source_image_name': role_info.os_virtual_hard_disk.source_image_name,
                }
    return ret
1172637
def hostingServers(self):
        
        portals = self.portals
        portal = portals.portalSelf
        urls = portal.urls
        if 'error' in urls:
            print( urls)
            return

        services = []
        if urls != {}:
            if 'urls' in urls:
                if 'features' in urls['urls']:
                    if 'https' in urls['urls']['features']:
                        for https in urls['urls']['features']['https']:
                            if portal.isPortal == True:

                                url = "%s/admin" % https
                                #url = https
                                services.append(AGSAdministration(url=url,
                                             securityHandler=self._securityHandler,
                                             proxy_url=self._proxy_url,
                                             proxy_port=self._proxy_port))

                            else:
                                url = "https://%s/%s/ArcGIS/rest/admin" % (https, portal.portalId)
                                services.append(Services(url=url,
                                             securityHandler=self._securityHandler,
                                             proxy_url=self._proxy_url,
                                             proxy_port=self._proxy_port))
                    elif 'http' in urls['urls']['features']:
                        for http in urls['urls']['features']['http']:

                            if (portal.isPortal == True):
                                url = "%s/admin" % http
                                services.append(AGSAdministration(url=url,
                                                                  securityHandler=self._securityHandler,
                                                                  proxy_url=self._proxy_url,
                                                                  proxy_port=self._proxy_port,
                                                                  initialize=True))

                            else:
                                url = "http://%s/%s/ArcGIS/rest/admin" % (http, portal.portalId)
                                services.append(Services(url=url,
                                                          securityHandler=self._securityHandler,
                                                          proxy_url=self._proxy_url,
                                                          proxy_port=self._proxy_port))

                    else:
                        print( "Publishing servers not found")
                else:
                    print ("Publishing servers not found")
            else:
                print( "Publishing servers not found")
            return services
        else:
            for server in portal.servers['servers']:
                url = server['adminUrl'] + "/admin"
                sh = PortalServerSecurityHandler(tokenHandler=self._securityHandler,
                                                   serverUrl=url,
                                                   referer=server['name'].replace(":6080", ":6443")
                                                   )
                services.append(
                    AGSAdministration(url=url,
                                      securityHandler=sh,
                                      proxy_url=self._proxy_url,
                                      proxy_port=self._proxy_port,
                                      initialize=False)
                    )
            return services