
    
                         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 Zd	 Z G d
 dej                        Zy)z(Command for describing forwarding rules.    )absolute_import)division)unicode_literals)base_classes)base)flagsc                 T    t        j                         }|j                  | d       |S )Ndescribe)operation_type)r   ForwardingRuleArgumentAddArgument)parserforwarding_rules_args     0lib/surface/compute/forwarding_rules/describe.py_Argsr      s*    557""6*"E	    c                    |j                   }|j                  | |j                  t        j                  |            }|j                         dk(  rA|j                  j                  } |j                  j                  di |j                         }nS|j                         dk(  r@|j                  j                  } |j                  j                  di |j                         }|j                  dfg      d   S )z9Issues request necessary to describe the Forwarding Rule.)scope_listerzcompute.forwardingRuleszcompute.globalForwardingRulesGetr    )clientResolveAsResource	resourcescompute_flagsGetDefaultScopeLister
Collectionapitools_clientforwardingRulesmessages ComputeForwardingRulesGetRequestAsDictglobalForwardingRules&ComputeGlobalForwardingRulesGetRequestMakeRequests)argsholderr   r   forwarding_rule_refservicerequests          r   _Runr*   !   s    ==&,>>
 66v> ? @
 ##%)BB$$44G>foo>> (

$
$
&(G%%'+JJ$$::GDfooDD (

$
$
&(G 
		ww78	9!	<<r   c                   *    e Zd ZdZdZed        Zd Zy)Describeai  Display detailed information about a forwarding rule.

  *{command}* displays all data associated with a forwarding rule
  in a project.

  ## EXAMPLES
  To get details about a global forwarding rule, run:

    $ {command} FORWARDING-RULE --global

  To get details about a regional forwarding rule, run:

    $ {command} FORWARDING-RULE --region=us-central1
  Nc                 ,    t        |       t        _        y N)r   r,   FORWARDING_RULE_ARG)r   s    r   ArgszDescribe.ArgsH   s    #(=H r   c                 v    t        j                  | j                               }t        ||| j                        S r.   )r   ComputeApiHolderReleaseTrackr*   r/   )selfr%   r&   s      r   RunzDescribe.RunL   s0    **4+<+<+>?Ffd6677r   )__name__
__module____qualname____doc__r/   staticmethodr0   r5   r   r   r   r,   r,   6   s&     1 18r   r,   N)r9   
__future__r   r   r   googlecloudsdk.api_lib.computer   googlecloudsdk.callioper   "googlecloudsdk.command_lib.computer   r   3googlecloudsdk.command_lib.compute.forwarding_rulesr   r*   DescribeCommandr,   r   r   r   <module>rA      s;    / &  ' 7 ( E E=*8t## 8r   