
                             d 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l	m
Z
 ddlmZ dd	lmZ d
ddZ ej                   ej"                  j$                         G d dej&                               Zee_        y)z&'vmware sddc clusters create' command.    )absolute_import)division)unicode_literals)ClustersClient)base)labels_util)flags)
propertiesa3  
          Create a cluster in a VMware Engine private cloud. Successful creation
          of a cluster results in a cluster in READY state. Check the progress
          of a cluster using `gcloud alpha vmware sddc clusters list`.

          For more examples, refer to the EXAMPLES section below.
        a4  
          To create a cluster called ``my-cluster'' in private cloud
          ``my-privatecloud'', with three initial nodes created in zone
          ``us-central1-a'', run:

            $ {command} my-cluster --privatecloud=my-privatecloud --region=us-central1 --project=my-project --zone=us-central1-a --node-count=3

          Or:

            $ {command} my-cluster --privatecloud=my-privatecloud -zone=us-central1-a --node-count=3

          In the second example, the project and region are taken from gcloud properties core/project and vmware/region.
    )DESCRIPTIONEXAMPLESc                   &    e Zd ZdZed        Zd Zy)Createz2Create a cluster in a VMware Engine private cloud.c                     t        j                  |        | j                  ddt        d       | j                  ddd       t	        j
                  |        y)	z Register flags for this command.z--node-countTz7        Initial number of nodes in the cluster
        )requiredtypehelpz--zonez=        Zone in which to create nodes in the cluster
        )r   r   N)r	   AddClusterArgToParseradd_argumentintr   AddCreateLabelsFlags)parsers    *lib/surface/vmware/sddc/clusters/create.pyArgszCreate.Args9   sc     
'
	      $$V,    c                 r   |j                   j                  j                         }t               }t        j
                  j                  j                  j                         }|j                  }|j                  }|j                  |||||j                        }|j                  |dj                  |            S )Nz&waiting for cluster [{}] to be created)CONCEPTSclusterParser   r
   VALUESvmware	node_typeGet
node_countzoner   labelsWaitForOperationformat)selfargsr   clientr!   r#   r$   	operations           r   Runz
Create.RunL   s    mm##))+GF!!((22668IJ99Dgz9dDKKPI"";BB7KM Mr   N)__name__
__module____qualname____doc__staticmethodr   r,    r   r   r   r   5   s    :- -$Mr   r   N)r0   
__future__r   r   r   +googlecloudsdk.api_lib.vmware.sddc.clustersr   googlecloudsdk.callioper   $googlecloudsdk.command_lib.util.argsr   &googlecloudsdk.command_lib.vmware.sddcr	   googlecloudsdk.corer
   DETAILED_HELPReleaseTracksReleaseTrackALPHACreateCommandr   detailed_helpr2   r   r   <module>r?      s{    - &  ' F ( < 8 *		4 D%%++,MT M -MB % r   