
    n                         d Z ddlmZ ddlmZ ddlmZ ddddZd	 Z	d
 Z
 ej                  ej                  j                        ej                   G d dej                                      Zy)z&Create instant snapshot group command.    )base_classes)base)flagsz!Create an instant snapshot group.z    *{command}* creates an instant snapshot group of the consistency group.  An Instant Snapshot Group is a Point In Time view of the constituent disks of a Consistency Group, they are stored in-place as Instant Snapshots on the corresponding disks.
    a-      To create an instant snapshot group 'my-instant-snapshot-group' in zone 'us-east1-a' from a consistency group 'my-consistency-group' in region 'us-east1', run:
        $ {command} my-instant-snapshot-group --zone us-east1-a --source-consistency-group=regions/us-east1/resourcePolicies/policy1
    )briefDESCRIPTIONEXAMPLESc                 .    t        j                  |        y N)	isg_flagsAddSourceConsistencyGroupArgparsers    5lib/surface/compute/instant_snapshot_groups/create.py_SourceArgsr   "   s    ((0    c                     t        j                         t        _        t        j                  j	                  | d       t        |        y)z?A helper function to build args based on different API version.create)operation_typeN)r   MakeInstantSnapshotGroupArgCreateISG_ARGAddArgumentr   r   s    r   _CommonArgsr   &   s1    88:&...VH=fr   c                   >    e Zd ZdZed        Zedd       Zd Zd Zy)r   z/Create a Compute Engine instant snapshot group.c                     t        |       y r
   )r   )clsr   s     r   ArgszCreate.Args2   s
    r   c                 H    t        j                  | j                               S r
   )r   ComputeApiHolderReleaseTrack)r   no_https     r   _GetApiHolderzCreate._GetApiHolder6   s    (()9)9);<<r   c                    | j                         }|j                  }|j                  }t        j                  j                  ||j                        }g }t        |dd       }|j                         dk(  rc|j                  |j                         |      }|j                  ||j                  |j                        }	|j                  j                  d|	f}	nu|j                         dk(  rb|j                  |j                         |      }|j!                  ||j                  |j"                        }	|j                  j$                  d|	f}	|j'                  	       |j)                  |      S )Nsource_consistency_groupzcompute.instantSnapshotGroups)namesourceConsistencyGroup)instantSnapshotGroupprojectzoneInsertz#compute.regionInstantSnapshotGroups)r'   r(   region)r"   clientmessagesr   r   ResolveAsResource	resourcesgetattr
CollectionInstantSnapshotGroupName)ComputeInstantSnapshotGroupsInsertRequestr(   r)   apitools_clientinstantSnapshotGroups/ComputeRegionInstantSnapshotGroupsInsertRequestr+   regionInstantSnapshotGroupsappendMakeRequests)
selfargscompute_holderr,   r-   isg_refrequestssource_cg_urlinstant_snapshot_grouprequests
             r   _RunzCreate._Run:   si   '')N""FHnn..t^5M5MNGHD"<dCM>>'<<||~m  =   BB5//|| C g 
 
 
6
6

g
 
			!F	F'<<||~m  =   HH5// I g 
 
 
<
<

g OOGx((r   c                 $    | j                  |      S r
   )rC   )r;   r<   s     r   Runz
Create.Runb   s    99T?r   N)F)	__name__
__module____qualname____doc__classmethodr   r"   rC   rE    r   r   r   r   -   s8     8  = =&)Pr   r   N)rI   googlecloudsdk.api_lib.computer   googlecloudsdk.callioper   :googlecloudsdk.command_lib.compute.instant_snapshot_groupsr   r   DETAILED_HELPr   r   ReleaseTracksr    ALPHADefaultUniverseOnlyCommandr   rK   r   r   <module>rT      s{    - 8 ( Y 1	1 D%%++,4T\\ 4  -4r   