
                            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d	lmZ ddlmZ ddlmZ dZdZdZdZej2                   ej4                  ej6                  j8                         G d dej:                                      Z ej4                  ej6                  j>                         G d de             Z y)z!Command to create a GDCE cluster.    )absolute_import)division)unicode_literalscluster)util)waiter)base)flags)print_warning)resource_args)log)	resourceszt
To create a cluster called `my-cluster` in region us-central1,
run:

$ {command} my-cluster --location=us-central1
z
  This command uses the edgecontainer/{API} API. The full documentation for this
  API can be found at: https://cloud.google.com/edge-cloud
i@w i Q%c                       e Zd ZdZeej                  ej                  j                  e
j                  j                              dZed        Zd Zy)Create!Create an Edge Container cluster.API)EXAMPLESAPI REFERENCEc                 ^   t        j                  | d       t        j                  |        t        j                  |        t        j
                  |        t        j                  |        t        j                  |        t        j                  |        t        j                  |        t        j                  |        t        j                  |        t        j                  |        t        j                  |        t        j                  |        t        j                  |        t        j                   |        t        j"                  |        t        j$                  |        t        j&                  |        t        j(                  |        t        j*                  |        t        j,                  |        t        j.                  |        t        j0                  |        t        j2                  |        t        j4                  |        t6        j8                  j;                  |        y )Nz	to create)r   AddClusterResourceArgcontainer_flagsAddAdminUsersAddClusterIPV4CIDRAddServicesIPV4CIDRAddDefaultMaxPodsPerNodeAddFleetProject	AddLabelsAddMaintenanceWindowRecurrenceAddMaintenanceWindowEndAddMaintenanceWindowStartAddControlPlaneKMSKeyAddLROMaximumTimeoutAddSystemAddonsConfigAddExternalLbIpv4AddressPoolsAddControlPlaneNodeLocationAddControlPlaneNodeCount AddControlPlaneNodeStorageSchemaAddControlPlaneMachineFilter%AddControlPlaneSharedDeploymentPolicyAddOfflineRebootTtLAddReleaseChannel
AddVersionAddZoneStorageKMSKeyAddContainerDefaultRuntimeClass"AddEnableGoogleGroupAuthenticationr
   
ASYNC_FLAGAddToParser)parsers    3lib/surface/edge_cloud/container/clusters/create.pyArgszCreate.Args<   st   ''<!!&)&&v.''/,,V4##F+f%226:++F3--f5))&1((0))&111&9//7,,V444V<00899&A''/%%f-v&((033F;66v>OO'    c                    t        j                  |      }t        j                  || j                               }t        j                  || j                               }|t        j                  |       y t        j                  | j                               }|j                  j                  |      }t        j                  j                  |j                  d      }t
        j                  j!                  dj#                  |j$                               t'        j(                  |d      sdj#                  |j+                               }t        j,                  |j                  |j.                        }	t0        }
t        j2                  |      rt4        }
t'        j(                  |d      rt7        |j8                        }
t;        j<                  |	|||
	      }t
        j                  j!                  d
j#                  |j$                               t?        j@                  |d       S t
        j                  j!                  dj#                  |j+                                      t?        j@                  |d       S )Nz+edgecontainer.projects.locations.operations)
collectionz&Create request issued for: [{cluster}]r   async_z/Waiting for operation [{operation}] to complete)	operationlro_timeout)max_wait_mszCreated cluster [{cluster}].z)Check operation [{operation}] for status.)!r   GetClusterReferenceGetClusterCreateRequestReleaseTrackValidateClusterCreateRequestr   errorr   GetClientInstanceprojects_locations_clustersr   r   REGISTRYParseRelativeNamenamestatusPrintformat
clustersIdr   FlagIsExplicitlySetRelativeNameOperationPollerprojects_locations_operations_RCP_LRO_MAXIMUM_TIMEOUT_IsLCPCluster_LCP_LRO_MAXIMUM_TIMEOUT_intr<   r	   WaitForr   PrintWarning)selfargscluster_refreqrB   cluster_clientopop_refprogress_stringoperation_pollerlro_maximum_timeoutresponses               r5   Runz
Create.RunY   s   --d3K

)
)$0A0A0C
DC00d6G6G6IJE	ii++D,=,=,?@N		3	3	:	:3	?B11
I 2 F JJ077** 	8 	

 $$T84
;
B
B++- C  
 --

4
4

6
6 6			d	#7		"	"4	7!$"2"23


)	h 
jj
(
/
/8N8N
/
O ''$77JJ3::))+ 	; 	

 %%b$//r7   N)__name__
__module____qualname____doc__	_EXAMPLES_API_REFERENCE_rJ   r   VERSION_MAPgetr
   r@   GAdetailed_helpstaticmethodr6   ra    r7   r5   r   r   0   s_     * &--""4#4#4#7#78 . - ( (810r7   r   c                   L    e Zd ZdZeej                  j                  fd       Zy)CreateAlphar   c                    t         j                  t        j                  j	                  |            t
        j                  d<   t
        j                  |        t        j                  |        t        j                  |        t        j                  |        t        j                  |        t        j                  |        t        j                  |        t        j                  |        t        j                   |        y)z-Registers alpha track flags for this command.r   r   N)rg   rJ   r   rh   ri   r   rk   r6   r   AddClusterIPV6CIDRAddServicesIPV6CIDRAddExternalLbIpv6AddressPools#AddExternalLoadBalancerAddressPoolsAddEnableClusterIsolationAddEnableRemoteBackupAddEnableRobinCNS&AddControlPlaneNodeSystemPartitionSize)r4   tracks     r5   r6   zCreateAlpha.Args   s     -<,B,B  ' -C -F) KK&&v.''/11&977?--f5))&1%%f-::6Br7   N)	rb   rc   rd   re   rl   r
   r@   ALPHAr6   rm   r7   r5   ro   ro      s(    )**00 C Cr7   ro   N)!re   
__future__r   r   r   +googlecloudsdk.api_lib.edge_cloud.containerr   r   googlecloudsdk.api_lib.utilr	   googlecloudsdk.callioper
   /googlecloudsdk.command_lib.edge_cloud.containerr   r   r   r   googlecloudsdk.command_lib.rungooglecloudsdk.corer   r   rf   rg   rP   rR   DefaultUniverseOnlyReleaseTracksr@   rj   CreateCommandr   rz   ro   rm   r7   r5   <module>r      s    ( &  ' ? < . ( T I I 0 # )	
 $ $  D%%(()X0T X0 * X0v D%%++,C& C -Cr7   