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