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\Operation;
|
---|
21 | use Google\Service\Compute\Policy;
|
---|
22 | use Google\Service\Compute\RegionSetPolicyRequest;
|
---|
23 | use Google\Service\Compute\Subnetwork;
|
---|
24 | use Google\Service\Compute\SubnetworkAggregatedList;
|
---|
25 | use Google\Service\Compute\SubnetworkList;
|
---|
26 | use Google\Service\Compute\SubnetworksExpandIpCidrRangeRequest;
|
---|
27 | use Google\Service\Compute\SubnetworksSetPrivateIpGoogleAccessRequest;
|
---|
28 | use Google\Service\Compute\TestPermissionsRequest;
|
---|
29 | use Google\Service\Compute\TestPermissionsResponse;
|
---|
30 | use Google\Service\Compute\UsableSubnetworksAggregatedList;
|
---|
31 |
|
---|
32 | /**
|
---|
33 | * The "subnetworks" collection of methods.
|
---|
34 | * Typical usage is:
|
---|
35 | * <code>
|
---|
36 | * $computeService = new Google\Service\Compute(...);
|
---|
37 | * $subnetworks = $computeService->subnetworks;
|
---|
38 | * </code>
|
---|
39 | */
|
---|
40 | class Subnetworks extends \Google\Service\Resource
|
---|
41 | {
|
---|
42 | /**
|
---|
43 | * Retrieves an aggregated list of subnetworks. To prevent failure, Google
|
---|
44 | * recommends that you set the `returnPartialSuccess` parameter to `true`.
|
---|
45 | * (subnetworks.aggregatedList)
|
---|
46 | *
|
---|
47 | * @param string $project Project ID for this request.
|
---|
48 | * @param array $optParams Optional parameters.
|
---|
49 | *
|
---|
50 | * @opt_param string filter A filter expression that filters resources listed in
|
---|
51 | * the response. Most Compute resources support two types of filter expressions:
|
---|
52 | * expressions that support regular expressions and expressions that follow API
|
---|
53 | * improvement proposal AIP-160. These two types of filter expressions cannot be
|
---|
54 | * mixed in one request. If you want to use AIP-160, your expression must
|
---|
55 | * specify the field name, an operator, and the value that you want to use for
|
---|
56 | * filtering. The value must be a string, a number, or a boolean. The operator
|
---|
57 | * must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you
|
---|
58 | * are filtering Compute Engine instances, you can exclude instances named
|
---|
59 | * `example-instance` by specifying `name != example-instance`. The `:*`
|
---|
60 | * comparison can be used to test whether a key has been defined. For example,
|
---|
61 | * to find all objects with `owner` label use: ``` labels.owner:* ``` You can
|
---|
62 | * also filter nested fields. For example, you could specify
|
---|
63 | * `scheduling.automaticRestart = false` to include instances only if they are
|
---|
64 | * not scheduled for automatic restarts. You can use filtering on nested fields
|
---|
65 | * to filter based on resource labels. To filter on multiple expressions,
|
---|
66 | * provide each separate expression within parentheses. For example: ```
|
---|
67 | * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By
|
---|
68 | * default, each expression is an `AND` expression. However, you can include
|
---|
69 | * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel
|
---|
70 | * Skylake") OR (cpuPlatform = "Intel Broadwell") AND
|
---|
71 | * (scheduling.automaticRestart = true) ``` If you want to use a regular
|
---|
72 | * expression, use the `eq` (equal) or `ne` (not equal) operator against a
|
---|
73 | * single un-parenthesized expression with or without quotes or against multiple
|
---|
74 | * parenthesized expressions. Examples: `fieldname eq unquoted literal`
|
---|
75 | * `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"`
|
---|
76 | * `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is
|
---|
77 | * interpreted as a regular expression using Google RE2 library syntax. The
|
---|
78 | * literal value must match the entire field. For example, to filter for
|
---|
79 | * instances that do not end with name "instance", you would use `name ne
|
---|
80 | * .*instance`. You cannot combine constraints on multiple fields using regular
|
---|
81 | * expressions.
|
---|
82 | * @opt_param bool includeAllScopes Indicates whether every visible scope for
|
---|
83 | * each scope type (zone, region, global) should be included in the response.
|
---|
84 | * For new resource types added after this field, the flag has no effect as new
|
---|
85 | * resource types will always include every visible scope for each scope type in
|
---|
86 | * response. For resource types which predate this field, if this flag is
|
---|
87 | * omitted or false, only scopes of the scope types where the resource type is
|
---|
88 | * expected to be found will be included.
|
---|
89 | * @opt_param string maxResults The maximum number of results per page that
|
---|
90 | * should be returned. If the number of available results is larger than
|
---|
91 | * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to
|
---|
92 | * get the next page of results in subsequent list requests. Acceptable values
|
---|
93 | * are `0` to `500`, inclusive. (Default: `500`)
|
---|
94 | * @opt_param string orderBy Sorts list results by a certain order. By default,
|
---|
95 | * results are returned in alphanumerical order based on the resource name. You
|
---|
96 | * can also sort results in descending order based on the creation timestamp
|
---|
97 | * using `orderBy="creationTimestamp desc"`. This sorts results based on the
|
---|
98 | * `creationTimestamp` field in reverse chronological order (newest result
|
---|
99 | * first). Use this to sort resources like operations so that the newest
|
---|
100 | * operation is returned first. Currently, only sorting by `name` or
|
---|
101 | * `creationTimestamp desc` is supported.
|
---|
102 | * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to
|
---|
103 | * the `nextPageToken` returned by a previous list request to get the next page
|
---|
104 | * of results.
|
---|
105 | * @opt_param bool returnPartialSuccess Opt-in for partial success behavior
|
---|
106 | * which provides partial results in case of failure. The default value is
|
---|
107 | * false. For example, when partial success behavior is enabled, aggregatedList
|
---|
108 | * for a single zone scope either returns all resources in the zone or no
|
---|
109 | * resources, with an error code.
|
---|
110 | * @opt_param string serviceProjectNumber The Shared VPC service project id or
|
---|
111 | * service project number for which aggregated list request is invoked for
|
---|
112 | * subnetworks list-usable api.
|
---|
113 | * @return SubnetworkAggregatedList
|
---|
114 | * @throws \Google\Service\Exception
|
---|
115 | */
|
---|
116 | public function aggregatedList($project, $optParams = [])
|
---|
117 | {
|
---|
118 | $params = ['project' => $project];
|
---|
119 | $params = array_merge($params, $optParams);
|
---|
120 | return $this->call('aggregatedList', [$params], SubnetworkAggregatedList::class);
|
---|
121 | }
|
---|
122 | /**
|
---|
123 | * Deletes the specified subnetwork. (subnetworks.delete)
|
---|
124 | *
|
---|
125 | * @param string $project Project ID for this request.
|
---|
126 | * @param string $region Name of the region scoping this request.
|
---|
127 | * @param string $subnetwork Name of the Subnetwork resource to delete.
|
---|
128 | * @param array $optParams Optional parameters.
|
---|
129 | *
|
---|
130 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
131 | * Specify a unique request ID so that if you must retry your request, the
|
---|
132 | * server will know to ignore the request if it has already been completed. For
|
---|
133 | * example, consider a situation where you make an initial request and the
|
---|
134 | * request times out. If you make the request again with the same request ID,
|
---|
135 | * the server can check if original operation with the same request ID was
|
---|
136 | * received, and if so, will ignore the second request. This prevents clients
|
---|
137 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
138 | * valid UUID with the exception that zero UUID is not supported (
|
---|
139 | * 00000000-0000-0000-0000-000000000000).
|
---|
140 | * @return Operation
|
---|
141 | * @throws \Google\Service\Exception
|
---|
142 | */
|
---|
143 | public function delete($project, $region, $subnetwork, $optParams = [])
|
---|
144 | {
|
---|
145 | $params = ['project' => $project, 'region' => $region, 'subnetwork' => $subnetwork];
|
---|
146 | $params = array_merge($params, $optParams);
|
---|
147 | return $this->call('delete', [$params], Operation::class);
|
---|
148 | }
|
---|
149 | /**
|
---|
150 | * Expands the IP CIDR range of the subnetwork to a specified value.
|
---|
151 | * (subnetworks.expandIpCidrRange)
|
---|
152 | *
|
---|
153 | * @param string $project Project ID for this request.
|
---|
154 | * @param string $region Name of the region scoping this request.
|
---|
155 | * @param string $subnetwork Name of the Subnetwork resource to update.
|
---|
156 | * @param SubnetworksExpandIpCidrRangeRequest $postBody
|
---|
157 | * @param array $optParams Optional parameters.
|
---|
158 | *
|
---|
159 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
160 | * Specify a unique request ID so that if you must retry your request, the
|
---|
161 | * server will know to ignore the request if it has already been completed. For
|
---|
162 | * example, consider a situation where you make an initial request and the
|
---|
163 | * request times out. If you make the request again with the same request ID,
|
---|
164 | * the server can check if original operation with the same request ID was
|
---|
165 | * received, and if so, will ignore the second request. This prevents clients
|
---|
166 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
167 | * valid UUID with the exception that zero UUID is not supported (
|
---|
168 | * 00000000-0000-0000-0000-000000000000).
|
---|
169 | * @return Operation
|
---|
170 | * @throws \Google\Service\Exception
|
---|
171 | */
|
---|
172 | public function expandIpCidrRange($project, $region, $subnetwork, SubnetworksExpandIpCidrRangeRequest $postBody, $optParams = [])
|
---|
173 | {
|
---|
174 | $params = ['project' => $project, 'region' => $region, 'subnetwork' => $subnetwork, 'postBody' => $postBody];
|
---|
175 | $params = array_merge($params, $optParams);
|
---|
176 | return $this->call('expandIpCidrRange', [$params], Operation::class);
|
---|
177 | }
|
---|
178 | /**
|
---|
179 | * Returns the specified subnetwork. (subnetworks.get)
|
---|
180 | *
|
---|
181 | * @param string $project Project ID for this request.
|
---|
182 | * @param string $region Name of the region scoping this request.
|
---|
183 | * @param string $subnetwork Name of the Subnetwork resource to return.
|
---|
184 | * @param array $optParams Optional parameters.
|
---|
185 | * @return Subnetwork
|
---|
186 | * @throws \Google\Service\Exception
|
---|
187 | */
|
---|
188 | public function get($project, $region, $subnetwork, $optParams = [])
|
---|
189 | {
|
---|
190 | $params = ['project' => $project, 'region' => $region, 'subnetwork' => $subnetwork];
|
---|
191 | $params = array_merge($params, $optParams);
|
---|
192 | return $this->call('get', [$params], Subnetwork::class);
|
---|
193 | }
|
---|
194 | /**
|
---|
195 | * Gets the access control policy for a resource. May be empty if no such policy
|
---|
196 | * or resource exists. (subnetworks.getIamPolicy)
|
---|
197 | *
|
---|
198 | * @param string $project Project ID for this request.
|
---|
199 | * @param string $region The name of the region for this request.
|
---|
200 | * @param string $resource Name or id of the resource for this request.
|
---|
201 | * @param array $optParams Optional parameters.
|
---|
202 | *
|
---|
203 | * @opt_param int optionsRequestedPolicyVersion Requested IAM Policy version.
|
---|
204 | * @return Policy
|
---|
205 | * @throws \Google\Service\Exception
|
---|
206 | */
|
---|
207 | public function getIamPolicy($project, $region, $resource, $optParams = [])
|
---|
208 | {
|
---|
209 | $params = ['project' => $project, 'region' => $region, 'resource' => $resource];
|
---|
210 | $params = array_merge($params, $optParams);
|
---|
211 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
212 | }
|
---|
213 | /**
|
---|
214 | * Creates a subnetwork in the specified project using the data included in the
|
---|
215 | * request. (subnetworks.insert)
|
---|
216 | *
|
---|
217 | * @param string $project Project ID for this request.
|
---|
218 | * @param string $region Name of the region scoping this request.
|
---|
219 | * @param Subnetwork $postBody
|
---|
220 | * @param array $optParams Optional parameters.
|
---|
221 | *
|
---|
222 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
223 | * Specify a unique request ID so that if you must retry your request, the
|
---|
224 | * server will know to ignore the request if it has already been completed. For
|
---|
225 | * example, consider a situation where you make an initial request and the
|
---|
226 | * request times out. If you make the request again with the same request ID,
|
---|
227 | * the server can check if original operation with the same request ID was
|
---|
228 | * received, and if so, will ignore the second request. This prevents clients
|
---|
229 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
230 | * valid UUID with the exception that zero UUID is not supported (
|
---|
231 | * 00000000-0000-0000-0000-000000000000).
|
---|
232 | * @return Operation
|
---|
233 | * @throws \Google\Service\Exception
|
---|
234 | */
|
---|
235 | public function insert($project, $region, Subnetwork $postBody, $optParams = [])
|
---|
236 | {
|
---|
237 | $params = ['project' => $project, 'region' => $region, 'postBody' => $postBody];
|
---|
238 | $params = array_merge($params, $optParams);
|
---|
239 | return $this->call('insert', [$params], Operation::class);
|
---|
240 | }
|
---|
241 | /**
|
---|
242 | * Retrieves a list of subnetworks available to the specified project.
|
---|
243 | * (subnetworks.listSubnetworks)
|
---|
244 | *
|
---|
245 | * @param string $project Project ID for this request.
|
---|
246 | * @param string $region Name of the region scoping this request.
|
---|
247 | * @param array $optParams Optional parameters.
|
---|
248 | *
|
---|
249 | * @opt_param string filter A filter expression that filters resources listed in
|
---|
250 | * the response. Most Compute resources support two types of filter expressions:
|
---|
251 | * expressions that support regular expressions and expressions that follow API
|
---|
252 | * improvement proposal AIP-160. These two types of filter expressions cannot be
|
---|
253 | * mixed in one request. If you want to use AIP-160, your expression must
|
---|
254 | * specify the field name, an operator, and the value that you want to use for
|
---|
255 | * filtering. The value must be a string, a number, or a boolean. The operator
|
---|
256 | * must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you
|
---|
257 | * are filtering Compute Engine instances, you can exclude instances named
|
---|
258 | * `example-instance` by specifying `name != example-instance`. The `:*`
|
---|
259 | * comparison can be used to test whether a key has been defined. For example,
|
---|
260 | * to find all objects with `owner` label use: ``` labels.owner:* ``` You can
|
---|
261 | * also filter nested fields. For example, you could specify
|
---|
262 | * `scheduling.automaticRestart = false` to include instances only if they are
|
---|
263 | * not scheduled for automatic restarts. You can use filtering on nested fields
|
---|
264 | * to filter based on resource labels. To filter on multiple expressions,
|
---|
265 | * provide each separate expression within parentheses. For example: ```
|
---|
266 | * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By
|
---|
267 | * default, each expression is an `AND` expression. However, you can include
|
---|
268 | * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel
|
---|
269 | * Skylake") OR (cpuPlatform = "Intel Broadwell") AND
|
---|
270 | * (scheduling.automaticRestart = true) ``` If you want to use a regular
|
---|
271 | * expression, use the `eq` (equal) or `ne` (not equal) operator against a
|
---|
272 | * single un-parenthesized expression with or without quotes or against multiple
|
---|
273 | * parenthesized expressions. Examples: `fieldname eq unquoted literal`
|
---|
274 | * `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"`
|
---|
275 | * `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is
|
---|
276 | * interpreted as a regular expression using Google RE2 library syntax. The
|
---|
277 | * literal value must match the entire field. For example, to filter for
|
---|
278 | * instances that do not end with name "instance", you would use `name ne
|
---|
279 | * .*instance`. You cannot combine constraints on multiple fields using regular
|
---|
280 | * expressions.
|
---|
281 | * @opt_param string maxResults The maximum number of results per page that
|
---|
282 | * should be returned. If the number of available results is larger than
|
---|
283 | * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to
|
---|
284 | * get the next page of results in subsequent list requests. Acceptable values
|
---|
285 | * are `0` to `500`, inclusive. (Default: `500`)
|
---|
286 | * @opt_param string orderBy Sorts list results by a certain order. By default,
|
---|
287 | * results are returned in alphanumerical order based on the resource name. You
|
---|
288 | * can also sort results in descending order based on the creation timestamp
|
---|
289 | * using `orderBy="creationTimestamp desc"`. This sorts results based on the
|
---|
290 | * `creationTimestamp` field in reverse chronological order (newest result
|
---|
291 | * first). Use this to sort resources like operations so that the newest
|
---|
292 | * operation is returned first. Currently, only sorting by `name` or
|
---|
293 | * `creationTimestamp desc` is supported.
|
---|
294 | * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to
|
---|
295 | * the `nextPageToken` returned by a previous list request to get the next page
|
---|
296 | * of results.
|
---|
297 | * @opt_param bool returnPartialSuccess Opt-in for partial success behavior
|
---|
298 | * which provides partial results in case of failure. The default value is
|
---|
299 | * false. For example, when partial success behavior is enabled, aggregatedList
|
---|
300 | * for a single zone scope either returns all resources in the zone or no
|
---|
301 | * resources, with an error code.
|
---|
302 | * @return SubnetworkList
|
---|
303 | * @throws \Google\Service\Exception
|
---|
304 | */
|
---|
305 | public function listSubnetworks($project, $region, $optParams = [])
|
---|
306 | {
|
---|
307 | $params = ['project' => $project, 'region' => $region];
|
---|
308 | $params = array_merge($params, $optParams);
|
---|
309 | return $this->call('list', [$params], SubnetworkList::class);
|
---|
310 | }
|
---|
311 | /**
|
---|
312 | * Retrieves an aggregated list of all usable subnetworks in the project.
|
---|
313 | * (subnetworks.listUsable)
|
---|
314 | *
|
---|
315 | * @param string $project Project ID for this request.
|
---|
316 | * @param array $optParams Optional parameters.
|
---|
317 | *
|
---|
318 | * @opt_param string filter A filter expression that filters resources listed in
|
---|
319 | * the response. Most Compute resources support two types of filter expressions:
|
---|
320 | * expressions that support regular expressions and expressions that follow API
|
---|
321 | * improvement proposal AIP-160. These two types of filter expressions cannot be
|
---|
322 | * mixed in one request. If you want to use AIP-160, your expression must
|
---|
323 | * specify the field name, an operator, and the value that you want to use for
|
---|
324 | * filtering. The value must be a string, a number, or a boolean. The operator
|
---|
325 | * must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you
|
---|
326 | * are filtering Compute Engine instances, you can exclude instances named
|
---|
327 | * `example-instance` by specifying `name != example-instance`. The `:*`
|
---|
328 | * comparison can be used to test whether a key has been defined. For example,
|
---|
329 | * to find all objects with `owner` label use: ``` labels.owner:* ``` You can
|
---|
330 | * also filter nested fields. For example, you could specify
|
---|
331 | * `scheduling.automaticRestart = false` to include instances only if they are
|
---|
332 | * not scheduled for automatic restarts. You can use filtering on nested fields
|
---|
333 | * to filter based on resource labels. To filter on multiple expressions,
|
---|
334 | * provide each separate expression within parentheses. For example: ```
|
---|
335 | * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By
|
---|
336 | * default, each expression is an `AND` expression. However, you can include
|
---|
337 | * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel
|
---|
338 | * Skylake") OR (cpuPlatform = "Intel Broadwell") AND
|
---|
339 | * (scheduling.automaticRestart = true) ``` If you want to use a regular
|
---|
340 | * expression, use the `eq` (equal) or `ne` (not equal) operator against a
|
---|
341 | * single un-parenthesized expression with or without quotes or against multiple
|
---|
342 | * parenthesized expressions. Examples: `fieldname eq unquoted literal`
|
---|
343 | * `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"`
|
---|
344 | * `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is
|
---|
345 | * interpreted as a regular expression using Google RE2 library syntax. The
|
---|
346 | * literal value must match the entire field. For example, to filter for
|
---|
347 | * instances that do not end with name "instance", you would use `name ne
|
---|
348 | * .*instance`. You cannot combine constraints on multiple fields using regular
|
---|
349 | * expressions.
|
---|
350 | * @opt_param string maxResults The maximum number of results per page that
|
---|
351 | * should be returned. If the number of available results is larger than
|
---|
352 | * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to
|
---|
353 | * get the next page of results in subsequent list requests. Acceptable values
|
---|
354 | * are `0` to `500`, inclusive. (Default: `500`)
|
---|
355 | * @opt_param string orderBy Sorts list results by a certain order. By default,
|
---|
356 | * results are returned in alphanumerical order based on the resource name. You
|
---|
357 | * can also sort results in descending order based on the creation timestamp
|
---|
358 | * using `orderBy="creationTimestamp desc"`. This sorts results based on the
|
---|
359 | * `creationTimestamp` field in reverse chronological order (newest result
|
---|
360 | * first). Use this to sort resources like operations so that the newest
|
---|
361 | * operation is returned first. Currently, only sorting by `name` or
|
---|
362 | * `creationTimestamp desc` is supported.
|
---|
363 | * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to
|
---|
364 | * the `nextPageToken` returned by a previous list request to get the next page
|
---|
365 | * of results.
|
---|
366 | * @opt_param bool returnPartialSuccess Opt-in for partial success behavior
|
---|
367 | * which provides partial results in case of failure. The default value is
|
---|
368 | * false. For example, when partial success behavior is enabled, aggregatedList
|
---|
369 | * for a single zone scope either returns all resources in the zone or no
|
---|
370 | * resources, with an error code.
|
---|
371 | * @return UsableSubnetworksAggregatedList
|
---|
372 | * @throws \Google\Service\Exception
|
---|
373 | */
|
---|
374 | public function listUsable($project, $optParams = [])
|
---|
375 | {
|
---|
376 | $params = ['project' => $project];
|
---|
377 | $params = array_merge($params, $optParams);
|
---|
378 | return $this->call('listUsable', [$params], UsableSubnetworksAggregatedList::class);
|
---|
379 | }
|
---|
380 | /**
|
---|
381 | * Patches the specified subnetwork with the data included in the request. Only
|
---|
382 | * certain fields can be updated with a patch request as indicated in the field
|
---|
383 | * descriptions. You must specify the current fingerprint of the subnetwork
|
---|
384 | * resource being patched. (subnetworks.patch)
|
---|
385 | *
|
---|
386 | * @param string $project Project ID for this request.
|
---|
387 | * @param string $region Name of the region scoping this request.
|
---|
388 | * @param string $subnetwork Name of the Subnetwork resource to patch.
|
---|
389 | * @param Subnetwork $postBody
|
---|
390 | * @param array $optParams Optional parameters.
|
---|
391 | *
|
---|
392 | * @opt_param int drainTimeoutSeconds The drain timeout specifies the upper
|
---|
393 | * bound in seconds on the amount of time allowed to drain connections from the
|
---|
394 | * current ACTIVE subnetwork to the current BACKUP subnetwork. The drain timeout
|
---|
395 | * is only applicable when the following conditions are true: - the subnetwork
|
---|
396 | * being patched has purpose = INTERNAL_HTTPS_LOAD_BALANCER - the subnetwork
|
---|
397 | * being patched has role = BACKUP - the patch request is setting the role to
|
---|
398 | * ACTIVE. Note that after this patch operation the roles of the ACTIVE and
|
---|
399 | * BACKUP subnetworks will be swapped.
|
---|
400 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
401 | * Specify a unique request ID so that if you must retry your request, the
|
---|
402 | * server will know to ignore the request if it has already been completed. For
|
---|
403 | * example, consider a situation where you make an initial request and the
|
---|
404 | * request times out. If you make the request again with the same request ID,
|
---|
405 | * the server can check if original operation with the same request ID was
|
---|
406 | * received, and if so, will ignore the second request. This prevents clients
|
---|
407 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
408 | * valid UUID with the exception that zero UUID is not supported (
|
---|
409 | * 00000000-0000-0000-0000-000000000000).
|
---|
410 | * @return Operation
|
---|
411 | * @throws \Google\Service\Exception
|
---|
412 | */
|
---|
413 | public function patch($project, $region, $subnetwork, Subnetwork $postBody, $optParams = [])
|
---|
414 | {
|
---|
415 | $params = ['project' => $project, 'region' => $region, 'subnetwork' => $subnetwork, 'postBody' => $postBody];
|
---|
416 | $params = array_merge($params, $optParams);
|
---|
417 | return $this->call('patch', [$params], Operation::class);
|
---|
418 | }
|
---|
419 | /**
|
---|
420 | * Sets the access control policy on the specified resource. Replaces any
|
---|
421 | * existing policy. (subnetworks.setIamPolicy)
|
---|
422 | *
|
---|
423 | * @param string $project Project ID for this request.
|
---|
424 | * @param string $region The name of the region for this request.
|
---|
425 | * @param string $resource Name or id of the resource for this request.
|
---|
426 | * @param RegionSetPolicyRequest $postBody
|
---|
427 | * @param array $optParams Optional parameters.
|
---|
428 | * @return Policy
|
---|
429 | * @throws \Google\Service\Exception
|
---|
430 | */
|
---|
431 | public function setIamPolicy($project, $region, $resource, RegionSetPolicyRequest $postBody, $optParams = [])
|
---|
432 | {
|
---|
433 | $params = ['project' => $project, 'region' => $region, 'resource' => $resource, 'postBody' => $postBody];
|
---|
434 | $params = array_merge($params, $optParams);
|
---|
435 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
436 | }
|
---|
437 | /**
|
---|
438 | * Set whether VMs in this subnet can access Google services without assigning
|
---|
439 | * external IP addresses through Private Google Access.
|
---|
440 | * (subnetworks.setPrivateIpGoogleAccess)
|
---|
441 | *
|
---|
442 | * @param string $project Project ID for this request.
|
---|
443 | * @param string $region Name of the region scoping this request.
|
---|
444 | * @param string $subnetwork Name of the Subnetwork resource.
|
---|
445 | * @param SubnetworksSetPrivateIpGoogleAccessRequest $postBody
|
---|
446 | * @param array $optParams Optional parameters.
|
---|
447 | *
|
---|
448 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
449 | * Specify a unique request ID so that if you must retry your request, the
|
---|
450 | * server will know to ignore the request if it has already been completed. For
|
---|
451 | * example, consider a situation where you make an initial request and the
|
---|
452 | * request times out. If you make the request again with the same request ID,
|
---|
453 | * the server can check if original operation with the same request ID was
|
---|
454 | * received, and if so, will ignore the second request. This prevents clients
|
---|
455 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
456 | * valid UUID with the exception that zero UUID is not supported (
|
---|
457 | * 00000000-0000-0000-0000-000000000000).
|
---|
458 | * @return Operation
|
---|
459 | * @throws \Google\Service\Exception
|
---|
460 | */
|
---|
461 | public function setPrivateIpGoogleAccess($project, $region, $subnetwork, SubnetworksSetPrivateIpGoogleAccessRequest $postBody, $optParams = [])
|
---|
462 | {
|
---|
463 | $params = ['project' => $project, 'region' => $region, 'subnetwork' => $subnetwork, 'postBody' => $postBody];
|
---|
464 | $params = array_merge($params, $optParams);
|
---|
465 | return $this->call('setPrivateIpGoogleAccess', [$params], Operation::class);
|
---|
466 | }
|
---|
467 | /**
|
---|
468 | * Returns permissions that a caller has on the specified resource.
|
---|
469 | * (subnetworks.testIamPermissions)
|
---|
470 | *
|
---|
471 | * @param string $project Project ID for this request.
|
---|
472 | * @param string $region The name of the region for this request.
|
---|
473 | * @param string $resource Name or id of the resource for this request.
|
---|
474 | * @param TestPermissionsRequest $postBody
|
---|
475 | * @param array $optParams Optional parameters.
|
---|
476 | * @return TestPermissionsResponse
|
---|
477 | * @throws \Google\Service\Exception
|
---|
478 | */
|
---|
479 | public function testIamPermissions($project, $region, $resource, TestPermissionsRequest $postBody, $optParams = [])
|
---|
480 | {
|
---|
481 | $params = ['project' => $project, 'region' => $region, 'resource' => $resource, 'postBody' => $postBody];
|
---|
482 | $params = array_merge($params, $optParams);
|
---|
483 | return $this->call('testIamPermissions', [$params], TestPermissionsResponse::class);
|
---|
484 | }
|
---|
485 | }
|
---|
486 |
|
---|
487 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
488 | class_alias(Subnetworks::class, 'Google_Service_Compute_Resource_Subnetworks');
|
---|