source: vendor/google/apiclient-services/src/Compute/Resource/RegionCommitments.php@ f9c482b

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

Upload new project files

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