
    e                         d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 ddlmZ d	d
dZ ej                  ej                  j                          G d dej"                               Zy)z+'vmware external-addresses update' command.    )absolute_import)division)unicode_literals)externaladdresses)base)flags)logz
          Updates an external IP address in a VMware Engine private cloud. Only description and internal-ip can be updated.
        a  
          To update an external IP address called `myip` that belongs to the private cloud `my-private-cloud` in project `my-project` and location `us-west1-a` by changing its description to `"Updated description for the external IP address"` and internal-ip to `165.87.54.14`, run:

            $ {command} myip --project=my-project --private-cloud=my-private-cloud --location=us-west1-a --internal-ip=165.87.54.14 --description="Updated description for the external IP address"

          Or:

            $ {command} myip --private-cloud=my-private-cloud --internal-ip=165.87.54.14 --description="Updated description for the external IP address"

          In the second example, the project and region are taken from gcloud properties core/project and vmware/region.
    )DESCRIPTIONEXAMPLESc                   *    e Zd ZdZeZed        Zd Zy)Updatez?Update an external IP address in a VMware Engine private cloud.c                 .   t        j                  |        t        j                  j	                  |        t        j                  j                  | d       | j                  j                  d       | j                  dd       | j                  dd       y)	z Register flags for this command.Tyamlz--internal-ipzF        Updated internal ip address for this external address
        )helpz--descriptionz>        Updated description for this external address
        N)	r   AddExternalAddressArgToParserr   
ASYNC_FLAGAddToParser
SetDefaultdisplay_info	AddFormatadd_argument)parsers    >lib/surface/vmware/private_clouds/external_addresses/update.pyArgszUpdate.Args2   s     
''/OO'OOvt,
!!&)
         c                    |j                   j                  j                         }t        j                         }|j
                  }|j                  ||j                  |j                        }|r#t        j                  |j                  dd       y |j                  |j                  |      dj                  |j                                     }t        j                  |j                         d       |S )Nzexternal addressT)kindis_asyncz/waiting for external address [{}] to be updated)operation_refmessage)r   )CONCEPTSexternal_addressParser   ExternalAddressesClientasync_r   internal_ipdescriptionr	   UpdatedResourcenameWaitForOperationGetOperationRefformatRelativeName)selfargsr"   clientr   	operationresources          r   Runz
Update.RunF   s    }}55;;=668F{{H$**D,<,<I 	
..1D &&,,Y7AHH))+
 ' H %%'.@ Or   N)	__name__
__module____qualname____doc__DETAILED_HELPdetailed_helpstaticmethodr   r3    r   r   r   r   ,   s!    G- &r   r   N)r7   
__future__r   r   r   googlecloudsdk.api_lib.vmwarer   googlecloudsdk.callioper   !googlecloudsdk.command_lib.vmwarer   googlecloudsdk.corer	   r8   ReleaseTracksReleaseTrackGAUpdateCommandr   r;   r   r   <module>rE      sj    2 &  ' ; ( 3 #
	$ D%%(()/T / */r   