source: vendor/google/apiclient-services/src/Compute/Resource/InstantSnapshots.php

Last change on this file was e3d4e0a, checked in by Vlado 222039 <vlado.popovski@…>, 3 weeks ago

Upload project files

  • Property mode set to 100644
File size: 19.0 KB
RevLine 
[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
18namespace Google\Service\Compute\Resource;
19
20use Google\Service\Compute\InstantSnapshot;
21use Google\Service\Compute\InstantSnapshotAggregatedList;
22use Google\Service\Compute\InstantSnapshotList;
23use Google\Service\Compute\Operation;
24use Google\Service\Compute\Policy;
25use Google\Service\Compute\TestPermissionsRequest;
26use Google\Service\Compute\TestPermissionsResponse;
27use Google\Service\Compute\ZoneSetLabelsRequest;
28use Google\Service\Compute\ZoneSetPolicyRequest;
29
30/**
31 * The "instantSnapshots" collection of methods.
32 * Typical usage is:
33 * <code>
34 * $computeService = new Google\Service\Compute(...);
35 * $instantSnapshots = $computeService->instantSnapshots;
36 * </code>
37 */
38class InstantSnapshots extends \Google\Service\Resource
39{
40 /**
41 * Retrieves an aggregated list of instantSnapshots. To prevent failure, Google
42 * recommends that you set the `returnPartialSuccess` parameter to `true`.
43 * (instantSnapshots.aggregatedList)
44 *
45 * @param string $project Project ID for this request.
46 * @param array $optParams Optional parameters.
47 *
48 * @opt_param string filter A filter expression that filters resources listed in
49 * the response. Most Compute resources support two types of filter expressions:
50 * expressions that support regular expressions and expressions that follow API
51 * improvement proposal AIP-160. These two types of filter expressions cannot be
52 * mixed in one request. If you want to use AIP-160, your expression must
53 * specify the field name, an operator, and the value that you want to use for
54 * filtering. The value must be a string, a number, or a boolean. The operator
55 * must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you
56 * are filtering Compute Engine instances, you can exclude instances named
57 * `example-instance` by specifying `name != example-instance`. The `:*`
58 * comparison can be used to test whether a key has been defined. For example,
59 * to find all objects with `owner` label use: ``` labels.owner:* ``` You can
60 * also filter nested fields. For example, you could specify
61 * `scheduling.automaticRestart = false` to include instances only if they are
62 * not scheduled for automatic restarts. You can use filtering on nested fields
63 * to filter based on resource labels. To filter on multiple expressions,
64 * provide each separate expression within parentheses. For example: ```
65 * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By
66 * default, each expression is an `AND` expression. However, you can include
67 * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel
68 * Skylake") OR (cpuPlatform = "Intel Broadwell") AND
69 * (scheduling.automaticRestart = true) ``` If you want to use a regular
70 * expression, use the `eq` (equal) or `ne` (not equal) operator against a
71 * single un-parenthesized expression with or without quotes or against multiple
72 * parenthesized expressions. Examples: `fieldname eq unquoted literal`
73 * `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"`
74 * `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is
75 * interpreted as a regular expression using Google RE2 library syntax. The
76 * literal value must match the entire field. For example, to filter for
77 * instances that do not end with name "instance", you would use `name ne
78 * .*instance`. You cannot combine constraints on multiple fields using regular
79 * expressions.
80 * @opt_param bool includeAllScopes Indicates whether every visible scope for
81 * each scope type (zone, region, global) should be included in the response.
82 * For new resource types added after this field, the flag has no effect as new
83 * resource types will always include every visible scope for each scope type in
84 * response. For resource types which predate this field, if this flag is
85 * omitted or false, only scopes of the scope types where the resource type is
86 * expected to be found will be included.
87 * @opt_param string maxResults The maximum number of results per page that
88 * should be returned. If the number of available results is larger than
89 * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to
90 * get the next page of results in subsequent list requests. Acceptable values
91 * are `0` to `500`, inclusive. (Default: `500`)
92 * @opt_param string orderBy Sorts list results by a certain order. By default,
93 * results are returned in alphanumerical order based on the resource name. You
94 * can also sort results in descending order based on the creation timestamp
95 * using `orderBy="creationTimestamp desc"`. This sorts results based on the
96 * `creationTimestamp` field in reverse chronological order (newest result
97 * first). Use this to sort resources like operations so that the newest
98 * operation is returned first. Currently, only sorting by `name` or
99 * `creationTimestamp desc` is supported.
100 * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to
101 * the `nextPageToken` returned by a previous list request to get the next page
102 * of results.
103 * @opt_param bool returnPartialSuccess Opt-in for partial success behavior
104 * which provides partial results in case of failure. The default value is
105 * false. For example, when partial success behavior is enabled, aggregatedList
106 * for a single zone scope either returns all resources in the zone or no
107 * resources, with an error code.
108 * @opt_param string serviceProjectNumber The Shared VPC service project id or
109 * service project number for which aggregated list request is invoked for
110 * subnetworks list-usable api.
111 * @return InstantSnapshotAggregatedList
112 * @throws \Google\Service\Exception
113 */
114 public function aggregatedList($project, $optParams = [])
115 {
116 $params = ['project' => $project];
117 $params = array_merge($params, $optParams);
118 return $this->call('aggregatedList', [$params], InstantSnapshotAggregatedList::class);
119 }
120 /**
121 * Deletes the specified InstantSnapshot resource. Keep in mind that deleting a
122 * single instantSnapshot might not necessarily delete all the data on that
123 * instantSnapshot. If any data on the instantSnapshot that is marked for
124 * deletion is needed for subsequent instantSnapshots, the data will be moved to
125 * the next corresponding instantSnapshot. For more information, see Deleting
126 * instantSnapshots. (instantSnapshots.delete)
127 *
128 * @param string $project Project ID for this request.
129 * @param string $zone The name of the zone for this request.
130 * @param string $instantSnapshot Name of the InstantSnapshot resource to
131 * delete.
132 * @param array $optParams Optional parameters.
133 *
134 * @opt_param string requestId An optional request ID to identify requests.
135 * Specify a unique request ID so that if you must retry your request, the
136 * server will know to ignore the request if it has already been completed. For
137 * example, consider a situation where you make an initial request and the
138 * request times out. If you make the request again with the same request ID,
139 * the server can check if original operation with the same request ID was
140 * received, and if so, will ignore the second request. This prevents clients
141 * from accidentally creating duplicate commitments. The request ID must be a
142 * valid UUID with the exception that zero UUID is not supported (
143 * 00000000-0000-0000-0000-000000000000).
144 * @return Operation
145 * @throws \Google\Service\Exception
146 */
147 public function delete($project, $zone, $instantSnapshot, $optParams = [])
148 {
149 $params = ['project' => $project, 'zone' => $zone, 'instantSnapshot' => $instantSnapshot];
150 $params = array_merge($params, $optParams);
151 return $this->call('delete', [$params], Operation::class);
152 }
153 /**
154 * Returns the specified InstantSnapshot resource in the specified zone.
155 * (instantSnapshots.get)
156 *
157 * @param string $project Project ID for this request.
158 * @param string $zone The name of the zone for this request.
159 * @param string $instantSnapshot Name of the InstantSnapshot resource to
160 * return.
161 * @param array $optParams Optional parameters.
162 * @return InstantSnapshot
163 * @throws \Google\Service\Exception
164 */
165 public function get($project, $zone, $instantSnapshot, $optParams = [])
166 {
167 $params = ['project' => $project, 'zone' => $zone, 'instantSnapshot' => $instantSnapshot];
168 $params = array_merge($params, $optParams);
169 return $this->call('get', [$params], InstantSnapshot::class);
170 }
171 /**
172 * Gets the access control policy for a resource. May be empty if no such policy
173 * or resource exists. (instantSnapshots.getIamPolicy)
174 *
175 * @param string $project Project ID for this request.
176 * @param string $zone The name of the zone for this request.
177 * @param string $resource Name or id of the resource for this request.
178 * @param array $optParams Optional parameters.
179 *
180 * @opt_param int optionsRequestedPolicyVersion Requested IAM Policy version.
181 * @return Policy
182 * @throws \Google\Service\Exception
183 */
184 public function getIamPolicy($project, $zone, $resource, $optParams = [])
185 {
186 $params = ['project' => $project, 'zone' => $zone, 'resource' => $resource];
187 $params = array_merge($params, $optParams);
188 return $this->call('getIamPolicy', [$params], Policy::class);
189 }
190 /**
191 * Creates an instant snapshot in the specified zone. (instantSnapshots.insert)
192 *
193 * @param string $project Project ID for this request.
194 * @param string $zone Name of the zone for this request.
195 * @param InstantSnapshot $postBody
196 * @param array $optParams Optional parameters.
197 *
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 insert($project, $zone, InstantSnapshot $postBody, $optParams = [])
212 {
213 $params = ['project' => $project, 'zone' => $zone, 'postBody' => $postBody];
214 $params = array_merge($params, $optParams);
215 return $this->call('insert', [$params], Operation::class);
216 }
217 /**
218 * Retrieves the list of InstantSnapshot resources contained within the
219 * specified zone. (instantSnapshots.listInstantSnapshots)
220 *
221 * @param string $project Project ID for this request.
222 * @param string $zone The name of the zone for this request.
223 * @param array $optParams Optional parameters.
224 *
225 * @opt_param string filter A filter expression that filters resources listed in
226 * the response. Most Compute resources support two types of filter expressions:
227 * expressions that support regular expressions and expressions that follow API
228 * improvement proposal AIP-160. These two types of filter expressions cannot be
229 * mixed in one request. If you want to use AIP-160, your expression must
230 * specify the field name, an operator, and the value that you want to use for
231 * filtering. The value must be a string, a number, or a boolean. The operator
232 * must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you
233 * are filtering Compute Engine instances, you can exclude instances named
234 * `example-instance` by specifying `name != example-instance`. The `:*`
235 * comparison can be used to test whether a key has been defined. For example,
236 * to find all objects with `owner` label use: ``` labels.owner:* ``` You can
237 * also filter nested fields. For example, you could specify
238 * `scheduling.automaticRestart = false` to include instances only if they are
239 * not scheduled for automatic restarts. You can use filtering on nested fields
240 * to filter based on resource labels. To filter on multiple expressions,
241 * provide each separate expression within parentheses. For example: ```
242 * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By
243 * default, each expression is an `AND` expression. However, you can include
244 * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel
245 * Skylake") OR (cpuPlatform = "Intel Broadwell") AND
246 * (scheduling.automaticRestart = true) ``` If you want to use a regular
247 * expression, use the `eq` (equal) or `ne` (not equal) operator against a
248 * single un-parenthesized expression with or without quotes or against multiple
249 * parenthesized expressions. Examples: `fieldname eq unquoted literal`
250 * `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"`
251 * `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is
252 * interpreted as a regular expression using Google RE2 library syntax. The
253 * literal value must match the entire field. For example, to filter for
254 * instances that do not end with name "instance", you would use `name ne
255 * .*instance`. You cannot combine constraints on multiple fields using regular
256 * expressions.
257 * @opt_param string maxResults The maximum number of results per page that
258 * should be returned. If the number of available results is larger than
259 * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to
260 * get the next page of results in subsequent list requests. Acceptable values
261 * are `0` to `500`, inclusive. (Default: `500`)
262 * @opt_param string orderBy Sorts list results by a certain order. By default,
263 * results are returned in alphanumerical order based on the resource name. You
264 * can also sort results in descending order based on the creation timestamp
265 * using `orderBy="creationTimestamp desc"`. This sorts results based on the
266 * `creationTimestamp` field in reverse chronological order (newest result
267 * first). Use this to sort resources like operations so that the newest
268 * operation is returned first. Currently, only sorting by `name` or
269 * `creationTimestamp desc` is supported.
270 * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to
271 * the `nextPageToken` returned by a previous list request to get the next page
272 * of results.
273 * @opt_param bool returnPartialSuccess Opt-in for partial success behavior
274 * which provides partial results in case of failure. The default value is
275 * false. For example, when partial success behavior is enabled, aggregatedList
276 * for a single zone scope either returns all resources in the zone or no
277 * resources, with an error code.
278 * @return InstantSnapshotList
279 * @throws \Google\Service\Exception
280 */
281 public function listInstantSnapshots($project, $zone, $optParams = [])
282 {
283 $params = ['project' => $project, 'zone' => $zone];
284 $params = array_merge($params, $optParams);
285 return $this->call('list', [$params], InstantSnapshotList::class);
286 }
287 /**
288 * Sets the access control policy on the specified resource. Replaces any
289 * existing policy. (instantSnapshots.setIamPolicy)
290 *
291 * @param string $project Project ID for this request.
292 * @param string $zone The name of the zone for this request.
293 * @param string $resource Name or id of the resource for this request.
294 * @param ZoneSetPolicyRequest $postBody
295 * @param array $optParams Optional parameters.
296 * @return Policy
297 * @throws \Google\Service\Exception
298 */
299 public function setIamPolicy($project, $zone, $resource, ZoneSetPolicyRequest $postBody, $optParams = [])
300 {
301 $params = ['project' => $project, 'zone' => $zone, 'resource' => $resource, 'postBody' => $postBody];
302 $params = array_merge($params, $optParams);
303 return $this->call('setIamPolicy', [$params], Policy::class);
304 }
305 /**
306 * Sets the labels on a instantSnapshot in the given zone. To learn more about
307 * labels, read the Labeling Resources documentation.
308 * (instantSnapshots.setLabels)
309 *
310 * @param string $project Project ID for this request.
311 * @param string $zone The name of the zone for this request.
312 * @param string $resource Name or id of the resource for this request.
313 * @param ZoneSetLabelsRequest $postBody
314 * @param array $optParams Optional parameters.
315 *
316 * @opt_param string requestId An optional request ID to identify requests.
317 * Specify a unique request ID so that if you must retry your request, the
318 * server will know to ignore the request if it has already been completed. For
319 * example, consider a situation where you make an initial request and the
320 * request times out. If you make the request again with the same request ID,
321 * the server can check if original operation with the same request ID was
322 * received, and if so, will ignore the second request. This prevents clients
323 * from accidentally creating duplicate commitments. The request ID must be a
324 * valid UUID with the exception that zero UUID is not supported (
325 * 00000000-0000-0000-0000-000000000000).
326 * @return Operation
327 * @throws \Google\Service\Exception
328 */
329 public function setLabels($project, $zone, $resource, ZoneSetLabelsRequest $postBody, $optParams = [])
330 {
331 $params = ['project' => $project, 'zone' => $zone, 'resource' => $resource, 'postBody' => $postBody];
332 $params = array_merge($params, $optParams);
333 return $this->call('setLabels', [$params], Operation::class);
334 }
335 /**
336 * Returns permissions that a caller has on the specified resource.
337 * (instantSnapshots.testIamPermissions)
338 *
339 * @param string $project Project ID for this request.
340 * @param string $zone The name of the zone for this request.
341 * @param string $resource Name or id of the resource for this request.
342 * @param TestPermissionsRequest $postBody
343 * @param array $optParams Optional parameters.
344 * @return TestPermissionsResponse
345 * @throws \Google\Service\Exception
346 */
347 public function testIamPermissions($project, $zone, $resource, TestPermissionsRequest $postBody, $optParams = [])
348 {
349 $params = ['project' => $project, 'zone' => $zone, 'resource' => $resource, 'postBody' => $postBody];
350 $params = array_merge($params, $optParams);
351 return $this->call('testIamPermissions', [$params], TestPermissionsResponse::class);
352 }
353}
354
355// Adding a class alias for backwards compatibility with the previous class name.
356class_alias(InstantSnapshots::class, 'Google_Service_Compute_Resource_InstantSnapshots');
Note: See TracBrowser for help on using the repository browser.