
                          n   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  \R&                  " \R(                  R*                  \R(                  R,                  \R(                  R.                  5      \R0                   " S S\R2                  5      5       5       rg)z.Creates a new Backup and DR Management Server.    )absolute_import)division)unicode_literals)
exceptions)util)ManagementServersClient)base)flags)logc                   :    \ rS rSrSrSSSS.r\S 5       rS rS	r	g
)Create   z.Create a new management server in the project.zCreates a new management serverz{description} A management server is required to access the management console. It can only be created in locations where Backup and DR is available. Resources in other locations can be backed up.z        To create a new management server `sample-ms` in project `sample-project` and location `us-central1`, run:

          $ {command} sample-ms --project=sample-project --location=us-central1
        )BRIEFDESCRIPTIONEXAMPLESc                     [         R                  R                  U 5        [         R                  R                  U S5        [        R
                  " U S5        [        R                  " U 5        g)zmSpecifies additional command flags.

Args:
  parser: argparse.Parser: Parser object for command line inputs.
TzName of the management server to be created. Once the management server is deployed, this name can't be changed. The name must be unique for a project and location.N)r	   
ASYNC_FLAGAddToParser
SetDefaultr
   AddManagementServerResourceArg
AddNetwork)parsers    2lib/surface/backup_dr/management_servers/create.pyArgsCreate.Args5   sP     	OO'OOvt,	((	. 
V    c                 J   [        5       nUR                  nUR                  R                  R	                  5       nUR
                  n UR                  XE5      nU(       a#  [        R                  " UR                  SSSS9  U$ UR!                  UR#                  U5      SR%                  UR'                  5       5      S9n[        R                  " UR'                  5       SS9  U$ ! [        R                   a*  n[        R                  " U[        R                  5      eSnAff = f)	zConstructs and sends request.

Args:
  args: argparse.Namespace, An object that contains the values for the
    arguments specified in the .Args() method.

Returns:
  ProcessHttpResponse of the request made.
Nzmanagement serverTz]Run the [gcloud backup-dr operations describe] command to check the status of this operation.)kindis_asyncdetailszJCreating management server [{}]. (This operation could take up to 1 hour.))operation_refmessage)r   )r   async_CONCEPTSmanagement_serverParsenetworkr   apitools_exceptions	HttpErrorr   HttpExceptionr   HTTP_ERROR_FORMATr   CreatedResourcenameWaitForOperationGetOperationRefformatRelativeName)	selfargsclientr   r%   r'   	operationeresources	            r   Run
Create.RunF   s    %&F{{H77==?llG@-- 1;i 	
.."7 &&,,Y7##)6*;*H*H*J#K	 ' H &&(/B O3 (( @$$Q(>(>??@s   C$ $D"8%DD" N)
__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr   r8   __static_attributes__r:   r   r   r   r      s6    
 7 1
-   +r   r   N)r?   
__future__r   r   r   apitools.base.pyr   r(   googlecloudsdk.api_lib.backupdrr   2googlecloudsdk.api_lib.backupdr.management_serversr   googlecloudsdk.api_lib.utilgooglecloudsdk.callioper	   #googlecloudsdk.command_lib.backupdrr
   googlecloudsdk.corer   ReleaseTracksReleaseTrackALPHABETAGADefaultUniverseOnlyCreateCommandr   r:   r   r   <module>rR      s    5 '  ' > 0 V 2 ( 5 # T..33T5F5F5I5I NT N Nr   