source: vendor/google/apiclient-services/src/Compute/Resource/FutureReservations.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.9 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\FutureReservation;
21use Google\Service\Compute\FutureReservationsAggregatedListResponse;
22use Google\Service\Compute\FutureReservationsListResponse;
23use Google\Service\Compute\Operation;
24
25/**
26 * The "futureReservations" collection of methods.
27 * Typical usage is:
28 * <code>
29 * $computeService = new Google\Service\Compute(...);
30 * $futureReservations = $computeService->futureReservations;
31 * </code>
32 */
33class FutureReservations extends \Google\Service\Resource
34{
35 /**
36 * Retrieves an aggregated list of future reservations. To prevent failure,
37 * Google recommends that you set the `returnPartialSuccess` parameter to
38 * `true`. (futureReservations.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 FutureReservationsAggregatedListResponse
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], FutureReservationsAggregatedListResponse::class);
114 }
115 /**
116 * Cancel the specified future reservation. (futureReservations.cancel)
117 *
118 * @param string $project Project ID for this request.
119 * @param string $zone Name of the zone for this request. Name should conform to
120 * RFC1035.
121 * @param string $futureReservation Name of the future reservation to retrieve.
122 * Name should conform to RFC1035.
123 * @param array $optParams Optional parameters.
124 *
125 * @opt_param string requestId An optional request ID to identify requests.
126 * Specify a unique request ID so that if you must retry your request, the
127 * server will know to ignore the request if it has already been completed. For
128 * example, consider a situation where you make an initial request and the
129 * request times out. If you make the request again with the same request ID,
130 * the server can check if original operation with the same request ID was
131 * received, and if so, will ignore the second request. This prevents clients
132 * from accidentally creating duplicate commitments. The request ID must be a
133 * valid UUID with the exception that zero UUID is not supported (
134 * 00000000-0000-0000-0000-000000000000).
135 * @return Operation
136 * @throws \Google\Service\Exception
137 */
138 public function cancel($project, $zone, $futureReservation, $optParams = [])
139 {
140 $params = ['project' => $project, 'zone' => $zone, 'futureReservation' => $futureReservation];
141 $params = array_merge($params, $optParams);
142 return $this->call('cancel', [$params], Operation::class);
143 }
144 /**
145 * Deletes the specified future reservation. (futureReservations.delete)
146 *
147 * @param string $project Project ID for this request.
148 * @param string $zone Name of the zone for this request. Name should conform to
149 * RFC1035.
150 * @param string $futureReservation Name of the future reservation to retrieve.
151 * Name should conform to RFC1035.
152 * @param array $optParams Optional parameters.
153 *
154 * @opt_param string requestId An optional request ID to identify requests.
155 * Specify a unique request ID so that if you must retry your request, the
156 * server will know to ignore the request if it has already been completed. For
157 * example, consider a situation where you make an initial request and the
158 * request times out. If you make the request again with the same request ID,
159 * the server can check if original operation with the same request ID was
160 * received, and if so, will ignore the second request. This prevents clients
161 * from accidentally creating duplicate commitments. The request ID must be a
162 * valid UUID with the exception that zero UUID is not supported (
163 * 00000000-0000-0000-0000-000000000000).
164 * @return Operation
165 * @throws \Google\Service\Exception
166 */
167 public function delete($project, $zone, $futureReservation, $optParams = [])
168 {
169 $params = ['project' => $project, 'zone' => $zone, 'futureReservation' => $futureReservation];
170 $params = array_merge($params, $optParams);
171 return $this->call('delete', [$params], Operation::class);
172 }
173 /**
174 * Retrieves information about the specified future reservation.
175 * (futureReservations.get)
176 *
177 * @param string $project Project ID for this request.
178 * @param string $zone Name of the zone for this request. Name should conform to
179 * RFC1035.
180 * @param string $futureReservation Name of the future reservation to retrieve.
181 * Name should conform to RFC1035.
182 * @param array $optParams Optional parameters.
183 * @return FutureReservation
184 * @throws \Google\Service\Exception
185 */
186 public function get($project, $zone, $futureReservation, $optParams = [])
187 {
188 $params = ['project' => $project, 'zone' => $zone, 'futureReservation' => $futureReservation];
189 $params = array_merge($params, $optParams);
190 return $this->call('get', [$params], FutureReservation::class);
191 }
192 /**
193 * Creates a new Future Reservation. (futureReservations.insert)
194 *
195 * @param string $project Project ID for this request.
196 * @param string $zone Name of the zone for this request. Name should conform to
197 * RFC1035.
198 * @param FutureReservation $postBody
199 * @param array $optParams Optional parameters.
200 *
201 * @opt_param string requestId An optional request ID to identify requests.
202 * Specify a unique request ID so that if you must retry your request, the
203 * server will know to ignore the request if it has already been completed. For
204 * example, consider a situation where you make an initial request and the
205 * request times out. If you make the request again with the same request ID,
206 * the server can check if original operation with the same request ID was
207 * received, and if so, will ignore the second request. This prevents clients
208 * from accidentally creating duplicate commitments. The request ID must be a
209 * valid UUID with the exception that zero UUID is not supported (
210 * 00000000-0000-0000-0000-000000000000).
211 * @return Operation
212 * @throws \Google\Service\Exception
213 */
214 public function insert($project, $zone, FutureReservation $postBody, $optParams = [])
215 {
216 $params = ['project' => $project, 'zone' => $zone, 'postBody' => $postBody];
217 $params = array_merge($params, $optParams);
218 return $this->call('insert', [$params], Operation::class);
219 }
220 /**
221 * A list of all the future reservations that have been configured for the
222 * specified project in specified zone.
223 * (futureReservations.listFutureReservations)
224 *
225 * @param string $project Project ID for this request.
226 * @param string $zone Name of the zone for this request. Name should conform to
227 * RFC1035.
228 * @param array $optParams Optional parameters.
229 *
230 * @opt_param string filter A filter expression that filters resources listed in
231 * the response. Most Compute resources support two types of filter expressions:
232 * expressions that support regular expressions and expressions that follow API
233 * improvement proposal AIP-160. These two types of filter expressions cannot be
234 * mixed in one request. If you want to use AIP-160, your expression must
235 * specify the field name, an operator, and the value that you want to use for
236 * filtering. The value must be a string, a number, or a boolean. The operator
237 * must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you
238 * are filtering Compute Engine instances, you can exclude instances named
239 * `example-instance` by specifying `name != example-instance`. The `:*`
240 * comparison can be used to test whether a key has been defined. For example,
241 * to find all objects with `owner` label use: ``` labels.owner:* ``` You can
242 * also filter nested fields. For example, you could specify
243 * `scheduling.automaticRestart = false` to include instances only if they are
244 * not scheduled for automatic restarts. You can use filtering on nested fields
245 * to filter based on resource labels. To filter on multiple expressions,
246 * provide each separate expression within parentheses. For example: ```
247 * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By
248 * default, each expression is an `AND` expression. However, you can include
249 * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel
250 * Skylake") OR (cpuPlatform = "Intel Broadwell") AND
251 * (scheduling.automaticRestart = true) ``` If you want to use a regular
252 * expression, use the `eq` (equal) or `ne` (not equal) operator against a
253 * single un-parenthesized expression with or without quotes or against multiple
254 * parenthesized expressions. Examples: `fieldname eq unquoted literal`
255 * `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"`
256 * `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is
257 * interpreted as a regular expression using Google RE2 library syntax. The
258 * literal value must match the entire field. For example, to filter for
259 * instances that do not end with name "instance", you would use `name ne
260 * .*instance`. You cannot combine constraints on multiple fields using regular
261 * expressions.
262 * @opt_param string maxResults The maximum number of results per page that
263 * should be returned. If the number of available results is larger than
264 * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to
265 * get the next page of results in subsequent list requests. Acceptable values
266 * are `0` to `500`, inclusive. (Default: `500`)
267 * @opt_param string orderBy Sorts list results by a certain order. By default,
268 * results are returned in alphanumerical order based on the resource name. You
269 * can also sort results in descending order based on the creation timestamp
270 * using `orderBy="creationTimestamp desc"`. This sorts results based on the
271 * `creationTimestamp` field in reverse chronological order (newest result
272 * first). Use this to sort resources like operations so that the newest
273 * operation is returned first. Currently, only sorting by `name` or
274 * `creationTimestamp desc` is supported.
275 * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to
276 * the `nextPageToken` returned by a previous list request to get the next page
277 * of results.
278 * @opt_param bool returnPartialSuccess Opt-in for partial success behavior
279 * which provides partial results in case of failure. The default value is
280 * false. For example, when partial success behavior is enabled, aggregatedList
281 * for a single zone scope either returns all resources in the zone or no
282 * resources, with an error code.
283 * @return FutureReservationsListResponse
284 * @throws \Google\Service\Exception
285 */
286 public function listFutureReservations($project, $zone, $optParams = [])
287 {
288 $params = ['project' => $project, 'zone' => $zone];
289 $params = array_merge($params, $optParams);
290 return $this->call('list', [$params], FutureReservationsListResponse::class);
291 }
292 /**
293 * Updates the specified future reservation. (futureReservations.update)
294 *
295 * @param string $project Project ID for this request.
296 * @param string $zone Name of the zone for this request. Name should conform to
297 * RFC1035.
298 * @param string $futureReservation Name of the reservation to update. Name
299 * should conform to RFC1035.
300 * @param FutureReservation $postBody
301 * @param array $optParams Optional parameters.
302 *
303 * @opt_param string requestId An optional request ID to identify requests.
304 * Specify a unique request ID so that if you must retry your request, the
305 * server will know to ignore the request if it has already been completed. For
306 * example, consider a situation where you make an initial request and the
307 * request times out. If you make the request again with the same request ID,
308 * the server can check if original operation with the same request ID was
309 * received, and if so, will ignore the second request. This prevents clients
310 * from accidentally creating duplicate commitments. The request ID must be a
311 * valid UUID with the exception that zero UUID is not supported (
312 * 00000000-0000-0000-0000-000000000000).
313 * @opt_param string updateMask update_mask indicates fields to be updated as
314 * part of this request.
315 * @return Operation
316 * @throws \Google\Service\Exception
317 */
318 public function update($project, $zone, $futureReservation, FutureReservation $postBody, $optParams = [])
319 {
320 $params = ['project' => $project, 'zone' => $zone, 'futureReservation' => $futureReservation, 'postBody' => $postBody];
321 $params = array_merge($params, $optParams);
322 return $this->call('update', [$params], Operation::class);
323 }
324}
325
326// Adding a class alias for backwards compatibility with the previous class name.
327class_alias(FutureReservations::class, 'Google_Service_Compute_Resource_FutureReservations');
Note: See TracBrowser for help on using the repository browser.