1<?php
2/*
3 * Copyright 2014 Google Inc.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6 * use this file except in compliance with the License. You may obtain a copy of
7 * the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 * License for the specific language governing permissions and limitations under
15 * the License.
16 */
17
18/**
19 * The "revisions" collection of methods.
20 * Typical usage is:
21 *  <code>
22 *   $apigeeService = new Google_Service_Apigee(...);
23 *   $revisions = $apigeeService->revisions;
24 *  </code>
25 */
26class Google_Service_Apigee_Resource_OrganizationsEnvironmentsApisRevisions extends Google_Service_Resource
27{
28  /**
29   * Deploys a revision of an API proxy. If another revision of the same API proxy
30   * revision is currently deployed, set the `override` parameter to `true` to
31   * have this revision replace the currently deployed revision. You cannot invoke
32   * an API proxy until it has been deployed to an environment. After you deploy
33   * an API proxy revision, you cannot edit it. To edit the API proxy, you must
34   * create and deploy a new revision. For a request path `organizations/{org}/env
35   * ironments/{env}/apis/{api}/revisions/{rev}/deployments`, two permissions are
36   * required: * `apigee.deployments.create` on the resource
37   * `organizations/{org}/environments/{env}` * `apigee.proxyrevisions.deploy` on
38   * the resource `organizations/{org}/apis/{api}/revisions/{rev}`
39   * (revisions.deploy)
40   *
41   * @param string $name Required. Name of the API proxy revision deployment in
42   * the following format:
43   * `organizations/{org}/environments/{env}/apis/{api}/revisions/{rev}`
44   * @param array $optParams Optional parameters.
45   *
46   * @opt_param bool override Flag that specifies whether the new deployment
47   * replaces other deployed revisions of the API proxy in the environment. Set
48   * `override` to `true` to replace other deployed revisions. By default,
49   * `override` is `false` and the deployment is rejected if other revisions of
50   * the API proxy are deployed in the environment.
51   * @opt_param bool sequencedRollout Flag that specifies whether to enable
52   * sequenced rollout. If set to `true`, a best-effort attempt will be made to
53   * roll out the routing rules corresponding to this deployment and the
54   * environment changes to add this deployment in a safe order. This reduces the
55   * risk of downtime that could be caused by changing the environment group's
56   * routing before the new destination for the affected traffic is ready to
57   * receive it. This should only be necessary if the new deployment will be
58   * capturing traffic from another environment under a shared environment group
59   * or if traffic will be rerouted to a different environment due to a base path
60   * removal. The [GenerateDeployChangeReport API](GenerateDeployChangeReport) may
61   * be used to examine routing changes before issuing the deployment request, and
62   * its response will indicate if a sequenced rollout is recommended for the
63   * deployment.
64   * @return Google_Service_Apigee_GoogleCloudApigeeV1Deployment
65   */
66  public function deploy($name, $optParams = array())
67  {
68    $params = array('name' => $name);
69    $params = array_merge($params, $optParams);
70    return $this->call('deploy', array($params), "Google_Service_Apigee_GoogleCloudApigeeV1Deployment");
71  }
72  /**
73   * Gets the deployment of an API proxy revision and actual state reported by
74   * runtime pods. (revisions.getDeployments)
75   *
76   * @param string $name Required. Name representing an API proxy revision in an
77   * environment in the following format:
78   * `organizations/{org}/environments/{env}/apis/{api}/revisions/{rev}`
79   * @param array $optParams Optional parameters.
80   * @return Google_Service_Apigee_GoogleCloudApigeeV1Deployment
81   */
82  public function getDeployments($name, $optParams = array())
83  {
84    $params = array('name' => $name);
85    $params = array_merge($params, $optParams);
86    return $this->call('getDeployments', array($params), "Google_Service_Apigee_GoogleCloudApigeeV1Deployment");
87  }
88  /**
89   * Undeploys an API proxy revision from an environment. For a request path `orga
90   * nizations/{org}/environments/{env}/apis/{api}/revisions/{rev}/deployments`,
91   * two permissions are required: * `apigee.deployments.delete` on the resource
92   * `organizations/{org}/environments/{env}` * `apigee.proxyrevisions.undeploy`
93   * on the resource `organizations/{org}/apis/{api}/revisions/{rev}`
94   * (revisions.undeploy)
95   *
96   * @param string $name Required. Name of the API proxy revision deployment in
97   * the following format:
98   * `organizations/{org}/environments/{env}/apis/{api}/revisions/{rev}`
99   * @param array $optParams Optional parameters.
100   *
101   * @opt_param bool sequencedRollout Flag that specifies whether to enable
102   * sequenced rollout. If set to `true`, a best-effort attempt will be made to
103   * remove the environment group routing rules corresponding to this deployment
104   * before removing the deployment from the runtime. This is likely to be a rare
105   * use case; it is only needed when the intended effect of undeploying this
106   * proxy is to cause the traffic it currently handles to be rerouted to some
107   * other existing proxy in the environment group. The
108   * [GenerateUndeployChangeReport API](GenerateUndeployChangeReport) may be used
109   * to examine routing changes before issuing the undeployment request, and its
110   * response will indicate if a sequenced rollout is recommended for the
111   * undeployment.
112   * @return Google_Service_Apigee_GoogleProtobufEmpty
113   */
114  public function undeploy($name, $optParams = array())
115  {
116    $params = array('name' => $name);
117    $params = array_merge($params, $optParams);
118    return $this->call('undeploy', array($params), "Google_Service_Apigee_GoogleProtobufEmpty");
119  }
120}
121