[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\ServiceManagement\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\ServiceManagement\ListServiceRolloutsResponse;
|
---|
| 21 | use Google\Service\ServiceManagement\Operation;
|
---|
| 22 | use Google\Service\ServiceManagement\Rollout;
|
---|
| 23 |
|
---|
| 24 | /**
|
---|
| 25 | * The "rollouts" collection of methods.
|
---|
| 26 | * Typical usage is:
|
---|
| 27 | * <code>
|
---|
| 28 | * $servicemanagementService = new Google\Service\ServiceManagement(...);
|
---|
| 29 | * $rollouts = $servicemanagementService->services_rollouts;
|
---|
| 30 | * </code>
|
---|
| 31 | */
|
---|
| 32 | class ServicesRollouts extends \Google\Service\Resource
|
---|
| 33 | {
|
---|
| 34 | /**
|
---|
| 35 | * Creates a new service configuration rollout. Based on rollout, the Google
|
---|
| 36 | * Service Management will roll out the service configurations to different
|
---|
| 37 | * backend services. For example, the logging configuration will be pushed to
|
---|
| 38 | * Google Cloud Logging. Please note that any previous pending and running
|
---|
| 39 | * Rollouts and associated Operations will be automatically cancelled so that
|
---|
| 40 | * the latest Rollout will not be blocked by previous Rollouts. Only the 100
|
---|
| 41 | * most recent (in any state) and the last 10 successful (if not already part of
|
---|
| 42 | * the set of 100 most recent) rollouts are kept for each service. The rest will
|
---|
| 43 | * be deleted eventually. Operation (rollouts.create)
|
---|
| 44 | *
|
---|
| 45 | * @param string $serviceName Required. The name of the service. See the
|
---|
| 46 | * [overview](https://cloud.google.com/service-management/overview) for naming
|
---|
| 47 | * requirements. For example: `example.googleapis.com`.
|
---|
| 48 | * @param Rollout $postBody
|
---|
| 49 | * @param array $optParams Optional parameters.
|
---|
| 50 | * @return Operation
|
---|
| 51 | * @throws \Google\Service\Exception
|
---|
| 52 | */
|
---|
| 53 | public function create($serviceName, Rollout $postBody, $optParams = [])
|
---|
| 54 | {
|
---|
| 55 | $params = ['serviceName' => $serviceName, 'postBody' => $postBody];
|
---|
| 56 | $params = array_merge($params, $optParams);
|
---|
| 57 | return $this->call('create', [$params], Operation::class);
|
---|
| 58 | }
|
---|
| 59 | /**
|
---|
| 60 | * Gets a service configuration rollout. (rollouts.get)
|
---|
| 61 | *
|
---|
| 62 | * @param string $serviceName Required. The name of the service. See the
|
---|
| 63 | * [overview](https://cloud.google.com/service-management/overview) for naming
|
---|
| 64 | * requirements. For example: `example.googleapis.com`.
|
---|
| 65 | * @param string $rolloutId Required. The id of the rollout resource.
|
---|
| 66 | * @param array $optParams Optional parameters.
|
---|
| 67 | * @return Rollout
|
---|
| 68 | * @throws \Google\Service\Exception
|
---|
| 69 | */
|
---|
| 70 | public function get($serviceName, $rolloutId, $optParams = [])
|
---|
| 71 | {
|
---|
| 72 | $params = ['serviceName' => $serviceName, 'rolloutId' => $rolloutId];
|
---|
| 73 | $params = array_merge($params, $optParams);
|
---|
| 74 | return $this->call('get', [$params], Rollout::class);
|
---|
| 75 | }
|
---|
| 76 | /**
|
---|
| 77 | * Lists the history of the service configuration rollouts for a managed
|
---|
| 78 | * service, from the newest to the oldest. (rollouts.listServicesRollouts)
|
---|
| 79 | *
|
---|
| 80 | * @param string $serviceName Required. The name of the service. See the
|
---|
| 81 | * [overview](https://cloud.google.com/service-management/overview) for naming
|
---|
| 82 | * requirements. For example: `example.googleapis.com`.
|
---|
| 83 | * @param array $optParams Optional parameters.
|
---|
| 84 | *
|
---|
| 85 | * @opt_param string filter Required. Use `filter` to return subset of rollouts.
|
---|
| 86 | * The following filters are supported: -- By status. For example,
|
---|
| 87 | * `filter='status=SUCCESS'` -- By strategy. For example,
|
---|
| 88 | * `filter='strategy=TrafficPercentStrategy'`
|
---|
| 89 | * @opt_param int pageSize The max number of items to include in the response
|
---|
| 90 | * list. Page size is 50 if not specified. Maximum value is 100.
|
---|
| 91 | * @opt_param string pageToken The token of the page to retrieve.
|
---|
| 92 | * @return ListServiceRolloutsResponse
|
---|
| 93 | * @throws \Google\Service\Exception
|
---|
| 94 | */
|
---|
| 95 | public function listServicesRollouts($serviceName, $optParams = [])
|
---|
| 96 | {
|
---|
| 97 | $params = ['serviceName' => $serviceName];
|
---|
| 98 | $params = array_merge($params, $optParams);
|
---|
| 99 | return $this->call('list', [$params], ListServiceRolloutsResponse::class);
|
---|
| 100 | }
|
---|
| 101 | }
|
---|
| 102 |
|
---|
| 103 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 104 | class_alias(ServicesRollouts::class, 'Google_Service_ServiceManagement_Resource_ServicesRollouts');
|
---|