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\BackendBucket;
|
---|
21 | use Google\Service\Compute\BackendBucketList;
|
---|
22 | use Google\Service\Compute\GlobalSetPolicyRequest;
|
---|
23 | use Google\Service\Compute\Operation;
|
---|
24 | use Google\Service\Compute\Policy;
|
---|
25 | use Google\Service\Compute\SecurityPolicyReference;
|
---|
26 | use Google\Service\Compute\SignedUrlKey;
|
---|
27 | use Google\Service\Compute\TestPermissionsRequest;
|
---|
28 | use Google\Service\Compute\TestPermissionsResponse;
|
---|
29 |
|
---|
30 | /**
|
---|
31 | * The "backendBuckets" collection of methods.
|
---|
32 | * Typical usage is:
|
---|
33 | * <code>
|
---|
34 | * $computeService = new Google\Service\Compute(...);
|
---|
35 | * $backendBuckets = $computeService->backendBuckets;
|
---|
36 | * </code>
|
---|
37 | */
|
---|
38 | class BackendBuckets extends \Google\Service\Resource
|
---|
39 | {
|
---|
40 | /**
|
---|
41 | * Adds a key for validating requests with signed URLs for this backend bucket.
|
---|
42 | * (backendBuckets.addSignedUrlKey)
|
---|
43 | *
|
---|
44 | * @param string $project Project ID for this request.
|
---|
45 | * @param string $backendBucket Name of the BackendBucket resource to which the
|
---|
46 | * Signed URL Key should be added. The name should conform to RFC1035.
|
---|
47 | * @param SignedUrlKey $postBody
|
---|
48 | * @param array $optParams Optional parameters.
|
---|
49 | *
|
---|
50 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
51 | * Specify a unique request ID so that if you must retry your request, the
|
---|
52 | * server will know to ignore the request if it has already been completed. For
|
---|
53 | * example, consider a situation where you make an initial request and the
|
---|
54 | * request times out. If you make the request again with the same request ID,
|
---|
55 | * the server can check if original operation with the same request ID was
|
---|
56 | * received, and if so, will ignore the second request. This prevents clients
|
---|
57 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
58 | * valid UUID with the exception that zero UUID is not supported (
|
---|
59 | * 00000000-0000-0000-0000-000000000000).
|
---|
60 | * @return Operation
|
---|
61 | * @throws \Google\Service\Exception
|
---|
62 | */
|
---|
63 | public function addSignedUrlKey($project, $backendBucket, SignedUrlKey $postBody, $optParams = [])
|
---|
64 | {
|
---|
65 | $params = ['project' => $project, 'backendBucket' => $backendBucket, 'postBody' => $postBody];
|
---|
66 | $params = array_merge($params, $optParams);
|
---|
67 | return $this->call('addSignedUrlKey', [$params], Operation::class);
|
---|
68 | }
|
---|
69 | /**
|
---|
70 | * Deletes the specified BackendBucket resource. (backendBuckets.delete)
|
---|
71 | *
|
---|
72 | * @param string $project Project ID for this request.
|
---|
73 | * @param string $backendBucket Name of the BackendBucket resource to delete.
|
---|
74 | * @param array $optParams Optional parameters.
|
---|
75 | *
|
---|
76 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
77 | * Specify a unique request ID so that if you must retry your request, the
|
---|
78 | * server will know to ignore the request if it has already been completed. For
|
---|
79 | * example, consider a situation where you make an initial request and the
|
---|
80 | * request times out. If you make the request again with the same request ID,
|
---|
81 | * the server can check if original operation with the same request ID was
|
---|
82 | * received, and if so, will ignore the second request. This prevents clients
|
---|
83 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
84 | * valid UUID with the exception that zero UUID is not supported (
|
---|
85 | * 00000000-0000-0000-0000-000000000000).
|
---|
86 | * @return Operation
|
---|
87 | * @throws \Google\Service\Exception
|
---|
88 | */
|
---|
89 | public function delete($project, $backendBucket, $optParams = [])
|
---|
90 | {
|
---|
91 | $params = ['project' => $project, 'backendBucket' => $backendBucket];
|
---|
92 | $params = array_merge($params, $optParams);
|
---|
93 | return $this->call('delete', [$params], Operation::class);
|
---|
94 | }
|
---|
95 | /**
|
---|
96 | * Deletes a key for validating requests with signed URLs for this backend
|
---|
97 | * bucket. (backendBuckets.deleteSignedUrlKey)
|
---|
98 | *
|
---|
99 | * @param string $project Project ID for this request.
|
---|
100 | * @param string $backendBucket Name of the BackendBucket resource to which the
|
---|
101 | * Signed URL Key should be added. The name should conform to RFC1035.
|
---|
102 | * @param string $keyName The name of the Signed URL Key to delete.
|
---|
103 | * @param array $optParams Optional parameters.
|
---|
104 | *
|
---|
105 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
106 | * Specify a unique request ID so that if you must retry your request, the
|
---|
107 | * server will know to ignore the request if it has already been completed. For
|
---|
108 | * example, consider a situation where you make an initial request and the
|
---|
109 | * request times out. If you make the request again with the same request ID,
|
---|
110 | * the server can check if original operation with the same request ID was
|
---|
111 | * received, and if so, will ignore the second request. This prevents clients
|
---|
112 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
113 | * valid UUID with the exception that zero UUID is not supported (
|
---|
114 | * 00000000-0000-0000-0000-000000000000).
|
---|
115 | * @return Operation
|
---|
116 | * @throws \Google\Service\Exception
|
---|
117 | */
|
---|
118 | public function deleteSignedUrlKey($project, $backendBucket, $keyName, $optParams = [])
|
---|
119 | {
|
---|
120 | $params = ['project' => $project, 'backendBucket' => $backendBucket, 'keyName' => $keyName];
|
---|
121 | $params = array_merge($params, $optParams);
|
---|
122 | return $this->call('deleteSignedUrlKey', [$params], Operation::class);
|
---|
123 | }
|
---|
124 | /**
|
---|
125 | * Returns the specified BackendBucket resource. (backendBuckets.get)
|
---|
126 | *
|
---|
127 | * @param string $project Project ID for this request.
|
---|
128 | * @param string $backendBucket Name of the BackendBucket resource to return.
|
---|
129 | * @param array $optParams Optional parameters.
|
---|
130 | * @return BackendBucket
|
---|
131 | * @throws \Google\Service\Exception
|
---|
132 | */
|
---|
133 | public function get($project, $backendBucket, $optParams = [])
|
---|
134 | {
|
---|
135 | $params = ['project' => $project, 'backendBucket' => $backendBucket];
|
---|
136 | $params = array_merge($params, $optParams);
|
---|
137 | return $this->call('get', [$params], BackendBucket::class);
|
---|
138 | }
|
---|
139 | /**
|
---|
140 | * Gets the access control policy for a resource. May be empty if no such policy
|
---|
141 | * or resource exists. (backendBuckets.getIamPolicy)
|
---|
142 | *
|
---|
143 | * @param string $project Project ID for this request.
|
---|
144 | * @param string $resource Name or id of the resource for this request.
|
---|
145 | * @param array $optParams Optional parameters.
|
---|
146 | *
|
---|
147 | * @opt_param int optionsRequestedPolicyVersion Requested IAM Policy version.
|
---|
148 | * @return Policy
|
---|
149 | * @throws \Google\Service\Exception
|
---|
150 | */
|
---|
151 | public function getIamPolicy($project, $resource, $optParams = [])
|
---|
152 | {
|
---|
153 | $params = ['project' => $project, 'resource' => $resource];
|
---|
154 | $params = array_merge($params, $optParams);
|
---|
155 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
156 | }
|
---|
157 | /**
|
---|
158 | * Creates a BackendBucket resource in the specified project using the data
|
---|
159 | * included in the request. (backendBuckets.insert)
|
---|
160 | *
|
---|
161 | * @param string $project Project ID for this request.
|
---|
162 | * @param BackendBucket $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 insert($project, BackendBucket $postBody, $optParams = [])
|
---|
179 | {
|
---|
180 | $params = ['project' => $project, 'postBody' => $postBody];
|
---|
181 | $params = array_merge($params, $optParams);
|
---|
182 | return $this->call('insert', [$params], Operation::class);
|
---|
183 | }
|
---|
184 | /**
|
---|
185 | * Retrieves the list of BackendBucket resources available to the specified
|
---|
186 | * project. (backendBuckets.listBackendBuckets)
|
---|
187 | *
|
---|
188 | * @param string $project Project ID for this request.
|
---|
189 | * @param array $optParams Optional parameters.
|
---|
190 | *
|
---|
191 | * @opt_param string filter A filter expression that filters resources listed in
|
---|
192 | * the response. Most Compute resources support two types of filter expressions:
|
---|
193 | * expressions that support regular expressions and expressions that follow API
|
---|
194 | * improvement proposal AIP-160. These two types of filter expressions cannot be
|
---|
195 | * mixed in one request. If you want to use AIP-160, your expression must
|
---|
196 | * specify the field name, an operator, and the value that you want to use for
|
---|
197 | * filtering. The value must be a string, a number, or a boolean. The operator
|
---|
198 | * must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you
|
---|
199 | * are filtering Compute Engine instances, you can exclude instances named
|
---|
200 | * `example-instance` by specifying `name != example-instance`. The `:*`
|
---|
201 | * comparison can be used to test whether a key has been defined. For example,
|
---|
202 | * to find all objects with `owner` label use: ``` labels.owner:* ``` You can
|
---|
203 | * also filter nested fields. For example, you could specify
|
---|
204 | * `scheduling.automaticRestart = false` to include instances only if they are
|
---|
205 | * not scheduled for automatic restarts. You can use filtering on nested fields
|
---|
206 | * to filter based on resource labels. To filter on multiple expressions,
|
---|
207 | * provide each separate expression within parentheses. For example: ```
|
---|
208 | * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By
|
---|
209 | * default, each expression is an `AND` expression. However, you can include
|
---|
210 | * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel
|
---|
211 | * Skylake") OR (cpuPlatform = "Intel Broadwell") AND
|
---|
212 | * (scheduling.automaticRestart = true) ``` If you want to use a regular
|
---|
213 | * expression, use the `eq` (equal) or `ne` (not equal) operator against a
|
---|
214 | * single un-parenthesized expression with or without quotes or against multiple
|
---|
215 | * parenthesized expressions. Examples: `fieldname eq unquoted literal`
|
---|
216 | * `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"`
|
---|
217 | * `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is
|
---|
218 | * interpreted as a regular expression using Google RE2 library syntax. The
|
---|
219 | * literal value must match the entire field. For example, to filter for
|
---|
220 | * instances that do not end with name "instance", you would use `name ne
|
---|
221 | * .*instance`. You cannot combine constraints on multiple fields using regular
|
---|
222 | * expressions.
|
---|
223 | * @opt_param string maxResults The maximum number of results per page that
|
---|
224 | * should be returned. If the number of available results is larger than
|
---|
225 | * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to
|
---|
226 | * get the next page of results in subsequent list requests. Acceptable values
|
---|
227 | * are `0` to `500`, inclusive. (Default: `500`)
|
---|
228 | * @opt_param string orderBy Sorts list results by a certain order. By default,
|
---|
229 | * results are returned in alphanumerical order based on the resource name. You
|
---|
230 | * can also sort results in descending order based on the creation timestamp
|
---|
231 | * using `orderBy="creationTimestamp desc"`. This sorts results based on the
|
---|
232 | * `creationTimestamp` field in reverse chronological order (newest result
|
---|
233 | * first). Use this to sort resources like operations so that the newest
|
---|
234 | * operation is returned first. Currently, only sorting by `name` or
|
---|
235 | * `creationTimestamp desc` is supported.
|
---|
236 | * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to
|
---|
237 | * the `nextPageToken` returned by a previous list request to get the next page
|
---|
238 | * of results.
|
---|
239 | * @opt_param bool returnPartialSuccess Opt-in for partial success behavior
|
---|
240 | * which provides partial results in case of failure. The default value is
|
---|
241 | * false. For example, when partial success behavior is enabled, aggregatedList
|
---|
242 | * for a single zone scope either returns all resources in the zone or no
|
---|
243 | * resources, with an error code.
|
---|
244 | * @return BackendBucketList
|
---|
245 | * @throws \Google\Service\Exception
|
---|
246 | */
|
---|
247 | public function listBackendBuckets($project, $optParams = [])
|
---|
248 | {
|
---|
249 | $params = ['project' => $project];
|
---|
250 | $params = array_merge($params, $optParams);
|
---|
251 | return $this->call('list', [$params], BackendBucketList::class);
|
---|
252 | }
|
---|
253 | /**
|
---|
254 | * Updates the specified BackendBucket resource with the data included in the
|
---|
255 | * request. This method supports PATCH semantics and uses the JSON merge patch
|
---|
256 | * format and processing rules. (backendBuckets.patch)
|
---|
257 | *
|
---|
258 | * @param string $project Project ID for this request.
|
---|
259 | * @param string $backendBucket Name of the BackendBucket resource to patch.
|
---|
260 | * @param BackendBucket $postBody
|
---|
261 | * @param array $optParams Optional parameters.
|
---|
262 | *
|
---|
263 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
264 | * Specify a unique request ID so that if you must retry your request, the
|
---|
265 | * server will know to ignore the request if it has already been completed. For
|
---|
266 | * example, consider a situation where you make an initial request and the
|
---|
267 | * request times out. If you make the request again with the same request ID,
|
---|
268 | * the server can check if original operation with the same request ID was
|
---|
269 | * received, and if so, will ignore the second request. This prevents clients
|
---|
270 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
271 | * valid UUID with the exception that zero UUID is not supported (
|
---|
272 | * 00000000-0000-0000-0000-000000000000).
|
---|
273 | * @return Operation
|
---|
274 | * @throws \Google\Service\Exception
|
---|
275 | */
|
---|
276 | public function patch($project, $backendBucket, BackendBucket $postBody, $optParams = [])
|
---|
277 | {
|
---|
278 | $params = ['project' => $project, 'backendBucket' => $backendBucket, 'postBody' => $postBody];
|
---|
279 | $params = array_merge($params, $optParams);
|
---|
280 | return $this->call('patch', [$params], Operation::class);
|
---|
281 | }
|
---|
282 | /**
|
---|
283 | * Sets the edge security policy for the specified backend bucket.
|
---|
284 | * (backendBuckets.setEdgeSecurityPolicy)
|
---|
285 | *
|
---|
286 | * @param string $project Project ID for this request.
|
---|
287 | * @param string $backendBucket Name of the BackendBucket resource to which the
|
---|
288 | * security policy should be set. The name should conform to RFC1035.
|
---|
289 | * @param SecurityPolicyReference $postBody
|
---|
290 | * @param array $optParams Optional parameters.
|
---|
291 | *
|
---|
292 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
293 | * Specify a unique request ID so that if you must retry your request, the
|
---|
294 | * server will know to ignore the request if it has already been completed. For
|
---|
295 | * example, consider a situation where you make an initial request and the
|
---|
296 | * request times out. If you make the request again with the same request ID,
|
---|
297 | * the server can check if original operation with the same request ID was
|
---|
298 | * received, and if so, will ignore the second request. This prevents clients
|
---|
299 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
300 | * valid UUID with the exception that zero UUID is not supported (
|
---|
301 | * 00000000-0000-0000-0000-000000000000).
|
---|
302 | * @return Operation
|
---|
303 | * @throws \Google\Service\Exception
|
---|
304 | */
|
---|
305 | public function setEdgeSecurityPolicy($project, $backendBucket, SecurityPolicyReference $postBody, $optParams = [])
|
---|
306 | {
|
---|
307 | $params = ['project' => $project, 'backendBucket' => $backendBucket, 'postBody' => $postBody];
|
---|
308 | $params = array_merge($params, $optParams);
|
---|
309 | return $this->call('setEdgeSecurityPolicy', [$params], Operation::class);
|
---|
310 | }
|
---|
311 | /**
|
---|
312 | * Sets the access control policy on the specified resource. Replaces any
|
---|
313 | * existing policy. (backendBuckets.setIamPolicy)
|
---|
314 | *
|
---|
315 | * @param string $project Project ID for this request.
|
---|
316 | * @param string $resource Name or id of the resource for this request.
|
---|
317 | * @param GlobalSetPolicyRequest $postBody
|
---|
318 | * @param array $optParams Optional parameters.
|
---|
319 | * @return Policy
|
---|
320 | * @throws \Google\Service\Exception
|
---|
321 | */
|
---|
322 | public function setIamPolicy($project, $resource, GlobalSetPolicyRequest $postBody, $optParams = [])
|
---|
323 | {
|
---|
324 | $params = ['project' => $project, 'resource' => $resource, 'postBody' => $postBody];
|
---|
325 | $params = array_merge($params, $optParams);
|
---|
326 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
327 | }
|
---|
328 | /**
|
---|
329 | * Returns permissions that a caller has on the specified resource.
|
---|
330 | * (backendBuckets.testIamPermissions)
|
---|
331 | *
|
---|
332 | * @param string $project Project ID for this request.
|
---|
333 | * @param string $resource Name or id of the resource for this request.
|
---|
334 | * @param TestPermissionsRequest $postBody
|
---|
335 | * @param array $optParams Optional parameters.
|
---|
336 | * @return TestPermissionsResponse
|
---|
337 | * @throws \Google\Service\Exception
|
---|
338 | */
|
---|
339 | public function testIamPermissions($project, $resource, TestPermissionsRequest $postBody, $optParams = [])
|
---|
340 | {
|
---|
341 | $params = ['project' => $project, 'resource' => $resource, 'postBody' => $postBody];
|
---|
342 | $params = array_merge($params, $optParams);
|
---|
343 | return $this->call('testIamPermissions', [$params], TestPermissionsResponse::class);
|
---|
344 | }
|
---|
345 | /**
|
---|
346 | * Updates the specified BackendBucket resource with the data included in the
|
---|
347 | * request. (backendBuckets.update)
|
---|
348 | *
|
---|
349 | * @param string $project Project ID for this request.
|
---|
350 | * @param string $backendBucket Name of the BackendBucket resource to update.
|
---|
351 | * @param BackendBucket $postBody
|
---|
352 | * @param array $optParams Optional parameters.
|
---|
353 | *
|
---|
354 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
355 | * Specify a unique request ID so that if you must retry your request, the
|
---|
356 | * server will know to ignore the request if it has already been completed. For
|
---|
357 | * example, consider a situation where you make an initial request and the
|
---|
358 | * request times out. If you make the request again with the same request ID,
|
---|
359 | * the server can check if original operation with the same request ID was
|
---|
360 | * received, and if so, will ignore the second request. This prevents clients
|
---|
361 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
362 | * valid UUID with the exception that zero UUID is not supported (
|
---|
363 | * 00000000-0000-0000-0000-000000000000).
|
---|
364 | * @return Operation
|
---|
365 | * @throws \Google\Service\Exception
|
---|
366 | */
|
---|
367 | public function update($project, $backendBucket, BackendBucket $postBody, $optParams = [])
|
---|
368 | {
|
---|
369 | $params = ['project' => $project, 'backendBucket' => $backendBucket, 'postBody' => $postBody];
|
---|
370 | $params = array_merge($params, $optParams);
|
---|
371 | return $this->call('update', [$params], Operation::class);
|
---|
372 | }
|
---|
373 | }
|
---|
374 |
|
---|
375 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
376 | class_alias(BackendBuckets::class, 'Google_Service_Compute_Resource_BackendBuckets');
|
---|