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