source: vendor/google/apiclient-services/src/Compute/Resource/RegionInstantSnapshots.php@ f9c482b

Last change on this file since f9c482b was f9c482b, checked in by Vlado 222039 <vlado.popovski@…>, 10 days ago

Upload new project files

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