
    &                        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	d
dZej                   ej                  ej                   j"                         G d dej$                                      Zej                   ej                  ej                   j(                         G d de                    Zy)z Command for creating multi-MIGs.    )absolute_import)division)unicode_literals)base_classes)utils)basez!Create a Compute Engine multi-MIGz<        *{command}* creates a Compute Engine multi-MIG.
    az        Running:

              $ {command} example-multimig --workload-policy=example-policy

      will create a multi-MIG called 'example-multimig'
      with a workload policy called 'example-policy' in the region and project which were set by `gcloud config set`.

      You can provide full path to multi-MIG name to override the region and
      project or use `--region` and `--project` flags.

      Example:

              $ {command} projects/example-project/regions/us-central1/multiMigs/example-multimig --workload-policy=example-policy --description="Multi-MIG with workload policy"

      will create a multi-MIG called 'example-multimig'
      in the region `us-central1` and project 'example-project' with a
      workload policy called 'projects/example-project/regions/us-central1/resourcePolicies/example-policy' and a description of 'Multi-MIG with workload policy'.
    )briefDESCRIPTIONEXAMPLESc                   *    e Zd ZdZeZed        Zd Zy)CreateCreate a multi-MIG.c                     t        j                  | t        j                  j                  j
                  j                                | j                  dd       | j                  dd       y )N--descriptionSets description to multi-MIG.help--workload-policyz*Specifies a workload policy for multi-MIG.r   AddMultiMigNameArgToParserr   ReleaseTrackALPHAnameloweradd_argument)parsers    (lib/surface/compute/multi_migs/create.pyArgszCreate.Args=   sf    	$$!!'',,224 -   9      c                    t        j                  | j                               }|j                  }|j                  }|j
                  j                  j                         }|j                  j                  |j                         |j                  |j                  t        j                  |||j                  |            }t        j                   |||      S )zCreates a multi-MIG.

    Args:
      args: the argparse arguments that this command was invoked with.

    Returns:
      List containing one resource.
    )r   descriptionregionresourcePolicies)r   ComputeApiHolderr   client	resourcesCONCEPTS	multi_migParsemessagesMultiMigNamer!   r"   r   MakeResourcePolicy	api_utilsInsert)selfargsholderr%   r&   multi_mig_refr(   s          r   Runz
Create.RunK   s     **4+<+<+>?F]]F  IMM++113M((!$$##11)V__m
	 ) I FI}==r   N)	__name__
__module____qualname____doc__DETAILED_HELPdetailed_helpstaticmethodr   r4    r   r   r   r   6   s#     - >r   r   c                        e Zd ZdZed        Zy)CreateAlphar   c                     t        j                  |t        j                  j                  j
                  j                                |j                  dd       |j                  dd       y )Nr   r   r   r   zLTaking the resource policy ID and specifies a workload policy for multi-MIG.r   )clsr   s     r   r   zCreateAlpha.Argsh   sh    	$$!!'',,224 -     r   N)r5   r6   r7   r8   classmethodr   r<   r   r   r>   r>   c   s      r   r>   N)r8   
__future__r   r   r   googlecloudsdk.api_lib.computer   )googlecloudsdk.api_lib.compute.multi_migsr   r.   googlecloudsdk.callioper   -googlecloudsdk.command_lib.compute.multi_migsr9   DefaultUniverseOnlyReleaseTracksr   BETACreateCommandr   r   r>   r<   r   r   <module>rK      s    ' &  ' 7 H ( ? 16 D%%**+(>T (> , (>V D%%++,&  - r   