
    (                         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 create' command.    )absolute_import)division)unicode_literals)ExternalAddressesClient)base)flags)logz
          Create an external IP address that represents an allocated external IP address and its corresponding internal IP address in the private cloud.
        a  
          To create an external IP address called `myip` that corresponds to the internal IP address `165.87.54.14` that belongs to the private cloud `my-private-cloud` in project `my-project` and location `us-east2-b`, run:

            $ {command} myip --project=my-project --private-cloud=my-private-cloud --location=us-east2-b --internal-ip=165.87.54.14 --description="A short description for the new external address"

          Or:

            $ {command} myip --private-cloud=my-private-cloud --internal-ip=165.87.54.14 --description="A short description for the new external 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)CreatezCreate an external IP address.c                 0   t        j                  |        t        j                  j	                  |        t        j                  j                  | d       | j                  j                  d       | j                  ddd       | j                  dd       y	)
z Register flags for this command.Tyamlz--internal-ipzM        internal ip address to which external address will be linked
        )requiredhelpz--descriptionz5        Text describing the external address
        )r   N)	r   AddExternalAddressArgToParserr   
ASYNC_FLAGAddToParser
SetDefaultdisplay_info	AddFormatadd_argument)parsers    >lib/surface/vmware/private_clouds/external_addresses/create.pyArgszCreate.Args2   s     
''/OO'OOvt,
!!&)
         c                    |j                   j                  j                         }t               }|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 created)operation_refmessage)r   )CONCEPTSexternal_addressParser   async_r   internal_ipdescriptionr	   CreatedResourcenameWaitForOperationGetOperationRefformatRelativeName)selfargsr#   clientr   	operationresources          r   Runz
Create.RunF   s    }}55;;=$&F{{H$**D,<,<I 	
..1DB&&,,Y7AHH))+- ' .H %%'.@ Or   N)	__name__
__module____qualname____doc__DETAILED_HELPdetailed_helpstaticmethodr   r3    r   r   r   r   ,   s!    &- &r   r   N)r7   
__future__r   r   r   /googlecloudsdk.api_lib.vmware.externaladdressesr   googlecloudsdk.callioper   !googlecloudsdk.command_lib.vmwarer   googlecloudsdk.corer	   r8   ReleaseTracksReleaseTrackGACreateCommandr   r;   r   r   <module>rE      sj    2 &  ' S ( 3 #
	$ D%%((),T , *,r   