[e3d4e0a] | 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 |
|
---|
| 18 | namespace Google\Service\Compute\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\Compute\BackendService;
|
---|
| 21 | use Google\Service\Compute\BackendServiceAggregatedList;
|
---|
| 22 | use Google\Service\Compute\BackendServiceGroupHealth;
|
---|
| 23 | use Google\Service\Compute\BackendServiceList;
|
---|
| 24 | use Google\Service\Compute\BackendServiceListUsable;
|
---|
| 25 | use Google\Service\Compute\GlobalSetPolicyRequest;
|
---|
| 26 | use Google\Service\Compute\Operation;
|
---|
| 27 | use Google\Service\Compute\Policy;
|
---|
| 28 | use Google\Service\Compute\ResourceGroupReference;
|
---|
| 29 | use Google\Service\Compute\SecurityPolicyReference;
|
---|
| 30 | use Google\Service\Compute\SignedUrlKey;
|
---|
| 31 | use Google\Service\Compute\TestPermissionsRequest;
|
---|
| 32 | use Google\Service\Compute\TestPermissionsResponse;
|
---|
| 33 |
|
---|
| 34 | /**
|
---|
| 35 | * The "backendServices" collection of methods.
|
---|
| 36 | * Typical usage is:
|
---|
| 37 | * <code>
|
---|
| 38 | * $computeService = new Google\Service\Compute(...);
|
---|
| 39 | * $backendServices = $computeService->backendServices;
|
---|
| 40 | * </code>
|
---|
| 41 | */
|
---|
| 42 | class BackendServices extends \Google\Service\Resource
|
---|
| 43 | {
|
---|
| 44 | /**
|
---|
| 45 | * Adds a key for validating requests with signed URLs for this backend service.
|
---|
| 46 | * (backendServices.addSignedUrlKey)
|
---|
| 47 | *
|
---|
| 48 | * @param string $project Project ID for this request.
|
---|
| 49 | * @param string $backendService Name of the BackendService resource to which
|
---|
| 50 | * the Signed URL Key should be added. The name should conform to RFC1035.
|
---|
| 51 | * @param SignedUrlKey $postBody
|
---|
| 52 | * @param array $optParams Optional parameters.
|
---|
| 53 | *
|
---|
| 54 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
| 55 | * Specify a unique request ID so that if you must retry your request, the
|
---|
| 56 | * server will know to ignore the request if it has already been completed. For
|
---|
| 57 | * example, consider a situation where you make an initial request and the
|
---|
| 58 | * request times out. If you make the request again with the same request ID,
|
---|
| 59 | * the server can check if original operation with the same request ID was
|
---|
| 60 | * received, and if so, will ignore the second request. This prevents clients
|
---|
| 61 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
| 62 | * valid UUID with the exception that zero UUID is not supported (
|
---|
| 63 | * 00000000-0000-0000-0000-000000000000).
|
---|
| 64 | * @return Operation
|
---|
| 65 | * @throws \Google\Service\Exception
|
---|
| 66 | */
|
---|
| 67 | public function addSignedUrlKey($project, $backendService, SignedUrlKey $postBody, $optParams = [])
|
---|
| 68 | {
|
---|
| 69 | $params = ['project' => $project, 'backendService' => $backendService, 'postBody' => $postBody];
|
---|
| 70 | $params = array_merge($params, $optParams);
|
---|
| 71 | return $this->call('addSignedUrlKey', [$params], Operation::class);
|
---|
| 72 | }
|
---|
| 73 | /**
|
---|
| 74 | * Retrieves the list of all BackendService resources, regional and global,
|
---|
| 75 | * available to the specified project. To prevent failure, Google recommends
|
---|
| 76 | * that you set the `returnPartialSuccess` parameter to `true`.
|
---|
| 77 | * (backendServices.aggregatedList)
|
---|
| 78 | *
|
---|
| 79 | * @param string $project Name of the project scoping this request.
|
---|
| 80 | * @param array $optParams Optional parameters.
|
---|
| 81 | *
|
---|
| 82 | * @opt_param string filter A filter expression that filters resources listed in
|
---|
| 83 | * the response. Most Compute resources support two types of filter expressions:
|
---|
| 84 | * expressions that support regular expressions and expressions that follow API
|
---|
| 85 | * improvement proposal AIP-160. These two types of filter expressions cannot be
|
---|
| 86 | * mixed in one request. If you want to use AIP-160, your expression must
|
---|
| 87 | * specify the field name, an operator, and the value that you want to use for
|
---|
| 88 | * filtering. The value must be a string, a number, or a boolean. The operator
|
---|
| 89 | * must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you
|
---|
| 90 | * are filtering Compute Engine instances, you can exclude instances named
|
---|
| 91 | * `example-instance` by specifying `name != example-instance`. The `:*`
|
---|
| 92 | * comparison can be used to test whether a key has been defined. For example,
|
---|
| 93 | * to find all objects with `owner` label use: ``` labels.owner:* ``` You can
|
---|
| 94 | * also filter nested fields. For example, you could specify
|
---|
| 95 | * `scheduling.automaticRestart = false` to include instances only if they are
|
---|
| 96 | * not scheduled for automatic restarts. You can use filtering on nested fields
|
---|
| 97 | * to filter based on resource labels. To filter on multiple expressions,
|
---|
| 98 | * provide each separate expression within parentheses. For example: ```
|
---|
| 99 | * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By
|
---|
| 100 | * default, each expression is an `AND` expression. However, you can include
|
---|
| 101 | * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel
|
---|
| 102 | * Skylake") OR (cpuPlatform = "Intel Broadwell") AND
|
---|
| 103 | * (scheduling.automaticRestart = true) ``` If you want to use a regular
|
---|
| 104 | * expression, use the `eq` (equal) or `ne` (not equal) operator against a
|
---|
| 105 | * single un-parenthesized expression with or without quotes or against multiple
|
---|
| 106 | * parenthesized expressions. Examples: `fieldname eq unquoted literal`
|
---|
| 107 | * `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"`
|
---|
| 108 | * `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is
|
---|
| 109 | * interpreted as a regular expression using Google RE2 library syntax. The
|
---|
| 110 | * literal value must match the entire field. For example, to filter for
|
---|
| 111 | * instances that do not end with name "instance", you would use `name ne
|
---|
| 112 | * .*instance`. You cannot combine constraints on multiple fields using regular
|
---|
| 113 | * expressions.
|
---|
| 114 | * @opt_param bool includeAllScopes Indicates whether every visible scope for
|
---|
| 115 | * each scope type (zone, region, global) should be included in the response.
|
---|
| 116 | * For new resource types added after this field, the flag has no effect as new
|
---|
| 117 | * resource types will always include every visible scope for each scope type in
|
---|
| 118 | * response. For resource types which predate this field, if this flag is
|
---|
| 119 | * omitted or false, only scopes of the scope types where the resource type is
|
---|
| 120 | * expected to be found will be included.
|
---|
| 121 | * @opt_param string maxResults The maximum number of results per page that
|
---|
| 122 | * should be returned. If the number of available results is larger than
|
---|
| 123 | * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to
|
---|
| 124 | * get the next page of results in subsequent list requests. Acceptable values
|
---|
| 125 | * are `0` to `500`, inclusive. (Default: `500`)
|
---|
| 126 | * @opt_param string orderBy Sorts list results by a certain order. By default,
|
---|
| 127 | * results are returned in alphanumerical order based on the resource name. You
|
---|
| 128 | * can also sort results in descending order based on the creation timestamp
|
---|
| 129 | * using `orderBy="creationTimestamp desc"`. This sorts results based on the
|
---|
| 130 | * `creationTimestamp` field in reverse chronological order (newest result
|
---|
| 131 | * first). Use this to sort resources like operations so that the newest
|
---|
| 132 | * operation is returned first. Currently, only sorting by `name` or
|
---|
| 133 | * `creationTimestamp desc` is supported.
|
---|
| 134 | * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to
|
---|
| 135 | * the `nextPageToken` returned by a previous list request to get the next page
|
---|
| 136 | * of results.
|
---|
| 137 | * @opt_param bool returnPartialSuccess Opt-in for partial success behavior
|
---|
| 138 | * which provides partial results in case of failure. The default value is
|
---|
| 139 | * false. For example, when partial success behavior is enabled, aggregatedList
|
---|
| 140 | * for a single zone scope either returns all resources in the zone or no
|
---|
| 141 | * resources, with an error code.
|
---|
| 142 | * @opt_param string serviceProjectNumber The Shared VPC service project id or
|
---|
| 143 | * service project number for which aggregated list request is invoked for
|
---|
| 144 | * subnetworks list-usable api.
|
---|
| 145 | * @return BackendServiceAggregatedList
|
---|
| 146 | * @throws \Google\Service\Exception
|
---|
| 147 | */
|
---|
| 148 | public function aggregatedList($project, $optParams = [])
|
---|
| 149 | {
|
---|
| 150 | $params = ['project' => $project];
|
---|
| 151 | $params = array_merge($params, $optParams);
|
---|
| 152 | return $this->call('aggregatedList', [$params], BackendServiceAggregatedList::class);
|
---|
| 153 | }
|
---|
| 154 | /**
|
---|
| 155 | * Deletes the specified BackendService resource. (backendServices.delete)
|
---|
| 156 | *
|
---|
| 157 | * @param string $project Project ID for this request.
|
---|
| 158 | * @param string $backendService Name of the BackendService resource to delete.
|
---|
| 159 | * @param array $optParams Optional parameters.
|
---|
| 160 | *
|
---|
| 161 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
| 162 | * Specify a unique request ID so that if you must retry your request, the
|
---|
| 163 | * server will know to ignore the request if it has already been completed. For
|
---|
| 164 | * example, consider a situation where you make an initial request and the
|
---|
| 165 | * request times out. If you make the request again with the same request ID,
|
---|
| 166 | * the server can check if original operation with the same request ID was
|
---|
| 167 | * received, and if so, will ignore the second request. This prevents clients
|
---|
| 168 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
| 169 | * valid UUID with the exception that zero UUID is not supported (
|
---|
| 170 | * 00000000-0000-0000-0000-000000000000).
|
---|
| 171 | * @return Operation
|
---|
| 172 | * @throws \Google\Service\Exception
|
---|
| 173 | */
|
---|
| 174 | public function delete($project, $backendService, $optParams = [])
|
---|
| 175 | {
|
---|
| 176 | $params = ['project' => $project, 'backendService' => $backendService];
|
---|
| 177 | $params = array_merge($params, $optParams);
|
---|
| 178 | return $this->call('delete', [$params], Operation::class);
|
---|
| 179 | }
|
---|
| 180 | /**
|
---|
| 181 | * Deletes a key for validating requests with signed URLs for this backend
|
---|
| 182 | * service. (backendServices.deleteSignedUrlKey)
|
---|
| 183 | *
|
---|
| 184 | * @param string $project Project ID for this request.
|
---|
| 185 | * @param string $backendService Name of the BackendService resource to which
|
---|
| 186 | * the Signed URL Key should be added. The name should conform to RFC1035.
|
---|
| 187 | * @param string $keyName The name of the Signed URL Key to delete.
|
---|
| 188 | * @param array $optParams Optional parameters.
|
---|
| 189 | *
|
---|
| 190 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
| 191 | * Specify a unique request ID so that if you must retry your request, the
|
---|
| 192 | * server will know to ignore the request if it has already been completed. For
|
---|
| 193 | * example, consider a situation where you make an initial request and the
|
---|
| 194 | * request times out. If you make the request again with the same request ID,
|
---|
| 195 | * the server can check if original operation with the same request ID was
|
---|
| 196 | * received, and if so, will ignore the second request. This prevents clients
|
---|
| 197 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
| 198 | * valid UUID with the exception that zero UUID is not supported (
|
---|
| 199 | * 00000000-0000-0000-0000-000000000000).
|
---|
| 200 | * @return Operation
|
---|
| 201 | * @throws \Google\Service\Exception
|
---|
| 202 | */
|
---|
| 203 | public function deleteSignedUrlKey($project, $backendService, $keyName, $optParams = [])
|
---|
| 204 | {
|
---|
| 205 | $params = ['project' => $project, 'backendService' => $backendService, 'keyName' => $keyName];
|
---|
| 206 | $params = array_merge($params, $optParams);
|
---|
| 207 | return $this->call('deleteSignedUrlKey', [$params], Operation::class);
|
---|
| 208 | }
|
---|
| 209 | /**
|
---|
| 210 | * Returns the specified BackendService resource. (backendServices.get)
|
---|
| 211 | *
|
---|
| 212 | * @param string $project Project ID for this request.
|
---|
| 213 | * @param string $backendService Name of the BackendService resource to return.
|
---|
| 214 | * @param array $optParams Optional parameters.
|
---|
| 215 | * @return BackendService
|
---|
| 216 | * @throws \Google\Service\Exception
|
---|
| 217 | */
|
---|
| 218 | public function get($project, $backendService, $optParams = [])
|
---|
| 219 | {
|
---|
| 220 | $params = ['project' => $project, 'backendService' => $backendService];
|
---|
| 221 | $params = array_merge($params, $optParams);
|
---|
| 222 | return $this->call('get', [$params], BackendService::class);
|
---|
| 223 | }
|
---|
| 224 | /**
|
---|
| 225 | * Gets the most recent health check results for this BackendService. Example
|
---|
| 226 | * request body: { "group": "/zones/us-east1-b/instanceGroups/lb-backend-
|
---|
| 227 | * example" } (backendServices.getHealth)
|
---|
| 228 | *
|
---|
| 229 | * @param string $project
|
---|
| 230 | * @param string $backendService Name of the BackendService resource to which
|
---|
| 231 | * the queried instance belongs.
|
---|
| 232 | * @param ResourceGroupReference $postBody
|
---|
| 233 | * @param array $optParams Optional parameters.
|
---|
| 234 | * @return BackendServiceGroupHealth
|
---|
| 235 | * @throws \Google\Service\Exception
|
---|
| 236 | */
|
---|
| 237 | public function getHealth($project, $backendService, ResourceGroupReference $postBody, $optParams = [])
|
---|
| 238 | {
|
---|
| 239 | $params = ['project' => $project, 'backendService' => $backendService, 'postBody' => $postBody];
|
---|
| 240 | $params = array_merge($params, $optParams);
|
---|
| 241 | return $this->call('getHealth', [$params], BackendServiceGroupHealth::class);
|
---|
| 242 | }
|
---|
| 243 | /**
|
---|
| 244 | * Gets the access control policy for a resource. May be empty if no such policy
|
---|
| 245 | * or resource exists. (backendServices.getIamPolicy)
|
---|
| 246 | *
|
---|
| 247 | * @param string $project Project ID for this request.
|
---|
| 248 | * @param string $resource Name or id of the resource for this request.
|
---|
| 249 | * @param array $optParams Optional parameters.
|
---|
| 250 | *
|
---|
| 251 | * @opt_param int optionsRequestedPolicyVersion Requested IAM Policy version.
|
---|
| 252 | * @return Policy
|
---|
| 253 | * @throws \Google\Service\Exception
|
---|
| 254 | */
|
---|
| 255 | public function getIamPolicy($project, $resource, $optParams = [])
|
---|
| 256 | {
|
---|
| 257 | $params = ['project' => $project, 'resource' => $resource];
|
---|
| 258 | $params = array_merge($params, $optParams);
|
---|
| 259 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
| 260 | }
|
---|
| 261 | /**
|
---|
| 262 | * Creates a BackendService resource in the specified project using the data
|
---|
| 263 | * included in the request. For more information, see Backend services overview
|
---|
| 264 | * . (backendServices.insert)
|
---|
| 265 | *
|
---|
| 266 | * @param string $project Project ID for this request.
|
---|
| 267 | * @param BackendService $postBody
|
---|
| 268 | * @param array $optParams Optional parameters.
|
---|
| 269 | *
|
---|
| 270 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
| 271 | * Specify a unique request ID so that if you must retry your request, the
|
---|
| 272 | * server will know to ignore the request if it has already been completed. For
|
---|
| 273 | * example, consider a situation where you make an initial request and the
|
---|
| 274 | * request times out. If you make the request again with the same request ID,
|
---|
| 275 | * the server can check if original operation with the same request ID was
|
---|
| 276 | * received, and if so, will ignore the second request. This prevents clients
|
---|
| 277 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
| 278 | * valid UUID with the exception that zero UUID is not supported (
|
---|
| 279 | * 00000000-0000-0000-0000-000000000000).
|
---|
| 280 | * @return Operation
|
---|
| 281 | * @throws \Google\Service\Exception
|
---|
| 282 | */
|
---|
| 283 | public function insert($project, BackendService $postBody, $optParams = [])
|
---|
| 284 | {
|
---|
| 285 | $params = ['project' => $project, 'postBody' => $postBody];
|
---|
| 286 | $params = array_merge($params, $optParams);
|
---|
| 287 | return $this->call('insert', [$params], Operation::class);
|
---|
| 288 | }
|
---|
| 289 | /**
|
---|
| 290 | * Retrieves the list of BackendService resources available to the specified
|
---|
| 291 | * project. (backendServices.listBackendServices)
|
---|
| 292 | *
|
---|
| 293 | * @param string $project Project ID for this request.
|
---|
| 294 | * @param array $optParams Optional parameters.
|
---|
| 295 | *
|
---|
| 296 | * @opt_param string filter A filter expression that filters resources listed in
|
---|
| 297 | * the response. Most Compute resources support two types of filter expressions:
|
---|
| 298 | * expressions that support regular expressions and expressions that follow API
|
---|
| 299 | * improvement proposal AIP-160. These two types of filter expressions cannot be
|
---|
| 300 | * mixed in one request. If you want to use AIP-160, your expression must
|
---|
| 301 | * specify the field name, an operator, and the value that you want to use for
|
---|
| 302 | * filtering. The value must be a string, a number, or a boolean. The operator
|
---|
| 303 | * must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you
|
---|
| 304 | * are filtering Compute Engine instances, you can exclude instances named
|
---|
| 305 | * `example-instance` by specifying `name != example-instance`. The `:*`
|
---|
| 306 | * comparison can be used to test whether a key has been defined. For example,
|
---|
| 307 | * to find all objects with `owner` label use: ``` labels.owner:* ``` You can
|
---|
| 308 | * also filter nested fields. For example, you could specify
|
---|
| 309 | * `scheduling.automaticRestart = false` to include instances only if they are
|
---|
| 310 | * not scheduled for automatic restarts. You can use filtering on nested fields
|
---|
| 311 | * to filter based on resource labels. To filter on multiple expressions,
|
---|
| 312 | * provide each separate expression within parentheses. For example: ```
|
---|
| 313 | * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By
|
---|
| 314 | * default, each expression is an `AND` expression. However, you can include
|
---|
| 315 | * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel
|
---|
| 316 | * Skylake") OR (cpuPlatform = "Intel Broadwell") AND
|
---|
| 317 | * (scheduling.automaticRestart = true) ``` If you want to use a regular
|
---|
| 318 | * expression, use the `eq` (equal) or `ne` (not equal) operator against a
|
---|
| 319 | * single un-parenthesized expression with or without quotes or against multiple
|
---|
| 320 | * parenthesized expressions. Examples: `fieldname eq unquoted literal`
|
---|
| 321 | * `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"`
|
---|
| 322 | * `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is
|
---|
| 323 | * interpreted as a regular expression using Google RE2 library syntax. The
|
---|
| 324 | * literal value must match the entire field. For example, to filter for
|
---|
| 325 | * instances that do not end with name "instance", you would use `name ne
|
---|
| 326 | * .*instance`. You cannot combine constraints on multiple fields using regular
|
---|
| 327 | * expressions.
|
---|
| 328 | * @opt_param string maxResults The maximum number of results per page that
|
---|
| 329 | * should be returned. If the number of available results is larger than
|
---|
| 330 | * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to
|
---|
| 331 | * get the next page of results in subsequent list requests. Acceptable values
|
---|
| 332 | * are `0` to `500`, inclusive. (Default: `500`)
|
---|
| 333 | * @opt_param string orderBy Sorts list results by a certain order. By default,
|
---|
| 334 | * results are returned in alphanumerical order based on the resource name. You
|
---|
| 335 | * can also sort results in descending order based on the creation timestamp
|
---|
| 336 | * using `orderBy="creationTimestamp desc"`. This sorts results based on the
|
---|
| 337 | * `creationTimestamp` field in reverse chronological order (newest result
|
---|
| 338 | * first). Use this to sort resources like operations so that the newest
|
---|
| 339 | * operation is returned first. Currently, only sorting by `name` or
|
---|
| 340 | * `creationTimestamp desc` is supported.
|
---|
| 341 | * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to
|
---|
| 342 | * the `nextPageToken` returned by a previous list request to get the next page
|
---|
| 343 | * of results.
|
---|
| 344 | * @opt_param bool returnPartialSuccess Opt-in for partial success behavior
|
---|
| 345 | * which provides partial results in case of failure. The default value is
|
---|
| 346 | * false. For example, when partial success behavior is enabled, aggregatedList
|
---|
| 347 | * for a single zone scope either returns all resources in the zone or no
|
---|
| 348 | * resources, with an error code.
|
---|
| 349 | * @return BackendServiceList
|
---|
| 350 | * @throws \Google\Service\Exception
|
---|
| 351 | */
|
---|
| 352 | public function listBackendServices($project, $optParams = [])
|
---|
| 353 | {
|
---|
| 354 | $params = ['project' => $project];
|
---|
| 355 | $params = array_merge($params, $optParams);
|
---|
| 356 | return $this->call('list', [$params], BackendServiceList::class);
|
---|
| 357 | }
|
---|
| 358 | /**
|
---|
| 359 | * Retrieves a list of all usable backend services in the specified project.
|
---|
| 360 | * (backendServices.listUsable)
|
---|
| 361 | *
|
---|
| 362 | * @param string $project Project ID for this request.
|
---|
| 363 | * @param array $optParams Optional parameters.
|
---|
| 364 | *
|
---|
| 365 | * @opt_param string filter A filter expression that filters resources listed in
|
---|
| 366 | * the response. Most Compute resources support two types of filter expressions:
|
---|
| 367 | * expressions that support regular expressions and expressions that follow API
|
---|
| 368 | * improvement proposal AIP-160. These two types of filter expressions cannot be
|
---|
| 369 | * mixed in one request. If you want to use AIP-160, your expression must
|
---|
| 370 | * specify the field name, an operator, and the value that you want to use for
|
---|
| 371 | * filtering. The value must be a string, a number, or a boolean. The operator
|
---|
| 372 | * must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you
|
---|
| 373 | * are filtering Compute Engine instances, you can exclude instances named
|
---|
| 374 | * `example-instance` by specifying `name != example-instance`. The `:*`
|
---|
| 375 | * comparison can be used to test whether a key has been defined. For example,
|
---|
| 376 | * to find all objects with `owner` label use: ``` labels.owner:* ``` You can
|
---|
| 377 | * also filter nested fields. For example, you could specify
|
---|
| 378 | * `scheduling.automaticRestart = false` to include instances only if they are
|
---|
| 379 | * not scheduled for automatic restarts. You can use filtering on nested fields
|
---|
| 380 | * to filter based on resource labels. To filter on multiple expressions,
|
---|
| 381 | * provide each separate expression within parentheses. For example: ```
|
---|
| 382 | * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By
|
---|
| 383 | * default, each expression is an `AND` expression. However, you can include
|
---|
| 384 | * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel
|
---|
| 385 | * Skylake") OR (cpuPlatform = "Intel Broadwell") AND
|
---|
| 386 | * (scheduling.automaticRestart = true) ``` If you want to use a regular
|
---|
| 387 | * expression, use the `eq` (equal) or `ne` (not equal) operator against a
|
---|
| 388 | * single un-parenthesized expression with or without quotes or against multiple
|
---|
| 389 | * parenthesized expressions. Examples: `fieldname eq unquoted literal`
|
---|
| 390 | * `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"`
|
---|
| 391 | * `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is
|
---|
| 392 | * interpreted as a regular expression using Google RE2 library syntax. The
|
---|
| 393 | * literal value must match the entire field. For example, to filter for
|
---|
| 394 | * instances that do not end with name "instance", you would use `name ne
|
---|
| 395 | * .*instance`. You cannot combine constraints on multiple fields using regular
|
---|
| 396 | * expressions.
|
---|
| 397 | * @opt_param string maxResults The maximum number of results per page that
|
---|
| 398 | * should be returned. If the number of available results is larger than
|
---|
| 399 | * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to
|
---|
| 400 | * get the next page of results in subsequent list requests. Acceptable values
|
---|
| 401 | * are `0` to `500`, inclusive. (Default: `500`)
|
---|
| 402 | * @opt_param string orderBy Sorts list results by a certain order. By default,
|
---|
| 403 | * results are returned in alphanumerical order based on the resource name. You
|
---|
| 404 | * can also sort results in descending order based on the creation timestamp
|
---|
| 405 | * using `orderBy="creationTimestamp desc"`. This sorts results based on the
|
---|
| 406 | * `creationTimestamp` field in reverse chronological order (newest result
|
---|
| 407 | * first). Use this to sort resources like operations so that the newest
|
---|
| 408 | * operation is returned first. Currently, only sorting by `name` or
|
---|
| 409 | * `creationTimestamp desc` is supported.
|
---|
| 410 | * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to
|
---|
| 411 | * the `nextPageToken` returned by a previous list request to get the next page
|
---|
| 412 | * of results.
|
---|
| 413 | * @opt_param bool returnPartialSuccess Opt-in for partial success behavior
|
---|
| 414 | * which provides partial results in case of failure. The default value is
|
---|
| 415 | * false. For example, when partial success behavior is enabled, aggregatedList
|
---|
| 416 | * for a single zone scope either returns all resources in the zone or no
|
---|
| 417 | * resources, with an error code.
|
---|
| 418 | * @return BackendServiceListUsable
|
---|
| 419 | * @throws \Google\Service\Exception
|
---|
| 420 | */
|
---|
| 421 | public function listUsable($project, $optParams = [])
|
---|
| 422 | {
|
---|
| 423 | $params = ['project' => $project];
|
---|
| 424 | $params = array_merge($params, $optParams);
|
---|
| 425 | return $this->call('listUsable', [$params], BackendServiceListUsable::class);
|
---|
| 426 | }
|
---|
| 427 | /**
|
---|
| 428 | * Patches the specified BackendService resource with the data included in the
|
---|
| 429 | * request. For more information, see Backend services overview. This method
|
---|
| 430 | * supports PATCH semantics and uses the JSON merge patch format and processing
|
---|
| 431 | * rules. (backendServices.patch)
|
---|
| 432 | *
|
---|
| 433 | * @param string $project Project ID for this request.
|
---|
| 434 | * @param string $backendService Name of the BackendService resource to patch.
|
---|
| 435 | * @param BackendService $postBody
|
---|
| 436 | * @param array $optParams Optional parameters.
|
---|
| 437 | *
|
---|
| 438 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
| 439 | * Specify a unique request ID so that if you must retry your request, the
|
---|
| 440 | * server will know to ignore the request if it has already been completed. For
|
---|
| 441 | * example, consider a situation where you make an initial request and the
|
---|
| 442 | * request times out. If you make the request again with the same request ID,
|
---|
| 443 | * the server can check if original operation with the same request ID was
|
---|
| 444 | * received, and if so, will ignore the second request. This prevents clients
|
---|
| 445 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
| 446 | * valid UUID with the exception that zero UUID is not supported (
|
---|
| 447 | * 00000000-0000-0000-0000-000000000000).
|
---|
| 448 | * @return Operation
|
---|
| 449 | * @throws \Google\Service\Exception
|
---|
| 450 | */
|
---|
| 451 | public function patch($project, $backendService, BackendService $postBody, $optParams = [])
|
---|
| 452 | {
|
---|
| 453 | $params = ['project' => $project, 'backendService' => $backendService, 'postBody' => $postBody];
|
---|
| 454 | $params = array_merge($params, $optParams);
|
---|
| 455 | return $this->call('patch', [$params], Operation::class);
|
---|
| 456 | }
|
---|
| 457 | /**
|
---|
| 458 | * Sets the edge security policy for the specified backend service.
|
---|
| 459 | * (backendServices.setEdgeSecurityPolicy)
|
---|
| 460 | *
|
---|
| 461 | * @param string $project Project ID for this request.
|
---|
| 462 | * @param string $backendService Name of the BackendService resource to which
|
---|
| 463 | * the edge security policy should be set. The name should conform to RFC1035.
|
---|
| 464 | * @param SecurityPolicyReference $postBody
|
---|
| 465 | * @param array $optParams Optional parameters.
|
---|
| 466 | *
|
---|
| 467 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
| 468 | * Specify a unique request ID so that if you must retry your request, the
|
---|
| 469 | * server will know to ignore the request if it has already been completed. For
|
---|
| 470 | * example, consider a situation where you make an initial request and the
|
---|
| 471 | * request times out. If you make the request again with the same request ID,
|
---|
| 472 | * the server can check if original operation with the same request ID was
|
---|
| 473 | * received, and if so, will ignore the second request. This prevents clients
|
---|
| 474 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
| 475 | * valid UUID with the exception that zero UUID is not supported (
|
---|
| 476 | * 00000000-0000-0000-0000-000000000000).
|
---|
| 477 | * @return Operation
|
---|
| 478 | * @throws \Google\Service\Exception
|
---|
| 479 | */
|
---|
| 480 | public function setEdgeSecurityPolicy($project, $backendService, SecurityPolicyReference $postBody, $optParams = [])
|
---|
| 481 | {
|
---|
| 482 | $params = ['project' => $project, 'backendService' => $backendService, 'postBody' => $postBody];
|
---|
| 483 | $params = array_merge($params, $optParams);
|
---|
| 484 | return $this->call('setEdgeSecurityPolicy', [$params], Operation::class);
|
---|
| 485 | }
|
---|
| 486 | /**
|
---|
| 487 | * Sets the access control policy on the specified resource. Replaces any
|
---|
| 488 | * existing policy. (backendServices.setIamPolicy)
|
---|
| 489 | *
|
---|
| 490 | * @param string $project Project ID for this request.
|
---|
| 491 | * @param string $resource Name or id of the resource for this request.
|
---|
| 492 | * @param GlobalSetPolicyRequest $postBody
|
---|
| 493 | * @param array $optParams Optional parameters.
|
---|
| 494 | * @return Policy
|
---|
| 495 | * @throws \Google\Service\Exception
|
---|
| 496 | */
|
---|
| 497 | public function setIamPolicy($project, $resource, GlobalSetPolicyRequest $postBody, $optParams = [])
|
---|
| 498 | {
|
---|
| 499 | $params = ['project' => $project, 'resource' => $resource, 'postBody' => $postBody];
|
---|
| 500 | $params = array_merge($params, $optParams);
|
---|
| 501 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
| 502 | }
|
---|
| 503 | /**
|
---|
| 504 | * Sets the Google Cloud Armor security policy for the specified backend
|
---|
| 505 | * service. For more information, see Google Cloud Armor Overview
|
---|
| 506 | * (backendServices.setSecurityPolicy)
|
---|
| 507 | *
|
---|
| 508 | * @param string $project Project ID for this request.
|
---|
| 509 | * @param string $backendService Name of the BackendService resource to which
|
---|
| 510 | * the security policy should be set. The name should conform to RFC1035.
|
---|
| 511 | * @param SecurityPolicyReference $postBody
|
---|
| 512 | * @param array $optParams Optional parameters.
|
---|
| 513 | *
|
---|
| 514 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
| 515 | * Specify a unique request ID so that if you must retry your request, the
|
---|
| 516 | * server will know to ignore the request if it has already been completed. For
|
---|
| 517 | * example, consider a situation where you make an initial request and the
|
---|
| 518 | * request times out. If you make the request again with the same request ID,
|
---|
| 519 | * the server can check if original operation with the same request ID was
|
---|
| 520 | * received, and if so, will ignore the second request. This prevents clients
|
---|
| 521 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
| 522 | * valid UUID with the exception that zero UUID is not supported (
|
---|
| 523 | * 00000000-0000-0000-0000-000000000000).
|
---|
| 524 | * @return Operation
|
---|
| 525 | * @throws \Google\Service\Exception
|
---|
| 526 | */
|
---|
| 527 | public function setSecurityPolicy($project, $backendService, SecurityPolicyReference $postBody, $optParams = [])
|
---|
| 528 | {
|
---|
| 529 | $params = ['project' => $project, 'backendService' => $backendService, 'postBody' => $postBody];
|
---|
| 530 | $params = array_merge($params, $optParams);
|
---|
| 531 | return $this->call('setSecurityPolicy', [$params], Operation::class);
|
---|
| 532 | }
|
---|
| 533 | /**
|
---|
| 534 | * Returns permissions that a caller has on the specified resource.
|
---|
| 535 | * (backendServices.testIamPermissions)
|
---|
| 536 | *
|
---|
| 537 | * @param string $project Project ID for this request.
|
---|
| 538 | * @param string $resource Name or id of the resource for this request.
|
---|
| 539 | * @param TestPermissionsRequest $postBody
|
---|
| 540 | * @param array $optParams Optional parameters.
|
---|
| 541 | * @return TestPermissionsResponse
|
---|
| 542 | * @throws \Google\Service\Exception
|
---|
| 543 | */
|
---|
| 544 | public function testIamPermissions($project, $resource, TestPermissionsRequest $postBody, $optParams = [])
|
---|
| 545 | {
|
---|
| 546 | $params = ['project' => $project, 'resource' => $resource, 'postBody' => $postBody];
|
---|
| 547 | $params = array_merge($params, $optParams);
|
---|
| 548 | return $this->call('testIamPermissions', [$params], TestPermissionsResponse::class);
|
---|
| 549 | }
|
---|
| 550 | /**
|
---|
| 551 | * Updates the specified BackendService resource with the data included in the
|
---|
| 552 | * request. For more information, see Backend services overview.
|
---|
| 553 | * (backendServices.update)
|
---|
| 554 | *
|
---|
| 555 | * @param string $project Project ID for this request.
|
---|
| 556 | * @param string $backendService Name of the BackendService resource to update.
|
---|
| 557 | * @param BackendService $postBody
|
---|
| 558 | * @param array $optParams Optional parameters.
|
---|
| 559 | *
|
---|
| 560 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
| 561 | * Specify a unique request ID so that if you must retry your request, the
|
---|
| 562 | * server will know to ignore the request if it has already been completed. For
|
---|
| 563 | * example, consider a situation where you make an initial request and the
|
---|
| 564 | * request times out. If you make the request again with the same request ID,
|
---|
| 565 | * the server can check if original operation with the same request ID was
|
---|
| 566 | * received, and if so, will ignore the second request. This prevents clients
|
---|
| 567 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
| 568 | * valid UUID with the exception that zero UUID is not supported (
|
---|
| 569 | * 00000000-0000-0000-0000-000000000000).
|
---|
| 570 | * @return Operation
|
---|
| 571 | * @throws \Google\Service\Exception
|
---|
| 572 | */
|
---|
| 573 | public function update($project, $backendService, BackendService $postBody, $optParams = [])
|
---|
| 574 | {
|
---|
| 575 | $params = ['project' => $project, 'backendService' => $backendService, 'postBody' => $postBody];
|
---|
| 576 | $params = array_merge($params, $optParams);
|
---|
| 577 | return $this->call('update', [$params], Operation::class);
|
---|
| 578 | }
|
---|
| 579 | }
|
---|
| 580 |
|
---|
| 581 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 582 | class_alias(BackendServices::class, 'Google_Service_Compute_Resource_BackendServices');
|
---|