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\HttpHealthCheck; 21use Google\Service\Compute\HttpHealthCheckList; 22use Google\Service\Compute\Operation; 23 24/** 25 * The "httpHealthChecks" collection of methods. 26 * Typical usage is: 27 * <code> 28 * $computeService = new Google\Service\Compute(...); 29 * $httpHealthChecks = $computeService->httpHealthChecks; 30 * </code> 31 */ 32class HttpHealthChecks extends \Google\Service\Resource 33{ 34 /** 35 * Deletes the specified HttpHealthCheck resource. (httpHealthChecks.delete) 36 * 37 * @param string $project Project ID for this request. 38 * @param string $httpHealthCheck Name of the HttpHealthCheck resource to 39 * delete. 40 * @param array $optParams Optional parameters. 41 * 42 * @opt_param string requestId An optional request ID to identify requests. 43 * Specify a unique request ID so that if you must retry your request, the 44 * server will know to ignore the request if it has already been completed. For 45 * example, consider a situation where you make an initial request and the 46 * request times out. If you make the request again with the same request ID, 47 * the server can check if original operation with the same request ID was 48 * received, and if so, will ignore the second request. This prevents clients 49 * from accidentally creating duplicate commitments. The request ID must be a 50 * valid UUID with the exception that zero UUID is not supported ( 51 * 00000000-0000-0000-0000-000000000000). 52 * @return Operation 53 */ 54 public function delete($project, $httpHealthCheck, $optParams = []) 55 { 56 $params = ['project' => $project, 'httpHealthCheck' => $httpHealthCheck]; 57 $params = array_merge($params, $optParams); 58 return $this->call('delete', [$params], Operation::class); 59 } 60 /** 61 * Returns the specified HttpHealthCheck resource. Gets a list of available HTTP 62 * health checks by making a list() request. (httpHealthChecks.get) 63 * 64 * @param string $project Project ID for this request. 65 * @param string $httpHealthCheck Name of the HttpHealthCheck resource to 66 * return. 67 * @param array $optParams Optional parameters. 68 * @return HttpHealthCheck 69 */ 70 public function get($project, $httpHealthCheck, $optParams = []) 71 { 72 $params = ['project' => $project, 'httpHealthCheck' => $httpHealthCheck]; 73 $params = array_merge($params, $optParams); 74 return $this->call('get', [$params], HttpHealthCheck::class); 75 } 76 /** 77 * Creates a HttpHealthCheck resource in the specified project using the data 78 * included in the request. (httpHealthChecks.insert) 79 * 80 * @param string $project Project ID for this request. 81 * @param HttpHealthCheck $postBody 82 * @param array $optParams Optional parameters. 83 * 84 * @opt_param string requestId An optional request ID to identify requests. 85 * Specify a unique request ID so that if you must retry your request, the 86 * server will know to ignore the request if it has already been completed. For 87 * example, consider a situation where you make an initial request and the 88 * request times out. If you make the request again with the same request ID, 89 * the server can check if original operation with the same request ID was 90 * received, and if so, will ignore the second request. This prevents clients 91 * from accidentally creating duplicate commitments. The request ID must be a 92 * valid UUID with the exception that zero UUID is not supported ( 93 * 00000000-0000-0000-0000-000000000000). 94 * @return Operation 95 */ 96 public function insert($project, HttpHealthCheck $postBody, $optParams = []) 97 { 98 $params = ['project' => $project, 'postBody' => $postBody]; 99 $params = array_merge($params, $optParams); 100 return $this->call('insert', [$params], Operation::class); 101 } 102 /** 103 * Retrieves the list of HttpHealthCheck resources available to the specified 104 * project. (httpHealthChecks.listHttpHealthChecks) 105 * 106 * @param string $project Project ID for this request. 107 * @param array $optParams Optional parameters. 108 * 109 * @opt_param string filter A filter expression that filters resources listed in 110 * the response. The expression must specify the field name, an operator, and 111 * the value that you want to use for filtering. The value must be a string, a 112 * number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, 113 * `>=` or `:`. For example, if you are filtering Compute Engine instances, you 114 * can exclude instances named `example-instance` by specifying `name != 115 * example-instance`. The `:` operator can be used with string fields to match 116 * substrings. For non-string fields it is equivalent to the `=` operator. The 117 * `:*` comparison can be used to test whether a key has been defined. For 118 * example, to find all objects with `owner` label use: ``` labels.owner:* ``` 119 * You can also filter nested fields. For example, you could specify 120 * `scheduling.automaticRestart = false` to include instances only if they are 121 * not scheduled for automatic restarts. You can use filtering on nested fields 122 * to filter based on resource labels. To filter on multiple expressions, 123 * provide each separate expression within parentheses. For example: ``` 124 * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By 125 * default, each expression is an `AND` expression. However, you can include 126 * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel 127 * Skylake") OR (cpuPlatform = "Intel Broadwell") AND 128 * (scheduling.automaticRestart = true) ``` 129 * @opt_param string maxResults The maximum number of results per page that 130 * should be returned. If the number of available results is larger than 131 * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to 132 * get the next page of results in subsequent list requests. Acceptable values 133 * are `0` to `500`, inclusive. (Default: `500`) 134 * @opt_param string orderBy Sorts list results by a certain order. By default, 135 * results are returned in alphanumerical order based on the resource name. You 136 * can also sort results in descending order based on the creation timestamp 137 * using `orderBy="creationTimestamp desc"`. This sorts results based on the 138 * `creationTimestamp` field in reverse chronological order (newest result 139 * first). Use this to sort resources like operations so that the newest 140 * operation is returned first. Currently, only sorting by `name` or 141 * `creationTimestamp desc` is supported. 142 * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to 143 * the `nextPageToken` returned by a previous list request to get the next page 144 * of results. 145 * @opt_param bool returnPartialSuccess Opt-in for partial success behavior 146 * which provides partial results in case of failure. The default value is 147 * false. 148 * @return HttpHealthCheckList 149 */ 150 public function listHttpHealthChecks($project, $optParams = []) 151 { 152 $params = ['project' => $project]; 153 $params = array_merge($params, $optParams); 154 return $this->call('list', [$params], HttpHealthCheckList::class); 155 } 156 /** 157 * Updates a HttpHealthCheck resource in the specified project using the data 158 * included in the request. This method supports PATCH semantics and uses the 159 * JSON merge patch format and processing rules. (httpHealthChecks.patch) 160 * 161 * @param string $project Project ID for this request. 162 * @param string $httpHealthCheck Name of the HttpHealthCheck resource to patch. 163 * @param HttpHealthCheck $postBody 164 * @param array $optParams Optional parameters. 165 * 166 * @opt_param string requestId An optional request ID to identify requests. 167 * Specify a unique request ID so that if you must retry your request, the 168 * server will know to ignore the request if it has already been completed. For 169 * example, consider a situation where you make an initial request and the 170 * request times out. If you make the request again with the same request ID, 171 * the server can check if original operation with the same request ID was 172 * received, and if so, will ignore the second request. This prevents clients 173 * from accidentally creating duplicate commitments. The request ID must be a 174 * valid UUID with the exception that zero UUID is not supported ( 175 * 00000000-0000-0000-0000-000000000000). 176 * @return Operation 177 */ 178 public function patch($project, $httpHealthCheck, HttpHealthCheck $postBody, $optParams = []) 179 { 180 $params = ['project' => $project, 'httpHealthCheck' => $httpHealthCheck, 'postBody' => $postBody]; 181 $params = array_merge($params, $optParams); 182 return $this->call('patch', [$params], Operation::class); 183 } 184 /** 185 * Updates a HttpHealthCheck resource in the specified project using the data 186 * included in the request. (httpHealthChecks.update) 187 * 188 * @param string $project Project ID for this request. 189 * @param string $httpHealthCheck Name of the HttpHealthCheck resource to 190 * update. 191 * @param HttpHealthCheck $postBody 192 * @param array $optParams Optional parameters. 193 * 194 * @opt_param string requestId An optional request ID to identify requests. 195 * Specify a unique request ID so that if you must retry your request, the 196 * server will know to ignore the request if it has already been completed. For 197 * example, consider a situation where you make an initial request and the 198 * request times out. If you make the request again with the same request ID, 199 * the server can check if original operation with the same request ID was 200 * received, and if so, will ignore the second request. This prevents clients 201 * from accidentally creating duplicate commitments. The request ID must be a 202 * valid UUID with the exception that zero UUID is not supported ( 203 * 00000000-0000-0000-0000-000000000000). 204 * @return Operation 205 */ 206 public function update($project, $httpHealthCheck, HttpHealthCheck $postBody, $optParams = []) 207 { 208 $params = ['project' => $project, 'httpHealthCheck' => $httpHealthCheck, 'postBody' => $postBody]; 209 $params = array_merge($params, $optParams); 210 return $this->call('update', [$params], Operation::class); 211 } 212} 213 214// Adding a class alias for backwards compatibility with the previous class name. 215class_alias(HttpHealthChecks::class, 'Google_Service_Compute_Resource_HttpHealthChecks'); 216