
    Yq                     \   S r SSKJr  SSKJr  SSKJr  SSKrSSK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rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS r S r!S r"S r#S r$S r%S  r&S! r'SVS" jr(S# r)S$ r*S% r+S& r,S' r-S( r.S) r/S* r0S+ r1S, r2S- r3S. r4S/ r5S0 r6S1 r7S2 r8SWS3 jr9S4 r:S5 r;S6 r<S7 r=S8 r>SXS9 jr?S: r@SWS; jrAS< rBS= rCS> rDSVS? jrES@ rFSA rGSB rHSC rISD rJSE rKSF rLSG rMSH rNSI rOSJ rPSK rQSL rRSM rSSN rTSO rUSP rVSQ rWSR rXSS rYST rZSU r[g)Yz.Flags for workflow templates related commands.    )absolute_import)division)unicode_literalsN)actions)arg_parsers)concepts)deps)concept_parsers)
propertiesc                      [         R                  " [        R                  R                  R
                  5      /n [        R                  " SSU S9$ )Nregiona
  Dataproc region for the {resource}. Each Dataproc region constitutes an independent resource namespace constrained to deploying instances into Compute Engine zones inside the region. Overrides the default `dataproc/region` property value for this command invocation.name	help_textfallthroughs)r	   PropertyFallthroughr   VALUESdataprocr   r    ResourceParameterAttributeConfigr   s    0lib/googlecloudsdk/command_lib/dataproc/flags.py_RegionAttributeConfigr   "   sG    **:+<+<+E+E+L+LMN,		2	2/
  
! !    c                      [         R                  " [        R                  R                  R
                  5      /n [        R                  " SSU S9$ )Nlocationa  Dataproc location for the {resource}. Each Dataproc location constitutes an independent resource namespace constrained to deploying instances into Compute Engine zones inside the location. Overrides the default `dataproc/location` property value for this command invocation.r   )r	   r   r   r   r   r   r   r   r   s    r   _LocationAttributeConfigr   /   sG    **:+<+<+E+E+N+NOP,		2	2/
  
! !r   c                     [         R                  R                  R                  nU R	                  SUR
                  [        R                  " U5      S9  g )N--regionhelpaction)r   r   r   r   add_argumentr   r   StoreProperty)parserregion_props     r   AddRegionFlagr&   <   sF    !!**11+  "";/	  1r   c                     [         R                  R                  R                  nU R	                  SUR
                  [        R                  " U5      S9  g )Nz
--locationr   )r   r   r   r   r"   r   r   r#   )r$   location_props     r   AddLocationFlagr)   E   sF    ##,,55-""""=1	  3r   c           	         [         R                  " SUSS[         R                  [        5       S9n[        R
                  R                  SU[        R                  R                  R                  R                  SS9R                  U 5        g)z.Add resrouce arg for projects/{}/locations/{}.zdataproc.projects.locationsr   T)api_versionresource_namedisable_auto_completers
projectsIdlocationsIdr   requiredN)r   ResourceSpec DEFAULT_PROJECT_ATTRIBUTE_CONFIGr   r
   ConceptParserForResourcer   r   r   r   r   AddToParser)r$   r+   specs      r   AddProjectsLocationsResourceArgr8   N   sz     
		#"::(*
,$ ++
  ''11	 ,  ![(r   c                 (    U R                  SSSSS9  g)z'Adds async flag with our own help text.z--async
store_trueasync_zMReturn immediately without waiting for the operation in progress to complete.)r!   destr    Nr"   r$   s    r   AddAsyncr?   `   s#    $	  &r   c                  ,    [         R                  " SSS9$ )NclusterzThe Cluster name.r   r   r   r    r   r   ClusterConfigrE   j   s    		2	2#
 r   c           
      r    [         R                  " SU SS[         R                  [        5       [	        5       S9$ )N"dataproc.projects.regions.clustersrA   Tr+   r,   r-   	projectIdr   clusterNamer   r2   r3   r   rE   r+   s    r   _GetClusterResourceSpecrM   q   s5    			*"99#%/
 r   c                     [         R                  R                  S[        U5      SR	                  U5      SS9R                  U 5        g )NrA   zThe name of the cluster to {}.Tr0   )r
   r4   r5   rM   formatr6   r$   verbr+   s      r   AddClusterResourceArgrR   }   sC    ++k*&--d3	 ,  ![(r   c                  ,    [         R                  " SSS9$ )Ngke-clusterzThe GKE Cluster path.rB   rC   rD   r   r   GkeClusterConfigrU      s    		2	2'
 r   c                      [         R                  " S5      [         R                  " [        R                  R
                  R                  5      /$ )Nr   )r	   ArgFallthroughr   r   r   r   r   rD   r   r   _DataprocRegionFallthroughrX      s:    
*%
z0099@@A
 r   c                  >    [         R                  " SS[        5       S9$ )Nzgke-cluster-locationzGKE region for the {resource}.r   r   r   rX   rD   r   r   _GkeLocationAttributeConfigr[      s!    		2	2!0-/
1 1r   c                  n    [         R                  " SS[         R                  [        5       [	        5       S9$ )Nz%container.projects.locations.clustersrT   r,   r.   r/   
clustersId)r   r2   r3   r[   rU   rD   r   r   _GetGkeClusterResourceSpecr_      s0    			-!::-/!#
 r   c                 r    [         R                  R                  S[        5       SSS9R	                  U 5        g )Nz--gke-clusterz3The GKE cluster to install the Dataproc cluster on.Tr0   )r
   r4   r5   r_   r6   r>   s    r   AddGkeClusterResourceArgra      s6    ++ ";	 ,  ![(r   c                  ,    [         R                  " SSS9$ )Nmetastore-service?Dataproc Metastore Service to be used as an external metastore.rB   rC   rD   r   r   MetastoreServiceConfigre      s    		2	2Q
 r   c                  >    [         R                  " SS[        5       S9$ )Nzmetastore-service-locationz/Dataproc Metastore location for the {resource}.r   rZ   rD   r   r   (_MetastoreServiceLocationAttributeConfigrg      s!    		2	2'A-/
1 1r   c                  n    [         R                  " SS[         R                  [        5       [	        5       S9$ )Nz%metastore.projects.locations.servicesrc   )r,   r.   r/   
servicesId)r   r2   r3   rg   re   rD   r   r    _GetMetastoreServiceResourceSpecrj      s0    			-':::<')
 r   c                 t    [         R                  R                  S[        5       S5      R	                  U 5        g )Nz--metastore-servicerd   )r
   r4   r5   rj   r6   r>   s    r   AddMetastoreServiceResourceArgrl      s.    ++&(G Kr   c                  ,    [         R                  " SSS9$ )Nhistory-server-clusterzSpark History Server. Resource name of an existing Dataproc cluster to act as a Spark History Server for workloads run on the Cluster.rB   rC   rD   r   r   HistoryServerClusterConfigro      s    		2	2#?
@ @r   c                  >    [         R                  " SS[        5       S9$ )Nzhistory-server-cluster-regionzsCompute Engine region for the {resource}. It must be the same region as the Dataproc cluster that is being created.r   rZ   rD   r   r   *_HistoryServerClusterRegionAttributeConfigrq      s$    		2	2*N-/	
1 1r   c                  n    [         R                  " SS[         R                  [        5       [	        5       S9$ )NrG   rn   )r,   rI   r   rJ   )r   r2   r3   rq   ro   rD   r   r   $_GetHistoryServerClusterResourceSpecrs      s0    			*,9979,.
 r   c                 t    [         R                  R                  S[        5       S5      R	                  U 5        g )Nz--history-server-clusterzwA Dataproc Cluster created as a History Server, see https://cloud.google.com/dataproc/docs/concepts/jobs/history-server)r
   r4   r5   rs   r6   r>   s    r   "AddHistoryServerClusterResourceArgru      s.    ++ *, Kr   c           	         U R                  SS9nUR                  " S/U(       a  S/O/ Q7S[        R                  " [        R
                  R                  R                  5      S.6  UR                  S[        R                  " 5       / SSS	S
9  g)z!Add zone and excluded zones flag.T)mutexz--zonez-zz
            The compute zone (e.g. us-central1-a) for the cluster. If empty
            and --region is set to a value other than `global`, the server will
            pick a zone in the region.
            r   z--auto-zone-exclude-zonesZONEz
            A comma-separated list of compute zones (e.g. us-central1-a) to
            exclude when picking the zone for the cluster.
            )typedefaultmetavarhiddenr    N)
add_argument_groupr"   r   r#   r   r   computezoner   ArgList)r$   short_flagszone_and_excluded_zones_groups      r   AddZoneAndExcludedZonesFlagsr      s    "(";";$";"G,,	2	
 "":#4#4#<#<#A#AB	  ,,!  - 
r   c                 .    U R                  S[        SS9  g )Nz	--versionz%The version of the workflow template.)ry   r    r"   intr>   s    r   AddVersionFlagr     s    "I  Kr   c                 D    U R                  SSR                  X5      SS9  g )Nz--filez'The YAML file containing the {0} to {1}Tr    r1   )r"   rO   )r$   
input_typer!   s      r   AddFileFlagr     s)    4;;JO  r   c                 $    U R                  SSS9  g )NMAIN_PYTHON_FILEzOURI of the main Python file to use as the Spark driver. Must be a ``.py'' file.r    r=   r>   s    r   AddMainPythonFiler     s    (  *r   c                 f    U R                  SS9nUR                  SSSS9  UR                  SSS	S9  g
)zMain class or main jar.Tr0   z--class
main_classzClass contains the main method of the job. The jar file that contains the class must be in the classpath or specified in `jar_files`.)r<   r    z--jarmain_jarzURI of the main jar file.N)add_mutually_exclusive_groupr"   )r$   
main_groups     r   AddJvmMainMutexr     sQ    22D2A*+  - J%@  Br   c                 $    U R                  SSS9  g )N
SQL_SCRIPTz=URI of the script that contains Spark SQL queries to execute.r   r=   r>   s    r   AddMainSqlScriptr   +  s    J  Lr   c                 N    U R                  S[        R                  " 5       SSS9  g)zAdd --params flag.z--varsz
NAME=VALUEzcMapping of query variable names to values (equivalent to the Spark SQL command: SET name="value";).)ry   r{   r    Nr"   r   ArgDictr>   s    r   AddSqlScriptVariablesr   1  s,     5	  7r   c                 P    U R                  S[        R                  " 5       S/ SS9  g)zAdd --jars flag.z--jarsJARzCComma-separated list of jar files to be provided to the classpaths.ry   r{   rz   r    Nr"   r   r   r>   s    r   AddJarFilesr   ;  s/       r   c                 $    U R                  SSS9  g )NMAIN_R_FILEzMURI of the main R file to use as the driver. Must be a ``.R'' or ``.r'' file.r   r=   r>   s    r   AddMainRFiler   F  s    3  5r   c                 P    U R                  S[        R                  " 5       S/ SS9  g)zAdd --py-files flag.z
--py-filesPYzComma-separated list of Python scripts to be passed to the PySpark framework. Supported file types: ``.py'', ``.egg'' and ``.zip.''r   Nr   r>   s    r   AddPythonFilesr   M  s/        r   c                 P    U R                  S[        R                  " 5       S/ SS9  g )Nz--filesFILEz,Files to be placed in the working directory.r   r   r>   s    r   AddOtherFilesr   Y  s-     9  ;r   c                 P    U R                  S[        R                  " 5       S/ SS9  g )Nz
--archivesARCHIVEzoArchives to be extracted into the working directory. Supported file types: .jar, .tar, .tar.gz, .tgz, and .zip.r   r   r>   s    r   AddArchivesr   b  s1     I  Kr   c                 F    U R                  SS[        R                  / SS9  g)zRemaining args to the program.argsJOB_ARGz Arguments to pass to the driver.)r{   nargsrz   r    N)r"   argparse	REMAINDERr>   s    r   AddArgsr   l  s*    -  /r   c                 $    U R                  SSS9  g)z5Cloud Storage bucket to upload workload dependencies.z--deps-bucketz7A Cloud Storage bucket to upload workload dependencies.r   Nr=   r>   s    r   	AddBucketr   v  s      r   c                  ,    [         R                  " SSS9$ )NjobzThe Job ID.rB   rC   rD   r   r   	JobConfigr   ~  s    		2	2
 r   c           
      r    [         R                  " SU SS[         R                  [        5       [	        5       S9$ )Nzdataproc.projects.regions.jobsr   T)r+   r,   r-   rI   r   jobId)r   r2   r3   r   r   rL   s    r   _GetJobResourceSpecr     s5    			&"99#%K
 r   c                     [         R                  R                  S[        U5      SR	                  U5      SS9R                  U 5        g )Nr   zThe ID of the job to {0}.Tr0   )r
   r4   r5   r   rO   r6   rP   s      r   AddJobResourceArgr     sC    +++&!((.	 ,  ![(r   c                    ^^ S mUU4S jn[         R                  R                  SU" U5      SR                  U5      SS9R	                  U 5        g)z'Adds batch resource argument to parser.c                  ,    [         R                  " SSS9$ )NbatchzBatch job ID.rB   rC   rD   r   r   BatchConfig(AddBatchResourceArg.<locals>.BatchConfig  s    44! r   c           
         > [         R                  " SU SS[         R                  T(       a
  [        5       O	[	        5       T" 5       S9$ )Nz#dataproc.projects.locations.batchesr   T)r+   r,   r-   r.   r/   	batchesId)r   r2   r3   r   r   )r+   r   use_locations    r   GetBatchResourceSpec1AddBatchResourceArg.<locals>.GetBatchResourceSpec  sA      - $<< -.#%-
 
r   r   zID of the batch job to {0}.Tr0   Nr
   r4   r5   rO   r6   )r$   rQ   r+   r   r   r   s      ` @r   AddBatchResourceArgr     sP     ++;'#**40	 ,  ![(r   c                    ^ S mU4S jn[         R                  R                  SU" U5      SR                  U5      SS9R	                  U 5        g)z)Adds session resource argument to parser.c                  ,    [         R                  " SSS9$ )NsessionzSession ID.rB   rC   rD   r   r   SessionConfig,AddSessionResourceArg.<locals>.SessionConfig  s    44 r   c           
      n   > [         R                  " SU SS[         R                  [        5       T" 5       S9$ )Nz$dataproc.projects.locations.sessionsr   T)r+   r,   r-   r.   r/   
sessionsId)r   r2   r3   r   )r+   r   s    r   GetSessionResourceSpec5AddSessionResourceArg.<locals>.GetSessionResourceSpec  s6      . $<<,. ? r   r   zID of the session to {0}.Tr0   Nr   )r$   rQ   r+   r   r   s       @r   AddSessionResourceArgr     sP    	 ++[)!((.	 ,  ![(r   c                    ^ S mU4S jn[         R                  R                  SU" U5      SR                  U5      SS9R	                  U 5        g)z,Adds node group resource argument to parser.c                  ,    [         R                  " SSS9$ )N
node_groupzNode group ID.rB   rC   rD   r   r   NodeGroupConfig0AddNodeGroupResourceArg.<locals>.NodeGroupConfig  s    44" r   c                    > [         R                  " SU SS[         R                  [        5       [	        5       T" 5       S9$ )Nz-dataproc.projects.regions.clusters.nodeGroupsr   T)r+   r,   r-   rI   r   rJ   nodeGroupsIdrK   )r+   r   s    r   GetNodeGroupResourceSpec9AddNodeGroupResourceArg.<locals>.GetNodeGroupResourceSpec  s<      7" $;;%'!O$&	 	r   r   zID of the node group to {0}.Tr0   Nr   )r$   rQ   r+   r   r   s       @r   AddNodeGroupResourceArgr     sP    
 ++{+$++D1	 ,  ![(r   c                  ,    [         R                  " SSS9$ )N	operationzThe Operation ID.rB   rC   rD   r   r   OperationConfigr     s    		2	2#
 r   c           
      r    [         R                  " SU SS[         R                  [        5       [	        5       S9$ )Nz$dataproc.projects.regions.operationsr   T)r+   r,   r-   r.   	regionsIdoperationsId)r   r2   r3   r   r   rL   s    r   _GetOperationResourceSpecr     s6    			,"::&("$
 r   c                     Sn[         R                  R                  U[        U5      SR	                  U5      SS9R                  U 5        g )Nr   zThe ID of the operation to {0}.Tr0   )r
   r4   r5   r   rO   r6   )r$   rQ   r+   r   s       r   AddOperationResourceArgr      sH    	$++
,'..t4	 ,  ![(r   c                 P    U R                  S[        R                  " 5       USSS9  g )Nz	--timeoutzClient side timeout on how long to wait for Dataproc operations. See $ gcloud topic datetimes for information on duration formats.T)ry   rz   r    r|   )r"   r   Duration)r$   rz   s     r   AddTimeoutFlagr   	  s1    !   r   c                 P    U R                  SS[        R                  " 5       SSS9  g )Nz--parameterszPARAM=VALUEa  
          A map from parameter names to values that should be used for those
          parameters. A value must be provided for every configured parameter.
          Parameters can be configured when creating or updating a workflow
          template.
          
parameters)r{   ry   r    r<   r   r>   s    r   AddParametersFlagr     s1        
r   c                     SnU R                  SSSUS9  U R                  SSSUS9  U(       a  U R                  SSSUS9  gg)	zDAdd mininum CPU platform flags for both master and worker instances.am        When specified, the VM is scheduled on the host with a specified CPU
      architecture or a more recent CPU platform that's available in that
      zone. To list available CPU platforms in a zone, run:

          $ gcloud compute zones describe ZONE

      CPU platform selection may not be available in a zone. Zones
      that support CPU platform selection provide an `availableCpuPlatforms`
      field, which contains the list of available CPU platforms in the zone
      (see [Availability of CPU platforms](/compute/docs/instances/specify-min-cpu-platform#availablezones)
      for more information).
      z--master-min-cpu-platformPLATFORMF)r{   r1   r    z--worker-min-cpu-platformz--driver-pool-min-cpu-platformNr=   )r$   include_driver_pool_argsr   s      r   AddMinCpuPlatformArgsr   #  st    
) 	!	  
 	!	  
 
(	   r   c                 T    SnU R                  SS[        R                  " S S9SUS9  g)	zAdd optional components flag.a        List of optional components to be installed on cluster machines.

      The following page documents the optional components that can be
      installed:
      https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/optional-components.
      z--optional-components	COMPONENTc                 "    U R                  5       $ )N)upper)vals    r   <lambda>"AddComponentFlag.<locals>.<lambda>P  s
    		r   )element_type
components)r{   ry   r<   r    Nr   )r$   r   s     r   AddComponentFlagr   D  s9    
) 	,CD  r   c                  ,    [         R                  " SSS9$ )NtemplatezThe workflow template name.rB   rC   rD   r   r   TemplateAttributeConfigr   U  s    		2	2-
 r   c           
      r    [         R                  " SU SS[         R                  [        5       [	        5       S9$ )Nz+dataproc.projects.regions.workflowTemplatesr   T)r+   r,   r-   r.   r   workflowTemplatesId)r   r2   r3   r   r   rL   s    r   _GetTemplateResourceSpecr  \  s6    			3"::&(13
 r   c                     U(       a  SOSn[         R                  R                  U[        U5      SR	                  U5      SS9R                  U 5        g)a2  Adds a workflow template resource argument.

Args:
  parser: the argparse parser for the command.
  verb: str, the verb to describe the resource, such as 'to update'.
  api_version: api version, for example v1
  positional: bool, if True, means that the instance ID is a positional rather
    than a flag.
r   z--workflow-templatez(The name of the workflow template to {}.Tr0   N)r
   r4   r5   r  rO   r6   )r$   rQ   r+   
positionalr   s        r   AddTemplateResourceArgr  h  sO     "'<$++
{+077=	 ,  ![(r   c                     [         R                  " SU SS[         R                  [        5       [         R                  " SSS9S9$ )Nz-dataproc.projects.regions.autoscalingPolicieszautoscaling policyTautoscaling_policyzThe autoscaling policy id.rB   )r+   r,   r-   r.   r   autoscalingPoliciesId)r   r2   r3   r   r   rL   s    r   _AutoscalingPolicyResourceSpecr  z  sD    			5("::&($EE#0
 r   c                     [         R                  " SU SS[         R                  [        5       [         R                  " SSS9S9$ )Nz,dataproc.projects.locations.sessionTemplateszsession templateTsession_templatezThe session template name.rB   )r+   r,   r-   r.   r/   sessionTemplatesId)r   r2   r3   r   r   rL   s    r   _SessionTemplateResourceSpecr    sD    			4&"::*,!BB!0
 r   c                     [         R                  R                  S[        U5      SR	                  U5      SS9R                  U 5        g)zAdds a workflow template resource argument.

Args:
  parser: the argparse parser for the command.
  verb: str, the verb to apply to the resource, such as 'to update'.
  api_version: api version, for example v1
r  zThe autoscaling policy to {}.Tr0   N)r
   r4   r5   r  rO   r6   rP   s      r   AddAutoscalingPolicyResourceArgr    sE     ++$[1%,,T2	 ,  ![(r   c                     [         R                  R                  S[        U5      SR	                  U5      SS9R                  U 5        g)zAdds a session template resource argument.

Args:
  parser: The argparse parser for the command.
  verb: The verb to apply to the resource, such as 'to update'.
  api_version: api version, for example v1
r
  zThe session template to {}.Tr0   N)r
   r4   r5   r  rO   r6   rP   s      r   AddSessionTemplateResourceArgr    sE     ++";/#**40	 ,  ![(r   c           	          [         R                  R                  S[        U5      SSS/0SS0SS9R	                  U 5        g)	zAdds a workflow template resource argument.

Args:
  parser: the argparse parser for the command.
  api_version: api version, for example v1
z--autoscaling-policyzThe autoscaling policy to use.r   r    F)command_level_fallthroughsflag_name_overridesr1   N)r
   r4   r5   r  r6   )r$   r+   s     r   )AddAutoscalingPolicyResourceArgForClusterr    sT     ++$[1&
ZL" B  , 
 "k&)r   c                     U R                   R                  [        [        [        [
        S.5        U R                   R                  S5        g )N)operationStateoperationTimestampoperationTypeoperationWarningsztable(name.segment():label=NAME, metadata.operationTimestamp():label=TIMESTAMP,metadata.operationType():label=TYPE, metadata.operationState():label=STATE, status.code.yesno(no=''):label=ERROR, metadata.operationWarnings():label=WARNINGS))display_infoAddTransforms_TransformOperationState_TransformOperationTimestamp_TransformOperationType_TransformOperationWarnings	AddFormatr>   s    r   AddListOperationsFormatr"    sD    ##08.6	%  	 !O Pr   c                 (    SU ;   a  U S   $ SU ;   a  gg)z%Extract operation type from metadata.r  graphWORKFLOWr  rD   metadatas    r   r  r    s#     O$$(	r   c                 6    SU ;   a  U S   S   $ SU ;   a  U S   $ g)z&Extract operation state from metadata.statusstater  rD   r&  s    r   r  r    s0    Hg&&(G	r   c                 <    SU ;   a  U S   S   S   $ SU ;   a  U S   $ g)z0Extract operation start timestamp from metadata.statusHistoryr   stateStartTime	startTimer  rD   r&  s    r   r  r    s6     O$Q'(899hK  	r   c                 ,    SU ;   a  [        U S   5      $ g)z1Returns a count of operations if any are present.warningsr  )lenr&  s    r   r   r     s    8x
#$$	r   c                 l    U R                  SSS9  U R                  SSSS9  U R                  SS	SSS
S9  g)z7Adds the arguments for enabling personal auth sessions.z--access-boundarya  
        The path to a JSON file specifying the credential access boundary for
        the personal auth session.

        If not specified, then the access boundary defaults to one that includes
        the following roles on the containing project:

            roles/storage.objectViewer
            roles/storage.objectCreator
            roles/storage.objectAdmin
            roles/storage.legacyBucketReader

        For more information, see:
        https://cloud.google.com/iam/docs/downscoping-short-lived-credentials.
        r   z--openssl-commandTzg
        The full path to the command used to invoke the OpenSSL tool on this
        machine.
        )r|   r    z--refresh-credentialsr:   zO
        Keep the command running to periodically refresh credentials.
        )r!   rz   r|   r    Nr=   r>   s    r   AddPersonalAuthSessionArgsr3    se     	  " 	   	  r   c                     [         R                  R                  R                  R	                  5       nSU SU  3nSSU/ SQS./00n[
        R                  " [        R                  " U5      5      $ )zGet an access boundary limited to to a project's GCS objects.

Args:
  project: The project ID for the access boundary.

Returns:
  A JSON formatted access boundary suitable for creating a downscoped token.
z//cloudresourcemanager.z
/projects/access_boundaryaccessBoundaryRules)z!inRole:roles/storage.objectViewerz"inRole:roles/storage.objectCreatorz inRole:roles/storage.objectAdminz'inRole:roles/storage.legacyBucketReader)availableResourceavailablePermissions)	r   r   coreuniverse_domainGetsix	text_typejsondumps)projectr:  cab_resourcer5  s       r   ProjectGcsObjectsAccessBoundaryrB     su     %%**::>>@/*?*;:gYO,
'	# 	"/ 
tzz/2	33r   c                 0    U R                  SS[        SS9  g)zdAdds the size field for resizing node groups.

Args:
  parser: The argparse parser for the command.
z--sizezNew size for a node group.T)r    ry   r1   Nr   r>   s    r   AddSizeFlagrD  <  s#     	(	  r   c                 &    U R                  SSSS9  g)zvAdds a graceful decommission timeout for resizing a node group.

Args:
  parser: The argparse parser for the command.
z--graceful-decommission-timeoutzAGraceful decommission timeout for a node group scale-down resize.Fr   Nr=   r>   s    r   "AddGracefulDecommissionTimeoutFlagrF  I  s      	'
M  r   c                 (    U R                  SSSSS9  g)zgAdds the customer provided driver pool id field.

Args:
  parser: The argparse parser for the command.
z--driver-pool-idz
            Custom identifier for the DRIVER Node Group being created. If not
            provided, a random string is generated.
            FN)r    r1   rz   r=   r>   s    r   AddDriverPoolIdrH  W  s'     	   r   c                  ,    [         R                  " SSS9$ )NinstancezThe instance name.rB   rC   rD   r   r   InstanceConfigrK  g  s    		2	2$
 r   c           
      r    [         R                  " SU SS[         R                  [        5       [	        5       S9$ )NrG   rJ  TrH   )r   r2   r3   r   rK  rL   s    r   _GetInstanceResourceSpecrM  n  s6    			*"99#% "
 r   c                     [         R                  R                  S[        U5      SR	                  U5      SS9R                  U 5        g )NrJ  zThe name of the instance to {}.Tr0   )r
   r4   r5   rM  rO   r6   rP   s      r   AddInstanceResourceArgrO  z  sC    ++{+'..t4	 ,  ![(r   c                  ,    [         R                  " SSS9$ )Ngdce-clusterzThe GDCE Cluster path.rB   rC   rD   r   r   GdceClusterConfigrR    s    		2	2(
 r   c                  >    [         R                  " SS[        5       S9$ )Nzgdce-cluster-locationzGDCE region for the {resource}.r   rZ   rD   r   r   _GdceLocationAttributeConfigrT    s!    		2	2"1-/
 r   c                 r    [         R                  R                  S[        5       SSS9R	                  U 5        g )Nz--gdce-clusterz5The GDCE cluster to install the Dataproc instance on.Tr0   )r
   r4   r5   _GetGdceClusterResourceSpecr6   r>   s    r   AddGdceClusterResourceArgrW    s6    ++!#=	 , 
 Kr   c                  n    [         R                  " SS[         R                  [        5       [	        5       S9$ )Nz)edgecontainer.projects.locations.clustersrQ  r]   )r   r2   r3   rT  rR  rD   r   r   rV  rV    s0    			1"::.0"$
 r   )T)F)10m)\__doc__
__future__r   r   r   r   r>  googlecloudsdk.callioper   r    googlecloudsdk.calliope.conceptsr   r	   (googlecloudsdk.command_lib.util.conceptsr
   googlecloudsdk.corer   r<  r   r   r&   r)   r8   r?   rE   rM   rR   rU   rX   r[   r_   ra   re   rg   rj   rl   ro   rq   rs   ru   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r  r  r"  r  r  r  r   r3  rB  rD  rF  rH  rK  rM  rO  rR  rT  rW  rV  rD   r   r   <module>r`     s   5 &  '   + / 5 1 D * 

!
!13)$&	)1)1@14K
*BL75	 ;K/	)):)6)8	)	B"	)$))*(P"J48
 	)r   