
    c                         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 vcenter credentials reset' command.    )absolute_import)division)unicode_literals)PrivateCloudsClient)base)flags)logzk
          Reset VMware vCenter sign-in credentials associated with a VMware Engine private cloud.
        a  
          To reset sign-in credentials for vCenter in private cloud `my-private-cloud`, run:


            $ {command} --private-cloud=my-private-cloud --location=us-west2-a --project=my-project

          Or:

            $ {command} --private-cloud=my-private-cloud

          In the second example, the project and location are taken from gcloud properties `core/project` and `compute/zone`.

    )DESCRIPTIONEXAMPLESc                   *    e Zd ZdZeZed        Zd Zy)ResetzgReset VMware vCenter sign-in credentials associated with a Google Cloud VMware Engine private cloud.
  c                 
   t        j                  |        t        j                  j	                  |        t        j                  j                  | d       | j                  j                  d       | j                  ddd       y)z Register flags for this command.Tyamlz
--usernamezC        The username of the user to reset the credentials.
        )hiddenhelpN)	r   AddPrivatecloudArgToParserr   
ASYNC_FLAGAddToParser
SetDefaultdisplay_info	AddFormatadd_argument)parsers    >lib/surface/vmware/private_clouds/vcenter/credentials/reset.pyArgsz
Reset.Args7   sj     
$$V,OO'OOvt,
!!&)
      c                    |j                   j                  j                         }t               }|j                  }|j                  ||j                        }|r#t        j                  |j                  dd       y |j                  |j                  |      dj                  |j                                     }t        j                  |j                         d       |S )Nzvcenter credentialsT)kindis_asyncz0waiting for vcenter credentials [{}] to be reset)operation_refmessage)r   )CONCEPTSprivate_cloudParser   async_ResetVcenterCredentialsusernamer	   UpdatedResourcenameWaitForOperationGetOperationRefformatRelativeName)selfargsr#   clientr   	operationresources          r   Runz	Reset.RunF   s    MM//557M "F{{H..}dmmLI	
..4tE&&,,Y7BII&&(
 ' H ""$+@ Or   N)	__name__
__module____qualname____doc__DETAILED_HELPdetailed_helpstaticmethodr   r3    r   r   r   r   0   s%      - r   r   N)r7   
__future__r   r   r   +googlecloudsdk.api_lib.vmware.privatecloudsr   googlecloudsdk.callioper   !googlecloudsdk.command_lib.vmwarer   googlecloudsdk.corer	   r8   ReleaseTracksReleaseTrackGAUpdateCommandr   r;   r   r   <module>rE      sj    2 &  ' K ( 3 #		, D%%(()(D ( *(r   