
                             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
lmZ ddlmZ  G d de
j                         Zy)z#bigtable instances upgrade command.    )absolute_import)division)unicode_literalsN)	instances)util)base)	arguments)log)	resourcesc                   N    e Zd ZdZd ej
                  d      iZed        Zd Z	y)UpgradeInstancezCUpgrade an existing instance's type from development to production.EXAMPLESzw          To upgrade a `DEVELOPMENT` instance to `PRODUCTION`, run:

            $ {command} my-instance-id

          c                 z    t        j                  |       j                          t        j                  | dd       y)z Register flags for this command.z
to upgradeT)
positionalN)r	   ArgAdderAddAsyncAddInstanceResourceArg)parsers    )lib/surface/bigtable/instances/upgrade.pyArgszUpgradeInstance.Args,   s-     v'')$$V\dK    c                 r   t        j                  |j                        }|j                  r|}n\t        j
                  j                  |j                  d      }dj                  |j                        }t        j                  ||      }t        j                  |j                  d|j                         |S )zThis is what gets called when the user runs this command.

    Args:
      args: an argparse namespace. All the arguments that were provided to this
        command invocation.

    Returns:
      Some value that we want to have printed later.
    zbigtableadmin.operations)
collectionzUpgrading bigtable instance {0}instance)kindis_async)r   Upgrader   async_r   REGISTRYParseRelativeNamenameformatr   AwaitInstancer
   UpdatedResource)selfargsopresultop_refmessages         r   RunzUpgradeInstance.Run2   s     
		4==	)B{{f!!33
''8 4 :f188Gg!!&'2fJMMr   N)
__name__
__module____qualname____doc__textwrapdedentdetailed_helpstaticmethodr   r+    r   r   r   r      s?    K 
(//  - L L
r   r   )r/   
__future__r   r   r   r0   googlecloudsdk.api_lib.bigtabler   r   googlecloudsdk.callioper   #googlecloudsdk.command_lib.bigtabler	   googlecloudsdk.corer
   r   UpdateCommandr   r4   r   r   <module>r;      s:    * &  '  5 0 ( 9 # )'d(( 'r   