
                         >   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  SSKJr  SSKJr  \R*                  " \R,                  R.                  \R,                  R0                  5       " S S\R2                  5      5       rg)z.`gcloud dataplex environments update` command.    )absolute_import)division)unicode_literals)environment)util)
exceptions)arg_parsers)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	)
Update    z?Update a Dataplex Environment with the given configurations.
  EXAMPLESaM  
          To update a Dataplex environment `test-environment` within lake `test-lake` in location `us-central1` and
          change the description to `Updated Description`, run:

            $ {command} test-environment --project=test-project --location=us-central1 --lake=test-lake --description='Updated Description'

          c                 `   [         R                  " U S5        U R                  SSS9  U R                  SSS9  U R                  SS9nUR                  SS9nUR                  S	[        S
S9  UR                  S[        SS9  UR                  S[        SS9  UR                  SS9nUR                  SSS9  UR                  SS[
        R                  " 5       / SS9  UR                  SS[
        R                  " 5       / SS9  UR                  SS[
        R                  " 5       SS9  U R                  SS9nUR                  SS S9  UR                  S!S"S#S#S$S%9  U R                  S&S#S'S(9nUR                  S)S"S#S*S+9  [        R                  R                  U5        [        R                  " U 5        g ),Nzto update a Environment to.z--descriptionzDescription of the Environment)helpz--display-namezDisplay Name of the EnvironmentzFConfiguration for the underlying infrastructure used to run workloads.zDCompute resources associated with the analyze interactive workloads.z--compute-disk-size-gbz*Size in GB of the disk. Default is 100 GB.)typer   z--compute-node-countz,Total number of worker nodes in the cluster.z--compute-max-node-countz%Maximum number of configurable nodes.z.Software Runtime Configuration to run Analyze.z--os-image-versionzDataplex Image version.z--os-image-java-librariesOS_IMAGE_JAVA_LIBRARIESzList of Java jars to be included in the runtime environment. Valid input includes Cloud Storage URIs to Jar binaries. For example, gs://bucket-name/my/path/to/file.jar)metavarr   defaultr   z--os-image-python-packagesOS_IMAGE_PYTHON_PACKAGESzA list of python packages to be installed. Valid formats include Cloud Storage URI to a PIP installable library. For example, gs://bucket-name/my/path/to/lib.tar.gzz--os-image-propertiesOS_IMAGE_PROPERTIESzOverride to common configuration of open source components installed on the Dataproc cluster. The properties to set on daemon config files. Property keys are specified in `prefix:property` format.)r   r   r   zEConfiguration for sessions created for the environment to be updated.z--session-max-idle-durationzjThe idle time configuration of the session. The session will be auto-terminated at the end of this period.z--session-enable-fast-startup
store_trueFzEnables fast startup. This causes sessions to be pre-created and available for faster startup to enable interactive exploration use-cases.)actionr   requiredr   Tz:At most one of --async | --validate-only can be specified.)mutexr   r   z--validate-onlyz:Validate the create action, but don't actually perform it.)r   r   r   )r   AddEnvironmentResourceArgadd_argument	add_groupintr	   ArgListArgDictr
   
ASYNC_FLAGAddToParserr   AddCreateLabelsFlags)parserinfrastructure_speccompute_resourcesos_image_runtimesession_specasync_groups         +lib/surface/dataplex/environments/update.pyArgsUpdate.Args1   sR   ++F,IK
.NO
@  B **U +  ,55S 6  "" 9 # ; ""; # = """4 # 6 +44= 5 ?!!#< " >!!#)  " w "  !!$*  " t "  !!%  " T	 "  ##T $ L %y   ' Z   ""I # KK J	  L
 	OO,$$V,    z-Status code: {status_code}. {status_message}.c           
      >   [         R                  " U5      n[        U5      S:  a  [        R                  " S5      eUR
                  R                   R                  5       n[        R                  " 5       n[        R                  " 5       nUR                  R                  UR                  UR                  5       UR                  SR                  U5      [         R                   " U5      S95      n[#        USS5      nU(       a   [$        R&                  R)                  S5        g [#        USS5      nU(       d-  [         R*                  " U5      n	[$        R,                  " US	S
9  U	$ [$        R&                  R)                  SR/                  X6R0                  5      5        U$ )N   zIUpdate commands must specify at least one additional parameter to change.,)namevalidateOnly
updateMask googleCloudDataplexV1Environmentvalidate_onlyFzValidation complete.async_zOperation was successful.)detailsz$Updating [{0}] with operation [{1}].)r   GenerateUpdateMasklenr   HttpExceptionCONCEPTSParsedataplex_utilGetClientInstanceGetMessageModule%projects_locations_lakes_environmentsPatch6DataplexProjectsLocationsLakesEnvironmentsPatchRequestRelativeNamer8   join#GenerateEnvironmentForUpdateRequestgetattrr   statusPrintWaitForOperationUpdatedResourceformatr4   )
selfargsupdate_maskenvironment_refdataplex_clientmessageupdate_req_opr8   r9   responses
             r-   Run
Update.Run|   s]    006K
;!$$
U  mm//557O#557O,,.G#IIOOFF --/++yy--800.115.7	 	G 	89M D/59M	jj-.T8U+F--m<h	/3NOoJJ;BB++- .r0    N)__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr.   gcloud_exception CatchHTTPErrorRaiseHTTPExceptionrW   __static_attributes__rY   r0   r-   r   r       sQ     
- H- H-T 44577r0   r   N)r^   
__future__r   r   r   googlecloudsdk.api_lib.dataplexr   r   r@   googlecloudsdk.api_lib.utilr   ra   googlecloudsdk.callioper	   r
   #googlecloudsdk.command_lib.dataplexr   $googlecloudsdk.command_lib.util.argsr   googlecloudsdk.corer   ReleaseTracksReleaseTrackALPHAGACommandr   rY   r0   r-   <module>rp      sv    5 &  ' 7 A F / ( . = < # D%%++T->->-A-AB|T\\ | C|r0   