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