
    "                     (   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KJr  SSKJr  SSKJr  SSKJr  SSKJr  Sr\R6                  " \R8                  R:                  5       " S S\R<                  5      5       r\R6                  " \R8                  R@                  5       " S S\R<                  5      5       r!\R6                  " \R8                  RD                  5       " S S\R<                  5      5       r#g)z2Command to create an Anthos cluster on bare metal.    )absolute_import)division)unicode_literals)Optional)bare_metal_clusters)
operations)base)parser_arguments)cluster_flags)	constants)flags)log)gkeonprem_v1_messagesz}
To create a cluster named ``my-cluster'' managed in location ``us-west1'', run:

$ {command} my-cluster --location=us-west1
c                   t    \ rS rSrSrS\0r\S\R                  4S j5       r
S\\R                     4S jrSrg	)
Create)   'Create an Anthos cluster on bare metal.EXAMPLESparserc                 ~   U R                   R                  [        R                  5        [        R
                  " U SSS9  [        R                  " U SS9  [        R                  R                  U 5        [        R                  " U 5        [        R                  " U 5        [        R                  " U 5        [        R                  " U 5        [        R                  " U 5        [        R                  " U 5        [        R                   " U 5        [        R"                  " U 5        [        R$                  " U 5        [        R&                  " U 5        [        R(                  " U 5        [        R*                  " U 5        [        R,                  " U 5        [        R.                  " U 5        [0        R2                  " U 5        gzpGathers command line arguments for the create command.

Args:
  parser: The argparse parser to add the flag to.
z	to createT)verb
positionalF)r   Ndisplay_info	AddFormatbare_metal_constantsBARE_METAL_CLUSTERS_FORMATbare_metal_flagsAddClusterResourceArg$AddAdminClusterMembershipResourceArgr	   
ASYNC_FLAGAddToParserAddValidationOnlyAddDescriptionAddAnnotations
AddVersionAddNetworkConfigAddLoadBalancerConfigAddStorageConfigAddControlPlaneConfigAddProxyConfigAddClusterOperationsConfigAddMaintenanceConfigAddWorkloadNodeConfigAddSecurityConfigAddNodeAccessConfigr   AddBinauthzEvaluationModer   s    3lib/surface/container/bare_metal/clusters/create.pyArgsCreate.Args/   3    !!77 **[T 995 	OO'&&v.##F+##F+'%%f-**62%%f-**62##F+//7))&1**62&&v.((0	##F+    returnc                    UR                   R                  R                  5       n[        R                  " 5       nUR                  U5      nUR                  (       a+  UR                  S5      (       d  [        R                  Ul
        UR                  (       a  U$ [        R                  " 5       nUR                  U5      nUR                  (       d"  [        R                   " USUR                  5        U$ aA  Runs the create command.

Args:
  args: The arguments received from command line.

Returns:
  The return value depends on the command arguments. If `--async` is
  specified, it returns an operation; otherwise, it returns the created
  resource. If `--validate-only` is specified, it returns None or any
  possible error.
formatzAnthos cluster on bare metalCONCEPTSclusterParseapisClustersClientr   async_IsSpecifiedr   OPERATIONS_FORMATr<   r   OperationsClientWaitvalidate_onlyr   CreatedResourceselfargscluster_refcluster_client	operationoperation_clientoperation_responses          r4   Run
Create.RunP        --''--/K((*N%%d+I{{4++H55//dk{{!224)..y9	
5t{{ r8    N__name__
__module____qualname____firstlineno____doc__	_EXAMPLESdetailed_helpstaticmethodr
   ArgumentInterceptorr5   r   messages	OperationrR   __static_attributes__rU   r8   r4   r   r   )   G    /y)-,#77 , ,@("4"45 r8   r   c                   t    \ rS rSrSrS\0r\S\R                  4S j5       r
S\\R                     4S jrSrg	)

CreateBetap   r   r   r   c                 ~   U R                   R                  [        R                  5        [        R
                  " U SSS9  [        R                  " U SS9  [        R                  R                  U 5        [        R                  " U 5        [        R                  " U 5        [        R                  " U 5        [        R                  " U 5        [        R                  " U 5        [        R                  " U 5        [        R                   " U 5        [        R"                  " U 5        [        R$                  " U 5        [        R&                  " U 5        [        R(                  " U 5        [        R*                  " U 5        [        R,                  " U 5        [        R.                  " U 5        [0        R2                  " U 5        gr   r   r3   s    r4   r5   CreateBeta.Argsv   r7   r8   r9   c                    UR                   R                  R                  5       n[        R                  " 5       nUR                  U5      nUR                  (       a+  UR                  S5      (       d  [        R                  Ul
        UR                  (       a  U$ [        R                  " 5       nUR                  U5      nUR                  (       d"  [        R                   " USUR                  5        U$ r;   r=   rJ   s          r4   rR   CreateBeta.Run   rT   r8   rU   NrV   rU   r8   r4   re   re   p   rc   r8   re   c                   x    \ rS rSrSrS\0r\S\R                  SS4S j5       r
S\\R                     4S jrS	rg)
CreateAlpha   r   r   r   r9   Nc                    U R                   R                  [        R                  5        [        R
                  " U SSS9  [        R                  " U SS9  [        R                  R                  U 5        [        R                  " U 5        [        R                  " U 5        [        R                  " U 5        [        R                  " U 5        [        R                  " U 5        [        R                  " U 5        [        R                   " U 5        [        R"                  " U 5        [        R$                  " U 5        [        R&                  " U 5        [        R(                  " U 5        [        R*                  " U 5        [        R,                  " U 5        [        R.                  " U 5        [0        R2                  " U 5        [        R4                  " U 5        gr   )r   r   r   r   r   r    r!   r	   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r   r2   AddUpgradePolicyr3   s    r4   r5   CreateAlpha.Args   sA    !!77 **[T 995 	OO'&&v.##F+##F+'%%f-**62%%f-**62##F+//7))&1**62&&v.((0	##F+%%f-r8   c                    UR                   R                  R                  5       n[        R                  " 5       nUR                  U5      nUR                  (       a+  UR                  S5      (       d  [        R                  Ul
        UR                  (       a  U$ [        R                  " 5       nUR                  U5      nUR                  (       d"  [        R                   " USUR                  5        U$ r;   r=   rJ   s          r4   rR   CreateAlpha.Run   s     --''--/K((*N%%d+I{{4++H55//dk{{!224)..y9	+'E++'r8   rU   rV   rU   r8   r4   rl   rl      sO    /y)-!.22!.!. !.F("4"45 r8   rl   N)$r[   
__future__r   r   r   typingr   *googlecloudsdk.api_lib.container.gkeonpremr   rA   r   googlecloudsdk.callioper	   r
   /googlecloudsdk.command_lib.container.bare_metalr   r   r   r   .googlecloudsdk.command_lib.container.gkeonpremr   googlecloudsdk.corer   2googlecloudsdk.generated_clients.apis.gkeonprem.v1r   r`   r\   ReleaseTracksReleaseTrackGACreateCommandr   BETAre   ALPHArl   rU   r8   r4   <module>r      s    9 &  '  R A ( 4 ] ] D @ # `	 D%%(()CT C *CL D%%**+C## C ,CL D%%++,E$$$ E -Er8   