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