• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python api.validate_kwargs函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: get_notification_rules

def get_notification_rules(**kwargs):
    ''' Get list of existing notification rules for the specified monitor '''
    required = ['monitorId', 'monitorType']
    optional = []

    get_args = validate_kwargs(required, optional, **kwargs)
    return get(action='getNotificationRules', **get_args)
开发者ID:SeanYa,项目名称:Python-SDK,代码行数:7,代码来源:notifications.py


示例2: add_notification_rule

def add_notification_rule(**kwargs):
    ''' Add a notification rule for monitor - contact pair '''
    required = ['monitorId', 'monitorType', 'period', 'notifyBackup',
                'continuousAlerts', 'failureCount']

    optional = ['weekdayFrom', 'weekdayTo', 'timeFrom', 'timeTo',
                'contactGroup', 'contactId', 'minFailedLocationCount',
                'paramName', 'paramValue', 'comparingMethod']

    post_args = validate_kwargs(required, optional, **kwargs)

    # paramName and paramValue are required when monitorType is custom
    if post_args.get('monitorType', None) is 'custom':
        if not (post_args.has_key('paramName') \
            and post_args.has_key('paramValue')):
            raise MonitisError('paramName and paramValue are required')
    # comparingMethod is required when paramName and paramValue are present
    if post_args.has_key('paramName') or post_args.has_key('paramValue'):
        if not post_args.has_key('comparingMethod'):
            raise MonitisError('comparingMethod is required')

    # either contact_group or contact_id must be specified
    if not (post_args.has_key('contactGroup') \
        or post_args.has_key('contactId')):
        raise MonitisError('Either contactName or contactGroup is required')

    return post(action='addNotificationRule', **post_args)
开发者ID:SeanYa,项目名称:Python-SDK,代码行数:27,代码来源:notifications.py


示例3: edit_internal_ping_monitor

def edit_internal_ping_monitor(**kwargs):
    ''' Edit the specified Ping monitor '''
    required = ['testId']
    required.extend(common_required)
    optional = []
    req_args = validate_kwargs(required, optional, **kwargs)
    return post(action='editInternalPingMonitor', **req_args)
开发者ID:SeanYa,项目名称:Python-SDK,代码行数:7,代码来源:ping.py


示例4: add_page_module

def add_page_module(**kwargs):
    ''' Add a module to the specified page. '''
    required = ['moduleName', 'pageId', 'column', 'row', 'dataModuleId']
    optional = ['height']

    req_args = validate_kwargs(required, optional, **kwargs)
    return post(action='addPageModule', **req_args)
开发者ID:SeanYa,项目名称:Python-SDK,代码行数:7,代码来源:layout.py


示例5: add_drive_monitor

def add_drive_monitor(**kwargs):
    ''' Add a new internal drive monitor '''
    required = ['agentkey', 'driveLetter']
    required.extend(common_required)
    optional = []
    req_args = validate_kwargs(required, optional, **kwargs)
    return post(action='addDriveMonitor', **req_args)
开发者ID:SeanYa,项目名称:Python-SDK,代码行数:7,代码来源:drive.py


示例6: edit_memory_monitor

def edit_memory_monitor(**kwargs):
    """ Edit the specified memory monitor """
    required = ["testId"]
    required.extend(common_required)
    optional = ["freeLimit", "freeSwapLimit", "freeVirtualLimit", "bufferedLimit", "cachedLimit"]
    req_args = validate_kwargs(required, optional, **kwargs)
    return post(action="editMemoryMonitor", **req_args)
开发者ID:SeanYa,项目名称:Python-SDK,代码行数:7,代码来源:memory.py


示例7: confirm_contact

def confirm_contact(**kwargs):
    ''' Confirm the specified contact '''
    required = ['contactId', 'confirmationKey']
    optional = []

    post_args = validate_kwargs(required, optional, **kwargs)
    return post(action='confirmContact', **post_args)
开发者ID:SeanYa,项目名称:Python-SDK,代码行数:7,代码来源:contacts.py


示例8: add_internal_ping_monitor

def add_internal_ping_monitor(**kwargs):
    ''' Add a new internal ping monitor '''
    required = ['userAgentId', 'url']
    required.extend(common_required)
    optional = []
    req_args = validate_kwargs(required, optional, **kwargs)
    return post(action='addInternalPingMonitor', **req_args)
开发者ID:SeanYa,项目名称:Python-SDK,代码行数:7,代码来源:ping.py


示例9: add_memory_monitor

def add_memory_monitor(**kwargs):
    """ Add a new internal memory monitor """
    required = ["agentkey"]
    required.extend(common_required)
    optional = ["freeLimit", "freeSwapLimit", "freeVirtualLimit", "bufferedLimit", "cachedLimit"]
    req_args = validate_kwargs(required, optional, **kwargs)
    return post(action="addMemoryMonitor", **req_args)
