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\ListStoragePoolsResponse;
|
---|
21 | use Google\Service\NetAppFiles\Operation;
|
---|
22 | use Google\Service\NetAppFiles\StoragePool;
|
---|
23 | use Google\Service\NetAppFiles\SwitchActiveReplicaZoneRequest;
|
---|
24 |
|
---|
25 | /**
|
---|
26 | * The "storagePools" collection of methods.
|
---|
27 | * Typical usage is:
|
---|
28 | * <code>
|
---|
29 | * $netappService = new Google\Service\NetAppFiles(...);
|
---|
30 | * $storagePools = $netappService->projects_locations_storagePools;
|
---|
31 | * </code>
|
---|
32 | */
|
---|
33 | class ProjectsLocationsStoragePools extends \Google\Service\Resource
|
---|
34 | {
|
---|
35 | /**
|
---|
36 | * Creates a new storage pool. (storagePools.create)
|
---|
37 | *
|
---|
38 | * @param string $parent Required. Value for parent.
|
---|
39 | * @param StoragePool $postBody
|
---|
40 | * @param array $optParams Optional parameters.
|
---|
41 | *
|
---|
42 | * @opt_param string storagePoolId Required. Id of the requesting storage pool.
|
---|
43 | * Must be unique within the parent resource. Must contain only letters, numbers
|
---|
44 | * and hyphen, with the first character a letter, the last a letter or a number,
|
---|
45 | * and a 63 character maximum.
|
---|
46 | * @return Operation
|
---|
47 | * @throws \Google\Service\Exception
|
---|
48 | */
|
---|
49 | public function create($parent, StoragePool $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 | * Warning! This operation will permanently delete the storage pool.
|
---|
57 | * (storagePools.delete)
|
---|
58 | *
|
---|
59 | * @param string $name Required. Name of the storage pool
|
---|
60 | * @param array $optParams Optional parameters.
|
---|
61 | * @return Operation
|
---|
62 | * @throws \Google\Service\Exception
|
---|
63 | */
|
---|
64 | public function delete($name, $optParams = [])
|
---|
65 | {
|
---|
66 | $params = ['name' => $name];
|
---|
67 | $params = array_merge($params, $optParams);
|
---|
68 | return $this->call('delete', [$params], Operation::class);
|
---|
69 | }
|
---|
70 | /**
|
---|
71 | * Returns the description of the specified storage pool by poolId.
|
---|
72 | * (storagePools.get)
|
---|
73 | *
|
---|
74 | * @param string $name Required. Name of the storage pool
|
---|
75 | * @param array $optParams Optional parameters.
|
---|
76 | * @return StoragePool
|
---|
77 | * @throws \Google\Service\Exception
|
---|
78 | */
|
---|
79 | public function get($name, $optParams = [])
|
---|
80 | {
|
---|
81 | $params = ['name' => $name];
|
---|
82 | $params = array_merge($params, $optParams);
|
---|
83 | return $this->call('get', [$params], StoragePool::class);
|
---|
84 | }
|
---|
85 | /**
|
---|
86 | * Returns descriptions of all storage pools owned by the caller.
|
---|
87 | * (storagePools.listProjectsLocationsStoragePools)
|
---|
88 | *
|
---|
89 | * @param string $parent Required. Parent value
|
---|
90 | * @param array $optParams Optional parameters.
|
---|
91 | *
|
---|
92 | * @opt_param string filter Optional. List filter.
|
---|
93 | * @opt_param string orderBy Optional. Sort results. Supported values are
|
---|
94 | * "name", "name desc" or "" (unsorted).
|
---|
95 | * @opt_param int pageSize Optional. The maximum number of items to return.
|
---|
96 | * @opt_param string pageToken Optional. The next_page_token value to use if
|
---|
97 | * there are additional results to retrieve for this list request.
|
---|
98 | * @return ListStoragePoolsResponse
|
---|
99 | * @throws \Google\Service\Exception
|
---|
100 | */
|
---|
101 | public function listProjectsLocationsStoragePools($parent, $optParams = [])
|
---|
102 | {
|
---|
103 | $params = ['parent' => $parent];
|
---|
104 | $params = array_merge($params, $optParams);
|
---|
105 | return $this->call('list', [$params], ListStoragePoolsResponse::class);
|
---|
106 | }
|
---|
107 | /**
|
---|
108 | * Updates the storage pool properties with the full spec (storagePools.patch)
|
---|
109 | *
|
---|
110 | * @param string $name Identifier. Name of the storage pool
|
---|
111 | * @param StoragePool $postBody
|
---|
112 | * @param array $optParams Optional parameters.
|
---|
113 | *
|
---|
114 | * @opt_param string updateMask Required. Field mask is used to specify the
|
---|
115 | * fields to be overwritten in the StoragePool resource by the update. The
|
---|
116 | * fields specified in the update_mask are relative to the resource, not the
|
---|
117 | * full request. A field will be overwritten if it is in the mask. If the user
|
---|
118 | * does not provide a mask then all fields will be overwritten.
|
---|
119 | * @return Operation
|
---|
120 | * @throws \Google\Service\Exception
|
---|
121 | */
|
---|
122 | public function patch($name, StoragePool $postBody, $optParams = [])
|
---|
123 | {
|
---|
124 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
125 | $params = array_merge($params, $optParams);
|
---|
126 | return $this->call('patch', [$params], Operation::class);
|
---|
127 | }
|
---|
128 | /**
|
---|
129 | * This operation will switch the active/replica zone for a regional
|
---|
130 | * storagePool. (storagePools.switchProjectsLocationsStoragePools)
|
---|
131 | *
|
---|
132 | * @param string $name Required. Name of the storage pool
|
---|
133 | * @param SwitchActiveReplicaZoneRequest $postBody
|
---|
134 | * @param array $optParams Optional parameters.
|
---|
135 | * @return Operation
|
---|
136 | * @throws \Google\Service\Exception
|
---|
137 | */
|
---|
138 | public function switchProjectsLocationsStoragePools($name, SwitchActiveReplicaZoneRequest $postBody, $optParams = [])
|
---|
139 | {
|
---|
140 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
141 | $params = array_merge($params, $optParams);
|
---|
142 | return $this->call('switch', [$params], Operation::class);
|
---|
143 | }
|
---|
144 | }
|
---|
145 |
|
---|
146 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
147 | class_alias(ProjectsLocationsStoragePools::class, 'Google_Service_NetAppFiles_Resource_ProjectsLocationsStoragePools');
|
---|