
                            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 d
 Ze	j$                   e	j&                  e	j(                  j*                         G d de	j,                                      Z e	j&                  e	j(                  j0                         G d de             Z e	j&                  e	j(                  j4                         G d de             Zy)z$Creates a Cloud NetApp Storage Pool.    )absolute_import)division)unicode_literals)client)base)flags)labels_util)logc                 2    t        j                  | |       y )N)release_track)storagepools_flagsAddStoragePoolCreateArgs)parserr   s     *lib/surface/netapp/storage_pools/create.py_CommonArgsr      s    --M    c                   \    e Zd ZdZej
                  j                  ZdddZe	d        Z
d Zy)Create#Create a Cloud NetApp Storage Pool.zk          Creates a Storage Pool to contain Volumes with a specified Service Level and capacity.
          a$            The following command creates a Storage Pool named NAME using all possible arguments with a VPC network in the same project

              $ {command} NAME --location=us-central1 --service-level=standard --capacity=2048 --network=name=default --active-directory=ad1 --kms-config=kms-config1 --enable-ldap=true --description="example description"

          The following command creates a Storage pool named NAME using all possible arguments with a shared VPC network in a separate project called VPC_PROJECT

              $ {command} NAME --location=us-central1 --service-level=standard --capacity=2048 --network=name=projects/VPC_PROJECT/locations/us-central1/networks/default --active-directory=ad1 --kms-config=kms-config1 --enable-ldap=true --description="example description"

          )DESCRIPTIONEXAMPLESc                 8    t        | t        j                         y N)r   r   _RELEASE_TRACKr   s    r   ArgszCreate.Args:   s    --.r   c                 ,   |j                   j                  j                         }t        j                  | j
                        }t        j                  |j                  | j
                        j                  |j                        }t        j                  ||j                  j                  j                        }|j                  dz	  }|j                   }|j"                  }|j$                  |j$                  dz	  }	nd}	d}
d}|j&                  8t        j(                  |j                        j                  |j&                        }d}d}d}| j
                  t*        j,                  j.                  k(  s'| j
                  t*        j,                  j0                  k(  ru|j2                  |j2                  dz	  }
|j4                  }|j6                  |j6                  }|j8                  *t        j:                  |j8                  |j                        }|j=                  |j?                         ||j@                  |jB                  |jD                  |jF                  ||jH                  |jJ                  |||jL                  |	|jN                  |
|||||      }|jQ                  ||jR                  |      }|jR                  rWdjU                  | j-                         jV                        }tX        jZ                  j]                  djU                  |             |S )z:Create a Cloud NetApp Storage Pool in the current project.   N   )nameservice_levelnetworkactive_directory
kms_configenable_ldapcapacitydescriptionallow_auto_tieringzonereplica_zonecustom_performance_enabledtotal_throughput
total_iopshot_tier_sizeenable_hot_tier_auto_resizelabelsunified_poolqos_typestorage_pool_typez#gcloud {} netapp storage-pools listzNCheck the status of the new storage pool by listing all storage pools:
  $ {} )/CONCEPTSstorage_poolParsestoragepools_clientStoragePoolsClientr   r   GetStoragePoolServiceLevelArgmessagesGetEnumForChoicer!   r	   ParseCreateArgsStoragePoolLabelsValuer&   r)   r*   r,   r2   GetStoragePoolQosTypeArgr   ReleaseTrackALPHABETAr.   r/   r1   typeGetStoragePoolTypeEnumFromArgParseStoragePoolConfigRelativeNamer"   r#   r$   r%   r'   r(   r+   r-   CreateStoragePoolasync_formatprefixr
   statusPrint)selfargsstoragepool_refr   r!   r0   capacity_in_gibr)   r*   total_throughput_mibpshot_tier_size_gibr2   r/   r1   r3   r5   resultcommands                     r   Runz
Create.Run>   s   mm00668O 33D4G4GHF&DD,,t))*  ((foo))557Fmmr)O99D$$L(#44:#H}} #<<
//'  #'Lt00666t00555				' .."4$($D$D!				&((		.LLIIv
 00))+#..??$$ $$22!#'#B#B/??'$?!+) 1 L, %%lF {{5<<




$
$g 
jj#VG_ Mr   N)__name__
__module____qualname____doc__r   r@   GAr   detailed_helpstaticmethodr   rU    r   r   r   r   #   sC     ,$$''.		-  / /Fr   r   c                   L    e Zd ZdZej
                  j                  Zed        Z	y)
CreateBetar   c                 8    t        | t        j                         y r   )r   r_   r   r   s    r   r   zCreateBeta.Args   s    
112r   N)
rV   rW   rX   rY   r   r@   rB   r   r\   r   r]   r   r   r_   r_      s(    +$$)).3 3r   r_   c                   L    e Zd ZdZej
                  j                  Zed        Z	y)CreateAlphar   c                 8    t        | t        j                         y r   )r   rb   r   r   s    r   r   zCreateAlpha.Args   s    223r   N)
rV   rW   rX   rY   r   r@   rA   r   r\   r   r]   r   r   rb   rb      s(    +$$**.4 4r   rb   N)rY   
__future__r   r   r   +googlecloudsdk.api_lib.netapp.storage_poolsr   r7   googlecloudsdk.callioper   /googlecloudsdk.command_lib.netapp.storage_poolsr   r   $googlecloudsdk.command_lib.util.argsr	   googlecloudsdk.corer
   r   DefaultUniverseOnlyReleaseTracksr@   rZ   CreateCommandr   rB   r_   rA   rb   r]   r   r   <module>rm      s    + &  ' U ( W < # D%%(()_T _ * _D D%%**+3 3 ,3 D%%++,4* 4 -4r   