
    2                     4   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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)zACommand to create a node pool in an Anthos cluster on bare metal.    )absolute_import)division)unicode_literals)Optional)bare_metal_node_pools)
operations)base)parser_arguments)parser_extensions)cluster_flags)	constants)node_pool_flags)log)gkeonprem_v1_messagesz
To create a node pool named ``my-node-pool'' in a cluster named
``my-cluster'' managed in location ``us-west1'', run:

$ {command} my-node-pool --cluster=my-cluster --location=us-west1
c                   R    \ rS rSrSrS\0r\S\R                  4S j5       r
S rSrg)	Create,   6Create a node pool in an Anthos cluster on bare metal.EXAMPLESparserc                 r   U R                   R                  [        R                  5        [        R
                  " U S5        [        R                  " U 5        [        R                  R                  U 5        [        R                  " U 5        [        R                  " U 5        [        R                  " U 5        gzpGathers command line arguments for the create command.

Args:
  parser: The argparse parser to add the flag to.
z	to createNdisplay_info	AddFormatbare_metal_constantsBARE_METAL_NODE_POOLS_FORMATr   AddNodePoolResourceArgr   AddValidationOnlyr	   
ASYNC_FLAGAddToParserAddNodePoolAnnotationsAddNodePoolDisplayNameAddNodePoolConfigr   s    5lib/surface/container/bare_metal/node_pools/create.pyArgsCreate.Args2   s}     !!99 **6;?##F+OO'**62**62%%f-    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$ 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)node pool in Anthos cluster on bare metalCONCEPTS	node_poolParseapisNodePoolsClientr   async_IsSpecifiedr   OPERATIONS_FORMATr,   r   OperationsClientWaitvalidate_onlyr   CreatedResourceselfargsnode_pool_refclient	operationoperation_clientoperation_responses          r&   Run
Create.RunC   s     MM++113M!!#Fd#I{{4++H55//dk{{!224)..y9	

5
++
 r)    N__name__
__module____qualname____firstlineno____doc__	_EXAMPLESdetailed_helpstaticmethodr
   ArgumentInterceptorr'   rB   __static_attributes__rD   r)   r&   r   r   ,   s4    >y)-.#77 . . r)   r   c                   R    \ rS rSrSrS\0r\S\R                  4S j5       r
S rSrg)	
CreateBetae   r   r   r   c                 r   U R                   R                  [        R                  5        [        R
                  " U S5        [        R                  " U 5        [        R                  R                  U 5        [        R                  " U 5        [        R                  " U 5        [        R                  " U 5        gr   r   r%   s    r&   r'   CreateBeta.Argsk   s{     !!99;**6;?##F+OO'**62**62%%f-r)   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-   r:   s          r&   rB   CreateBeta.Run{   s     MM++113M!!#Fd#I{{4++H55//dk{{!224)..y9	-E++' r)   rD   NrE   rD   r)   r&   rQ   rQ   e   s4    >y)-.#77 . .r)   rQ   c                       \ rS rSrSrS\0r\S\R                  4S j5       r
S\R                  S\\R                     4S jrS	rg
)CreateAlpha   r   r   r   c                    U R                   R                  [        R                  5        [        R
                  " U S5        [        R                  " U 5        [        R                  R                  U 5        [        R                  " U 5        [        R                  " U 5        [        R                  " U 5        [        R                  " U 5        gr   )r   r   r   r   r   r   r   r   r	   r    r!   r"   r#   r$   AddNodePoolVersionr%   s    r&   r'   CreateAlpha.Args   s     !!99;**6;?##F+OO'**62**62%%f-&&v.r)   r<   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$ r+   r-   r:   s          r&   rB   CreateAlpha.Run   s     MM++113M!!#Fd#I{{4++H55//dk{{!224)..y9	-E++' r)   rD   N)rF   rG   rH   rI   rJ   rK   rL   rM   r
   rN   r'   r   	Namespacer   messages	OperationrB   rO   rD   r)   r&   rX   rX      sU    >y)-/#77 / / #--""#r)   rX   N)$rJ   
__future__r   r   r   typingr   *googlecloudsdk.api_lib.container.gkeonpremr   r1   r   googlecloudsdk.callioper	   r
   r   /googlecloudsdk.command_lib.container.bare_metalr   r   r   r   .googlecloudsdk.command_lib.container.gkeonpremgooglecloudsdk.corer   2googlecloudsdk.generated_clients.apis.gkeonprem.v1r   ra   rK   ReleaseTracksReleaseTrackGACreateCommandr   BETArQ   ALPHArX   rD   r)   r&   <module>rq      s    H &  '  T A ( 4 5 I ] K D # `	 D%%(()5T 5 *5p D%%**+2## 2 ,2j D%%++,5$$$ 5 -5r)   