
    J                         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S.r\	R"                  " \	R$                  R&                  5      \	R(                   " S S\	R*                  5      5       5       rg)z''vmware private-clouds create' command.    )absolute_import)division)unicode_literals)PrivateCloudsClient)arg_parsers)base)flags)util)logz
          Create a VMware Engine private cloud. Private cloud creation is considered finished when the private cloud is in READY state. Check the progress of a private cloud using `{parent_command} list`.
        a  
          To create a private cloud in the `us-west2-a` zone using `standard-72` nodes that connects to the `my-network` VMware Engine network, run:


          $ {command} my-private-cloud --location=us-west2-a --project=my-project --cluster=my-management-cluster --node-type-config=type=standard-72,count=3 --management-range=192.168.0.0/24 --vmware-engine-network=my-network

          Or:

          $ {command} my-private-cloud --cluster=my-management-cluster --node-type-config=type=standard-72,count=3 --management-range=192.168.0.0/24 --vmware-engine-network=my-network

          In the second example, the project and location are taken from gcloud properties core/project and compute/zone.


          To create a stretched private cloud in the `us-west2` region using `us-west2-a` zone as preferred and `us-west2-b` zone as secondary

          $ {command} my-private-cloud --project=sample-project --location=us-west2 --cluster=my-management-cluster --node-type-config=type=standard-72,count=6 --management-range=192.168.0.0/24 --vmware-engine-network=my-network --type=STRETCHED --preferred-zone=us-west2-a --secondary-zone=us-west2-b

          The project is taken from gcloud properties core/project.
    )DESCRIPTIONEXAMPLESc                   2    \ rS rSrSr\r\S 5       rS r	Sr
g)Create6   z%Create a VMware Engine private cloud.c           
         [         R                  " U SS9  [         R                  " U SSS9  [        R                  R                  U 5        [        R                  R                  U S5        U R                  R                  S5        U R                  SSS9  U R                  S	SS
S9  U R                  SSSS9  U R                  SS[        R                  " [        [        [        S.SS9SSS9  U R                  SSSSSSS.SS9  U R                  SSSS9  U R                  SSS S9  U R                  S!SSSS"S#9  [         R                  " U 5        g$)%z Register flags for this command.T)
positionalF)r   hide_resource_argument_flagsyamlz--descriptionz3        Text describing the private cloud.
        )helpz--management-rangea	           IP address range in the private cloud to use for management appliances, in CIDR format. Use an IP address range that meets the [VMware Engine networking requirements](https://cloud.google.com/vmware-engine/docs/quickstart-networking-requirements).
        )requiredr   z--vmware-engine-networkzX        Resource ID of the VMware Engine network attached to the private cloud.
        z--node-type-config)typecountzcustom-core-count)r   r   )specrequired_keysappenda          Information about the type and number of nodes associated with the cluster.

        type (required): canonical identifier of the node type.

        count (required): number of nodes of this type in the cluster.

        custom-core-count (optional): customized number of cores available to each node of the type.
        To get a list of valid values for your node type,
        run the gcloud vmware node-types describe command and reference the
        availableCustomCoreCounts field in the output.
        )r   r   actionr   z--typeSTANDARDzOStandard private is a zonal resource, with 3 or more nodes nodes. Default type.a  Time limited private cloud is a zonal resource, can have only 1 node and
            has limited life span. Will be deleted after defined period of time,
            can be converted into standard private cloud by expanding it up to 3
            or more nodes.zStretched private cloud is a regional resource with redundancy,
            with a minimum of 6 nodes, nodes count has to be even.)r   TIME_LIMITED	STRETCHEDzType of the private cloud)r   defaultchoicesr   z--preferred-zonez        Zone that will remain operational when connection between the two zones is
        lost. Specify the resource name of a zone that belongs to the region of the
        private cloud.
        z--secondary-zonez        Additional zone for a higher level of availability and load balancing.
        Specify the resource name of a zone that belongs to the region of the
        private cloud.
        z--service-subnetz        A non-overlapping CIDR range and prefix length for the service subnets.
        The service subnets are used for appliance or service deployment, such as storage,
        backup, disaster recovery, and media streaming.
        )r   hiddenr   r   N)r	   AddPrivatecloudArgToParserAddClusterArgToParserr   
ASYNC_FLAGAddToParser
SetDefaultdisplay_info	AddFormatadd_argumentr   ArgDictstrint#AddAutoscalingSettingsFlagsToParser)parsers    +lib/surface/vmware/private_clouds/create.pyArgsCreate.Args=   s    
$$V=	5t 	OO'OOvt,
!!&)
      !     #F+
   * mF
 )           
 
--f5    c                 
   UR                   R                  R                  5       n[        5       nUR                  n[
        R                  " UR                  5      nS nUR                  (       a   [
        R                  " UR                  5      nUR                  (       d3  UR                  (       d"  UR                  (       d  UR                  (       aA  [
        R                  " UR                  UR                  UR                  UR                  5      nUR                  UUR                   UUR"                  UR$                  UR&                  UR(                  UR*                  UR,                  UUR.                  S9nU(       a!  [0        R2                  " UR4                  SSS9  g UR7                  UR9                  U5      SR;                  UR=                  5       5      S9n[0        R2                  " UR=                  5       SS9  U$ )N)

cluster_idnodes_configsnetwork_cidrvmware_engine_network_iddescriptionprivate_cloud_typepreferred_zonesecondary_zoneautoscaling_settingsservice_subnetzprivate cloudT)kindis_asyncz,waiting for private cloud [{}] to be created)operation_refmessage)r?   )CONCEPTSprivate_cloudParser   async_r
   ParseNodesConfigsParametersnode_type_configautoscaling_settings_from_file&ParseAutoscalingSettingsFromFileFormat"autoscaling_min_cluster_node_count"autoscaling_max_cluster_node_countautoscaling_cool_down_periodautoscaling_policy)ParseAutoscalingSettingsFromInlinedFormatr   clustermanagement_rangevmware_engine_networkr9   r   r;   r<   r>   r   CreatedResourcenameWaitForOperationGetOperationRefformatRelativeName)	selfargsprivatecloudclientr@   r6   r=   	operationresources	            r0   Run
Create.Run   s   ==..446L "F{{H44T5J5JKM**!HH

-
- 	//22,,""!KK

1
1

1
1

+
+

!
!	 <<#**!%!;!;$$99****1**  I 	)..N&&,,Y7>EE%%'
 ' H 113/JOr3    N)__name__
__module____qualname____firstlineno____doc__DETAILED_HELPdetailed_helpstaticmethodr1   r_   __static_attributes__ra   r3   r0   r   r   6   s&     .-^6 ^6@0r3   r   N)rf   
__future__r   r   r   +googlecloudsdk.api_lib.vmware.privatecloudsr   googlecloudsdk.callioper   r   !googlecloudsdk.command_lib.vmwarer	   *googlecloudsdk.command_lib.vmware.clustersr
   googlecloudsdk.corer   rg   ReleaseTracksReleaseTrackGAUniverseCompatibleCreateCommandr   ra   r3   r0   <module>rv      s    . &  ' K / ( 3 ; #	4 D%%(()VT V  *Vr3   