
                            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
 r\	R$                  \	R&                  " \	R(                  R*                  5       " S S\	R,                  5      5       5       r\	R&                  " \	R(                  R0                  5       " S S\5      5       r\	R&                  " \	R(                  R4                  5       " S S\5      5       rg)Create a Cloud NetApp Volume.    )absolute_import)division)unicode_literals)client)base)flags)labels_util)logc                 ,    [         R                  " XS9  g )N)release_track)volumes_flagsAddVolumeCreateArgs)parserr   s     $lib/surface/netapp/volumes/create.py_CommonArgsr      s    ##FH    c                   d    \ rS rSrSr\R                  R                  rSSS.r	\
S 5       rS rSrg	)
Create!   r   z1          Create a Cloud NetApp Volume
          a            The following command creates a NFS Volume named NAME asynchronously using the specified arguments

              $ {command} NAME --capacity=1024 --protocols=nfsv3,nfsv4 --share-name=share1 --storage-pool=sp1 --description="test description" --enable-kerberos=true --unix-permissions=0755 --async

          The following command creates a SMB Volume named NAME asynchronously using the specified arguments

              $ {command} NAME --capacity=1024 --protocols=smb --share-name=share2 --storage-pool=sp2 --description="test smb" --security-style=ntfs --smb-settings=SHOW_SNAPSHOT,SHOW_PREVIOUS_VERSIONS,ACCESS_BASED_ENUMERATION --snap-reserve=0.1 --async
          )DESCRIPTIONEXAMPLESc                 8    [        U [        R                  5        g N)r   r   _RELEASE_TRACKr   s    r   ArgsCreate.Args7   s    --.r   c                    UR                   R                  R                  5       n[        R                  " U R
                  5      n/ nUR                   H4  n[        R                  " XSR                  5      nUR                  U5        M6     UR                  S-	  n/ nUR                  (       aD  UR                   H4  n	[        R                  " XR                  5      n
UR                  U
5        M6     0 nUR                  UR                  UR                   UR"                  S.R%                  5        H  u  pU(       d  M  XU'   M     U(       d  Sn[        R&                  " UR(                  UR                  5      n/ nUR*                  (       aE  UR*                   H5  n[        R,                  " UUR                  5      nUR                  U5        M7     [.        R0                  " XR                  R2                  R4                  5      nUR6                  nUR8                  nUR:                  nUR<                  nUR>                  nU R
                  [@        RB                  RD                  :X  d(  U R
                  [@        RB                  RF                  :X  a  URH                  nURJ                  nOSnSnURM                  URO                  5       UURP                  UURR                  UURT                  URV                  URX                  UUURZ                  UR\                  UUR^                  UR`                  UUUUUURb                  URd                  UUUS9nURg                  X!Rh                  U5      nURh                  (       aW  SRk                  U RC                  5       Rl                  5      n[n        Rp                  Rs                  SRk                  U5      5        U$ )z4Create a Cloud NetApp Volume in the current project.   )hourly_snapshotdaily_snapshotweekly_snapshotmonthly_snapshotN)namecapacitydescriptionlabelsstorage_pool	protocols
share_nameexport_policyunix_permissionssmb_settingssnapshot_policysnap_reservesnapshot_directorysecurity_styleenable_kerberossnapshotbackuprestricted_actionsbackup_configlarge_capacitymultiple_endpointstiering_policyhybrid_replication_parametersthroughput_mibpscache_parametersblock_deviceszgcloud {} netapp volumes listzBCheck the status of the new volume by listing all volumes:
  $ {} ):CONCEPTSvolumeParsevolumes_clientVolumesClientr   r*   r   GetVolumeProtocolEnumFromArgmessagesappendr&   r.   GetVolumeSmbSettingsEnumFromArgsnapshot_hourlysnapshot_dailysnapshot_weeklysnapshot_monthlyitems!GetVolumeSecurityStyleEnumFromArgr2   r6   %GetVolumeRestrictedActionsEnumFromArgr
   ParseCreateArgsVolumeLabelsValuer8   r<   r9   r=   r>   r   ReleaseTrackBETAGAr7   source_backupParseVolumeConfigRelativeNamer'   r)   r+   r,   r-   r0   r1   r3   source_snapshotr:   r;   CreateVolumeasync_formatprefixr   statusPrint)selfargs
volume_refr   r*   protocolprotocol_enumcapacity_in_gibr.   smb_settingsmb_setting_enumr/   r%   snapshot_scheduler2   r6   restricted_actionrestricted_action_enumr(   r8   r<   r9   r=   r>   r7   rU   r@   resultcommands                                r   Run
Create.Run;   s\   %%++-J))$*=*=>FINN#@@
OO%m}% # mmr)OL**+99__. 	 	,-	 +
 O//--// 11	$
 eg$ 
	 1$  o"DDV__N #66
??!6?? 	
 	!!"89  7 ((oo$$00F ((N,,00,,&&Mt00555t00333((m((mmm%%$$& $$&&??((..!'&&22%,,%%-#%-**&*&H&H))#5 & F8   [[&AF{{/66




$
$&g	jj&/# Mr    N)__name__
__module____qualname____firstlineno____doc__r   rR   rT   r   detailed_helpstaticmethodr   rl   __static_attributes__rn   r   r   r   r   !   sC     &$$''.	- / /^r   r   c                   T    \ rS rSrSr\R                  R                  r\	S 5       r
Srg)
CreateBeta   r   c                 8    [        U [        R                  5        g r   )r   rx   r   r   s    r   r   CreateBeta.Args   s    
112r   rn   N)ro   rp   rq   rr   rs   r   rR   rS   r   ru   r   rv   rn   r   r   rx   rx      s(    %$$)).3 3r   rx   c                   T    \ rS rSrSr\R                  R                  r\	S 5       r
Srg)CreateAlpha   r   c                 8    [        U [        R                  5        g r   )r   r}   r   r   s    r   r   CreateAlpha.Args   s    223r   rn   N)ro   rp   rq   rr   rs   r   rR   ALPHAr   ru   r   rv   rn   r   r   r}   r}      s(    %$$**.4 4r   r}   N)rs   
__future__r   r   r   %googlecloudsdk.api_lib.netapp.volumesr   rB   googlecloudsdk.callioper   )googlecloudsdk.command_lib.netapp.volumesr	   r   $googlecloudsdk.command_lib.util.argsr
   googlecloudsdk.corer   r   DefaultUniverseOnlyReleaseTracksrR   rT   CreateCommandr   rS   rx   r   r}   rn   r   r   <module>r      s    $ &  ' K ( L < #I D%%(()vT v * vr D%%**+3 3 ,3 D%%++,4* 4 -4r   