[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\Container\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\Container\CancelOperationRequest;
|
---|
| 21 | use Google\Service\Container\ContainerEmpty;
|
---|
| 22 | use Google\Service\Container\ListOperationsResponse;
|
---|
| 23 | use Google\Service\Container\Operation;
|
---|
| 24 |
|
---|
| 25 | /**
|
---|
| 26 | * The "operations" collection of methods.
|
---|
| 27 | * Typical usage is:
|
---|
| 28 | * <code>
|
---|
| 29 | * $containerService = new Google\Service\Container(...);
|
---|
| 30 | * $operations = $containerService->projects_zones_operations;
|
---|
| 31 | * </code>
|
---|
| 32 | */
|
---|
| 33 | class ProjectsZonesOperations extends \Google\Service\Resource
|
---|
| 34 | {
|
---|
| 35 | /**
|
---|
| 36 | * Cancels the specified operation. (operations.cancel)
|
---|
| 37 | *
|
---|
| 38 | * @param string $projectId Deprecated. The Google Developers Console [project
|
---|
| 39 | * ID or project number](https://cloud.google.com/resource-
|
---|
| 40 | * manager/docs/creating-managing-projects). This field has been deprecated and
|
---|
| 41 | * replaced by the name field.
|
---|
| 42 | * @param string $zone Deprecated. The name of the Google Compute Engine
|
---|
| 43 | * [zone](https://cloud.google.com/compute/docs/zones#available) in which the
|
---|
| 44 | * operation resides. This field has been deprecated and replaced by the name
|
---|
| 45 | * field.
|
---|
| 46 | * @param string $operationId Deprecated. The server-assigned `name` of the
|
---|
| 47 | * operation. This field has been deprecated and replaced by the name field.
|
---|
| 48 | * @param CancelOperationRequest $postBody
|
---|
| 49 | * @param array $optParams Optional parameters.
|
---|
| 50 | * @return ContainerEmpty
|
---|
| 51 | * @throws \Google\Service\Exception
|
---|
| 52 | */
|
---|
| 53 | public function cancel($projectId, $zone, $operationId, CancelOperationRequest $postBody, $optParams = [])
|
---|
| 54 | {
|
---|
| 55 | $params = ['projectId' => $projectId, 'zone' => $zone, 'operationId' => $operationId, 'postBody' => $postBody];
|
---|
| 56 | $params = array_merge($params, $optParams);
|
---|
| 57 | return $this->call('cancel', [$params], ContainerEmpty::class);
|
---|
| 58 | }
|
---|
| 59 | /**
|
---|
| 60 | * Gets the specified operation. (operations.get)
|
---|
| 61 | *
|
---|
| 62 | * @param string $projectId Deprecated. The Google Developers Console [project
|
---|
| 63 | * ID or project number](https://cloud.google.com/resource-
|
---|
| 64 | * manager/docs/creating-managing-projects). This field has been deprecated and
|
---|
| 65 | * replaced by the name field.
|
---|
| 66 | * @param string $zone Deprecated. The name of the Google Compute Engine
|
---|
| 67 | * [zone](https://cloud.google.com/compute/docs/zones#available) in which the
|
---|
| 68 | * cluster resides. This field has been deprecated and replaced by the name
|
---|
| 69 | * field.
|
---|
| 70 | * @param string $operationId Deprecated. The server-assigned `name` of the
|
---|
| 71 | * operation. This field has been deprecated and replaced by the name field.
|
---|
| 72 | * @param array $optParams Optional parameters.
|
---|
| 73 | *
|
---|
| 74 | * @opt_param string name The name (project, location, operation id) of the
|
---|
| 75 | * operation to get. Specified in the format `projects/locations/operations`.
|
---|
| 76 | * @return Operation
|
---|
| 77 | * @throws \Google\Service\Exception
|
---|
| 78 | */
|
---|
| 79 | public function get($projectId, $zone, $operationId, $optParams = [])
|
---|
| 80 | {
|
---|
| 81 | $params = ['projectId' => $projectId, 'zone' => $zone, 'operationId' => $operationId];
|
---|
| 82 | $params = array_merge($params, $optParams);
|
---|
| 83 | return $this->call('get', [$params], Operation::class);
|
---|
| 84 | }
|
---|
| 85 | /**
|
---|
| 86 | * Lists all operations in a project in a specific zone or all zones.
|
---|
| 87 | * (operations.listProjectsZonesOperations)
|
---|
| 88 | *
|
---|
| 89 | * @param string $projectId Deprecated. The Google Developers Console [project
|
---|
| 90 | * ID or project number](https://cloud.google.com/resource-
|
---|
| 91 | * manager/docs/creating-managing-projects). This field has been deprecated and
|
---|
| 92 | * replaced by the parent field.
|
---|
| 93 | * @param string $zone Deprecated. The name of the Google Compute Engine
|
---|
| 94 | * [zone](https://cloud.google.com/compute/docs/zones#available) to return
|
---|
| 95 | * operations for, or `-` for all zones. This field has been deprecated and
|
---|
| 96 | * replaced by the parent field.
|
---|
| 97 | * @param array $optParams Optional parameters.
|
---|
| 98 | *
|
---|
| 99 | * @opt_param string parent The parent (project and location) where the
|
---|
| 100 | * operations will be listed. Specified in the format `projects/locations`.
|
---|
| 101 | * Location "-" matches all zones and all regions.
|
---|
| 102 | * @return ListOperationsResponse
|
---|
| 103 | * @throws \Google\Service\Exception
|
---|
| 104 | */
|
---|
| 105 | public function listProjectsZonesOperations($projectId, $zone, $optParams = [])
|
---|
| 106 | {
|
---|
| 107 | $params = ['projectId' => $projectId, 'zone' => $zone];
|
---|
| 108 | $params = array_merge($params, $optParams);
|
---|
| 109 | return $this->call('list', [$params], ListOperationsResponse::class);
|
---|
| 110 | }
|
---|
| 111 | }
|
---|
| 112 |
|
---|
| 113 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 114 | class_alias(ProjectsZonesOperations::class, 'Google_Service_Container_Resource_ProjectsZonesOperations');
|
---|