#NEWLINE# def run( self , host_id , hostname , keepname = None , description = None , status = None , ipaddrout = None , portout = None , sslout = None , monituser = None , monitpassword = None , skew = None ) : #NEWLINE# #INDENT# self . login ( ) #NEWLINE# data = { #NEWLINE# #INDENT# 'id' : host_id , #NEWLINE# 'hostname' : hostname , #NEWLINE# #UNINDENT# } #NEWLINE# if ( keepname is not None ) : #NEWLINE# #INDENT# data [ 'keepname' ] = keepname #NEWLINE# #UNINDENT# if ( description is not None ) : #NEWLINE# #INDENT# data [ 'description' ] = description #NEWLINE# #UNINDENT# if ( status is not None ) : #NEWLINE# #INDENT# data [ 'status' ] = status #NEWLINE# #UNINDENT# if ( ipaddrout is not None ) : #NEWLINE# #INDENT# data [ 'ipaddrout' ] = ipaddrout #NEWLINE# #UNINDENT# if ( portout is not None ) : #NEWLINE# #INDENT# data [ 'portout' ] = portout #NEWLINE# #UNINDENT# if ( sslout is not None ) : #NEWLINE# #INDENT# data [ 'sslout' ] = sslout #NEWLINE# #UNINDENT# if ( monituser is not None ) : #NEWLINE# #INDENT# data [ 'monituser' ] = monituser #NEWLINE# #UNINDENT# if ( monitpassword is not None ) : #NEWLINE# #INDENT# data [ 'monitpassword' ] = monitpassword #NEWLINE# #UNINDENT# if ( skew is not None ) : #NEWLINE# #INDENT# data [ 'skew' ] = skew #NEWLINE# #UNINDENT# req = self . session . post ( '{}/admin/hosts/update' . format ( self . url ) , data = data ) #NEWLINE# try : #NEWLINE# #INDENT# return req . json ( ) #NEWLINE# #UNINDENT# except Exception : #NEWLINE# #INDENT# raise #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# self . logout ( )