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\DeploymentManager\Resource; 19 20use Google\Service\DeploymentManager\Operation; 21use Google\Service\DeploymentManager\OperationsListResponse; 22 23/** 24 * The "operations" collection of methods. 25 * Typical usage is: 26 * <code> 27 * $deploymentmanagerService = new Google\Service\DeploymentManager(...); 28 * $operations = $deploymentmanagerService->operations; 29 * </code> 30 */ 31class Operations extends \Google\Service\Resource 32{ 33 /** 34 * Gets information about a specific operation. (operations.get) 35 * 36 * @param string $project The project ID for this request. 37 * @param string $operation The name of the operation for this request. 38 * @param array $optParams Optional parameters. 39 * @return Operation 40 */ 41 public function get($project, $operation, $optParams = []) 42 { 43 $params = ['project' => $project, 'operation' => $operation]; 44 $params = array_merge($params, $optParams); 45 return $this->call('get', [$params], Operation::class); 46 } 47 /** 48 * Lists all operations for a project. (operations.listOperations) 49 * 50 * @param string $project The project ID for this request. 51 * @param array $optParams Optional parameters. 52 * 53 * @opt_param string filter A filter expression that filters resources listed in 54 * the response. The expression must specify the field name, an operator, and 55 * the value that you want to use for filtering. The value must be a string, a 56 * number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, 57 * `>=` or `:`. For example, if you are filtering Compute Engine instances, you 58 * can exclude instances named `example-instance` by specifying `name != 59 * example-instance`. The `:` operator can be used with string fields to match 60 * substrings. For non-string fields it is equivalent to the `=` operator. The 61 * `:*` comparison can be used to test whether a key has been defined. For 62 * example, to find all objects with `owner` label use: ``` labels.owner:* ``` 63 * You can also filter nested fields. For example, you could specify 64 * `scheduling.automaticRestart = false` to include instances only if they are 65 * not scheduled for automatic restarts. You can use filtering on nested fields 66 * to filter based on resource labels. To filter on multiple expressions, 67 * provide each separate expression within parentheses. For example: ``` 68 * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By 69 * default, each expression is an `AND` expression. However, you can include 70 * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel 71 * Skylake") OR (cpuPlatform = "Intel Broadwell") AND 72 * (scheduling.automaticRestart = true) ``` 73 * @opt_param string maxResults The maximum number of results per page that 74 * should be returned. If the number of available results is larger than 75 * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to 76 * get the next page of results in subsequent list requests. Acceptable values 77 * are `0` to `500`, inclusive. (Default: `500`) 78 * @opt_param string orderBy Sorts list results by a certain order. By default, 79 * results are returned in alphanumerical order based on the resource name. You 80 * can also sort results in descending order based on the creation timestamp 81 * using `orderBy="creationTimestamp desc"`. This sorts results based on the 82 * `creationTimestamp` field in reverse chronological order (newest result 83 * first). Use this to sort resources like operations so that the newest 84 * operation is returned first. Currently, only sorting by `name` or 85 * `creationTimestamp desc` is supported. 86 * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to 87 * the `nextPageToken` returned by a previous list request to get the next page 88 * of results. 89 * @return OperationsListResponse 90 */ 91 public function listOperations($project, $optParams = []) 92 { 93 $params = ['project' => $project]; 94 $params = array_merge($params, $optParams); 95 return $this->call('list', [$params], OperationsListResponse::class); 96 } 97} 98 99// Adding a class alias for backwards compatibility with the previous class name. 100class_alias(Operations::class, 'Google_Service_DeploymentManager_Resource_Operations'); 101