本文整理汇总了Python中monitis.api.validate_kwargs函数的典型用法代码示例。如果您正苦于以下问题:Python validate_kwargs函数的具体用法?Python validate_kwargs怎么用?Python validate_kwargs使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了validate_kwargs函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)
示例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)