#NEWLINE# @ classmethod #NEWLINE# def relocate_app( cls , options ) : #NEWLINE# #INDENT# "Instructs AppScale to move the named application to a different port.\n\n    Args:\n      options: A Namespace that has fields for each parameter that can be passed\n        in via the command-line interface.\n    Raises:\n      AppScaleException: If the named application isn't running in this AppScale\n        cloud, if the destination port is in use by a different application, or\n        if the AppController rejects the request to relocate the application (in\n        which case it includes the reason why the rejection occurred).\n    " #NEWLINE# login_host = LocalState . get_login_host ( options . keyname ) #NEWLINE# acc = AppControllerClient ( login_host , LocalState . get_secret_key ( options . keyname ) ) #NEWLINE# app_info_map = acc . get_app_info_map ( ) #NEWLINE# if ( options . appname not in app_info_map . keys ( ) ) : #NEWLINE# #INDENT# raise AppScaleException ( "The given application, {0}, is not currently running in this AppScale cloud, so we can't move it to a different port." . format ( options . appname ) ) #NEWLINE# #UNINDENT# relocate_result = acc . relocate_app ( options . appname , options . http_port , options . https_port ) #NEWLINE# if ( relocate_result == 'OK' ) : #NEWLINE# #INDENT# AppScaleLogger . success ( 'Successfully issued request to move {0} to ports {1} and {2}.' . format ( options . appname , options . http_port , options . https_port ) ) #NEWLINE# AppScaleLogger . success ( ( 'Your app serves unencrypted traffic at: ' + 'http://{0}:{1}' . format ( login_host , options . http_port ) ) ) #NEWLINE# AppScaleLogger . success ( ( 'Your app serves encrypted traffic at: ' + 'https://{0}:{1}' . format ( login_host , options . https_port ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise AppScaleException ( relocate_result )