
                         &   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S
KJr  SSKJr  \R(                  " \R*                  R,                  \R*                  R.                  5       " S S\R0                  5      5       rg)z+Command to create a Dataplex lake resource.    )absolute_import)division)unicode_literals)lake)util)
exceptions)base)resource_args)labels_util)logc                   `    \ rS rSrSrSS0r\S 5       r\R                  " S5      S 5       r
Srg	)
Create   a  Create a Dataplex lake resource.

A lake is a centralized repository for managing data across the
organization, where enterprise data is distributed across many cloud projects,
and stored in a variety of storage services, such as Google Cloud Storage and
BigQuery. A lake provides data admins with tools to organize, secure and
manage their data at scale, and provides data scientists and data engineers an
integrated experience to easily search, discover, analyze and transform data
and associated metadata.

The Lake ID will be used to generate names such as database and dataset names
when publishing metadata to Hive Metastore and BigQuery.
The Lake id must follow these rules:
 * Must contain only lowercase letters, numbers, and hyphens.
 * Must start with a letter.
 * Must end with a number or a letter.
 * Must be between 1-63 characters.
 * Must be unique within the customer project / location.
EXAMPLESa            To create a Dataplex lake with name `my-dataplex-lake` in location
          `us-central1`, run:

            $ {command} my-dataplex-lake --location=us-central

          To create a Dataplex lake with name `my-dataplex-lake` in location
          `us-central1` with metastore service `service-123abc` attached, run:

            $ {command} my-dataplex-lake --location=us-central --metastore-service=projects/my-project/services/service-123abc
          c                 >   [         R                  " U S5        U R                  SSSSS9  U R                  SS9nUR                  S	S
S9  U R                  SSS9  U R                  SSS9  [        R
                  R                  U 5        [        R                  " U 5        g )Nz
to create.z--validate-only
store_trueFz:Validate the create action, but don't actually perform it.)actiondefaulthelpzGSettings to manage metadata publishing to a Hive Metastore from a lake.)r   z--metastore-serviceaN   A relative reference to the Dataproc Metastore
        (https://cloud.google.com/dataproc-metastore/docs) service instance into
        which metadata will be published. This is of the form:
        `projects/{project_number}/locations/{location_id}/services/{service_id}`
        where the location matches the location of the lake.z--descriptionzDescription of the lake.z--display-namezDisplay name of the lake.)	r
   AddLakeResourceArgadd_argument	add_groupr	   
ASYNC_FLAGAddToParserr   AddCreateLabelsFlags)parser	metastores     $lib/surface/dataplex/lakes/create.pyArgsCreate.ArgsC   s    $$V\:
J	  L
   V ! I @  A .HI
(/JKOO'$$V,    z-Status code: {status_code}. {status_message}.c                    UR                   R                  R                  5       n[        R                  " 5       n[        R
                  " 5       nUR                  R                  UR                  UR                  5       UR                  5       R                  5       UR                  UR                  UR                  UR                  [        R                   " UR                  U5      UR#                  UR$                  S9S9S95      n['        USS5      nU(       a   [(        R*                  R-                  S5        g ['        USS5      nU(       de  [        R.                  " U5        [(        R0                  " UR                  5       SR3                  UR                  5       R                  5       5      S	9  g [(        R*                  R-                  S
R3                  X%R4                  5      5        g )N)service)descriptiondisplayNamelabelsr   )lakeIdparentvalidateOnlygoogleCloudDataplexV1Lakevalidate_onlyFzValidation complete.async_zLake created in [{0}])detailsz$Creating [{0}] with operation [{1}].)CONCEPTSr   Parsedataplex_utilGetClientInstanceGetMessageModuleprojects_locations_lakesr   +DataplexProjectsLocationsLakesCreateRequestNameParentRelativeNamer+   GoogleCloudDataplexV1Laker$   display_nameCreateLabels"GoogleCloudDataplexV1LakeMetastoremetastore_servicegetattrr   statusPrintWaitForLongOperationCreatedResourceformatname)selfargslake_refdataplex_clientmessagecreate_req_opr+   r,   s           r   Run
Create.RunZ   s    }}!!'')H#557O,,.G#<<CC;;==???$113++&-&G&G ,, --$1155t=!DD 22 E 4 'H '5	 	< 
	67M D/59M	jj-.T8U+F
.	
--/)00oo,,.01 JJ;BB$$& 'r!    N)__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr   gcloud_exception CatchHTTPErrorRaiseHTTPExceptionrJ   __static_attributes__rL   r!   r   r   r      sN    * 
- - -, 4457 '7 'r!   r   N)rQ   
__future__r   r   r   googlecloudsdk.api_lib.dataplexr   r   r0   googlecloudsdk.api_lib.utilr   rT   googlecloudsdk.callioper	   #googlecloudsdk.command_lib.dataplexr
   $googlecloudsdk.command_lib.util.argsr   googlecloudsdk.corer   ReleaseTracksReleaseTrackALPHAGACommandr   rL   r!   r   <module>rc      sp    2 &  ' 0 A F ( = < # D%%++T->->-A-AB]'T\\ ]' C]'r!   