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\Compute\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Compute\BulkInsertDiskResource;
|
---|
21 | use Google\Service\Compute\Disk;
|
---|
22 | use Google\Service\Compute\DiskAggregatedList;
|
---|
23 | use Google\Service\Compute\DiskList;
|
---|
24 | use Google\Service\Compute\DisksAddResourcePoliciesRequest;
|
---|
25 | use Google\Service\Compute\DisksRemoveResourcePoliciesRequest;
|
---|
26 | use Google\Service\Compute\DisksResizeRequest;
|
---|
27 | use Google\Service\Compute\DisksStartAsyncReplicationRequest;
|
---|
28 | use Google\Service\Compute\DisksStopGroupAsyncReplicationResource;
|
---|
29 | use Google\Service\Compute\Operation;
|
---|
30 | use Google\Service\Compute\Policy;
|
---|
31 | use Google\Service\Compute\Snapshot;
|
---|
32 | use Google\Service\Compute\TestPermissionsRequest;
|
---|
33 | use Google\Service\Compute\TestPermissionsResponse;
|
---|
34 | use Google\Service\Compute\ZoneSetLabelsRequest;
|
---|
35 | use Google\Service\Compute\ZoneSetPolicyRequest;
|
---|
36 |
|
---|
37 | /**
|
---|
38 | * The "disks" collection of methods.
|
---|
39 | * Typical usage is:
|
---|
40 | * <code>
|
---|
41 | * $computeService = new Google\Service\Compute(...);
|
---|
42 | * $disks = $computeService->disks;
|
---|
43 | * </code>
|
---|
44 | */
|
---|
45 | class Disks extends \Google\Service\Resource
|
---|
46 | {
|
---|
47 | /**
|
---|
48 | * Adds existing resource policies to a disk. You can only add one policy which
|
---|
49 | * will be applied to this disk for scheduling snapshot creation.
|
---|
50 | * (disks.addResourcePolicies)
|
---|
51 | *
|
---|
52 | * @param string $project Project ID for this request.
|
---|
53 | * @param string $zone The name of the zone for this request.
|
---|
54 | * @param string $disk The disk name for this request.
|
---|
55 | * @param DisksAddResourcePoliciesRequest $postBody
|
---|
56 | * @param array $optParams Optional parameters.
|
---|
57 | *
|
---|
58 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
59 | * Specify a unique request ID so that if you must retry your request, the
|
---|
60 | * server will know to ignore the request if it has already been completed. For
|
---|
61 | * example, consider a situation where you make an initial request and the
|
---|
62 | * request times out. If you make the request again with the same request ID,
|
---|
63 | * the server can check if original operation with the same request ID was
|
---|
64 | * received, and if so, will ignore the second request. This prevents clients
|
---|
65 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
66 | * valid UUID with the exception that zero UUID is not supported (
|
---|
67 | * 00000000-0000-0000-0000-000000000000).
|
---|
68 | * @return Operation
|
---|
69 | * @throws \Google\Service\Exception
|
---|
70 | */
|
---|
71 | public function addResourcePolicies($project, $zone, $disk, DisksAddResourcePoliciesRequest $postBody, $optParams = [])
|
---|
72 | {
|
---|
73 | $params = ['project' => $project, 'zone' => $zone, 'disk' => $disk, 'postBody' => $postBody];
|
---|
74 | $params = array_merge($params, $optParams);
|
---|
75 | return $this->call('addResourcePolicies', [$params], Operation::class);
|
---|
76 | }
|
---|
77 | /**
|
---|
78 | * Retrieves an aggregated list of persistent disks. To prevent failure, Google
|
---|
79 | * recommends that you set the `returnPartialSuccess` parameter to `true`.
|
---|
80 | * (disks.aggregatedList)
|
---|
81 | *
|
---|
82 | * @param string $project Project ID for this request.
|
---|
83 | * @param array $optParams Optional parameters.
|
---|
84 | *
|
---|
85 | * @opt_param string filter A filter expression that filters resources listed in
|
---|
86 | * the response. Most Compute resources support two types of filter expressions:
|
---|
87 | * expressions that support regular expressions and expressions that follow API
|
---|
88 | * improvement proposal AIP-160. These two types of filter expressions cannot be
|
---|
89 | * mixed in one request. If you want to use AIP-160, your expression must
|
---|
90 | * specify the field name, an operator, and the value that you want to use for
|
---|
91 | * filtering. The value must be a string, a number, or a boolean. The operator
|
---|
92 | * must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you
|
---|
93 | * are filtering Compute Engine instances, you can exclude instances named
|
---|
94 | * `example-instance` by specifying `name != example-instance`. The `:*`
|
---|
95 | * comparison can be used to test whether a key has been defined. For example,
|
---|
96 | * to find all objects with `owner` label use: ``` labels.owner:* ``` You can
|
---|
97 | * also filter nested fields. For example, you could specify
|
---|
98 | * `scheduling.automaticRestart = false` to include instances only if they are
|
---|
99 | * not scheduled for automatic restarts. You can use filtering on nested fields
|
---|
100 | * to filter based on resource labels. To filter on multiple expressions,
|
---|
101 | * provide each separate expression within parentheses. For example: ```
|
---|
102 | * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By
|
---|
103 | * default, each expression is an `AND` expression. However, you can include
|
---|
104 | * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel
|
---|
105 | * Skylake") OR (cpuPlatform = "Intel Broadwell") AND
|
---|
106 | * (scheduling.automaticRestart = true) ``` If you want to use a regular
|
---|
107 | * expression, use the `eq` (equal) or `ne` (not equal) operator against a
|
---|
108 | * single un-parenthesized expression with or without quotes or against multiple
|
---|
109 | * parenthesized expressions. Examples: `fieldname eq unquoted literal`
|
---|
110 | * `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"`
|
---|
111 | * `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is
|
---|
112 | * interpreted as a regular expression using Google RE2 library syntax. The
|
---|
113 | * literal value must match the entire field. For example, to filter for
|
---|
114 | * instances that do not end with name "instance", you would use `name ne
|
---|
115 | * .*instance`. You cannot combine constraints on multiple fields using regular
|
---|
116 | * expressions.
|
---|
117 | * @opt_param bool includeAllScopes Indicates whether every visible scope for
|
---|
118 | * each scope type (zone, region, global) should be included in the response.
|
---|
119 | * For new resource types added after this field, the flag has no effect as new
|
---|
120 | * resource types will always include every visible scope for each scope type in
|
---|
121 | * response. For resource types which predate this field, if this flag is
|
---|
122 | * omitted or false, only scopes of the scope types where the resource type is
|
---|
123 | * expected to be found will be included.
|
---|
124 | * @opt_param string maxResults The maximum number of results per page that
|
---|
125 | * should be returned. If the number of available results is larger than
|
---|
126 | * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to
|
---|
127 | * get the next page of results in subsequent list requests. Acceptable values
|
---|
128 | * are `0` to `500`, inclusive. (Default: `500`)
|
---|
129 | * @opt_param string orderBy Sorts list results by a certain order. By default,
|
---|
130 | * results are returned in alphanumerical order based on the resource name. You
|
---|
131 | * can also sort results in descending order based on the creation timestamp
|
---|
132 | * using `orderBy="creationTimestamp desc"`. This sorts results based on the
|
---|
133 | * `creationTimestamp` field in reverse chronological order (newest result
|
---|
134 | * first). Use this to sort resources like operations so that the newest
|
---|
135 | * operation is returned first. Currently, only sorting by `name` or
|
---|
136 | * `creationTimestamp desc` is supported.
|
---|
137 | * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to
|
---|
138 | * the `nextPageToken` returned by a previous list request to get the next page
|
---|
139 | * of results.
|
---|
140 | * @opt_param bool returnPartialSuccess Opt-in for partial success behavior
|
---|
141 | * which provides partial results in case of failure. The default value is
|
---|
142 | * false. For example, when partial success behavior is enabled, aggregatedList
|
---|
143 | * for a single zone scope either returns all resources in the zone or no
|
---|
144 | * resources, with an error code.
|
---|
145 | * @opt_param string serviceProjectNumber The Shared VPC service project id or
|
---|
146 | * service project number for which aggregated list request is invoked for
|
---|
147 | * subnetworks list-usable api.
|
---|
148 | * @return DiskAggregatedList
|
---|
149 | * @throws \Google\Service\Exception
|
---|
150 | */
|
---|
151 | public function aggregatedList($project, $optParams = [])
|
---|
152 | {
|
---|
153 | $params = ['project' => $project];
|
---|
154 | $params = array_merge($params, $optParams);
|
---|
155 | return $this->call('aggregatedList', [$params], DiskAggregatedList::class);
|
---|
156 | }
|
---|
157 | /**
|
---|
158 | * Bulk create a set of disks. (disks.bulkInsert)
|
---|
159 | *
|
---|
160 | * @param string $project Project ID for this request.
|
---|
161 | * @param string $zone The name of the zone for this request.
|
---|
162 | * @param BulkInsertDiskResource $postBody
|
---|
163 | * @param array $optParams Optional parameters.
|
---|
164 | *
|
---|
165 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
166 | * Specify a unique request ID so that if you must retry your request, the
|
---|
167 | * server will know to ignore the request if it has already been completed. For
|
---|
168 | * example, consider a situation where you make an initial request and the
|
---|
169 | * request times out. If you make the request again with the same request ID,
|
---|
170 | * the server can check if original operation with the same request ID was
|
---|
171 | * received, and if so, will ignore the second request. This prevents clients
|
---|
172 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
173 | * valid UUID with the exception that zero UUID is not supported (
|
---|
174 | * 00000000-0000-0000-0000-000000000000).
|
---|
175 | * @return Operation
|
---|
176 | * @throws \Google\Service\Exception
|
---|
177 | */
|
---|
178 | public function bulkInsert($project, $zone, BulkInsertDiskResource $postBody, $optParams = [])
|
---|
179 | {
|
---|
180 | $params = ['project' => $project, 'zone' => $zone, 'postBody' => $postBody];
|
---|
181 | $params = array_merge($params, $optParams);
|
---|
182 | return $this->call('bulkInsert', [$params], Operation::class);
|
---|
183 | }
|
---|
184 | /**
|
---|
185 | * Creates a snapshot of a specified persistent disk. For regular snapshot
|
---|
186 | * creation, consider using snapshots.insert instead, as that method supports
|
---|
187 | * more features, such as creating snapshots in a project different from the
|
---|
188 | * source disk project. (disks.createSnapshot)
|
---|
189 | *
|
---|
190 | * @param string $project Project ID for this request.
|
---|
191 | * @param string $zone The name of the zone for this request.
|
---|
192 | * @param string $disk Name of the persistent disk to snapshot.
|
---|
193 | * @param Snapshot $postBody
|
---|
194 | * @param array $optParams Optional parameters.
|
---|
195 | *
|
---|
196 | * @opt_param bool guestFlush [Input Only] Whether to attempt an application
|
---|
197 | * consistent snapshot by informing the OS to prepare for the snapshot process.
|
---|
198 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
199 | * Specify a unique request ID so that if you must retry your request, the
|
---|
200 | * server will know to ignore the request if it has already been completed. For
|
---|
201 | * example, consider a situation where you make an initial request and the
|
---|
202 | * request times out. If you make the request again with the same request ID,
|
---|
203 | * the server can check if original operation with the same request ID was
|
---|
204 | * received, and if so, will ignore the second request. This prevents clients
|
---|
205 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
206 | * valid UUID with the exception that zero UUID is not supported (
|
---|
207 | * 00000000-0000-0000-0000-000000000000).
|
---|
208 | * @return Operation
|
---|
209 | * @throws \Google\Service\Exception
|
---|
210 | */
|
---|
211 | public function createSnapshot($project, $zone, $disk, Snapshot $postBody, $optParams = [])
|
---|
212 | {
|
---|
213 | $params = ['project' => $project, 'zone' => $zone, 'disk' => $disk, 'postBody' => $postBody];
|
---|
214 | $params = array_merge($params, $optParams);
|
---|
215 | return $this->call('createSnapshot', [$params], Operation::class);
|
---|
216 | }
|
---|
217 | /**
|
---|
218 | * Deletes the specified persistent disk. Deleting a disk removes its data
|
---|
219 | * permanently and is irreversible. However, deleting a disk does not delete any
|
---|
220 | * snapshots previously made from the disk. You must separately delete
|
---|
221 | * snapshots. (disks.delete)
|
---|
222 | *
|
---|
223 | * @param string $project Project ID for this request.
|
---|
224 | * @param string $zone The name of the zone for this request.
|
---|
225 | * @param string $disk Name of the persistent disk to delete.
|
---|
226 | * @param array $optParams Optional parameters.
|
---|
227 | *
|
---|
228 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
229 | * Specify a unique request ID so that if you must retry your request, the
|
---|
230 | * server will know to ignore the request if it has already been completed. For
|
---|
231 | * example, consider a situation where you make an initial request and the
|
---|
232 | * request times out. If you make the request again with the same request ID,
|
---|
233 | * the server can check if original operation with the same request ID was
|
---|
234 | * received, and if so, will ignore the second request. This prevents clients
|
---|
235 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
236 | * valid UUID with the exception that zero UUID is not supported (
|
---|
237 | * 00000000-0000-0000-0000-000000000000).
|
---|
238 | * @return Operation
|
---|
239 | * @throws \Google\Service\Exception
|
---|
240 | */
|
---|
241 | public function delete($project, $zone, $disk, $optParams = [])
|
---|
242 | {
|
---|
243 | $params = ['project' => $project, 'zone' => $zone, 'disk' => $disk];
|
---|
244 | $params = array_merge($params, $optParams);
|
---|
245 | return $this->call('delete', [$params], Operation::class);
|
---|
246 | }
|
---|
247 | /**
|
---|
248 | * Returns the specified persistent disk. (disks.get)
|
---|
249 | *
|
---|
250 | * @param string $project Project ID for this request.
|
---|
251 | * @param string $zone The name of the zone for this request.
|
---|
252 | * @param string $disk Name of the persistent disk to return.
|
---|
253 | * @param array $optParams Optional parameters.
|
---|
254 | * @return Disk
|
---|
255 | * @throws \Google\Service\Exception
|
---|
256 | */
|
---|
257 | public function get($project, $zone, $disk, $optParams = [])
|
---|
258 | {
|
---|
259 | $params = ['project' => $project, 'zone' => $zone, 'disk' => $disk];
|
---|
260 | $params = array_merge($params, $optParams);
|
---|
261 | return $this->call('get', [$params], Disk::class);
|
---|
262 | }
|
---|
263 | /**
|
---|
264 | * Gets the access control policy for a resource. May be empty if no such policy
|
---|
265 | * or resource exists. (disks.getIamPolicy)
|
---|
266 | *
|
---|
267 | * @param string $project Project ID for this request.
|
---|
268 | * @param string $zone The name of the zone for this request.
|
---|
269 | * @param string $resource Name or id of the resource for this request.
|
---|
270 | * @param array $optParams Optional parameters.
|
---|
271 | *
|
---|
272 | * @opt_param int optionsRequestedPolicyVersion Requested IAM Policy version.
|
---|
273 | * @return Policy
|
---|
274 | * @throws \Google\Service\Exception
|
---|
275 | */
|
---|
276 | public function getIamPolicy($project, $zone, $resource, $optParams = [])
|
---|
277 | {
|
---|
278 | $params = ['project' => $project, 'zone' => $zone, 'resource' => $resource];
|
---|
279 | $params = array_merge($params, $optParams);
|
---|
280 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
281 | }
|
---|
282 | /**
|
---|
283 | * Creates a persistent disk in the specified project using the data in the
|
---|
284 | * request. You can create a disk from a source (sourceImage, sourceSnapshot, or
|
---|
285 | * sourceDisk) or create an empty 500 GB data disk by omitting all properties.
|
---|
286 | * You can also create a disk that is larger than the default size by specifying
|
---|
287 | * the sizeGb property. (disks.insert)
|
---|
288 | *
|
---|
289 | * @param string $project Project ID for this request.
|
---|
290 | * @param string $zone The name of the zone for this request.
|
---|
291 | * @param Disk $postBody
|
---|
292 | * @param array $optParams Optional parameters.
|
---|
293 | *
|
---|
294 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
295 | * Specify a unique request ID so that if you must retry your request, the
|
---|
296 | * server will know to ignore the request if it has already been completed. For
|
---|
297 | * example, consider a situation where you make an initial request and the
|
---|
298 | * request times out. If you make the request again with the same request ID,
|
---|
299 | * the server can check if original operation with the same request ID was
|
---|
300 | * received, and if so, will ignore the second request. This prevents clients
|
---|
301 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
302 | * valid UUID with the exception that zero UUID is not supported (
|
---|
303 | * 00000000-0000-0000-0000-000000000000).
|
---|
304 | * @opt_param string sourceImage Source image to restore onto a disk. This field
|
---|
305 | * is optional.
|
---|
306 | * @return Operation
|
---|
307 | * @throws \Google\Service\Exception
|
---|
308 | */
|
---|
309 | public function insert($project, $zone, Disk $postBody, $optParams = [])
|
---|
310 | {
|
---|
311 | $params = ['project' => $project, 'zone' => $zone, 'postBody' => $postBody];
|
---|
312 | $params = array_merge($params, $optParams);
|
---|
313 | return $this->call('insert', [$params], Operation::class);
|
---|
314 | }
|
---|
315 | /**
|
---|
316 | * Retrieves a list of persistent disks contained within the specified zone.
|
---|
317 | * (disks.listDisks)
|
---|
318 | *
|
---|
319 | * @param string $project Project ID for this request.
|
---|
320 | * @param string $zone The name of the zone for this request.
|
---|
321 | * @param array $optParams Optional parameters.
|
---|
322 | *
|
---|
323 | * @opt_param string filter A filter expression that filters resources listed in
|
---|
324 | * the response. Most Compute resources support two types of filter expressions:
|
---|
325 | * expressions that support regular expressions and expressions that follow API
|
---|
326 | * improvement proposal AIP-160. These two types of filter expressions cannot be
|
---|
327 | * mixed in one request. If you want to use AIP-160, your expression must
|
---|
328 | * specify the field name, an operator, and the value that you want to use for
|
---|
329 | * filtering. The value must be a string, a number, or a boolean. The operator
|
---|
330 | * must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you
|
---|
331 | * are filtering Compute Engine instances, you can exclude instances named
|
---|
332 | * `example-instance` by specifying `name != example-instance`. The `:*`
|
---|
333 | * comparison can be used to test whether a key has been defined. For example,
|
---|
334 | * to find all objects with `owner` label use: ``` labels.owner:* ``` You can
|
---|
335 | * also filter nested fields. For example, you could specify
|
---|
336 | * `scheduling.automaticRestart = false` to include instances only if they are
|
---|
337 | * not scheduled for automatic restarts. You can use filtering on nested fields
|
---|
338 | * to filter based on resource labels. To filter on multiple expressions,
|
---|
339 | * provide each separate expression within parentheses. For example: ```
|
---|
340 | * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By
|
---|
341 | * default, each expression is an `AND` expression. However, you can include
|
---|
342 | * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel
|
---|
343 | * Skylake") OR (cpuPlatform = "Intel Broadwell") AND
|
---|
344 | * (scheduling.automaticRestart = true) ``` If you want to use a regular
|
---|
345 | * expression, use the `eq` (equal) or `ne` (not equal) operator against a
|
---|
346 | * single un-parenthesized expression with or without quotes or against multiple
|
---|
347 | * parenthesized expressions. Examples: `fieldname eq unquoted literal`
|
---|
348 | * `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"`
|
---|
349 | * `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is
|
---|
350 | * interpreted as a regular expression using Google RE2 library syntax. The
|
---|
351 | * literal value must match the entire field. For example, to filter for
|
---|
352 | * instances that do not end with name "instance", you would use `name ne
|
---|
353 | * .*instance`. You cannot combine constraints on multiple fields using regular
|
---|
354 | * expressions.
|
---|
355 | * @opt_param string maxResults The maximum number of results per page that
|
---|
356 | * should be returned. If the number of available results is larger than
|
---|
357 | * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to
|
---|
358 | * get the next page of results in subsequent list requests. Acceptable values
|
---|
359 | * are `0` to `500`, inclusive. (Default: `500`)
|
---|
360 | * @opt_param string orderBy Sorts list results by a certain order. By default,
|
---|
361 | * results are returned in alphanumerical order based on the resource name. You
|
---|
362 | * can also sort results in descending order based on the creation timestamp
|
---|
363 | * using `orderBy="creationTimestamp desc"`. This sorts results based on the
|
---|
364 | * `creationTimestamp` field in reverse chronological order (newest result
|
---|
365 | * first). Use this to sort resources like operations so that the newest
|
---|
366 | * operation is returned first. Currently, only sorting by `name` or
|
---|
367 | * `creationTimestamp desc` is supported.
|
---|
368 | * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to
|
---|
369 | * the `nextPageToken` returned by a previous list request to get the next page
|
---|
370 | * of results.
|
---|
371 | * @opt_param bool returnPartialSuccess Opt-in for partial success behavior
|
---|
372 | * which provides partial results in case of failure. The default value is
|
---|
373 | * false. For example, when partial success behavior is enabled, aggregatedList
|
---|
374 | * for a single zone scope either returns all resources in the zone or no
|
---|
375 | * resources, with an error code.
|
---|
376 | * @return DiskList
|
---|
377 | * @throws \Google\Service\Exception
|
---|
378 | */
|
---|
379 | public function listDisks($project, $zone, $optParams = [])
|
---|
380 | {
|
---|
381 | $params = ['project' => $project, 'zone' => $zone];
|
---|
382 | $params = array_merge($params, $optParams);
|
---|
383 | return $this->call('list', [$params], DiskList::class);
|
---|
384 | }
|
---|
385 | /**
|
---|
386 | * Removes resource policies from a disk. (disks.removeResourcePolicies)
|
---|
387 | *
|
---|
388 | * @param string $project Project ID for this request.
|
---|
389 | * @param string $zone The name of the zone for this request.
|
---|
390 | * @param string $disk The disk name for this request.
|
---|
391 | * @param DisksRemoveResourcePoliciesRequest $postBody
|
---|
392 | * @param array $optParams Optional parameters.
|
---|
393 | *
|
---|
394 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
395 | * Specify a unique request ID so that if you must retry your request, the
|
---|
396 | * server will know to ignore the request if it has already been completed. For
|
---|
397 | * example, consider a situation where you make an initial request and the
|
---|
398 | * request times out. If you make the request again with the same request ID,
|
---|
399 | * the server can check if original operation with the same request ID was
|
---|
400 | * received, and if so, will ignore the second request. This prevents clients
|
---|
401 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
402 | * valid UUID with the exception that zero UUID is not supported (
|
---|
403 | * 00000000-0000-0000-0000-000000000000).
|
---|
404 | * @return Operation
|
---|
405 | * @throws \Google\Service\Exception
|
---|
406 | */
|
---|
407 | public function removeResourcePolicies($project, $zone, $disk, DisksRemoveResourcePoliciesRequest $postBody, $optParams = [])
|
---|
408 | {
|
---|
409 | $params = ['project' => $project, 'zone' => $zone, 'disk' => $disk, 'postBody' => $postBody];
|
---|
410 | $params = array_merge($params, $optParams);
|
---|
411 | return $this->call('removeResourcePolicies', [$params], Operation::class);
|
---|
412 | }
|
---|
413 | /**
|
---|
414 | * Resizes the specified persistent disk. You can only increase the size of the
|
---|
415 | * disk. (disks.resize)
|
---|
416 | *
|
---|
417 | * @param string $project Project ID for this request.
|
---|
418 | * @param string $zone The name of the zone for this request.
|
---|
419 | * @param string $disk The name of the persistent disk.
|
---|
420 | * @param DisksResizeRequest $postBody
|
---|
421 | * @param array $optParams Optional parameters.
|
---|
422 | *
|
---|
423 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
424 | * Specify a unique request ID so that if you must retry your request, the
|
---|
425 | * server will know to ignore the request if it has already been completed. For
|
---|
426 | * example, consider a situation where you make an initial request and the
|
---|
427 | * request times out. If you make the request again with the same request ID,
|
---|
428 | * the server can check if original operation with the same request ID was
|
---|
429 | * received, and if so, will ignore the second request. This prevents clients
|
---|
430 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
431 | * valid UUID with the exception that zero UUID is not supported (
|
---|
432 | * 00000000-0000-0000-0000-000000000000).
|
---|
433 | * @return Operation
|
---|
434 | * @throws \Google\Service\Exception
|
---|
435 | */
|
---|
436 | public function resize($project, $zone, $disk, DisksResizeRequest $postBody, $optParams = [])
|
---|
437 | {
|
---|
438 | $params = ['project' => $project, 'zone' => $zone, 'disk' => $disk, 'postBody' => $postBody];
|
---|
439 | $params = array_merge($params, $optParams);
|
---|
440 | return $this->call('resize', [$params], Operation::class);
|
---|
441 | }
|
---|
442 | /**
|
---|
443 | * Sets the access control policy on the specified resource. Replaces any
|
---|
444 | * existing policy. (disks.setIamPolicy)
|
---|
445 | *
|
---|
446 | * @param string $project Project ID for this request.
|
---|
447 | * @param string $zone The name of the zone for this request.
|
---|
448 | * @param string $resource Name or id of the resource for this request.
|
---|
449 | * @param ZoneSetPolicyRequest $postBody
|
---|
450 | * @param array $optParams Optional parameters.
|
---|
451 | * @return Policy
|
---|
452 | * @throws \Google\Service\Exception
|
---|
453 | */
|
---|
454 | public function setIamPolicy($project, $zone, $resource, ZoneSetPolicyRequest $postBody, $optParams = [])
|
---|
455 | {
|
---|
456 | $params = ['project' => $project, 'zone' => $zone, 'resource' => $resource, 'postBody' => $postBody];
|
---|
457 | $params = array_merge($params, $optParams);
|
---|
458 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
459 | }
|
---|
460 | /**
|
---|
461 | * Sets the labels on a disk. To learn more about labels, read the Labeling
|
---|
462 | * Resources documentation. (disks.setLabels)
|
---|
463 | *
|
---|
464 | * @param string $project Project ID for this request.
|
---|
465 | * @param string $zone The name of the zone for this request.
|
---|
466 | * @param string $resource Name or id of the resource for this request.
|
---|
467 | * @param ZoneSetLabelsRequest $postBody
|
---|
468 | * @param array $optParams Optional parameters.
|
---|
469 | *
|
---|
470 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
471 | * Specify a unique request ID so that if you must retry your request, the
|
---|
472 | * server will know to ignore the request if it has already been completed. For
|
---|
473 | * example, consider a situation where you make an initial request and the
|
---|
474 | * request times out. If you make the request again with the same request ID,
|
---|
475 | * the server can check if original operation with the same request ID was
|
---|
476 | * received, and if so, will ignore the second request. This prevents clients
|
---|
477 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
478 | * valid UUID with the exception that zero UUID is not supported (
|
---|
479 | * 00000000-0000-0000-0000-000000000000).
|
---|
480 | * @return Operation
|
---|
481 | * @throws \Google\Service\Exception
|
---|
482 | */
|
---|
483 | public function setLabels($project, $zone, $resource, ZoneSetLabelsRequest $postBody, $optParams = [])
|
---|
484 | {
|
---|
485 | $params = ['project' => $project, 'zone' => $zone, 'resource' => $resource, 'postBody' => $postBody];
|
---|
486 | $params = array_merge($params, $optParams);
|
---|
487 | return $this->call('setLabels', [$params], Operation::class);
|
---|
488 | }
|
---|
489 | /**
|
---|
490 | * Starts asynchronous replication. Must be invoked on the primary disk.
|
---|
491 | * (disks.startAsyncReplication)
|
---|
492 | *
|
---|
493 | * @param string $project Project ID for this request.
|
---|
494 | * @param string $zone The name of the zone for this request.
|
---|
495 | * @param string $disk The name of the persistent disk.
|
---|
496 | * @param DisksStartAsyncReplicationRequest $postBody
|
---|
497 | * @param array $optParams Optional parameters.
|
---|
498 | *
|
---|
499 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
500 | * Specify a unique request ID so that if you must retry your request, the
|
---|
501 | * server will know to ignore the request if it has already been completed. For
|
---|
502 | * example, consider a situation where you make an initial request and the
|
---|
503 | * request times out. If you make the request again with the same request ID,
|
---|
504 | * the server can check if original operation with the same request ID was
|
---|
505 | * received, and if so, will ignore the second request. This prevents clients
|
---|
506 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
507 | * valid UUID with the exception that zero UUID is not supported (
|
---|
508 | * 00000000-0000-0000-0000-000000000000).
|
---|
509 | * @return Operation
|
---|
510 | * @throws \Google\Service\Exception
|
---|
511 | */
|
---|
512 | public function startAsyncReplication($project, $zone, $disk, DisksStartAsyncReplicationRequest $postBody, $optParams = [])
|
---|
513 | {
|
---|
514 | $params = ['project' => $project, 'zone' => $zone, 'disk' => $disk, 'postBody' => $postBody];
|
---|
515 | $params = array_merge($params, $optParams);
|
---|
516 | return $this->call('startAsyncReplication', [$params], Operation::class);
|
---|
517 | }
|
---|
518 | /**
|
---|
519 | * Stops asynchronous replication. Can be invoked either on the primary or on
|
---|
520 | * the secondary disk. (disks.stopAsyncReplication)
|
---|
521 | *
|
---|
522 | * @param string $project Project ID for this request.
|
---|
523 | * @param string $zone The name of the zone for this request.
|
---|
524 | * @param string $disk The name of the persistent disk.
|
---|
525 | * @param array $optParams Optional parameters.
|
---|
526 | *
|
---|
527 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
528 | * Specify a unique request ID so that if you must retry your request, the
|
---|
529 | * server will know to ignore the request if it has already been completed. For
|
---|
530 | * example, consider a situation where you make an initial request and the
|
---|
531 | * request times out. If you make the request again with the same request ID,
|
---|
532 | * the server can check if original operation with the same request ID was
|
---|
533 | * received, and if so, will ignore the second request. This prevents clients
|
---|
534 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
535 | * valid UUID with the exception that zero UUID is not supported (
|
---|
536 | * 00000000-0000-0000-0000-000000000000).
|
---|
537 | * @return Operation
|
---|
538 | * @throws \Google\Service\Exception
|
---|
539 | */
|
---|
540 | public function stopAsyncReplication($project, $zone, $disk, $optParams = [])
|
---|
541 | {
|
---|
542 | $params = ['project' => $project, 'zone' => $zone, 'disk' => $disk];
|
---|
543 | $params = array_merge($params, $optParams);
|
---|
544 | return $this->call('stopAsyncReplication', [$params], Operation::class);
|
---|
545 | }
|
---|
546 | /**
|
---|
547 | * Stops asynchronous replication for a consistency group of disks. Can be
|
---|
548 | * invoked either in the primary or secondary scope.
|
---|
549 | * (disks.stopGroupAsyncReplication)
|
---|
550 | *
|
---|
551 | * @param string $project Project ID for this request.
|
---|
552 | * @param string $zone The name of the zone for this request. This must be the
|
---|
553 | * zone of the primary or secondary disks in the consistency group.
|
---|
554 | * @param DisksStopGroupAsyncReplicationResource $postBody
|
---|
555 | * @param array $optParams Optional parameters.
|
---|
556 | *
|
---|
557 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
558 | * Specify a unique request ID so that if you must retry your request, the
|
---|
559 | * server will know to ignore the request if it has already been completed. For
|
---|
560 | * example, consider a situation where you make an initial request and the
|
---|
561 | * request times out. If you make the request again with the same request ID,
|
---|
562 | * the server can check if original operation with the same request ID was
|
---|
563 | * received, and if so, will ignore the second request. This prevents clients
|
---|
564 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
565 | * valid UUID with the exception that zero UUID is not supported (
|
---|
566 | * 00000000-0000-0000-0000-000000000000).
|
---|
567 | * @return Operation
|
---|
568 | * @throws \Google\Service\Exception
|
---|
569 | */
|
---|
570 | public function stopGroupAsyncReplication($project, $zone, DisksStopGroupAsyncReplicationResource $postBody, $optParams = [])
|
---|
571 | {
|
---|
572 | $params = ['project' => $project, 'zone' => $zone, 'postBody' => $postBody];
|
---|
573 | $params = array_merge($params, $optParams);
|
---|
574 | return $this->call('stopGroupAsyncReplication', [$params], Operation::class);
|
---|
575 | }
|
---|
576 | /**
|
---|
577 | * Returns permissions that a caller has on the specified resource.
|
---|
578 | * (disks.testIamPermissions)
|
---|
579 | *
|
---|
580 | * @param string $project Project ID for this request.
|
---|
581 | * @param string $zone The name of the zone for this request.
|
---|
582 | * @param string $resource Name or id of the resource for this request.
|
---|
583 | * @param TestPermissionsRequest $postBody
|
---|
584 | * @param array $optParams Optional parameters.
|
---|
585 | * @return TestPermissionsResponse
|
---|
586 | * @throws \Google\Service\Exception
|
---|
587 | */
|
---|
588 | public function testIamPermissions($project, $zone, $resource, TestPermissionsRequest $postBody, $optParams = [])
|
---|
589 | {
|
---|
590 | $params = ['project' => $project, 'zone' => $zone, 'resource' => $resource, 'postBody' => $postBody];
|
---|
591 | $params = array_merge($params, $optParams);
|
---|
592 | return $this->call('testIamPermissions', [$params], TestPermissionsResponse::class);
|
---|
593 | }
|
---|
594 | /**
|
---|
595 | * Updates the specified disk with the data included in the request. The update
|
---|
596 | * is performed only on selected fields included as part of update-mask. Only
|
---|
597 | * the following fields can be modified: user_license. (disks.update)
|
---|
598 | *
|
---|
599 | * @param string $project Project ID for this request.
|
---|
600 | * @param string $zone The name of the zone for this request.
|
---|
601 | * @param string $disk The disk name for this request.
|
---|
602 | * @param Disk $postBody
|
---|
603 | * @param array $optParams Optional parameters.
|
---|
604 | *
|
---|
605 | * @opt_param string paths
|
---|
606 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
607 | * Specify a unique request ID so that if you must retry your request, the
|
---|
608 | * server will know to ignore the request if it has already been completed. For
|
---|
609 | * example, consider a situation where you make an initial request and the
|
---|
610 | * request times out. If you make the request again with the same request ID,
|
---|
611 | * the server can check if original operation with the same request ID was
|
---|
612 | * received, and if so, will ignore the second request. This prevents clients
|
---|
613 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
614 | * valid UUID with the exception that zero UUID is not supported (
|
---|
615 | * 00000000-0000-0000-0000-000000000000).
|
---|
616 | * @opt_param string updateMask update_mask indicates fields to be updated as
|
---|
617 | * part of this request.
|
---|
618 | * @return Operation
|
---|
619 | * @throws \Google\Service\Exception
|
---|
620 | */
|
---|
621 | public function update($project, $zone, $disk, Disk $postBody, $optParams = [])
|
---|
622 | {
|
---|
623 | $params = ['project' => $project, 'zone' => $zone, 'disk' => $disk, 'postBody' => $postBody];
|
---|
624 | $params = array_merge($params, $optParams);
|
---|
625 | return $this->call('update', [$params], Operation::class);
|
---|
626 | }
|
---|
627 | }
|
---|
628 |
|
---|
629 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
630 | class_alias(Disks::class, 'Google_Service_Compute_Resource_Disks');
|
---|