
                            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	rS
rSS jr\R                   " \R"                  R$                  \R"                  R&                  5       " S S\R(                  5      5       rg)zThe Open Console command.    )absolute_import)division)unicode_literals)base)browser_dispatcher)
properties)urllibz7https://console.developers.google.com/appengine?{query}z2https://console.developers.google.com/logs?{query}Nc                     Uc  SnSU 4SU4/nU(       a  UR                  SU45        [        R                  R                  U5      nU(       a  [        O[
        R                  US9$ )aq  Creates a URL to a page in the Developer Console according to the params.

Args:
  project: The app engine project id
  service: A service belonging to the project
  version: A version belonging to the service, or all versions if omitted
  logs: If true, go to the log section instead of the dashboard
Returns:
  The URL to the respective page in the Developer Console
defaultproject	serviceId	versionId)query)appendr	   parse	urlencodeLOGS_URLCONSOLE_URLformat)r   serviceversionlogsr   query_strings         lib/surface/app/open_console.py_CreateDevConsoleURLr      sb     _Gw+w!7
8%	LL+w'(''.,(	3	3,	3	GG    c                   8    \ rS rSrSrSSS.r\S 5       rS rSr	g	)
OpenConsole3   zCOpen the App Engine dashboard, or log viewer, in a web browser.

  z"          {description}
          a            Open the App Engine dashboard for the default service:

              $ {command}

          Open the service specific dashboard view:

              $ {command} --service="myService"

          Open the version specific dashboard view:

              $ {command} --service="myService" --version="v1"

          Open the log viewer for the default service:

              $ {command} --logs
          )DESCRIPTIONEXAMPLESc                 n    U R                  SSSS9  U R                  SSSS9  U R                  SS	S
SSS9  g )Nz	--servicez-szCThe service to consider. If not specified, use the default service.)helpz	--versionz-vz]The version to consider. If not specified, all versions for the given service are considered.z--logsz-l
store_trueFz8Open the log viewer instead of the App Engine dashboard.)actionr   r#   )add_argument)parsers    r   ArgsOpenConsole.ArgsP   sg    
!  #
 C  E
 G  Ir   c                     [         R                  R                  R                  R	                  SS9n[        X!R                  UR                  UR                  5      n[        R                  " U5        g )NT)required)r   VALUEScorer   Getr   r   r   r   r   OpenURL)selfargsr   urls       r   RunOpenConsole.Runc   sO    $$,,00$0?G
wdllDII
NCs#r    N)
__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr(   r3   __static_attributes__r5   r   r   r   r   3   s3    
	-. I I$$r   r   )r   NF)r:   
__future__r   r   r   googlecloudsdk.callioper   googlecloudsdk.command_lib.appr   googlecloudsdk.corer   	six.movesr	   r   r   r   ReleaseTracksReleaseTrackGABETACommandr   r5   r   r   <module>rH      sw      &  ' ( = *  H?H( D%%(($*;*;*@*@A2$$,, 2$ B2$r   