
                            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
dZd Z ej                  ej                   j"                        ej$                   G d dej&                                      Zee_        y)zNCommand for retrieving the status of asynchronous replication for a disk-pair.    )absolute_import)division)unicode_literals)base_classes)base)flagszZRetrieves the status of asynchronous replication for a Compute Engine persistent disk-paira          *{command}* fetches the current status of async replication on a Compute
        Engine persistent disk-pair. This command can be invoked on either the
        primary disk or the secondary-disk but the scope respective to the disk
        must be provided.
        aH          Replication status can be fetched by using either the primary or the
        secondary disk. To get the current replication status of the disk-pair
        with the primary disk 'primary-disk-1' in zone 'us-east1-a', and project
        'my-project1' and the secondary disk 'secondary-disk-1' in zone
        'us-west1-a', and the project 'my-project2', the following commands can
        be used:

          $ {command} primary-disk-1 --zone=us-east1-a --project=my-project1
          or
          $ {command} secondary-disk-1 --zone=us-west1-a --project=my-project2
        )briefDESCRIPTIONEXAMPLESc                 B    t         j                  j                  |        y)z5Add arguments used for parsing in all command tracks.N)GetAsyncReplicationStatus	disks_argAddArgument)parsers    9lib/surface/compute/disks/get_async_replication_status.py_CommonArgsr   4   s    %%11&9    c                   >    e Zd ZdZed        Zedd       Zd Zd Zy)r   zfGet Async Replication Status for Compute Engine persistent disk-pairs in an asynchronous replication .c                 X    t        j                  d      t        _        t	        |       y )NF)plural)disks_flagsMakeDiskArgr   r   r   )clsr   s     r   ArgszGetAsyncReplicationStatus.Args>   s    *5*A*A*O'r   c                 J    t        j                  | j                         |      S N)r   ComputeApiHolderReleaseTrack)r   no_https     r   _GetApiHolderz'GetAsyncReplicationStatus._GetApiHolderC   s    (()9)9);WEEr   c                 $    | j                  |      S r   )_Run)selfargss     r   RunzGetAsyncReplicationStatus.RunG   s    99T?r   c                    | j                         }|j                  }t        j                  j	                  ||j
                  t        j                  |            }d }|j                         dk(  rZ|j                  j                  |j                         |j                  |j                        }|j                  j                  d|f}nl|j                         dk(  rY|j                  j!                  |j                         |j                  |j"                        }|j                  j$                  d|f}|j'                  |g      S )N)scope_listerzcompute.disks)diskprojectzoner   zcompute.regionDisks)r(   r)   region)r    clientr   r   ResolveAsResource	resourcesr   GetDefaultScopeLister
Collectionmessages,ComputeDisksGetAsyncReplicationStatusRequestNamer)   r*   apitools_clientdisks2ComputeRegionDisksGetAsyncReplicationStatusRequestr+   regionDisksMakeRequests)r#   r$   compute_holderr,   disk_refrequests         r   r"   zGetAsyncReplicationStatus._RunJ   s7   '')N""F(22DD  008 E H G/LL}}""}} M g 
 
 
&
&
%
g
 
			"7	7
//
L
L==?&&__ M   
 
 
,
,
%
g
 y))r   N)F)	__name__
__module____qualname____doc__classmethodr   r    r%   r"    r   r   r   r   9   s:     o  F F#*r   r   N)r?   
__future__r   r   r   googlecloudsdk.api_lib.computer   googlecloudsdk.callioper   "googlecloudsdk.command_lib.computer   (googlecloudsdk.command_lib.compute.disksr   DETAILED_HELPr   ReleaseTracksr   ALPHADefaultUniverseOnlyCommandr   detailed_helprA   r   r   <module>rM      s    U &  ' 7 ( 4 I	'4:
 D%%++,2* 2*  -2*j +8  'r   