
                             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Zej                   G d d	ej                               Zy
)zfA group of commands used to retrieve information about proxy configuration from the Envoy config dump.    )
debug_util)base)	resources)istioctl_backend)
propertiesa  
    To retrieve the type cluster config dump for Pod instance pn.default.

    ${command} pn.default
              --type=cluster
              --project=projectId
              --membership=membershipId
              --location=us-central1
              --ouput=yaml
c                   .    e Zd ZdZdeiZed        Zd Zy)ProxyConfigz?Retrieve a configuration summary for a given Envoy instance.
  EXAMPLESc                 
   t        j                  | ddd       | j                  dd       t        j                  ddg d	d
      }|j                  |        | j                  dddgdd       | j                  ddd       y )NFTz/Name of the membership to troubleshoot against.)pluralmembership_requiredmembership_helppod_name_namespacez=Pod to check against. Use in format of <pod-name[.Namespace]>)helpz--type)	bootstrapclusterclustersendpoint	endpointslistener	listenerslogrouteroutessecretsecretsa  Proxy configuration type to retrieve. 

  bootstrap            Retrieves bootstrap configuration for the Envoy in the specified pod 
 clusters/cluster     Retrieves cluster configuration for the Envoy in the specified pod 
 endpoints/endpoint   Retrieves endpoint configuration for the Envoy in the specified pod 
 listeners/listener   Retrieves listener configuration for the Envoy in the specified pod 
 log                  Retrieves logging levels of the Envoy in the specified pod 
 routes/route         Retrieves route configuration for the Envoy in the specified pod 
 secrets/secret       Retrieves secret configuration for the Envoy in the specified pod 
)requiredchoiceshelp_strz--outputjsonyamlzKReturn the detailed proxy config. The output format is either json or yaml.)r   r   r   z--fqdnzpFilter clusters by substring of Service FQDN field. If unspecified, all clusters will be included in the output")r   r   )r   AddMembershipResourceArgadd_argumentr   ChoiceArgumentAddToParser)parserproxy_config_types     6lib/surface/container/fleet/mesh/debug/proxy_config.pyArgszProxyConfig.Args)   s    && I	 L  
 ++
'%@ !!&)
    I	      c           
         t        j                         }t        j                  |      }t        j                  t
        j                  j                  j                  j                         d      } |d|t        j                  ddi      |j                  |j                  |j                  |j                  |      }|S )Napply)account	operationzproxy-configGCLOUD_AUTH_PLUGINtrue)
extra_vars)commandcontextenvr'   r   output_formatfqdnstdin)r   IstioctlWrapperr   ContextGeneratorGetAuthTokenr   VALUEScorer-   GetGetEnvArgsForCommandtyper   outputr6   )selfargscommand_executorr3   	auth_credresponses         r(   RunzProxyConfig.Runk   s    '779))$/G --!!&&..224I  11,f5
 ))22kkYYH Or*   N)	__name__
__module____qualname____doc__r
   detailed_helpstaticmethodr)   rF    r*   r(   r	   r	   #   s)    x(-? ?Br*   r	   N)rJ   &googlecloudsdk.api_lib.container.fleetr   googlecloudsdk.callioper   *googlecloudsdk.command_lib.container.fleetr   /googlecloudsdk.command_lib.container.fleet.meshr   googlecloudsdk.corer   r
   DefaultUniverseOnlyBinaryBackedCommandr	   rM   r*   r(   <module>rU      sK    m = ( @ L *	 [$** [ [r*   