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

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

Upload project files

  • Property mode set to 100644
File size: 17.2 KB
Line 
1<?php
2/*
3 * Copyright 2014 Google Inc.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6 * use this file except in compliance with the License. You may obtain a copy of
7 * the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 * License for the specific language governing permissions and limitations under
15 * the License.
16 */
17
18namespace Google\Service\Compute\Resource;
19
20use Google\Service\Compute\Autoscaler;
21use Google\Service\Compute\AutoscalerAggregatedList;
22use Google\Service\Compute\AutoscalerList;
23use Google\Service\Compute\Operation;
24
25/**
26 * The "autoscalers" collection of methods.
27 * Typical usage is:
28 * <code>
29 * $computeService = new Google\Service\Compute(...);
30 * $autoscalers = $computeService->autoscalers;
31 * </code>
32 */
33class Autoscalers extends \Google\Service\Resource
34{
35 /**
36 * Retrieves an aggregated list of autoscalers. To prevent failure, Google
37 * recommends that you set the `returnPartialSuccess` parameter to `true`.
38 * (autoscalers.aggregatedList)
39 *
40 * @param string $project Project ID for this request.
41 * @param array $optParams Optional parameters.
42 *
43 * @opt_param string filter A filter expression that filters resources listed in
44 * the response. Most Compute resources support two types of filter expressions:
45 * expressions that support regular expressions and expressions that follow API
46 * improvement proposal AIP-160. These two types of filter expressions cannot be
47 * mixed in one request. If you want to use AIP-160, your expression must
48 * specify the field name, an operator, and the value that you want to use for
49 * filtering. The value must be a string, a number, or a boolean. The operator
50 * must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you
51 * are filtering Compute Engine instances, you can exclude instances named
52 * `example-instance` by specifying `name != example-instance`. The `:*`
53 * comparison can be used to test whether a key has been defined. For example,
54 * to find all objects with `owner` label use: ``` labels.owner:* ``` You can
55 * also filter nested fields. For example, you could specify
56 * `scheduling.automaticRestart = false` to include instances only if they are
57 * not scheduled for automatic restarts. You can use filtering on nested fields
58 * to filter based on resource labels. To filter on multiple expressions,
59 * provide each separate expression within parentheses. For example: ```
60 * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By
61 * default, each expression is an `AND` expression. However, you can include
62 * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel
63 * Skylake") OR (cpuPlatform = "Intel Broadwell") AND
64 * (scheduling.automaticRestart = true) ``` If you want to use a regular
65 * expression, use the `eq` (equal) or `ne` (not equal) operator against a
66 * single un-parenthesized expression with or without quotes or against multiple
67 * parenthesized expressions. Examples: `fieldname eq unquoted literal`
68 * `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"`
69 * `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is
70 * interpreted as a regular expression using Google RE2 library syntax. The
71 * literal value must match the entire field. For example, to filter for
72 * instances that do not end with name "instance", you would use `name ne
73 * .*instance`. You cannot combine constraints on multiple fields using regular
74 * expressions.
75 * @opt_param bool includeAllScopes Indicates whether every visible scope for
76 * each scope type (zone, region, global) should be included in the response.
77 * For new resource types added after this field, the flag has no effect as new
78 * resource types will always include every visible scope for each scope type in
79 * response. For resource types which predate this field, if this flag is
80 * omitted or false, only scopes of the scope types where the resource type is
81 * expected to be found will be included.
82 * @opt_param string maxResults The maximum number of results per page that
83 * should be returned. If the number of available results is larger than
84 * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to
85 * get the next page of results in subsequent list requests. Acceptable values
86 * are `0` to `500`, inclusive. (Default: `500`)
87 * @opt_param string orderBy Sorts list results by a certain order. By default,
88 * results are returned in alphanumerical order based on the resource name. You
89 * can also sort results in descending order based on the creation timestamp
90 * using `orderBy="creationTimestamp desc"`. This sorts results based on the
91 * `creationTimestamp` field in reverse chronological order (newest result
92 * first). Use this to sort resources like operations so that the newest
93 * operation is returned first. Currently, only sorting by `name` or
94 * `creationTimestamp desc` is supported.
95 * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to
96 * the `nextPageToken` returned by a previous list request to get the next page
97 * of results.
98 * @opt_param bool returnPartialSuccess Opt-in for partial success behavior
99 * which provides partial results in case of failure. The default value is
100 * false. For example, when partial success behavior is enabled, aggregatedList
101 * for a single zone scope either returns all resources in the zone or no
102 * resources, with an error code.
103 * @opt_param string serviceProjectNumber The Shared VPC service project id or
104 * service project number for which aggregated list request is invoked for
105 * subnetworks list-usable api.
106 * @return AutoscalerAggregatedList
107 * @throws \Google\Service\Exception
108 */
109 public function aggregatedList($project, $optParams = [])
110 {
111 $params = ['project' => $project];
112 $params = array_merge($params, $optParams);
113 return $this->call('aggregatedList', [$params], AutoscalerAggregatedList::class);
114 }
115 /**
116 * Deletes the specified autoscaler. (autoscalers.delete)
117 *
118 * @param string $project Project ID for this request.
119 * @param string $zone Name of the zone for this request.
120 * @param string $autoscaler Name of the autoscaler to delete.
121 * @param array $optParams Optional parameters.
122 *
123 * @opt_param string requestId An optional request ID to identify requests.
124 * Specify a unique request ID so that if you must retry your request, the
125 * server will know to ignore the request if it has already been completed. For
126 * example, consider a situation where you make an initial request and the
127 * request times out. If you make the request again with the same request ID,
128 * the server can check if original operation with the same request ID was
129 * received, and if so, will ignore the second request. This prevents clients
130 * from accidentally creating duplicate commitments. The request ID must be a
131 * valid UUID with the exception that zero UUID is not supported (
132 * 00000000-0000-0000-0000-000000000000).
133 * @return Operation
134 * @throws \Google\Service\Exception
135 */
136 public function delete($project, $zone, $autoscaler, $optParams = [])
137 {
138 $params = ['project' => $project, 'zone' => $zone, 'autoscaler' => $autoscaler];
139 $params = array_merge($params, $optParams);
140 return $this->call('delete', [$params], Operation::class);
141 }
142 /**
143 * Returns the specified autoscaler resource. (autoscalers.get)
144 *
145 * @param string $project Project ID for this request.
146 * @param string $zone Name of the zone for this request.
147 * @param string $autoscaler Name of the autoscaler to return.
148 * @param array $optParams Optional parameters.
149 * @return Autoscaler
150 * @throws \Google\Service\Exception
151 */
152 public function get($project, $zone, $autoscaler, $optParams = [])
153 {
154 $params = ['project' => $project, 'zone' => $zone, 'autoscaler' => $autoscaler];
155 $params = array_merge($params, $optParams);
156 return $this->call('get', [$params], Autoscaler::class);
157 }
158 /**
159 * Creates an autoscaler in the specified project using the data included in the
160 * request. (autoscalers.insert)
161 *
162 * @param string $project Project ID for this request.
163 * @param string $zone Name of the zone for this request.
164 * @param Autoscaler $postBody
165 * @param array $optParams Optional parameters.
166 *
167 * @opt_param string requestId An optional request ID to identify requests.
168 * Specify a unique request ID so that if you must retry your request, the
169 * server will know to ignore the request if it has already been completed. For
170 * example, consider a situation where you make an initial request and the
171 * request times out. If you make the request again with the same request ID,
172 * the server can check if original operation with the same request ID was
173 * received, and if so, will ignore the second request. This prevents clients
174 * from accidentally creating duplicate commitments. The request ID must be a
175 * valid UUID with the exception that zero UUID is not supported (
176 * 00000000-0000-0000-0000-000000000000).
177 * @return Operation
178 * @throws \Google\Service\Exception
179 */
180 public function insert($project, $zone, Autoscaler $postBody, $optParams = [])
181 {
182 $params = ['project' => $project, 'zone' => $zone, 'postBody' => $postBody];
183 $params = array_merge($params, $optParams);
184 return $this->call('insert', [$params], Operation::class);
185 }
186 /**
187 * Retrieves a list of autoscalers contained within the specified zone.
188 * (autoscalers.listAutoscalers)
189 *
190 * @param string $project Project ID for this request.
191 * @param string $zone Name of the zone for this request.
192 * @param array $optParams Optional parameters.
193 *
194 * @opt_param string filter A filter expression that filters resources listed in
195 * the response. Most Compute resources support two types of filter expressions:
196 * expressions that support regular expressions and expressions that follow API
197 * improvement proposal AIP-160. These two types of filter expressions cannot be
198 * mixed in one request. If you want to use AIP-160, your expression must
199 * specify the field name, an operator, and the value that you want to use for
200 * filtering. The value must be a string, a number, or a boolean. The operator
201 * must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you
202 * are filtering Compute Engine instances, you can exclude instances named
203 * `example-instance` by specifying `name != example-instance`. The `:*`
204 * comparison can be used to test whether a key has been defined. For example,
205 * to find all objects with `owner` label use: ``` labels.owner:* ``` You can
206 * also filter nested fields. For example, you could specify
207 * `scheduling.automaticRestart = false` to include instances only if they are
208 * not scheduled for automatic restarts. You can use filtering on nested fields
209 * to filter based on resource labels. To filter on multiple expressions,
210 * provide each separate expression within parentheses. For example: ```
211 * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By
212 * default, each expression is an `AND` expression. However, you can include
213 * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel
214 * Skylake") OR (cpuPlatform = "Intel Broadwell") AND
215 * (scheduling.automaticRestart = true) ``` If you want to use a regular
216 * expression, use the `eq` (equal) or `ne` (not equal) operator against a
217 * single un-parenthesized expression with or without quotes or against multiple
218 * parenthesized expressions. Examples: `fieldname eq unquoted literal`
219 * `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"`
220 * `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is
221 * interpreted as a regular expression using Google RE2 library syntax. The
222 * literal value must match the entire field. For example, to filter for
223 * instances that do not end with name "instance", you would use `name ne
224 * .*instance`. You cannot combine constraints on multiple fields using regular
225 * expressions.
226 * @opt_param string maxResults The maximum number of results per page that
227 * should be returned. If the number of available results is larger than
228 * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to
229 * get the next page of results in subsequent list requests. Acceptable values
230 * are `0` to `500`, inclusive. (Default: `500`)
231 * @opt_param string orderBy Sorts list results by a certain order. By default,
232 * results are returned in alphanumerical order based on the resource name. You
233 * can also sort results in descending order based on the creation timestamp
234 * using `orderBy="creationTimestamp desc"`. This sorts results based on the
235 * `creationTimestamp` field in reverse chronological order (newest result
236 * first). Use this to sort resources like operations so that the newest
237 * operation is returned first. Currently, only sorting by `name` or
238 * `creationTimestamp desc` is supported.
239 * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to
240 * the `nextPageToken` returned by a previous list request to get the next page
241 * of results.
242 * @opt_param bool returnPartialSuccess Opt-in for partial success behavior
243 * which provides partial results in case of failure. The default value is
244 * false. For example, when partial success behavior is enabled, aggregatedList
245 * for a single zone scope either returns all resources in the zone or no
246 * resources, with an error code.
247 * @return AutoscalerList
248 * @throws \Google\Service\Exception
249 */
250 public function listAutoscalers($project, $zone, $optParams = [])
251 {
252 $params = ['project' => $project, 'zone' => $zone];
253 $params = array_merge($params, $optParams);
254 return $this->call('list', [$params], AutoscalerList::class);
255 }
256 /**
257 * Updates an autoscaler in the specified project using the data included in the
258 * request. This method supports PATCH semantics and uses the JSON merge patch
259 * format and processing rules. (autoscalers.patch)
260 *
261 * @param string $project Project ID for this request.
262 * @param string $zone Name of the zone for this request.
263 * @param Autoscaler $postBody
264 * @param array $optParams Optional parameters.
265 *
266 * @opt_param string autoscaler Name of the autoscaler to patch.
267 * @opt_param string requestId An optional request ID to identify requests.
268 * Specify a unique request ID so that if you must retry your request, the
269 * server will know to ignore the request if it has already been completed. For
270 * example, consider a situation where you make an initial request and the
271 * request times out. If you make the request again with the same request ID,
272 * the server can check if original operation with the same request ID was
273 * received, and if so, will ignore the second request. This prevents clients
274 * from accidentally creating duplicate commitments. The request ID must be a
275 * valid UUID with the exception that zero UUID is not supported (
276 * 00000000-0000-0000-0000-000000000000).
277 * @return Operation
278 * @throws \Google\Service\Exception
279 */
280 public function patch($project, $zone, Autoscaler $postBody, $optParams = [])
281 {
282 $params = ['project' => $project, 'zone' => $zone, 'postBody' => $postBody];
283 $params = array_merge($params, $optParams);
284 return $this->call('patch', [$params], Operation::class);
285 }
286 /**
287 * Updates an autoscaler in the specified project using the data included in the
288 * request. (autoscalers.update)
289 *
290 * @param string $project Project ID for this request.
291 * @param string $zone Name of the zone for this request.
292 * @param Autoscaler $postBody
293 * @param array $optParams Optional parameters.
294 *
295 * @opt_param string autoscaler Name of the autoscaler to update.
296 * @opt_param string requestId An optional request ID to identify requests.
297 * Specify a unique request ID so that if you must retry your request, the
298 * server will know to ignore the request if it has already been completed. For
299 * example, consider a situation where you make an initial request and the
300 * request times out. If you make the request again with the same request ID,
301 * the server can check if original operation with the same request ID was
302 * received, and if so, will ignore the second request. This prevents clients
303 * from accidentally creating duplicate commitments. The request ID must be a
304 * valid UUID with the exception that zero UUID is not supported (
305 * 00000000-0000-0000-0000-000000000000).
306 * @return Operation
307 * @throws \Google\Service\Exception
308 */
309 public function update($project, $zone, Autoscaler $postBody, $optParams = [])
310 {
311 $params = ['project' => $project, 'zone' => $zone, 'postBody' => $postBody];
312 $params = array_merge($params, $optParams);
313 return $this->call('update', [$params], Operation::class);
314 }
315}
316
317// Adding a class alias for backwards compatibility with the previous class name.
318class_alias(Autoscalers::class, 'Google_Service_Compute_Resource_Autoscalers');
Note: See TracBrowser for help on using the repository browser.