def create_monitor(hostname, username, password, monitor_type, name, **kwargs):
 bigip_session = _build_session(username, password)
 payload = {}
 payload['name'] = name
 for (key, value) in six.iteritems(kwargs):
  if (not key.startswith('__')):
   if (key not in ['hostname', 'username', 'password', 'type']):
    key = key.replace('_', '-')
    payload[key] = value
 try:
  response = bigip_session.post((BIG_IP_URL_BASE.format(host=hostname) + '/ltm/monitor/{type}'.format(type=monitor_type)), data=json.dumps(payload))
 except requests.exceptions.ConnectionError as e:
  return _load_connection_error(hostname, e)
 return _load_response(response)

def create_monitor ( hostname , username , password , monitor_type , name , ** kwargs ) : bigip_session = _build_session ( username , password ) payload = { } payload [ 'name' ] = name for ( key , value ) in six . iteritems ( kwargs ) : if ( not key . startswith ( '__' ) ) : if ( key not in [ 'hostname' , 'username' , 'password' , 'type' ] ) : key = key . replace ( '_' , '-' ) payload [ key ] = value try : response = bigip_session . post ( ( BIG_IP_URL_BASE . format ( host = hostname ) + '/ltm/monitor/{type}' . format ( type = monitor_type ) ) , data = json . dumps ( payload ) ) except requests . exceptions . ConnectionError as e : return _load_connection_error ( hostname , e ) return _load_response ( response )
a function to connect to a bigip device and create a monitor .