
    0
                        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 e
j$                   e
j&                  e
j(                  j*                         G d
 de
j,                                      Zy)zxCommand for updating member interconnects to an interconnect L2-forwarding attachment innner vlan to appliance mappings.    )absolute_import)division)unicode_literals)base_classes)client)base)flags)logc                   0    e Zd ZdZdZed        Zd Zd Zy)RemoveMappingzRemove vlan to ip mapping rule to an L2-forwarding attachment.

  *{command}* remove vlan to ip mapping rule to an L2-forwarding attachment.
  Nc                     t        j                         | _        | j                  j                  |d       t        j                  |d       y )Ncreate)operation_typeT)required)attachment_flagsInterconnectAttachmentArgumentINTERCONNECT_ATTACHMENT_ARGAddArgument
AddVlanKey)clsparsers     Mlib/surface/compute/interconnects/attachments/l2_forwarding/remove_mapping.pyArgszRemoveMapping.Args(   sA     	779 ###//x/P6    c                    t        j                  | j                               }| j                  j	                  ||j
                  t        j                  |j                              }t        j                  ||j                        }|j                  |j                        }|s9t        j                  j                  dj                  |j                               y |j!                  |j                        S )N)scope_lister)compute_clientz(Mapping with vlan key {} does not exists)vlan_key)r   ComputeApiHolderReleaseTrackr   ResolveAsResource	resourcescompute_flagsGetDefaultScopeListerr   InterconnectAttachmentDescribeMappingr   r
   statusPrintformatr   )selfargsholderattachment_refinterconnect_attachmentold_mappings         r   _RunzRemoveMapping._Run/   s    **4+<+<+>?F55GG"88G H IN
 %;;v}}6 *99$--HK	jj
4
;
;DMM
J "00 1  r   c                 $    | j                  |      S )zSee base.UpdateCommand.)r0   )r*   r+   s     r   RunzRemoveMapping.RunD   s    99T?r   )	__name__
__module____qualname____doc__r   classmethodr   r0   r2    r   r   r   r      s+    
 !%7 7*r   r   N)r6   
__future__r   r   r   googlecloudsdk.api_lib.computer   8googlecloudsdk.api_lib.compute.interconnects.attachmentsr   googlecloudsdk.callioper   "googlecloudsdk.command_lib.computer	   r#   <googlecloudsdk.command_lib.compute.interconnects.attachmentsr   googlecloudsdk.corer
   DefaultUniverseOnlyReleaseTracksr    ALPHAUpdateCommandr   r8   r   r   <module>rD      sn      &  ' 7 K ( E b # D%%++,&D&& & - &r   