Ë
    €ÏW/  ã                   óü   — d Z ddlmZ ddlmZ ddlmZ ddl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„Zd„ Zd„ Z	 dd„Zd„ Zd„ Zd„ Zdd„Zdd„Zdd„Zdd„Zd„ Zd„ Zd„ Zd„ Zdej<                  ddfd„Zy)z Flags for data-catalog commands.é    )Úabsolute_import)Údivision)Úunicode_literalsN)Úarg_parsers)Úconcepts)Ú	yaml_data)Úconcept_parsers)Úpresentation_specsc                 ó"  — d}|rd}t         j                  j                  d«      }t        j                  j                  |j                  «       «      }t        j                  ||dd¬«      }t        j                  |g«      j                  | «      S )z2Sets up an argument for the privatecloud resource.z--private-cloudÚprivate_cloudzvmware.private_cloudTzprivate_cloud.©ÚnameÚconcept_specÚrequiredÚ
group_help©r   ÚResourceYAMLDataÚFromPathr   ÚResourceSpecÚFromYamlÚGetDatar
   ÚResourcePresentationSpecr	   ÚConceptParserÚAddToParser)ÚparserÚ
positionalr   Úprivatecloud_dataÚresource_specÚpresentation_specs         ú.lib/googlecloudsdk/command_lib/vmware/flags.pyÚAddPrivatecloudArgToParserr!      sŠ   € à	€$ÙØ€DÜ×0Ñ0×9Ñ9ØóÐô ×'Ñ'×0Ñ0Ð1B×1JÑ1JÓ1LÓM€-Ü(×AÑAØØ ØØ!ô	Ðô 
×	&Ñ	&Ð(9Ð':Ó	;×	GÑ	GÈÓ	OÐOó    c                 ó  — t         j                  j                  d«      }t        j                  j                  |j                  «       «      }t        j                  d|dd¬«      }t        j                  |g«      j                  | «      S )z/Sets up an argument for the operation resource.zvmware.operationÚ	operationTz
operation.r   r   )r   Úoperation_datar   r   s       r    ÚAddOperationArgToParserr&   0   sw   € ä×-Ñ-×6Ñ6Ð7IÓJ€.Ü×'Ñ'×0Ñ0°×1GÑ1GÓ1IÓJ€-Ü(×AÑAØØ ØØô	Ðô 
×	&Ñ	&Ð(9Ð':Ó	;×	GÑ	GÈÓ	OÐOr"   c                 ó  — t         j                  j                  d«      }t        j                  j                  |j                  «       «      }t        j                  d|dd¬«      }t        j                  |g«      j                  | «      S )z,Sets up an argument for the subnet resource.zvmware.subnetÚsubnetTzsubnet.r   r   ©r   Úaddress_datar   r   s       r    ÚAddSubnetArgToParserr+   =   sx   € ô ×+Ñ+×4Ñ4°_ÓE€,Ü×'Ñ'×0Ñ0°×1EÑ1EÓ1GÓH€-ä(×AÑAØØ ØØô	Ðô 
×	&Ñ	&Ð(9Ð':Ó	;×	GÑ	GÈÓ	OÐOr"   c                 ó8  — |rd}nd}t         j                  j                  d«      }t        j                  j                  |j                  «       «      }d}|rdddœ}t        j                  ||dd|¬	«      }t        j                  |g«      j                  | «      S )
z-Sets up an argument for the cluster resource.Úclusterz	--clusterzvmware.clusterNÚ )Úlocationzprivate-cloudTzcluster.©r   r   r   r   Úflag_name_overridesr   )r   r   Úhide_resource_argument_flagsr   Úcluster_datar   r1   r   s           r    ÚAddClusterArgToParserr4   L   s   € ñ ØDà€DÜ×+Ñ+×4Ñ4Ð5EÓF€,Ü×'Ñ'×0Ñ0°×1EÑ1EÓ1GÓH€-ØÐá!Ø')¸BÑ?ÐÜ(×AÑAØØ ØØØ-ôÐô 
×	&Ñ	&Ð(9Ð':Ó	;×	GÑ	GÈÓ	OÐOr"   c                 ó  — t         j                  j                  d«      }t        j                  j                  |j                  «       «      }t        j                  d|dd¬«      }t        j                  |g«      j                  | «      S )z6Sets up an argument for the external address resource.zvmware.external_addressÚexternal_addressTzexternal_address.r   r   r)   s       r    ÚAddExternalAddressArgToParserr7   d   sy   € ô ×+Ñ+×4Ñ4Ð5NÓO€,Ü×'Ñ'×0Ñ0°×1EÑ1EÓ1GÓH€-ä(×AÑAØØ ØØ$ô	Ðô 
×	&Ñ	&Ð(9Ð':Ó	;×	GÑ	GÈÓ	OÐOr"   c                 ó  — d}t         j                  j                  |«      }t        j                  j                  |j                  «       «      }t        j                  d|dd¬«      }t        j                  |g«      j                  | «      S )zASets up an argument for the management DNS zone binding resource.z"vmware.management_dns_zone_bindingÚmanagement_dns_zone_bindingTzmanagement_dns_zone_binding.r   r   )r   Úpathr*   r   r   s        r    Ú&AddManagementDnsZoneBindingArgToParserr;   s   s}   € ð 
.€$Ü×+Ñ+×4Ñ4°TÓ:€,Ü×'Ñ'×0Ñ0°×1EÑ1EÓ1GÓH€-ä(×AÑAØ(Ø ØØ/ô	Ðô 
×	&Ñ	&Ð(9Ð':Ó	;×	GÑ	GÈÓ	OÐOr"   c                 ó  — t         j                  j                  d«      }t        j                  j                  |j                  «       «      }t        j                  d|dd¬«      }t        j                  |g«      j                  | «      S )z8Sets up an argument for the HCX activation key resource.zvmware.hcx_activation_keyÚhcx_activation_keyTzhcxactivationkey.r   r   )r   Úhcx_activation_key_datar   r   s       r    ÚAddHcxActivationKeyArgToParserr?   ƒ   s   € ä%×6Ñ6×?Ñ?Ø!óÐô ×'Ñ'×0Ñ0Ø×%Ñ%Ó'ó€-ô )×AÑAØØ ØØ$ô	Ðô 
×	&Ñ	&Ð(9Ð':Ó	;×	GÑ	GÈÓ	OÐOr"   c                 ód  — t         j                  j                  d«      }|rt         j                  j                  d«      }t        j                  j                  |j                  «       «      }d}|rd}t        j                  ||dd¬«      }t        j                  |g«      j                  | «      S )zParses location flag.zvmware.locationzvmware.regional_locationz
--locationr/   Tz	location.r   r   )r   Úregionalr   Úlocation_datar   r   r   s          r    ÚAddLocationArgToParserrC   ”   s¢   € ä×,Ñ,×5Ñ5Ð6GÓH€-ÙÜ×.Ñ.×7Ñ7Ø"ó€Mô ×'Ñ'×0Ñ0°×1FÑ1FÓ1HÓI€-Ø	€$ÙØ€DÜ(×AÑAØØ ØØô	Ðô 
×	&Ñ	&Ð(9Ð':Ó	;×	GÑ	GÈÓ	OÐOr"   c                 ó2  — |rd}d}nd}ddi}t         j                  j                  d«      }t        j                  j                  |j                  «       «      }t        j                  ||dd|¬	«      }t        j                  |g«      j                  | «      S )
zParses node type flag.Ú	node_typeNz--node-typer/   r.   zvmware.node_typeTz
node_type.r0   r   )r   r   r   r1   rB   r   r   s          r    ÚAddNodeTypeArgToParserrF   ¨   sš   € ñ Ø€DØÑà€DØ% rÐ*Ðä×,Ñ,×5Ñ5Ð6HÓI€-Ü×'Ñ'×0Ñ0°×1FÑ1FÓ1HÓI€-Ü(×AÑAØØ ØØØ-ôÐô 
×	&Ñ	&Ð(9Ð':Ó	;×	GÑ	GÈÓ	OÐOr"   c                 ó"  — d}|rd}t         j                  j                  d«      }t        j                  j                  |j                  «       «      }t        j                  ||dd¬«      }t        j                  |g«      j                  | «      S )zParses project flag.z	--projectÚprojectzvmware.projectTzproject.r   r   )r   r   r   Úproject_datar   r   s         r    ÚAddProjectArgToParserrJ   ¾   s„   € à	€$ÙØ€Dä×+Ñ+×4Ñ4Ð5EÓF€,Ü×'Ñ'×0Ñ0°×1EÑ1EÓ1GÓH€-ä(×AÑAØØ ØØô	Ðô 
×	&Ñ	&Ð(9Ð':Ó	;×	GÑ	GÈÓ	OÐOr"   c                 ó"  — d}|rd}t         j                  j                  d«      }t        j                  j                  |j                  «       «      }t        j                  ||dd¬«      }t        j                  |g«      j                  | «      S )z8Sets up an argument for the Private Connection resource.z--private-connectionÚprivate_connectionzvmware.private_connectionTzprivate_connection.r   r   )r   r   r   Úprivate_connection_datar   r   s         r    ÚAddPrivateConnectionToParserrN   Ð   sŽ   € à	€$ÙØ€DÜ%×6Ñ6×?Ñ?Ø!óÐô ×'Ñ'×0Ñ0Ø×%Ñ%Ó'ó€-ô )×AÑAØØ ØØ&ô	Ðô 
×	&Ñ	&Ð(9Ð':Ó	;×	GÑ	GÈÓ	OÐOr"   c                 ó  — t         j                  j                  d«      }t        j                  j                  |j                  «       «      }t        j                  d|dd¬«      }t        j                  |g«      j                  | «      S )z4Sets up an argument for the Logging Server resource.zvmware.logging_serverÚlogging_serverTzlogging_server.r   r   )r   Úlogging_server_datar   r   s       r    ÚAddLoggingServerArgToParserrR   ä   s   € ô "×2Ñ2×;Ñ;ØóÐô ×'Ñ'×0Ñ0Ð1D×1LÑ1LÓ1NÓO€-Ü(×AÑAØØ ØØ"ô	Ðô 
×	&Ñ	&Ð(9Ð':Ó	;×	GÑ	GÈÓ	OÐOr"   c                 ó  — t         j                  j                  d«      }t        j                  j                  |j                  «       «      }t        j                  d|dd¬«      }t        j                  |g«      j                  | «      S )z5Sets up an argument for the Identity Source resource.zvmware.identity_sourceÚidentity_sourceTzidentity_source.r   r   )r   Úresource_datar   r   s       r    ÚAddIdentitySourceArgToParserrV   ô   sy   € ô ×,Ñ,×5Ñ5Ð6NÓO€-Ü×'Ñ'×0Ñ0°×1FÑ1FÓ1HÓI€-Ü(×AÑAØØ ØØ#ô	Ðô 
×	&Ñ	&Ð(9Ð':Ó	;×	GÑ	GÈÓ	OÐOr"   c                 ó  — t         j                  j                  d«      }t        j                  j                  |j                  «       «      }t        j                  d|dd¬«      }t        j                  |g«      j                  | «      S )z*Sets up an argument for the node resource.zvmware.nodeÚnodeTznode.r   r   )r   Ú	node_datar   r   s       r    ÚAddNodeArgToParserrZ     su   € ô ×(Ñ(×1Ñ1°-Ó@€)Ü×'Ñ'×0Ñ0°×1BÑ1BÓ1DÓE€-ä(×AÑAØ ¸ÈôÐô 
×	&Ñ	&Ð(9Ð':Ó	;×	GÑ	GÈÓ	OÐOr"   c                 ó  — | j                  dd¬«      }|j                  «       }|j                  dt        d¬«       |j                  dt        d¬«       |j                  d	t        d
¬«       |j                  dt        j                  t        t        t        t        t        t        t        t        t        t        t        t        t        dœg d¢¬«      dt        «       d¬«       |j                  dt        j                  «       d¬«       y)zñSets up autoscaling settings flags.

  There are two mutually exclusive options to pass the autoscaling settings:
  through command line arguments or as a yaml file.

  Args:
    parser: arg_parser instance that will have the flags added.
  FT)r   Úhiddenz$--autoscaling-min-cluster-node-countz&Minimum number of nodes in the cluster)ÚtypeÚhelpz$--autoscaling-max-cluster-node-countz&Maximum number of nodes in the clusterz--autoscaling-cool-down-periodzQCool down period (in minutes) between consecutive cluster expansions/contractionsz--autoscaling-policy)r   únode-type-idúscale-out-sizezmin-node-countzmax-node-countzcpu-thresholds-scale-inzcpu-thresholds-scale-outz"granted-memory-thresholds-scale-inz#granted-memory-thresholds-scale-outz#consumed-memory-thresholds-scale-inz$consumed-memory-thresholds-scale-outzstorage-thresholds-scale-inzstorage-thresholds-scale-out)r   r_   r`   )ÚspecÚrequired_keysÚappendz/Autoscaling policy to be applied to the cluster)r]   ÚactionÚdefaultr^   z --autoscaling-settings-from-filezLA YAML file containing the autoscaling settings to be applied to the clusterN)	Úadd_mutually_exclusive_groupÚ	add_groupÚadd_argumentÚintÚstrr   ÚArgDictÚlistÚYAMLFileContents)r   Úautoscaling_settings_groupÚ"inlined_autoscaling_settings_groups      r    Ú#AddAutoscalingSettingsFlagsToParserrp     s  € ð  &×BÑBØ˜Tð  Có  Ðð (B×'KÑ'KÓ'MÐ$Ø$×1Ñ1Ø,ÜØ3ð 2ô ð
 %×1Ñ1Ø,ÜØ3ð 2ô ð
 %×1Ñ1Ø&Üð%ð	 2ô ð %×1Ñ1ØÜ×ÑäÜ!Ü #Ü #Ü #Ü),Ü*-Ü47Ü58Ü58Ü69Ü-0Ü.1ñò Cô!ð$ Ü‹fØ<ð- 2ô ð0 ×)Ñ)Ø(Ü×'Ñ'Ó)ðð	 *õ r"   r   Úreturnc                 ó  — t         j                  j                  d«      }t        j                  dt
        j                  j                  |j                  «       «      ddd¬«      }t        j                  |g«      j                  | «      S )z-Sets up an argument for the upgrade resource.zvmware.upgradeÚupgradeTzupgrade.Nr0   )r   r   r   r
   r   r   r   r   r   r	   r   r   )r   Úupgrade_datar   s      r    ÚAddUpgradeArgToParserru   O  sw   € ô ×+Ñ+×4Ñ4Ð5EÓF€,ä(×AÑAØÜ×(Ñ(×1Ñ1°,×2FÑ2FÓ2HÓIØØØôÐô 
×	&Ñ	&Ð(9Ð':Ó	;×	GÑ	GÈÓ	OÐOr"   )F)FF) Ú__doc__Ú
__future__r   r   r   ÚargparseÚgooglecloudsdk.callioper   Ú googlecloudsdk.calliope.conceptsr   Ú$googlecloudsdk.command_lib.util.apisr   Ú(googlecloudsdk.command_lib.util.conceptsr	   r
   r!   r&   r+   r4   r7   r;   r?   rC   rF   rJ   rN   rR   rV   rZ   rp   ÚArgumentParserru   © r"   r    Ú<module>r      s£   ðñ 'å &Ý Ý 'ã å /Ý 5Ý :Ý DÝ GóPò$
PòPð  <AóPò0PòPò Pó"Pó(Pó,Pó$Pò(Pò Pò	Pò>ðBPØ×#Ñ#ðPà	ôPr"   