
                            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 rS r\R                  " \R                  R                  5      \R                    " S	 S
\R"                  5      5       5       r\R                  " \R                  R&                  5       " S S\5      5       r\R                  " \R                  R*                  5       " S S\5      5       rSSS.\l        g)z(Command for compute reservations create.    )base_classes)base)flags)resource_args)utilc                     [         R                  " XX45      nU R                  Ul        UR                  XRUR                  S9$ )z0Common routine for creating reservation request.)reservationprojectzone)r   MakeReservationMessageFromArgsdescription ComputeReservationsInsertRequestr   )argsmessagesr
   reservation_ref	resourcesr	   s         *lib/surface/compute/reservations/create.py_MakeCreateRequestr      sK    33H4CP+ ,,+		2	2_5I5I 
3 
K K    c                 z   U R                   n[        R                  " 5       R                  UU[        R
                  " U R                  5      S9nU R                  R                  nUR                  n[        XXSU5      nU R                  R                  R                  nU R                  R                  USU4/5      $ )z(Common routine for creating reservation.)scope_listerInsert)r   r   GetReservationResourceArgResolveAsResourcecompute_flagsGetDefaultScopeListerclientr   r
   r   apitools_clientreservationsMakeRequests)compute_apir   r   r   r   r
   create_requestservices           r   
_RunCreater$   #   s    ##)!;;=OO
 66{7I7IJ P L/
 (((##'%dg&/1. ..;;'				(	(7Hn*M)N	OOr   c                   >    \ rS rSrSrSrSrSrSr\	S 5       r
S rSrg)	Create4   $Create a Compute Engine reservation.FTc                     [         R                  " 5       R                  USS9  [        R                  " UU R
                  U R                  U R                  S9  g )Ncreateoperation_type)support_folder_share_setting"support_reservation_sharing_policysupport_ssd_count)r   r   AddArgumentr   AddCreateFlags_support_folder_share_setting#_support_reservation_sharing_policy_support_ssd_countclsparsers     r   ArgsCreate.Args=   sO    ++-99x : )	%(%F%F+.+R+R00	r   c                 r    [        [        R                  " [        R                  R
                  5      U5      $ N)r$   r   ComputeApiHolderr   ReleaseTrackGAselfr   s     r   Run
Create.RunH   s&    l33D4E4E4H4HI4PPr    N)__name__
__module____qualname____firstlineno____doc___support_auto_deleter2   r3   r4   classmethodr8   rA   __static_attributes__rC   r   r   r&   r&   4   s7     -"'(,% Qr   r&   c                   >    \ rS rSrSrSrSrSrSr\	S 5       r
S rSrg)	
CreateBetaL   r(   TFc                     [         R                  " 5       R                  USS9  [        R                  " UU R
                  U R                  U R                  U R                  S9  g )Nr*   r+   )r-   support_auto_deleter.   r/   )	r   r   r0   r   r1   r2   rI   r3   r4   r5   s     r   r8   CreateBeta.ArgsT   sX    ++-99x : )	%(%F%F44+.+R+R00r   c                 r    [        [        R                  " [        R                  R
                  5      U5      $ r;   )r$   r   r<   r   r=   BETAr?   s     r   rA   CreateBeta.Run`   s-    %%d&7&7&<&<=tE Er   rC   NrD   rE   rF   rG   rH   r4   rI   r2   r3   rJ   r8   rA   rK   rC   r   r   rM   rM   L   s5    ,"'(,%	 	Er   rM   c                   >    \ rS rSrSrSrSrSrSr\	S 5       r
S rSrg)CreateAlphae   r(   Tc           	          [         R                  " 5       R                  USS9  [        R                  " USU R
                  U R                  U R                  U R                  S9  g )Nr*   r+   T)support_fleetr-   r/   rP   r.   )	r   r   r0   r   r1   r2   r4   rI   r3   r5   s     r   r8   CreateAlpha.Argsm   s[    ++-99x : )	%(%F%F0044+.+R+Rr   c                 r    [        [        R                  " [        R                  R
                  5      U5      $ r;   )r$   r   r<   r   r=   ALPHAr?   s     r   rA   CreateAlpha.Runz   s-    %%d&7&7&=&=>F Fr   rC   NrU   rC   r   r   rW   rW   e   s5    ,"&(,%
 
Fr   rW   r(   a#  
        To create a Compute Engine reservation by specifying VM properties using an instance template, run:

            $ {command} my-reservation --vm-count=1 --source-instance-template=example-instance-template --zone=fake-zone

        To create a Compute Engine reservation by directly specifying VM properties, run:

            $ {command} my-reservation --vm-count=1 --machine-type=custom-8-10240 --min-cpu-platform="Intel Haswell" --accelerator=count=2,type=nvidia-tesla-v100 --local-ssd=size=375,interface=scsi --zone=fake-zone
        )briefEXAMPLESN)rH   googlecloudsdk.api_lib.computer   googlecloudsdk.callioper   "googlecloudsdk.command_lib.computer   r   /googlecloudsdk.command_lib.compute.reservationsr   r   r   r$   ReleaseTracksr=   r>   UniverseCompatibleCreateCommandr&   rS   rM   r]   rW   detailed_helprC   r   r   <module>ri      s    / 8 ( E A I @KP" D%%(()QT Q  *Q, D%%**+E E ,E0 D%%++,F* F -F6 	/	 r   