
                         d   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	lmZ dd
lmZ ddlmZ dZedz   Z ej(                  ej*                  j,                  ej*                  j.                  ej*                  j0                         G d dej2                               Zd Zy)z;services vpc-peerings disable-vpc-service-controls command.    )absolute_import)division)unicode_literals)projects_api)peering)services_util)base)util)log)
propertiesz(gcloud services vpc-peerings operations zwait {0}c                   0    e Zd ZdZdddZed        Zd Zy)DisableVpcServiceControlsz8Disable VPC Service Controls for the peering connection.a            This command disables VPC Service Controls for the peering connection.

          The local default route (destination 0.0.0.0/0, next hop default
          internet gateway) is recreated in the service producer VPC network.
          After the route is recreated, the service producer VPC network cannot
          import a custom default route from the peering connection to the
          customer VPC network.
          a            To disable VPC Service Controls for a connection peering a network
          called `my-network` on the current project to a service called
          `your-service`, run:

            $ {command} --network=my-network --service=your-service

          To run the same command asynchronously (non-blocking), run:

            $ {command} --network=my-network --service=your-service --async
          )DESCRIPTIONEXAMPLESc                     | j                  dddd       | j                  dddd	
       t        j                  j                  |        y)zArgs is called by calliope to gather arguments for this command.

    Args:
      parser: An argparse parser that can be used to add arguments that go on
        the command line after this command. Positional arguments are allowed.
    z	--networkNETWORKTzCThe network in the current project that is peered with the service.)metavarrequiredhelpz	--serviceSERVICEz servicenetworking.googleapis.comz/The service to enable VPC service controls for.)r   defaultr   N)add_argumentr	   
ASYNC_FLAGAddToParser)parsers    Alib/surface/services/vpc_peerings/disable_vpc_service_controls.pyArgszDisableVpcServiceControls.ArgsB   sY     R	   2>	  @
 	OO'    c                    t         j                  j                  j                  j	                  d      }t        |      }t        j                  ||j                  |j                        }|j                  rNt        j                  |j                        }t        j                  j!                  dj                  |             yt#        j$                  |j                  t        j&                        }t#        j(                  |       y)zRun 'services vpc-peerings enable-vpc-service-controls'.

    Args:
      args: argparse.Namespace, The arguments that this command was invoked
        with.
    T)r   zcAsynchronous operation is in progress... Use the following command to wait for its completion:
 {0}N)r   VALUEScoreprojectGet_GetProjectNumberr   r   servicenetworkasync_OP_WAIT_CMDformatnamer   statusPrintr   WaitOperationGetOperationPrintOperation)selfargsr"   project_numberopcmds         r   RunzDisableVpcServiceControls.RunW   s     $$,,00$0?G&w/N		*	*>4<<+/<<
9B{{rww'c	jj ++16#;8 		$	$RWWg.B.B	CB  $r   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr   r5    r   r   r   r   !   s2     A
-2 ( ((%r   r   c                 f    t        j                  t        j                  |             j                  S )N)r   r#   projects_utilParseProjectprojectNumber)
project_ids    r   r$   r$   l   s$    			-44Z@	A	O	OOr   N)r9   
__future__r   r   r   +googlecloudsdk.api_lib.cloudresourcemanagerr   googlecloudsdk.api_lib.servicesr   r   googlecloudsdk.callioper	   #googlecloudsdk.command_lib.projectsr
   r>   googlecloudsdk.corer   r   OP_BASE_CMDr(   ReleaseTracksReleaseTrackALPHABETAGASilentCommandr   r$   r<   r   r   <module>rO      s    B &  ' D 3 9 ( E # *8J& 
C% 2 2 C%
C%LPr   