开发者ID:SeanYa,项目名称:Python-SDK,代码行数:7,代码来源:memory.py


示例10: add_process_monitor

def add_process_monitor(**kwargs):
    ''' Add a new internal process monitor '''
    required = ['agentkey', 'processName']
    required.extend(common_required)
    optional = []
    req_args = validate_kwargs(required, optional, **kwargs)
    return post(action='addProcessMonitor', **req_args)
开发者ID:SeanYa,项目名称:Python-SDK,代码行数:7,代码来源:process.py


示例11: edit_process_monitor

def edit_process_monitor(**kwargs):
    ''' Edit the specified process monitor '''
    required = ['testId']
    required.extend(common_required)
    optional = []
    req_args = validate_kwargs(required, optional, **kwargs)
    return post(action='editProcessMonitor', **req_args)
开发者ID:SeanYa,项目名称:Python-SDK,代码行数:7,代码来源:process.py


示例12: edit_internal_http_monitor

def edit_internal_http_monitor(**kwargs):
    ''' Edit the specified http monitor '''
    required = ['testId', 'urlParams']
    required.extend(common_required)
    optional = []
    req_args = validate_kwargs(required, optional, **kwargs)
    return post(action='editInternalHttpMonitor', **req_args)
开发者ID:SeanYa,项目名称:Python-SDK,代码行数:7,代码来源:http.py


示例13: edit_load_average_monitor

def edit_load_average_monitor(**kwargs):
    """ Edit the specified load monitor """
    required = ["testId"]
    required.extend(common_required)
    optional = []
    req_args = validate_kwargs(required, optional, **kwargs)
    return post(action="editLoadAverageMonitor", **req_args)
开发者ID:SeanYa,项目名称:Python-SDK,代码行数:7,代码来源:loadavg.py


示例14: add_load_average_monitor

def add_load_average_monitor(**kwargs):
    """ Add a new internal load monitor """
    required = ["agentkey"]
    required.extend(common_required)
    optional = []
    req_args = validate_kwargs(required, optional, **kwargs)
    return post(action="addLoadAverageMonitor", **req_args)
开发者ID:SeanYa,项目名称:Python-SDK,代码行数:7,代码来源:loadavg.py


示例15: edit_agent

def edit_agent(**kwargs):
    ''' Edit an existing custom agent '''
    required = {'name': 'name', 'agent_id': 'agentId'}
    optional = {'params': 'params'}

    req_args = validate_kwargs(required, optional, **kwargs)

    return post(action='editAgent', **req_args)
开发者ID:SeanYa,项目名称:Python-SDK,代码行数:8,代码来源:agent.py


示例16: edit_contact

def edit_contact(**kwargs):
    '''  '''
    required = ['contactId']
    optional = ['firstName', 'lastName', 'account', 'contactType', 'timezone',
                'portable', 'code', 'country', 'textType']

    post_args = validate_kwargs(required, optional, **kwargs)
    return post(action='editContact', **post_args)
开发者ID:SeanYa,项目名称:Python-SDK,代码行数:8,代码来源:contacts.py


示例17: agent_info

def agent_info(**kwargs):
    ''' Get information for the specified agent '''
    required = {'agent_id': 'agentId'}
    optional = {}

    req_args = validate_kwargs(required, optional, **kwargs)

    return get(action='agentInfo', **req_args)
开发者ID:SeanYa,项目名称:Python-SDK,代码行数:8,代码来源:agent.py


示例18: transaction_test_result

def transaction_test_result(**kwargs):
    ''' Get results for the specified Transaction or
    Full Page Load monitor
    '''
    required = ['monitorId', 'year', 'month', 'day']
    optional = ['locationIds', 'timezone']
    req_args = validate_kwargs(required, optional, **kwargs)
    return get(action='transactionTestResult', **req_args)
开发者ID:SeanYa,项目名称:Python-SDK,代码行数:8,代码来源:transaction.py


示例19: get_recent_alerts

def get_recent_alerts(**kwargs):
    ''' Get recent alerts history

    Start date and end date are in miliseconds since the Epoch'''
    required = []
    optional = ['timezone', 'startDate', 'endDate']
    post_args = validate_kwargs(required, optional, **kwargs)
    return get(action='recentAlerts', **post_args)
开发者ID:SeanYa,项目名称:Python-SDK,代码行数:8,代码来源:contacts.py


示例20: add_agent

def add_agent(**kwargs):
    ''' Register a new custom agent in Monitis '''
    required = {'name': 'name'}
    optional = {'params': 'params'}

    req_args = validate_kwargs(required, optional, **kwargs)

    return post(action='addAgent', **req_args)
开发者ID:SeanYa,项目名称:Python-SDK,代码行数:8,代码来源:agent.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python monitor.Monitor类代码示例发布时间:2022-05-27
下一篇:
Python monit_interface.stop函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap