def modify_monitor(hostname, username, password, monitor_type, name, **kwargs):
 ret = {'name': name, 'changes': {}, 'result': False, 'comment': ''}
 if __opts__['test']:
  params = {'hostname': hostname, 'username': username, 'password': password, 'monitor_type': monitor_type, 'name': name}
  for (key, value) in six.iteritems(kwargs):
   params[key] = value
  return _test_output(ret, 'modify', params)
 existing = __salt__['bigip.list_monitor'](hostname, username, password, monitor_type, name)
 if (existing['code'] == 200):
  modified = __salt__['bigip.modify_monitor'](hostname, username, password, monitor_type, name, **kwargs)
  if (modified['code'] == 200):
   del existing['content']['selfLink']
   del modified['content']['selfLink']
   ret = _check_for_changes('Monitor', ret, existing, modified)
  else:
   ret = _load_result(modified, ret)
 elif (existing['code'] == 404):
  ret['comment'] = 'A Monitor with this name was not found.'
 else:
  ret = _load_result(existing, ret)
 return ret

def modify_monitor ( hostname , username , password , monitor_type , name , ** kwargs ) : ret = { 'name' : name , 'changes' : { } , 'result' : False , 'comment' : '' } if __opts__ [ 'test' ] : params = { 'hostname' : hostname , 'username' : username , 'password' : password , 'monitor_type' : monitor_type , 'name' : name } for ( key , value ) in six . iteritems ( kwargs ) : params [ key ] = value return _test_output ( ret , 'modify' , params ) existing = __salt__ [ 'bigip.list_monitor' ] ( hostname , username , password , monitor_type , name ) if ( existing [ 'code' ] == 200 ) : modified = __salt__ [ 'bigip.modify_monitor' ] ( hostname , username , password , monitor_type , name , ** kwargs ) if ( modified [ 'code' ] == 200 ) : del existing [ 'content' ] [ 'selfLink' ] del modified [ 'content' ] [ 'selfLink' ] ret = _check_for_changes ( 'Monitor' , ret , existing , modified ) else : ret = _load_result ( modified , ret ) elif ( existing [ 'code' ] == 404 ) : ret [ 'comment' ] = 'A Monitor with this name was not found.' else : ret = _load_result ( existing , ret ) return ret
modify an existing monitor .