#NEWLINE# def add_access_config( self , parameters , instance_id , static_ip ) : #NEWLINE# #INDENT# ' Instructs Google Compute Engine to use the given IP address as the\n    public IP for the named instance.\n\n    This assumes that there is no existing public IP address for the named\n    instance. If this is not the case, callers should use delete_access_config\n    first to remove it.\n\n    Args:\n      parameters: A dict with keys for each parameter needed to connect to\n        Google Compute Engine, and an additional key mapping to a list of\n        instance names that should be deleted.\n      instance_id: A str naming the running instance that the new public IP\n        address should be added to.\n      static_ip: A str naming the already allocated static IP address that\n        will be used for the named instance.\n    ' #NEWLINE# ( gce_service , credentials ) = self . open_connection ( parameters ) #NEWLINE# http = httplib2 . Http ( ) #NEWLINE# auth_http = credentials . authorize ( http ) #NEWLINE# request = gce_service . instances ( ) . addAccessConfig ( project = parameters [ self . PARAM_PROJECT ] , instance = instance_id , networkInterface = 'nic0' , zone = parameters [ self . PARAM_ZONE ] , body = { #NEWLINE# #INDENT# 'kind' : 'compute#accessConfig' , #NEWLINE# 'type' : 'ONE_TO_ONE_NAT' , #NEWLINE# 'name' : 'External NAT' , #NEWLINE# 'natIP' : static_ip , #NEWLINE# #UNINDENT# } ) #NEWLINE# response = request . execute ( http = auth_http ) #NEWLINE# AppScaleLogger . verbose ( str ( response ) , parameters [ self . PARAM_VERBOSE ] )