
                         h   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
lmZ ddlmZ dZ e	j$                  e	j&                  j(                         G d de	j*                               Z e	j$                  e	j&                  j.                         G d de             Zy)z-Command to create an Anthos cluster on Azure.    )absolute_import)division)unicode_literals)azure)base)resource_args)command_util)	constants)endpoint_util)flagsak  
To create a cluster named ``my-cluster'' managed in location ``us-west1'', run:

$ {command} my-cluster --location=us-west1 --azure-region=AZURE_REGION --cluster-version=CLUSTER_VERSION --client=CLIENT --pod-address-cidr-blocks=POD_ADDRESS_CIDR_BLOCKS --resource-group-id=RESOURCE_GROUP_ID --ssh-public-key=SSH_PUBLIC_KEY --subnet-id=SUBNET_ID --vnet-id=VNET_ID
c                   .    e Zd ZdZdeiZed        Zd Zy)Create"Create an Anthos cluster on Azure.EXAMPLESc                 b   | j                  ddd      }t        j                  | |       t        j                  |       t        j
                  |        t        j                  |        t        j                  |        t        j                  |        t        j                  |        t        j                  |        t        j                  |        t        j                  |        t        j                  | dd       t        j                  |        t        j                  |        t        j                   |        t        j"                  |        t        j$                  |        t        j&                  | d       t        j(                  | d       t        j*                  |        t        j,                  |        t        j.                  |        t        j0                  |        t        j2                  |        t        j4                  |        t        j6                  |        t        j8                  |        t        j:                  |        t        j<                  | d       t>        j@                  jC                  |        | jD                  jG                  tH        jJ                         y )	NzAuthentication configurationT)mutexrequiredzthe cluster control planeF)r   clusterzcreation of the cluster)&add_argument_groupr   $AddAzureClusterAndClientResourceArgsr   AddAzureServicesAuthenticationAddAzureRegionAddEndpointSubnetId	AddVnetIdAddResourceGroupIdAddServiceLoadBalancerSubnetIdAddPodAddressCidrBlocksAddServiceAddressCidrBlocksAddClusterVersionAddSubnetID	AddVMSizeAddSSHPublicKeyAddRootVolumeSizeAddMainVolumeSizeAddReplicaPlacementsAddTagsAddValidateOnlyAddDatabaseEncryptionAddConfigEncryptionAddProxyConfigAddFleetProjectAddAdminUsersAddAdminGroupsAddDescriptionAddAnnotations
AddLoggingAddMonitoringConfigr   
ASYNC_FLAGAddToParserdisplay_info	AddFormatr
   AZURE_CLUSTERS_FORMAT)parserauth_config_groups     .lib/surface/container/azure/clusters/create.pyArgszCreate.Args+   s   11&dT 2  66! 
(():;	 	f%	OOF	V$	((0	!!&)	%%f-	F#	f9EJ	OOF	&!	F#	F#	v&	MM&)$	&";<	'	f%	 	&!		 	 	 	V	fd+OO'
!!)"A"AB    c                    t        j                  |      j                  }t        j                  |      5  t        j                  |      }t        j                         }t        j                  |j                  dt        j                  |j                        }t        j                  ||||t        j                        cddd       S # 1 sw Y   yxY w)zRuns the create command.Creating)actionkindregion)resource_refresource_clientargsmessager?   N)r   ParseAzureClusterResourceArglocationsIdr   GkemulticloudEndpointOverrideapi_utilClustersClientr	   ClusterMessageazureClustersIdr
   AZUREazure_regionr   AZURE_CLUSTER_KIND)selfrC   locationcluster_refcluster_clientrD   s         r9   Runz
Create.RunQ   s    99$?KKH		4	4X	>!>>tDk..0n++

%
%""	g   "(++ 
?	>	>s   BCCN)	__name__
__module____qualname____doc__	_EXAMPLESdetailed_helpstaticmethodr:   rS    r;   r9   r   r   %   s)    *y)-#C #CJr;   r   c                   L    e Zd ZdZeej                  j                  fd       Zy)CreateAlphar   c                 .    t         j                  |        y)z-Registers alpha track flags for this command.N)r   r:   )r7   tracks     r9   r:   zCreateAlpha.Argsj   s     KKr;   N)	rT   rU   rV   rW   rZ   r   ReleaseTrackALPHAr:   r[   r;   r9   r]   r]   f   s&    ***00  r;   r]   N)rW   
__future__r   r   r   .googlecloudsdk.api_lib.container.gkemulticloudr   rH   googlecloudsdk.callioper   *googlecloudsdk.command_lib.container.azurer   2googlecloudsdk.command_lib.container.gkemulticloudr	   r
   r   r   rX   ReleaseTracksr`   GACreateCommandr   ra   r]   r[   r;   r9   <module>rj      s    4 &  ' L ( D K H L D	 D%%(()=T = *=@ D%%++,&  -r;   