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\Spanner\Resource; 19 20use Google\Service\Spanner\ListBackupOperationsResponse; 21 22/** 23 * The "backupOperations" collection of methods. 24 * Typical usage is: 25 * <code> 26 * $spannerService = new Google\Service\Spanner(...); 27 * $backupOperations = $spannerService->backupOperations; 28 * </code> 29 */ 30class ProjectsInstancesBackupOperations extends \Google\Service\Resource 31{ 32 /** 33 * Lists the backup long-running operations in the given instance. A backup 34 * operation has a name of the form `projects//instances//backups//operations/`. 35 * The long-running operation metadata field type `metadata.type_url` describes 36 * the type of the metadata. Operations returned include those that have 37 * completed/failed/canceled within the last 7 days, and pending operations. 38 * Operations returned are ordered by 39 * `operation.metadata.value.progress.start_time` in descending order starting 40 * from the most recently started operation. 41 * (backupOperations.listProjectsInstancesBackupOperations) 42 * 43 * @param string $parent Required. The instance of the backup operations. Values 44 * are of the form `projects//instances/`. 45 * @param array $optParams Optional parameters. 46 * 47 * @opt_param string filter An expression that filters the list of returned 48 * backup operations. A filter expression consists of a field name, a comparison 49 * operator, and a value for filtering. The value must be a string, a number, or 50 * a boolean. The comparison operator must be one of: `<`, `>`, `<=`, `>=`, 51 * `!=`, `=`, or `:`. Colon `:` is the contains operator. Filter rules are not 52 * case sensitive. The following fields in the operation are eligible for 53 * filtering: * `name` - The name of the long-running operation * `done` - False 54 * if the operation is in progress, else true. * `metadata.@type` - the type of 55 * metadata. For example, the type string for CreateBackupMetadata is 56 * `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`. 57 * * `metadata.` - any field in metadata.value. `metadata.@type` must be 58 * specified first if filtering on metadata fields. * `error` - Error associated 59 * with the long-running operation. * `response.@type` - the type of response. * 60 * `response.` - any field in response.value. You can combine multiple 61 * expressions by enclosing each expression in parentheses. By default, 62 * expressions are combined with AND logic, but you can specify AND, OR, and NOT 63 * logic explicitly. Here are a few examples: * `done:true` - The operation is 64 * complete. * `(metadata.@type=type.googleapis.com/google.spanner.admin.databas 65 * e.v1.CreateBackupMetadata) AND` \ `metadata.database:prod` - Returns 66 * operations where: * The operation's metadata type is CreateBackupMetadata. * 67 * The source database name of backup contains the string "prod". * `(metadata.@ 68 * type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadat 69 * a) AND` \ `(metadata.name:howl) AND` \ `(metadata.progress.start_time < 70 * \"2018-03-28T14:50:00Z\") AND` \ `(error:*)` - Returns operations where: * 71 * The operation's metadata type is CreateBackupMetadata. * The backup name 72 * contains the string "howl". * The operation started before 73 * 2018-03-28T14:50:00Z. * The operation resulted in an error. * `(metadata.@typ 74 * e=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) 75 * AND` \ `(metadata.source_backup:test) AND` \ `(metadata.progress.start_time < 76 * \"2022-01-18T14:50:00Z\") AND` \ `(error:*)` - Returns operations where: * 77 * The operation's metadata type is CopyBackupMetadata. * The source backup name 78 * contains the string "test". * The operation started before 79 * 2022-01-18T14:50:00Z. * The operation resulted in an error. * `((metadata.@ty 80 * pe=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) 81 * AND` \ `(metadata.database:test_db)) OR` \ `((metadata.@type=type.googleapis. 82 * com/google.spanner.admin.database.v1.CopyBackupMetadata) AND` \ 83 * `(metadata.source_backup:test_bkp)) AND` \ `(error:*)` - Returns operations 84 * where: * The operation's metadata matches either of criteria: * The 85 * operation's metadata type is CreateBackupMetadata AND the source database 86 * name of the backup contains the string "test_db" * The operation's metadata 87 * type is CopyBackupMetadata AND the source backup name contains the string 88 * "test_bkp" * The operation resulted in an error. 89 * @opt_param int pageSize Number of operations to be returned in the response. 90 * If 0 or less, defaults to the server's maximum allowed page size. 91 * @opt_param string pageToken If non-empty, `page_token` should contain a 92 * next_page_token from a previous ListBackupOperationsResponse to the same 93 * `parent` and with the same `filter`. 94 * @return ListBackupOperationsResponse 95 */ 96 public function listProjectsInstancesBackupOperations($parent, $optParams = []) 97 { 98 $params = ['parent' => $parent]; 99 $params = array_merge($params, $optParams); 100 return $this->call('list', [$params], ListBackupOperationsResponse::class); 101 } 102} 103 104// Adding a class alias for backwards compatibility with the previous class name. 105class_alias(ProjectsInstancesBackupOperations::class, 'Google_Service_Spanner_Resource_ProjectsInstancesBackupOperations'); 106