def modify_profile(hostname, username, password, profile_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', 'profile_type']):
    key = key.replace('_', '-')
    try:
     payload[key] = _set_value(value)
    except salt.exceptions.CommandExecutionError:
     return 'Error: Unable to Parse JSON data for parameter: {key}\n{value}'.format(key=key, value=value)
 try:
  response = bigip_session.put((BIG_IP_URL_BASE.format(host=hostname) + '/ltm/profile/{type}/{name}'.format(type=profile_type, name=name)), data=json.dumps(payload))
 except requests.exceptions.ConnectionError as e:
  return _load_connection_error(hostname, e)
 return _load_response(response)

def modify_profile ( hostname , username , password , profile_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' , 'profile_type' ] ) : key = key . replace ( '_' , '-' ) try : payload [ key ] = _set_value ( value ) except salt . exceptions . CommandExecutionError : return 'Error: Unable to Parse JSON data for parameter: {key}\n{value}' . format ( key = key , value = value ) try : response = bigip_session . put ( ( BIG_IP_URL_BASE . format ( host = hostname ) + '/ltm/profile/{type}/{name}' . format ( type = profile_type , name = name ) ) , 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 profile .