
                         x   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dlmZ dZdZ e	j(                  e	j*                  j,                         G d de	j.                               Z e	j(                  e	j*                  j2                         G d de             Zy)z-Command to upgrade an Edge Container cluster.    )absolute_import)division)unicode_literals)cluster)util)base)flags)print_warning)resource_args)log)	resourcesz
To upgrade an Edge Container cluster to 1.5.1 immediately, run:

$ {command} my-cluster --version=1.5.1 --schedule=IMMEDIATELY
z
  This command uses the edgecontainer/{API} API. The full documentation for this
  API can be found at: https://cloud.google.com/edge-cloud
c                       e Zd ZdZeej                  ej                  j                  e
j                  j                              dZed        Zd Zy)Upgrade"Upgrade an Edge Container cluster.API)EXAMPLESAPI REFERENCEc                     t        j                  | d       t        j                  |        t        j                  |        y )Nz
to upgrade)r   AddClusterResourceArgcontainer_flagsAddUpgradeVersionAddUpgradeSchedule)parsers    4lib/surface/edge_cloud/container/clusters/upgrade.pyArgszUpgrade.Args5   s.    ''=%%f-&&v.    c                    t        j                  |      }t        j                  || j                               }t	        j
                  | j                               }|j                  j                  |      }t        j                  j                  |j                  d      }t        j                  j                  dj                  |j                   |j#                                      t%        j&                  |d       S )Nz+edgecontainer.projects.locations.operations)
collectionzQUpgrade request issued for: [{cluster}]
Check operation [{operation}] for status.)r   	operation)r   GetClusterReferenceGetClusterUpgradeRequestReleaseTrackr   GetClientInstanceprojects_locations_clustersr   r   REGISTRYParseRelativeNamenamer   statusPrintformat
clustersIdRelativeNamer
   PrintWarning)selfargscluster_refreqcluster_clientopop_refs          r   RunzUpgrade.Run;   s    --d3K

*
*41B1B1D
EC++D,=,=,?@N		3	3	;	;C	@B11
I 2 F JJ	v**f6I6I6K  
 %%b$//r   N)__name__
__module____qualname____doc__	_EXAMPLES_API_REFERENCE_r+   r   VERSION_MAPgetr   r#   GAdetailed_helpstaticmethodr   r6    r   r   r   r   *   s]    * &--""4#4#4#7#78 . - / /
0r   r   c                   L    e Zd ZdZeej                  j                  fd       Zy)UpgradeAlphar   c                     t         j                  t        j                  j	                  |            t
        j                  d<   t
        j                  |        y )Nr   r   )r<   r+   r   r=   r>   r   r@   r   )r   tracks     r   r   zUpgradeAlpha.ArgsR   sE    -<-C-C  ' .D .G/* LLr   N)	r7   r8   r9   r:   rA   r   r#   ALPHAr   rB   r   r   rD   rD   N   s&    ***00  r   rD   N)r:   
__future__r   r   r   +googlecloudsdk.api_lib.edge_cloud.containerr   r   googlecloudsdk.callioper   /googlecloudsdk.command_lib.edge_cloud.containerr	   r   r
   r   googlecloudsdk.corer   r   r;   r<   ReleaseTracksr#   r?   Commandr   rG   rD   rB   r   r   <module>rO      s    4 &  ' ? < ( T I I # )	 D%%(() 0dll  0 * 0F D%%++,7  -r   