
    $                     L   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  e	j"                  e	j$                  j&                         G d
 de	j(                               Z e	j"                  e	j$                  j,                         G d de             Zy)z*Creates a Cloud NetApp Volumes KMS Config.    )absolute_import)division)unicode_literals)client)base)flags)labels_util)logc                   \    e Zd ZdZdddZej                  j                  Ze	d        Z
d Zy)Create)Create a Cloud NetApp Volumes KMS Config.z          Creates a KMS (Key Management System) Config to encrypt Cloud NetApp Volumes, Storage Pools etc. using Customer Managed Encryption Keys (CMEK)
          aE            The following command creates a KMS Config instance named KMS_CONFIG using specified project, location, Key Ring and Crypto Key

              $ {command} KMS_CONFIG --location=us-central1 --kms-location=northamerica-northeast1 --kms-project=kms-project1 --kms-keyring=kms-keyring21 --kms-key=crypto-key1
          )DESCRIPTIONEXAMPLESc                 .    t        j                  |        y )N)kmsconfigs_flagsAddKMSConfigCreateArgs)parsers    (lib/surface/netapp/kms_configs/create.pyArgszCreate.Args-   s    ++F3    c                    |j                   j                  j                         }t        j                  | j
                        }t        j                  ||j                  j                  j                        }t        j                  |j                  |j                  |j                  |j                         }|j#                  |j%                         ||j&                  |      }|j)                  ||j*                  |      }|j*                  rWdj-                  | j/                         j0                        }t2        j4                  j7                  dj-                  |             |S )z@Create a Cloud NetApp Volumes KMS Config in the current project.)namecrypto_key_namedescriptionlabelsz!gcloud {} netapp kms-configs listzJCheck the status of the new KMS Config by listing all KMS configs:
  $ {} )CONCEPTS
kms_configParsekmsconfigs_clientKmsConfigsClient_RELEASE_TRACKr	   ParseCreateArgsmessages	KmsConfigLabelsValuer   ConstructCryptoKeyNamekms_projectkms_locationkms_keyringkms_keyParseKmsConfigRelativeNamer   CreateKmsConfigasync_formatReleaseTrackprefixr
   statusPrint)	selfargskmsconfig_refr   r   r   r   resultcommands	            r   Runz
Create.Run1   s$   MM,,224M//0C0CDF((foo''33F '==$++T-=-=t||O &&'')'$$	 ' J ##M4;;
KF{{3::




$
$g 
jjF7O Mr   N)__name__
__module____qualname____doc__detailed_helpr   r0   GAr!   staticmethodr   r9    r   r   r   r      s@    1		- $$''.4 4r   r   c                   <    e Zd ZdZej
                  j                  Zy)
CreateBetar   N)r:   r;   r<   r=   r   r0   BETAr!   rA   r   r   rC   rC   M   s    1$$)).r   rC   N)r=   
__future__r   r   r   )googlecloudsdk.api_lib.netapp.kms_configsr   r   googlecloudsdk.callioper   -googlecloudsdk.command_lib.netapp.kms_configsr   r   $googlecloudsdk.command_lib.util.argsr	   googlecloudsdk.corer
   ReleaseTracksr0   r?   CreateCommandr   rD   rC   rA   r   r   <module>rM      s    1 &  ' Q ( S < # D%%(()-T - *-` D%%**+* * ,*r   