
    	                         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lmZ  G d	 d
e	j                        Zy)z*Command to get Shielded instance identity.    )absolute_import)division)unicode_literals)base_classes)utils)base)flagsc                   .    e Zd ZdZddiZed        Zd Zy)GetShieldedIdentityzGet the Shielded identity for a Compute Engine instance.

  *{command}* displays the Shielded identity associated with a
  Compute Engine instance in a project.
  EXAMPLESzo
  To get the shielded identity for an instance, run:

    $ {command} example-instance --zone=us-central1-b
  c                     t         j                  j                  | d       t        j                  j                  |        y )Nz!describe the Shielded identity of)operation_type)r	   INSTANCE_ARGAddArgumentr   URI_FLAGRemoveFromParser)parsers    6lib/surface/compute/instances/get_shielded_identity.pyArgszGetShieldedIdentity.Args*   s4    	""B # DMM""6*    c                    t        j                  | j                               }|j                  }t        j
                  j                  ||j                  t        j                  |            }|j                  j                  d|j                  j                  |j                  |j                  |j                         f}g }|j#                  |g|      }|rt%        j&                  |d       |d   }|S )N)scope_listerGetShieldedInstanceIdentity)instancezoneproject)requestserrors_to_collectz Could not get Shielded identity:)error_messager   )r   ComputeApiHolderReleaseTrackclientr	   r   ResolveAsResource	resourcescompute_flagsGetDefaultScopeListerapitools_client	instancesmessages2ComputeInstancesGetShieldedInstanceIdentityRequestr   r   r   MakeRequestsr   RaiseToolException)	selfargsholderr"   instance_refrequesterrorsobjectsresponses	            r   RunzGetShieldedIdentity.Run0   s    **4+<+<+>?F]]F%%77"88@ 8 BL 	((*GJJ!**"" (( 	K 	*+G F!!G9!OG
 BDqzHOr   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr   r5    r   r   r   r      s1      - + +
r   r   N)r9   
__future__r   r   r   googlecloudsdk.api_lib.computer   r   googlecloudsdk.callioper   "googlecloudsdk.command_lib.computer	   r%   ,googlecloudsdk.command_lib.compute.instancesDescribeCommandr   r<   r   r   <module>rC      s4    1 &  ' 7 0 ( E >*$.. *r   