
    .                         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Z ej                  ej                  j                          G d dej"                               Zy)z/'vmware private-clouds subnets update' command.    )absolute_import)division)unicode_literals)SubnetsClient)base)flags)logz
          Update a Subnet. Only ip-cidr-range can be updated. This is a synchronous command and doesn't support `--async` and `--no-async` flags.
        aL  
        To update a subnet named `my-subnet`, that belongs to the private cloud `my-private-cloud` in project `my-project` and zone `us-west1-a` by changing its ip-cidr-range to `10.0.0.0/24`, run:

          $ {command} my-subnet --private-cloud=my-private-cloud --location=us-west1 --project=my-project --ip-cidr-range=10.0.0.0/24

        Or:

          $ {command} my-subnet --private-cloud=my-private-cloud --ip-cidr-range=10.0.0.0/24

        In the second example, the project and location are taken from gcloud properties `core/project` and `compute/zone`, respectively.
        )DESCRIPTIONEXAMPLESc                   *    e Zd ZdZeZed        Zd Zy)UpdatezUpdate a subnet.c                     t        j                  |        | j                  j                  d       | j	                  ddd       y)z Register flags for this command.yamlz--ip-cidr-rangeTz7        Updated IP CIDR range for this subnet.
        )requiredhelpN)r   AddSubnetArgToParserdisplay_info	AddFormatadd_argument)parsers    3lib/surface/vmware/private_clouds/subnets/update.pyArgszUpdate.Args4   sD     
v&
!!&)
      c                    |j                   j                  j                         }t               }|j	                  ||j
                        }|j                  r|j                  |      }n?|j                  |j                  |      dj                  |j                                     }t        j                  |j                         d       |S )Nz%waiting for subnet [{}] to be updated)operation_refmessagesubnet)kind)CONCEPTSr   Parser   r   ip_cidr_rangedoneGetResponseWaitForOperationGetOperationRefformatRelativeNamer	   UpdatedResource)selfargsr   client	operationresources         r   Runz
Update.Run@   s    ]]!!'')F_Ffd&8&89I
 ~~##I.h((..y99@@!!# ) h ++-H=Or   N)	__name__
__module____qualname____doc__DETAILED_HELPdetailed_helpstaticmethodr   r.    r   r   r   r   .   s!    -	 	r   r   N)r2   
__future__r   r   r   4googlecloudsdk.api_lib.vmware.private_clouds.subnetsr   googlecloudsdk.callioper   !googlecloudsdk.command_lib.vmwarer   googlecloudsdk.corer	   r3   ReleaseTracksReleaseTrackGAUpdateCommandr   r6   r   r   <module>r@      sj    6 &  ' N ( 3 #	
	( D%%(()#T # *#r   