
                            d Z ddlmZ ddlmZ ddlmZ ddlZddlmZ ddlm	Z	 ddl
mZ dd	lmZ d
ddZe	j                  j                   fZe	j$                   e	j&                  e	j                  j                   e	j                  j(                  e	j                  j*                         G d de	j,                                      Zee_        y)zCreate endpoint group command.    )absolute_import)division)unicode_literalsN)api)base)endpoint_group_flags)labels_utilaV  
          Create a mirroring endpoint group. Successful creation of an endpoint group results
          in an endpoint group in ACTIVE state. Check the progress of endpoint group creation
          by using `gcloud network-security mirroring-endpoint-groups list`.

          For more examples, refer to the EXAMPLES section below.

        a  
            To create a mirroring endpoint group called `my-endpoint-group`, in project ID `my-project`, run:
            $ {command} my-endpoint-group --project=my-project --location=global --mirroring-deployment-group=my-deployment-group

            OR

            $ {command} my-endpoint-group --project=my-project --location=global
            --mirroring-deployment-group=projects/my-project/locations/global/mirroringDeploymentGroups/my-deployment-group

            OR

            $ {command} projects/my-project/locations/global/mirroringEndpointGroups/my-endpoint-group
            --mirroring-deployment-group=projects/my-project/locations/global/mirroringDeploymentGroups/my-deployment-group

            OR

            $ {command} my-endpoint-group --project=my-project --location=global
            --mirroring-deployment-group=projects/my-project/locations/global/mirroringDeploymentGroups/my-deployment-group
            --description='new description'
        )DESCRIPTIONEXAMPLESc                   &    e Zd ZdZed        Zd Zy)Createz"Create a Mirroring Endpoint Group.c                    t        j                  | j                         |       t        j                  | j                         |       t        j                  |d       t        j
                  |       | j                         t        v rt        j                  |       t        j                  j                  |       t        j                  j                  |d       t        j                  |       y )N20mT)r   AddEndpointGroupResourceReleaseTrack#AddMirroringDeploymentGroupResource
AddMaxWaitAddDescriptionArg_PACKET_BROKER_SUPPORTEDAddTyper   
ASYNC_FLAGAddToParser
SetDefaultr	   AddCreateLabelsFlags)clsparsers     @lib/surface/network_security/mirroring_endpoint_groups/create.pyArgszCreate.ArgsD   s    11#2B2B2DfM<<F ## **62
55""6*OO'OOvt,$$V,    c                    t        j                  | j                               }|j                  j                  j                         }|j                  j                  j                         }t        j                  ||j                  j                  j                        }|j                  }t        j                  |j                        }|j!                  |j#                         |j%                         j'                         |j'                         t)        |dd       t)        |dd       |      }|r|j+                  d      sd|_        |S |j/                  |j1                  |      dj-                  |j'                               d|	      S )
N)secondsdescriptiontype)endpoint_group_idparentmirroring_deployment_groupr"   endpoint_group_typelabelsformatdefaultz7waiting for mirroring endpoint group [{}] to be createdT)operation_refmessage
has_resultmax_wait)r   Clientr   CONCEPTSmirroring_endpoint_groupParser&   r	   ParseCreateArgsmessagesMirroringEndpointGroupLabelsValueasync_datetime	timedeltar.   CreateEndpointGroupNameParentRelativeNamegetattrIsSpecifiedr)   WaitForOperationGetOperationRef)	selfargsclientendpoint_groupr&   r(   is_asyncr.   	operations	            r   Runz
Create.RunU   s[   ZZ))+,F]];;AACN00668  ((foo44@@F {{H!!$--8H **(--/$$&335#=#J#J#LD-6#D&$7 + I  h'"",,Y7ELL++-  # 	 	r   N)__name__
__module____qualname____doc__classmethodr   rH    r   r   r   r   >   s     +- - (r   r   )rL   
__future__r   r   r   r8   Agooglecloudsdk.api_lib.network_security.mirroring_endpoint_groupsr   googlecloudsdk.callioper   +googlecloudsdk.command_lib.network_securityr   $googlecloudsdk.command_lib.util.argsr	   DETAILED_HELPr   ALPHAr   DefaultUniverseOnlyReleaseTracksBETAGACreateCommandr   detailed_helprN   r   r   <module>r\      s    % &  '  Q ( L <> !--335  D%%++T->->-C-C%%((*<T <* <~ % r   