
                         |   S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJ	r	  SSKJr  SSKJ
r  SSKJr  SS	KJr  SS
KJr  SSKJr  SSKJr  SSKJr  SSKr\R0                  " \R2                  R4                  \R2                  R6                  \R2                  R8                  5       " S S\R:                  5      5       rg)z1Retrieves information about a Cloud SQL instance.    )absolute_import)division)unicode_literals)
exceptions)api_util)	instances)validate)base)core)flags)
propertiesNc                   .    \ rS rSrSr\S 5       rS rSrg)Get#   zDisplays configuration and metadata about a Cloud SQL instance.

Displays configuration and metadata about a Cloud SQL instance.

Information such as instance name, IP address, region, the CA certificate
and configuration settings will be displayed.
c                     U R                  S[        R                  SS9  U R                  R	                  SR                  [        R                  5      5        g)zArgs is called by calliope to gather arguments for this command.

Args:
  parser: An argparse parser that you can use it to add arguments that go on
    the command line after this command. Positional arguments are allowed.
instancezCloud SQL instance ID.)	completerhelpz{0} defaultN)add_argumentr   InstanceCompleterdisplay_info	AddFormatformatINSTANCES_USERLABELS_FORMAT)parsers    %lib/surface/sql/instances/describe.pyArgsGet.Args.   sR     ))%  ' !!-"6"6))#+ ,    c                    [         R                  " [         R                  5      nUR                  nUR                  n[
        R                  " UR                  5        UR                  R                  UR                  S[        R                  R                  R                  R                  0SS9n UR                  R!                  UR#                  UR                  UR                  S95      n[$        R&                  " U5      n[        R(                  R*                  R-                  U5      nSUR/                  5       ;   a  SUS   R/                  5       ;   ao  Sn	SUS   S   R/                  5       ;   a  US   S   S   n	/ n
S	US   S   R/                  5       ;   a  US   S   S	   n
U	(       a  [1        U
5      S
:X  a  SUS   S   S'   U$ ! [2        R4                   a  nUR6                  [8        R:                  R<                  R>                  :X  a3  [@        RB                  " SRE                  URG                  5       5      5      e[H        RJ                  " U5      eSnAff = f)a(  Displays configuration and metadata about a Cloud SQL instance.

Information such as instance name, IP address, region, the CA certificate
and configuration settings will be displayed.

Args:
  args: argparse.Namespace, The arguments that this command was invoked
    with.

Returns:
  A DatabaseInstancePresentation object representing the instance resource
  if fetching the instance was successful.
Raises:
  HttpException: A http error response was received while executing api
      request.
ResourceNotFoundError: The SQL instance was not found.
projectzsql.instances)params
collection)r!   r   settingsipConfigurationFipv4EnabledauthorizedNetworksr   zConfiguring authorized network or using CloudSQL auth proxy or language connectors is a prerequisite for connecting to Public IP. Please refer to the documentation for more details https://cloud.google.com/sql/docs/mysql/authorize-networks.messagezIThere was no instance found at {} or you are not authorized to access it.N)&r   	SqlClientAPI_VERSION_DEFAULT
sql_clientsql_messagesr	   ValidateInstanceNamer   resource_parserParser   VALUESr   r!   	GetOrFailr   r   SqlInstancesGetRequestinstance_api_utilDatabaseInstancePresentationresourceresource_projectorMakeSerializablekeyslenapitools_exceptions	HttpErrorstatus_codesixmoveshttp_client	FORBIDDENr   ResourceNotFoundErrorr   RelativeNamecalliope_exceptionsHttpException)selfargsclientr+   r,   instance_refr   instance_presentation serialized_instance_presentationr&   r'   errors               r   RunGet.Run=   sP   $  < <=F""J&&L!!$--0))//:,,1199CCD" 0 $L
5%%))

-
-"**\5J5J . LMh 0LLXV)-)I)I)Z)Z[p)q&	7<<>	>CTXx  zD  YE  YJ  YJ  YL  DL<ZHIZ[``bb8DEVWXef+#CJ#OPa#b#g#g#ii?
KL]^_st
312a7K +:
67H
I)
T .-(( 5			cii33==	=.. 9 9 ;<> 	>  --e445s   1DG	 	IA;II N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   rL   __static_attributes__rN   r   r   r   r   #   s      , ,65r   r   )rS   
__future__r   r   r   apitools.base.pyr   r:   googlecloudsdk.api_lib.sqlr   r   r3   r	   googlecloudsdk.callioper
   googlecloudsdkr   rC   googlecloudsdk.command_lib.sqlr   googlecloudsdk.corer   six.moves.http_clientr=   ReleaseTracksReleaseTrackGABETAALPHADescribeCommandr   rN   r   r   <module>rd      s    8 &  ' > / 1 E / (  E 0 *  D%%(($*;*;*@*@%%++-N5$

 N5-N5r   