
                            S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSK	J
r
  SSK	Jr  SSKJr   " S	 S
\5      r\R                   " \R"                  R$                  5      \R&                  " \R(                  R*                  5       " S S\R,                  \R.                  5      5       5       r\R                   " \R"                  R2                  5      \R&                  " \R(                  R2                  5       " S S\5      5       5       r\R                   " \R"                  R6                  5       " S S\5      5       rg)zdeployments describe command.    )
exceptions)dm_api_util)dm_base)base)alpha_flags)flags)
propertiesc                       \ rS rSrSrS rSrg)_Results   z@Encapsulate results into a single object to fit the Run() model.c                 (    Xl         X l        X0l        g )N)
deployment	resourcesoutputs)selfr   r   r   s       6lib/surface/deployment_manager/deployments/describe.py__init___Results.__init__!   s     ONL    )r   r   r   N)__name__
__module____qualname____firstlineno____doc__r   __static_attributes__ r   r   r   r      s
    Hr   r   c                   d    \ rS rSrSrSS0r\\R                  R                  4S j5       r
S rSrg)	Describe'   kProvide information about a deployment.

This command prints out all available details about a deployment.
EXAMPLESzk          To display information about a deployment, run:

            $ {command} my-deployment
          c                 f    [         R                  " U 5        U R                  R                  S5        g)a@  Args is called by calliope to gather arguments for this command.

Args:
  parser: An argparse parser that you can use to add arguments that go
      on the command line after this command. Positional arguments are
      allowed.
  version: The version this tool is running as. base.ReleaseTrack.GA
      is the default.
a  
              table(
                deployment:format='default(name, id, description, fingerprint,
                insertTime, manifest.basename(), labels, operation.operationType,
                operation.name, operation.progress, operation.status,
                operation.user, operation.endTime, operation.startTime,
                operation.error, operation.warnings, update)',
                resources:format='table(
                  name:label=NAME,
                  type:wrap:label=TYPE,
                  update.state.yesno(no="COMPLETED"),
                  update.intent)',
              outputs:format='table(
                name:label=OUTPUTS,
                finalValue:label=VALUE)'
             )
    N)r   AddDeploymentNameFlagdisplay_info	AddFormat)parserversions     r   ArgsDescribe.Args7   s+     
'
!! # 	r   c                 $   U R                   R                  UR                  S[        R                  R
                  R                  R                  0SS9n U R                  R                  R                  U R                  R                  [        R                  " 5       UR                  S95      n U R                  R                   R-                  U R                  R/                  [        R                  " 5       UR0                  S95      nUR                   nU R3                  5       [4        R2                  R6                  L a<  UR9                  S5      (       d&  UR:                  (       a  [<        R>                  Ul         / n[(        RB                  " U5      nU(       a  U R                  RD                  R                  U R                  RG                  [        R                  " 5       UR                  US95      n	U	RH                  (       a   [(        RJ                  " U	RH                  5      n[M        X6U5      $ ! [         R"                   a*  n[$        R&                  " U[(        R*                  5      eSnAff = f! [         R"                   a    Sn GNf = f)zRun 'deployments describe'.

Args:
  args: argparse.Namespace, The arguments that this command was invoked
      with.

Returns:
  The requested Deployment.

Raises:
  HttpException: An http error response was received while executing api
      request.
projectzdeploymentmanager.deployments)params
collection)r+   r   Nformat)r+   r   manifest)'r   Parsedeployment_namer	   VALUEScorer+   	GetOrFailclientdeploymentsGetmessages&DeploymentmanagerDeploymentsGetRequestr   
GetProjectr   apitools_exceptions	HttpErrorr   HttpExceptionr   HTTP_ERROR_FORMATList%DeploymentmanagerResourcesListRequestnameReleaseTrackr   ALPHAIsSpecifiedupdater   5PREVIEWED_DEPLOYMENT_AND_RESOURCES_AND_OUTPUTS_FORMATr.   ExtractManifestName	manifests$DeploymentmanagerManifestsGetRequestlayoutFlattenLayoutOutputsr   )
r   argsdeployment_refr   errorresponser   r   r/   manifest_responses
             r   RunDescribe.RunU   s    ^^)):,,1199CCD2 * 4NK;;**..
--
>
>((*'22 ? 45j&&++
--
=
=((*z > HIh $$i				 1 1 7 7	7  **1B1BOO + G..z:H++//33
--
<
<((*'22 =  
	!	!223D3K3KLJ733A (( K$$UK,I,IJJK (( is,   AH4 0CI5 4I2%I--I25JJr   N)r   r   r   r   r   detailed_helpstaticmethodr   rB   GAr(   rQ   r   r   r   r   r   r   '   s@      - ,,// 	 	:74r   r   c                   (    \ rS rSrSr\S 5       rSrg)DescribeAlpha   r    c                     [         R                  U [        R                  R                  S9  U R
                  R                  [        R                  5        g N)r'   )	r   r(   r   rB   rC   r$   r%   r   +DEPLOYMENT_AND_RESOURCES_AND_OUTPUTS_FORMATr&   s    r   r(   DescribeAlpha.Args   s<    MM&$"3"3"9"9M:
!!??Ar   r   Nr   r   r   r   r   rT   r(   r   r   r   r   rW   rW      s    
 A Ar   rW   c                   (    \ rS rSrSr\S 5       rSrg)DescribeBeta   r    c                 \    [         R                  U [        R                  R                  S9  g rZ   )r   r(   r   rB   BETAr\   s    r   r(   DescribeBeta.Args   s    MM&$"3"3"8"8M9r   r   Nr^   r   r   r   r`   r`      s    
 : :r   r`   N)r   apitools.base.pyr   r;   )googlecloudsdk.api_lib.deployment_managerr   r   googlecloudsdk.callioper   -googlecloudsdk.command_lib.deployment_managerr   r   googlecloudsdk.corer	   objectr   ReleaseTracksrB   rU   UseDmApiDmApiVersionV2DescribeCommand	DmCommandr   rC   rW   rc   r`   r   r   r   <module>rq      s    $ ? A = ( . E ? *v  D%%(()'&&))*c4t##W%6%6 c4 + *c4L D%%++,'&&,,-
AH 
A . -
A D%%**+:8 : ,:r   