Returns info for all Nodes

    :param api_url: Base PuppetDB API url
486596
def get_nodes(api_url=None, verify=False, cert=list()):
    
    return utils._make_api_request(api_url, '/nodes', verify, cert)
786437
def get_api_url(server):
    
    parsed = urlparse(server)
    base_url = parsed.netloc if parsed.netloc else parsed.path
    base_url.replace('/', '')
    return 'https://' + base_url + '/apiv1'
1053623
def _fetch_all(cls, api_key, endpoint=None, offset=0, limit=25, **kwargs):
        
        output = []
        qp = kwargs.copy()
        limit = max(1, min(100, limit))
        maximum = kwargs.get('maximum')
        qp['limit'] = min(limit, maximum) if maximum is not None else limit
        qp['offset'] = offset
        more, total = None, None

        while True:
            entities, options = cls._fetch_page(
                api_key=api_key, endpoint=endpoint, **qp
            )
            output += entities
            more = options.get('more')
            limit = options.get('limit')
            offset = options.get('offset')
            total = options.get('total')

            if more is None:
                if total is None or offset is None:
                    break
                more = (limit + offset) < total

            if not more or (maximum is not None and len(output) >= maximum):
                break

            qp['limit'] = limit
            qp['offset'] = offset + limit

        return output
1330300
def get_all_client_tags(self, params=None):
        
        return self._iterate_through_pages(
            get_function=self.get_client_tags_per_page,
            resource=CLIENT_TAGS,
            **{'params': params}
        )
913519
def get_node (self, url_data):
        """"""
        if not url_data.url:
            return None
        elif url_data.url in self.nodes:
            return None
        node = {
            "url": url_data.url,
            "parent_url": url_data.parent_url,
            "id": self.nodeid,
            "label": quote(url_data.title if url_data.title else url_data.name),
            "extern": 1 if url_data.extern else 0,
            "checktime": url_data.checktime,
            "size": url_data.size,
            "dltime": url_data.dltime,
            "edge": quote(url_data.name),
            "valid": 1 if url_data.valid else 0,
        }
        self.nodes[node["url"]] = node
        self.nodeid += 1
        return node
624617
def api(self):
        
        functions = [x[0]for x in inspect.getmembers(self, predicate=inspect.ismethod)
                     if not x[0].startswith('_')]

        full_api = {
            'doc': u"When posting data you have to use the JSON format.",
            'api': []
        }
        my_daemon_type = "%s" % getattr(self.app, 'type', 'unknown')
        my_address = getattr(self.app, 'host_name', getattr(self.app, 'name', 'unknown'))
        if getattr(self.app, 'address', '127.0.0.1') not in ['127.0.0.1']:
            # If an address is explicitely specified, I must use it!
            my_address = self.app.address
        for fun in functions:
            endpoint = {
                'daemon': my_daemon_type,
                'name': fun,
                'doc': getattr(self, fun).__doc__,
                'uri': '%s://%s:%s/%s' % (getattr(self.app, 'scheme', 'http'),
                                          my_address,
                                          self.app.port, fun),
                'args': {}
            }

            try:
                spec = inspect.getfullargspec(getattr(self, fun))
            except Exception:  # pylint: disable=broad-except
                # pylint: disable=deprecated-method
                spec = inspect.getargspec(getattr(self, fun))
            args = [a for a in spec.args if a not in ('self', 'cls')]
            if spec.defaults:
                a_dict = dict(list(zip(args, spec.defaults)))
            else:
                a_dict = dict(list(zip(args, ("No default value",) * len(args))))

            endpoint["args"] = a_dict
            full_api['api'].append(endpoint)

        return full_api
739049
def list_apis(awsclient):
    """"""
    client_api = awsclient.get_client('apigateway')

    apis = client_api.get_rest_apis()['items']

    for api in apis:
        print(json2table(api))
675943
def nodes(**kwargs):
    '''
    
    '''
    cfg = _setup_conn(**kwargs)
    try:
        api_instance = kubernetes.client.CoreV1Api()
        api_response = api_instance.list_node()

        return [k8s_node['metadata']['name'] for k8s_node in api_response.to_dict().get('items')]
    except (ApiException, HTTPError) as exc:
        if isinstance(exc, ApiException) and exc.status == 404:
            return None
        else:
            log.exception('Exception when calling CoreV1Api->list_node')
            raise CommandExecutionError(exc)
    finally:
        _cleanup(**cfg)
692227
def _find_apis_by_name(name, description=None,
                       region=None, key=None, keyid=None, profile=None):
    '''
    
    '''
    try:
        conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
        apis = _multi_call(conn.get_rest_apis, 'items')
        if name:
            apis = _filter_apis(name, apis)
        if description is not None:
            apis = _filter_apis_desc(description, apis)
        return {'restapi': [_convert_datetime_str(api) for api in apis]}
    except ClientError as e:
        return {'error': __utils__['boto3.get_error'](e)}
135626
def _add_eutils_api_key(url):
    
    apikey = os.environ.get("NCBI_API_KEY")
    if apikey:
        url += "&api_key={apikey}".format(apikey=apikey)
    return url
785292
def _set_labels(node, apiserver_url, labels):
    ''''''
    # Prepare URL
    url = "{0}/api/v1/nodes/{1}".format(apiserver_url, node)
    # Prepare data
    data = [{"op": "replace", "path": "/metadata/labels", "value": labels}]
    # Make request
    ret = _kpatch(url, data)
    if ret.get("status") == 404:
        return "Node {0} doesn't exist".format(node)
    return ret
417000
def top(self):
        
        nodes = []
        for node in self.nodes():
            nodes.append(self.http_client.get(API_TOP % node['name']))
        return nodes
147671
def get_node_fact_by_name(api_url=None, node_name=None, fact_name=None, verify=False, cert=list()):
    
    return utils._make_api_request(api_url, '/nodes/{0}/facts/{1}'.format(node_name,
        fact_name), verify, cert)
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
1033905
def _get_api_version(self):
        
        url = "{base_url}/api/server_info".format(base_url=self._base_url())
        server_info = self._make_request(url=url, method="get")
        return server_info["latest_api_version"]
530633
def _get_labels(node, apiserver_url):
    ''''''
    # Prepare URL
    url = "{0}/api/v1/nodes/{1}".format(apiserver_url, node)
    # Make request
    ret = http.query(url)
    # Check requests status
    if 'body' in ret:
        ret = salt.utils.json.loads(ret.get('body'))
    elif ret.get('status', 0) == 404:
        return "Node {0} doesn't exist".format(node)
    else:
        return ret
    # Get and return labels
    return ret.get('metadata', {}).get('labels', {})
834040
def get_nodes(self, request):
        
        nodes = []
        docsmap_file = os.path.join(settings.SPHINX_DOCS_ROOT, 'docsmap.json')
        if not os.path.exists(docsmap_file):
            return nodes
        with io.open(docsmap_file) as fh:
            docs_map = json.load(fh, encoding='utf-8')

        for counter, items in enumerate(docs_map.items(), 1):
            bits = items[0].split('/')
            if len(bits) == 1 and bits[0] == 'index' or len(bits) == 2 and bits[1] != 'index':
                continue
            node = NavigationNode(
                title=items[1],
                url=reverse_lazy('sphinx-documentation', args=(bits[0],)),
                id=counter,
            )
            nodes.append(node)
        return nodes