[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\NetAppFiles\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\NetAppFiles\ListVolumesResponse;
|
---|
| 21 | use Google\Service\NetAppFiles\Operation;
|
---|
| 22 | use Google\Service\NetAppFiles\RevertVolumeRequest;
|
---|
| 23 | use Google\Service\NetAppFiles\Volume;
|
---|
| 24 |
|
---|
| 25 | /**
|
---|
| 26 | * The "volumes" collection of methods.
|
---|
| 27 | * Typical usage is:
|
---|
| 28 | * <code>
|
---|
| 29 | * $netappService = new Google\Service\NetAppFiles(...);
|
---|
| 30 | * $volumes = $netappService->projects_locations_volumes;
|
---|
| 31 | * </code>
|
---|
| 32 | */
|
---|
| 33 | class ProjectsLocationsVolumes extends \Google\Service\Resource
|
---|
| 34 | {
|
---|
| 35 | /**
|
---|
| 36 | * Creates a new Volume in a given project and location. (volumes.create)
|
---|
| 37 | *
|
---|
| 38 | * @param string $parent Required. Value for parent.
|
---|
| 39 | * @param Volume $postBody
|
---|
| 40 | * @param array $optParams Optional parameters.
|
---|
| 41 | *
|
---|
| 42 | * @opt_param string volumeId Required. Id of the requesting volume. Must be
|
---|
| 43 | * unique within the parent resource. Must contain only letters, numbers and
|
---|
| 44 | * hyphen, with the first character a letter, the last a letter or a number, and
|
---|
| 45 | * a 63 character maximum.
|
---|
| 46 | * @return Operation
|
---|
| 47 | * @throws \Google\Service\Exception
|
---|
| 48 | */
|
---|
| 49 | public function create($parent, Volume $postBody, $optParams = [])
|
---|
| 50 | {
|
---|
| 51 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 52 | $params = array_merge($params, $optParams);
|
---|
| 53 | return $this->call('create', [$params], Operation::class);
|
---|
| 54 | }
|
---|
| 55 | /**
|
---|
| 56 | * Deletes a single Volume. (volumes.delete)
|
---|
| 57 | *
|
---|
| 58 | * @param string $name Required. Name of the volume
|
---|
| 59 | * @param array $optParams Optional parameters.
|
---|
| 60 | *
|
---|
| 61 | * @opt_param bool force If this field is set as true, CCFE will not block the
|
---|
| 62 | * volume resource deletion even if it has any snapshots resource. (Otherwise,
|
---|
| 63 | * the request will only work if the volume has no snapshots.)
|
---|
| 64 | * @return Operation
|
---|
| 65 | * @throws \Google\Service\Exception
|
---|
| 66 | */
|
---|
| 67 | public function delete($name, $optParams = [])
|
---|
| 68 | {
|
---|
| 69 | $params = ['name' => $name];
|
---|
| 70 | $params = array_merge($params, $optParams);
|
---|
| 71 | return $this->call('delete', [$params], Operation::class);
|
---|
| 72 | }
|
---|
| 73 | /**
|
---|
| 74 | * Gets details of a single Volume. (volumes.get)
|
---|
| 75 | *
|
---|
| 76 | * @param string $name Required. Name of the volume
|
---|
| 77 | * @param array $optParams Optional parameters.
|
---|
| 78 | * @return Volume
|
---|
| 79 | * @throws \Google\Service\Exception
|
---|
| 80 | */
|
---|
| 81 | public function get($name, $optParams = [])
|
---|
| 82 | {
|
---|
| 83 | $params = ['name' => $name];
|
---|
| 84 | $params = array_merge($params, $optParams);
|
---|
| 85 | return $this->call('get', [$params], Volume::class);
|
---|
| 86 | }
|
---|
| 87 | /**
|
---|
| 88 | * Lists Volumes in a given project. (volumes.listProjectsLocationsVolumes)
|
---|
| 89 | *
|
---|
| 90 | * @param string $parent Required. Parent value for ListVolumesRequest
|
---|
| 91 | * @param array $optParams Optional parameters.
|
---|
| 92 | *
|
---|
| 93 | * @opt_param string filter Filtering results
|
---|
| 94 | * @opt_param string orderBy Hint for how to order the results
|
---|
| 95 | * @opt_param int pageSize Requested page size. Server may return fewer items
|
---|
| 96 | * than requested. If unspecified, the server will pick an appropriate default.
|
---|
| 97 | * @opt_param string pageToken A token identifying a page of results the server
|
---|
| 98 | * should return.
|
---|
| 99 | * @return ListVolumesResponse
|
---|
| 100 | * @throws \Google\Service\Exception
|
---|
| 101 | */
|
---|
| 102 | public function listProjectsLocationsVolumes($parent, $optParams = [])
|
---|
| 103 | {
|
---|
| 104 | $params = ['parent' => $parent];
|
---|
| 105 | $params = array_merge($params, $optParams);
|
---|
| 106 | return $this->call('list', [$params], ListVolumesResponse::class);
|
---|
| 107 | }
|
---|
| 108 | /**
|
---|
| 109 | * Updates the parameters of a single Volume. (volumes.patch)
|
---|
| 110 | *
|
---|
| 111 | * @param string $name Identifier. Name of the volume
|
---|
| 112 | * @param Volume $postBody
|
---|
| 113 | * @param array $optParams Optional parameters.
|
---|
| 114 | *
|
---|
| 115 | * @opt_param string updateMask Required. Field mask is used to specify the
|
---|
| 116 | * fields to be overwritten in the Volume resource by the update. The fields
|
---|
| 117 | * specified in the update_mask are relative to the resource, not the full
|
---|
| 118 | * request. A field will be overwritten if it is in the mask. If the user does
|
---|
| 119 | * not provide a mask then all fields will be overwritten.
|
---|
| 120 | * @return Operation
|
---|
| 121 | * @throws \Google\Service\Exception
|
---|
| 122 | */
|
---|
| 123 | public function patch($name, Volume $postBody, $optParams = [])
|
---|
| 124 | {
|
---|
| 125 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 126 | $params = array_merge($params, $optParams);
|
---|
| 127 | return $this->call('patch', [$params], Operation::class);
|
---|
| 128 | }
|
---|
| 129 | /**
|
---|
| 130 | * Revert an existing volume to a specified snapshot. Warning! This operation
|
---|
| 131 | * will permanently revert all changes made after the snapshot was created.
|
---|
| 132 | * (volumes.revert)
|
---|
| 133 | *
|
---|
| 134 | * @param string $name Required. The resource name of the volume, in the format
|
---|
| 135 | * of projects/{project_id}/locations/{location}/volumes/{volume_id}.
|
---|
| 136 | * @param RevertVolumeRequest $postBody
|
---|
| 137 | * @param array $optParams Optional parameters.
|
---|
| 138 | * @return Operation
|
---|
| 139 | * @throws \Google\Service\Exception
|
---|
| 140 | */
|
---|
| 141 | public function revert($name, RevertVolumeRequest $postBody, $optParams = [])
|
---|
| 142 | {
|
---|
| 143 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 144 | $params = array_merge($params, $optParams);
|
---|
| 145 | return $this->call('revert', [$params], Operation::class);
|
---|
| 146 | }
|
---|
| 147 | }
|
---|
| 148 |
|
---|
| 149 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 150 | class_alias(ProjectsLocationsVolumes::class, 'Google_Service_NetAppFiles_Resource_ProjectsLocationsVolumes');
|
---|