[e3d4e0a] | 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 | namespace Google\Service\Apigee\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\Apigee\GoogleCloudApigeeV1Deployment;
|
---|
| 21 | use Google\Service\Apigee\GoogleProtobufEmpty;
|
---|
| 22 |
|
---|
| 23 | /**
|
---|
| 24 | * The "revisions" collection of methods.
|
---|
| 25 | * Typical usage is:
|
---|
| 26 | * <code>
|
---|
| 27 | * $apigeeService = new Google\Service\Apigee(...);
|
---|
| 28 | * $revisions = $apigeeService->organizations_environments_apis_revisions;
|
---|
| 29 | * </code>
|
---|
| 30 | */
|
---|
| 31 | class OrganizationsEnvironmentsApisRevisions extends \Google\Service\Resource
|
---|
| 32 | {
|
---|
| 33 | /**
|
---|
| 34 | * Deploys a revision of an API proxy. If another revision of the same API proxy
|
---|
| 35 | * revision is currently deployed, set the `override` parameter to `true` to
|
---|
| 36 | * have this revision replace the currently deployed revision. You cannot invoke
|
---|
| 37 | * an API proxy until it has been deployed to an environment. After you deploy
|
---|
| 38 | * an API proxy revision, you cannot edit it. To edit the API proxy, you must
|
---|
| 39 | * create and deploy a new revision. For a request path `organizations/{org}/env
|
---|
| 40 | * ironments/{env}/apis/{api}/revisions/{rev}/deployments`, two permissions are
|
---|
| 41 | * required: * `apigee.deployments.create` on the resource
|
---|
| 42 | * `organizations/{org}/environments/{env}` * `apigee.proxyrevisions.deploy` on
|
---|
| 43 | * the resource `organizations/{org}/apis/{api}/revisions/{rev}`
|
---|
| 44 | * (revisions.deploy)
|
---|
| 45 | *
|
---|
| 46 | * @param string $name Required. Name of the API proxy revision deployment in
|
---|
| 47 | * the following format:
|
---|
| 48 | * `organizations/{org}/environments/{env}/apis/{api}/revisions/{rev}`
|
---|
| 49 | * @param array $optParams Optional parameters.
|
---|
| 50 | *
|
---|
| 51 | * @opt_param bool override Flag that specifies whether the new deployment
|
---|
| 52 | * replaces other deployed revisions of the API proxy in the environment. Set
|
---|
| 53 | * `override` to `true` to replace other deployed revisions. By default,
|
---|
| 54 | * `override` is `false` and the deployment is rejected if other revisions of
|
---|
| 55 | * the API proxy are deployed in the environment.
|
---|
| 56 | * @opt_param bool sequencedRollout Flag that specifies whether to enable
|
---|
| 57 | * sequenced rollout. If set to `true`, the routing rules for this deployment
|
---|
| 58 | * and the environment changes to add the deployment will be rolled out in a
|
---|
| 59 | * safe order. This reduces the risk of downtime that could be caused by
|
---|
| 60 | * changing the environment group's routing before the new destination for the
|
---|
| 61 | * affected traffic is ready to receive it. This should only be necessary if the
|
---|
| 62 | * new deployment will be capturing traffic from another environment under a
|
---|
| 63 | * shared environment group or if traffic will be rerouted to a different
|
---|
| 64 | * environment due to a base path removal. The generateDeployChangeReport API
|
---|
| 65 | * may be used to examine routing changes before issuing the deployment request,
|
---|
| 66 | * and its response will indicate if a sequenced rollout is recommended for the
|
---|
| 67 | * deployment.
|
---|
| 68 | * @opt_param string serviceAccount Google Cloud IAM service account. The
|
---|
| 69 | * service account represents the identity of the deployed proxy, and determines
|
---|
| 70 | * what permissions it has. The format must be
|
---|
| 71 | * `{ACCOUNT_ID}@{PROJECT}.iam.gserviceaccount.com`.
|
---|
| 72 | * @return GoogleCloudApigeeV1Deployment
|
---|
| 73 | * @throws \Google\Service\Exception
|
---|
| 74 | */
|
---|
| 75 | public function deploy($name, $optParams = [])
|
---|
| 76 | {
|
---|
| 77 | $params = ['name' => $name];
|
---|
| 78 | $params = array_merge($params, $optParams);
|
---|
| 79 | return $this->call('deploy', [$params], GoogleCloudApigeeV1Deployment::class);
|
---|
| 80 | }
|
---|
| 81 | /**
|
---|
| 82 | * Gets the deployment of an API proxy revision and actual state reported by
|
---|
| 83 | * runtime pods. (revisions.getDeployments)
|
---|
| 84 | *
|
---|
| 85 | * @param string $name Required. Name representing an API proxy revision in an
|
---|
| 86 | * environment in the following format:
|
---|
| 87 | * `organizations/{org}/environments/{env}/apis/{api}/revisions/{rev}`
|
---|
| 88 | * @param array $optParams Optional parameters.
|
---|
| 89 | * @return GoogleCloudApigeeV1Deployment
|
---|
| 90 | * @throws \Google\Service\Exception
|
---|
| 91 | */
|
---|
| 92 | public function getDeployments($name, $optParams = [])
|
---|
| 93 | {
|
---|
| 94 | $params = ['name' => $name];
|
---|
| 95 | $params = array_merge($params, $optParams);
|
---|
| 96 | return $this->call('getDeployments', [$params], GoogleCloudApigeeV1Deployment::class);
|
---|
| 97 | }
|
---|
| 98 | /**
|
---|
| 99 | * Undeploys an API proxy revision from an environment. For a request path `orga
|
---|
| 100 | * nizations/{org}/environments/{env}/apis/{api}/revisions/{rev}/deployments`,
|
---|
| 101 | * two permissions are required: * `apigee.deployments.delete` on the resource
|
---|
| 102 | * `organizations/{org}/environments/{env}` * `apigee.proxyrevisions.undeploy`
|
---|
| 103 | * on the resource `organizations/{org}/apis/{api}/revisions/{rev}`
|
---|
| 104 | * (revisions.undeploy)
|
---|
| 105 | *
|
---|
| 106 | * @param string $name Required. Name of the API proxy revision deployment in
|
---|
| 107 | * the following format:
|
---|
| 108 | * `organizations/{org}/environments/{env}/apis/{api}/revisions/{rev}`
|
---|
| 109 | * @param array $optParams Optional parameters.
|
---|
| 110 | *
|
---|
| 111 | * @opt_param bool sequencedRollout Flag that specifies whether to enable
|
---|
| 112 | * sequenced rollout. If set to `true`, the environment group routing rules
|
---|
| 113 | * corresponding to this deployment will be removed before removing the
|
---|
| 114 | * deployment from the runtime. This is likely to be a rare use case; it is only
|
---|
| 115 | * needed when the intended effect of undeploying this proxy is to cause the
|
---|
| 116 | * traffic it currently handles to be rerouted to some other existing proxy in
|
---|
| 117 | * the environment group. The GenerateUndeployChangeReport API may be used to
|
---|
| 118 | * examine routing changes before issuing the undeployment request, and its
|
---|
| 119 | * response will indicate if a sequenced rollout is recommended for the
|
---|
| 120 | * undeployment.
|
---|
| 121 | * @return GoogleProtobufEmpty
|
---|
| 122 | * @throws \Google\Service\Exception
|
---|
| 123 | */
|
---|
| 124 | public function undeploy($name, $optParams = [])
|
---|
| 125 | {
|
---|
| 126 | $params = ['name' => $name];
|
---|
| 127 | $params = array_merge($params, $optParams);
|
---|
| 128 | return $this->call('undeploy', [$params], GoogleProtobufEmpty::class);
|
---|
| 129 | }
|
---|
| 130 | }
|
---|
| 131 |
|
---|
| 132 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 133 | class_alias(OrganizationsEnvironmentsApisRevisions::class, 'Google_Service_Apigee_Resource_OrganizationsEnvironmentsApisRevisions');
|
---|