当前位置: 首页>>代码示例>>Python>>正文


Python utils.build_api_url函数代码示例

本文整理汇总了Python中utils.build_api_url函数的典型用法代码示例。如果您正苦于以下问题:Python build_api_url函数的具体用法?Python build_api_url怎么用?Python build_api_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了build_api_url函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_criteria

def get_criteria(url='', org='', account='', key='', rule='', **kwargs):
    return requests.get(
        utils.build_api_url(url,
                            org,
                            account,
                            endpoint='rules' + '/' + rule + '/criteria'),
        headers={'Authorization': "Bearer " + key}).json()
开发者ID:2dotstwice,项目名称:dlcli,代码行数:7,代码来源:rules.py

示例2: get_agent_series

def get_agent_series(url='', org='', account='', key='', agent_id='', metric='', resolution='', period='', **kwargs):
    return requests.get(
        utils.build_api_url(url,
                            org,
                            account,
                            endpoint='metrics' + '/' + metric + '/series?source=' + agent_id + '&resolution=' + str(resolution) + '&period=' + str(period)),
        headers={'Authorization': "Bearer " + key}).json()
开发者ID:2dotstwice,项目名称:dlcli,代码行数:7,代码来源:series.py

示例3: delete_org

def delete_org(url='', org='', account='', key='', org_name='', **kwargs):
    return requests.delete(
        utils.build_api_url(url,
                            org,
                            account,
                            orglevel=True) + '/' + org_name,
        headers={'Authorization': "Bearer " + key})
开发者ID:2dotstwice,项目名称:dlcli,代码行数:7,代码来源:orgs.py

示例4: update_agents_metric_paths

def update_agents_metric_paths(url='', org='', account='', key='', agents='', metric='',
                               status='', timeout=60, **kwargs):
    return put(utils.build_api_url(url, org, account,
                                   endpoint='metrics/%s/series' % metric),
               headers={'Authorization': "Bearer " + key},
               params={"source": agents},
               data={'status': status}, timeout=timeout).json()
开发者ID:dataloop,项目名称:dlcli,代码行数:7,代码来源:series.py

示例5: put_rule

def put_rule(url='', org='', account='', key='', path='', template='', timeout=60, **kwargs):
    rule_name = os.path.splitext(os.path.basename(path))[0]
    rule_content = utils.read_file_content(path)
    return post(utils.build_api_url(url, org, account,
                                    endpoint='/templates/private/%s/rules' % template),
                headers={'Authorization': "Bearer " + key, "Content-Type": "application/yaml"},
                data=rule_content, timeout=timeout)
开发者ID:dataloop,项目名称:dlcli,代码行数:7,代码来源:templates.py

示例6: get_agent_series

def get_agent_series(url='', org='', account='', key='', agent_id='', metric='',
                     resolution='', period='', timeout=60, **kwargs):
    return get(
        utils.build_api_url(url, org, account,
                            endpoint='metrics/%s/series?source=%s&resolution=%s&period=%s' % (
                                metric, agent_id, resolution, period)),
        headers={'Authorization': "Bearer " + key}, timeout=timeout).json()
开发者ID:dataloop,项目名称:dlcli,代码行数:7,代码来源:series.py

示例7: get_accounts

def get_accounts(url='', org='', key='', **kwargs):
    return requests.get(
        utils.build_api_url(url,
                            org,
                            account='',
                            accountlevel=True),
        headers={'Authorization': "Bearer " + key}).json()
开发者ID:2dotstwice,项目名称:dlcli,代码行数:7,代码来源:accounts.py

示例8: get_agent_name_from_id

def get_agent_name_from_id(url='', org='', account='', key='', agent_id='', timeout=60, **kwargs):
    agents = get(utils.build_api_url(url, org, account,
                                     endpoint='agents'),
                 headers={'Authorization': "Bearer " + key}, timeout=timeout).json()
    for a in agents:
        if a['id'] == agent_id:
            return a['name']
开发者ID:dataloop,项目名称:dlcli,代码行数:7,代码来源:agents.py

示例9: delete_template

def delete_template(url='', org='', account='', key='', name='', **kwargs):
    return requests.delete(
        utils.build_api_url(url,
                            org,
                            account,
                            endpoint='templates/private/%s' % name),
        headers={'Authorization': "Bearer " + key})
开发者ID:2dotstwice,项目名称:dlcli,代码行数:7,代码来源:templates.py

示例10: put_dashboard

def put_dashboard(url='', org='', account='', key='', path='', template='', timeout=60, **kwargs):
    dashboard_name = os.path.splitext(os.path.basename(path))[0]
    dashboard_yaml = utils.read_file_content(path)
    return put(utils.build_api_url(url, org, account,
                                   endpoint='/templates/private/%s/dashboards/%s' % (template, dashboard_name)),
               headers={'Authorization': "Bearer " + key, "Content-Type": "application/yaml"},
               data=dashboard_yaml, timeout=timeout)
开发者ID:dataloop,项目名称:dlcli,代码行数:7,代码来源:templates.py

示例11: delete_agent

def delete_agent(url='', org='', account='', key='', agent_name='', timeout=60, **kwargs):
    agent_map = get_agents(url, org, account, key)
    for agent in agent_map:
        if agent['name'] == agent_name:
            return requests.delete(utils.build_api_url(url, org, account,
                                                       endpoint='agents/%s' % agent['id']),
                                   headers={'Authorization': "Bearer " + key}, timeout=timeout)
开发者ID:dataloop,项目名称:dlcli,代码行数:7,代码来源:agents.py

示例12: delete_dashboard

def delete_dashboard(url='', org='', account='', key='', dashboard='', **kwargs):
    return requests.delete(
        utils.build_api_url(url,
                            org,
                            account,
                            endpoint='dashboards') + '/' + dashboard,
        headers={'Authorization': "Bearer " + key})
开发者ID:2dotstwice,项目名称:dlcli,代码行数:7,代码来源:dashboards.py

示例13: delete_tag

def delete_tag(url='', org='', account='', key='', tag='', **kwargs):
    return requests.delete(
        utils.build_api_url(url,
                            org,
                            account,
                            endpoint='tags') + '/' + tag,
        headers={'Authorization': "Bearer " + key})
开发者ID:2dotstwice,项目名称:dlcli,代码行数:7,代码来源:tags.py

示例14: export_dashboard

def export_dashboard(url='', org='', account='', key='', dashboard='', **kwargs):
    return requests.get(
        utils.build_api_url(url,
                            org,
                            account,
                            endpoint='dashboards') + '/' + dashboard,
        headers={'Authorization': "Bearer " + key, "Accept": "application/yaml"}).content
开发者ID:2dotstwice,项目名称:dlcli,代码行数:7,代码来源:dashboards.py

示例15: get_tags

def get_tags(url='', org='', account='', key='', **kwargs):
    return requests.get(
        utils.build_api_url(url,
                            org,
                            account,
                            endpoint='tags'),
        headers={'Authorization': "Bearer " + key}).json()
开发者ID:2dotstwice,项目名称:dlcli,代码行数:7,代码来源:tags.py


注:本文中的utils.build_api_url函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。