Get the possible list of resources (name, id and vhosts).
16085
def resource_list(cls):
        
        items = cls.list({'items_per_page': 500})
        ret = [paas['name'] for paas in items]
        ret.extend([str(paas['id']) for paas in items])
        for paas in items:
            paas = cls.info(paas['id'])
            ret.extend([vhost['name'] for vhost in paas['vhosts']])

        return ret
278002
def read_resource_list(self, uri):
        """"""
        self.logger.info("Reading resource list %s" % (uri))
        try:
            resource_list = ResourceList(allow_multifile=self.allow_multifile,
                                         mapper=self.mapper)
            resource_list.read(uri=uri)
        except Exception as e:
            raise ClientError("Can't read source resource list from %s (%s)" %
                              (uri, str(e)))
        self.logger.debug("Finished reading resource list")
        return(resource_list)
621301
def get_vhosts(ip, first=1, no_cache=False):
    

    if not no_cache:
        homedir = pwd.getpwuid(os.getuid()).pw_dir
        requests_cache.install_cache(homedir + '/.habu_requests_cache')

    url = "http://www.bing.com/search?q=ip:{ip}&first={first}".format(ip=ip, first=first)

    response = requests.get(url)

    soup = BeautifulSoup(response.text, "html.parser")

    vhosts = set()

    for h2 in soup.find_all('h2'):
        for link in h2.find_all('a'):
            href = link.get('href')

            if href.startswith('http://') or href.startswith('https://'):
                vhost = href.split('/')[2]
                vhosts.add(vhost)

    return list(vhosts)
1367217
def resources(self):
        
        data = self.query(MyPlexResource.key)
        return [MyPlexResource(self, elem) for elem in data]
1147635
def get_vm_ids_by_ud(access_token, subscription_id, resource_group, vmssname, updatedomain):
    ''''''
    instance_viewlist = azurerm.list_vmss_vm_instance_view(access_token, subscription_id,
                                                           resource_group, vmssname)
    # print(json.dumps(instance_viewlist, sort_keys=False, indent=2, separators=(',', ': ')))

    # loop through the instance view list, and build the vm id list of VMs in
    # the matching UD
    udinstancelist = []
    for instance_view in instance_viewlist['value']:
        vmud = instance_view['properties']['instance_view']['platformUpdateDomain']
        if vmud == updatedomain:
            udinstancelist.append(instance_view['instanceId'])
    udinstancelist.sort()
    return udinstancelist
208306
def list_routers_on_hosting_device(self, client, hosting_device_id,
                                       **_params):
        """"""
        res_path = hostingdevice.HostingDevice.resource_path
        return client.get((res_path + DEVICE_L3_ROUTERS) %
                          hosting_device_id, params=_params)
818658
def get_supported_resources(netid):
    
    url = _netid_supported_url(netid)
    response = get_resource(url)
    return _json_to_supported(response)
177544
def resources(self):
        

        if self._resources_objects is not None:
            return self._resources_objects

        resources = self.parent.parent.resources
        resources = [resources[name] for name in self._resources]
        self._resources_objects = resources
        return resources
894127
def from_vhost(cls, vhost):
        """"""
        result = Vhost().list()
        paas_hosts = {}
        for host in result:
            paas_hosts[host['name']] = host['paas_id']

        return paas_hosts.get(vhost)
383036
def get_resources(cls):
        """"""
        plural_mappings = resource_helper.build_plural_mappings(
            {}, RESOURCE_ATTRIBUTE_MAP)
        if NEUTRON_VERSION.version[0] <= NEUTRON_NEWTON_VERSION.version[0]:
            attr.PLURALS.update(plural_mappings)
        action_map = {DEVICE: {'get_hosting_device_config': 'GET'}}
        return resource_helper.build_resource_info(plural_mappings,
                                                   RESOURCE_ATTRIBUTE_MAP,
                                                   constants.DEVICE_MANAGER,
                                                   action_map=action_map)
788268
def resource_list(cls):
        
        items = cls.list({'items_per_page': 500})
        ret = [str(ip['id']) for ip in items]
        ret.extend([ip['ip'] for ip in items])
        return ret
615076
def sources(self):
        """"""
        res = self.client.service.Sources(self.userdata, 0)
        return [ustr(x[0]) for x in res[0]]
212455
def _list_available_hosts(self, *args):
        '''  '''

        return [ h for h in self.inventory.list_hosts(*args) if (h not in self.stats.failures) and (h not in self.stats.dark)]
1370548
def get_resources_nodes(call=None, resFilter=None):
    '''
    
    '''
    log.debug('Getting resource: nodes.. (filter: %s)', resFilter)
    resources = query('get', 'cluster/resources')

    ret = {}
    for resource in resources:
        if 'type' in resource and resource['type'] == 'node':
            name = resource['node']
            ret[name] = resource

    if resFilter is not None:
        log.debug('Filter given: %s, returning requested '
                  'resource: nodes', resFilter)
        return ret[resFilter]

    log.debug('Filter not given: %s, returning all resource: nodes', ret)
    return ret
1335985
def index_resources(self):
        
        if not self.__index_resources:
            self.__index_resources = IndexResources(self.__connection)
        return self.__index_resources
26725
def get_resources(cls):
        """"""
        exts = []
        parent = dict(member_name=ciscohostingdevicemanager.DEVICE,
                      collection_name=ciscohostingdevicemanager.DEVICES)
        controller = resource.Resource(
            RouterHostingDeviceSchedulerController(), cb_faults.FAULT_MAP)
        exts.append(extensions.ResourceExtension(
            DEVICE_L3_ROUTERS, controller, parent, path_prefix="/dev_mgr"))
        parent = dict(member_name="router",
                      collection_name=l3_const.ROUTERS)
        controller = resource.Resource(
            HostingDevicesHostingRouterController(), cb_faults.FAULT_MAP)
        exts.append(extensions.ResourceExtension(L3_ROUTER_DEVICES, controller,
                                                 parent))
        return exts
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)