
    $                         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\R                  5      rg)z8Command to deploy an Apigee API proxy to an environment.    )absolute_import)division)unicode_literals)apigee)base)defaults)resource_args)logc                   8    \ rS rSrSrSSS.r\S 5       rS rSr	g	)
Deploy   z&Deploy an API proxy to an environment.a     {description}

  `{command}` installs an API proxy revision in an Apigee runtime environment.

  By default, the API proxy's base path must not already be in use by a deployed
  proxy in the target environment. To allow Apigee to undeploy any conflicting
  API proxy as part of the deployment, use the `--override` command.

  Once a particular revision of an API proxy has been deployed, that revision
  can no longer be modified. Any updates to the API proxy must be saved as a new
  revision.
  a    To deploy the latest revision of the API proxy named ``demo'' to the ``test''
  environment, given that the API proxy and environment's matching Cloud
  Platform project has been set in gcloud settings, run:

    $ {command} --environment=test --api=demo

  To deploy revision 3 of that proxy, owned by an organization named ``my-org'',
  run, and replace any conflicting deployment that might already exist, run:

    $ {command} 3 --organization=my-org --environment=test --api=demo --override

  To deploy that proxy and print the resulting deployment as a JSON object, run:

    $ {command} 3 --organization=my-org --environment=test --api=demo --format=json
  )DESCRIPTIONEXAMPLESc                     U R                  SSSS9  SSSS.n[        R                  " 5       [        R                  " S	S
5      /n[        R
                  " U SSUUS9  g )Nz
--override
store_truea  Force the deployment of the new revision, overriding any currently deployed revision that would conflict with it.

If an existing API proxy revision is deployed, set this flag to ensure seamless deployment with zero downtime. In this case, the existing revision remains deployed until the new revision is fully deployed.

If unset, `{command}` will fail unless all conflicting API proxies are first undeployed from the environment. To do this, run `{parent_command} undeploy` on the conflicting deployment.)actionhelpz`API proxy to be deployed. To get a list of available API proxies, run `{{parent_command}} list`.zEnvironment in which to deploy the API proxy. To get a list of available environments, run `{{grandparent_command}} environments list`.zApigee organization of the proxy and environment. If unspecified, the Cloud Platform project's associated organization will be used.)apienvironmentorganizationrevisionlatestz%organization.environment.api.revisiona  API proxy revision to be deployed and environment in which to deploy it. Revisions can either be a positive revision number, or the special value ``latest'', which will deploy the latest revision of the API proxy. If revision is unspecified, the default is ``latest''.)fallthroughs
help_texts)add_argumentr   !GCPProductOrganizationFallthroughStaticFallthroughr	   AddSingleResourceArgument)parser	help_textr   s      !lib/surface/apigee/apis/deploy.pyArgsDeploy.Args@   s    
	  :GA	I >>@..z8DFL++/	P "    c                 d   UR                   R                  R                  5       R                  5       nUS   S:X  aK  [        R
                  R                  U5      S   S   n[        R                  R                  SU-  5        X2S'   [        R
                  R                  X!R                  5      nU$ )zRun the deploy command.revisionsIdr   r   z"Using current latest revision `%s`)CONCEPTSr   ParseAsDictr   
APIsClientDescriber
   statusPrintr   override)selfargsidentifierslatest_revisionresults        r!   Run
Deploy.Runf   s    --((..0779K=!X-))22;?
KBOo	jj;OKL#2- %%k==AFMr$    N)
__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr"   r5   __static_attributes__r7   r$   r!   r   r      s1    .! -D # #J	r$   r   N)r<   
__future__r   r   r   googlecloudsdk.api_libr   googlecloudsdk.callioper   !googlecloudsdk.command_lib.apigeer   r	   googlecloudsdk.corer
   DescribeCommandr   r7   r$   r!   <module>rF      s6    ? &  ' ) ( 6 ; #TT!! Tr$   