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\SQLAdmin\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\SQLAdmin\Operation;
|
---|
21 | use Google\Service\SQLAdmin\OperationsListResponse;
|
---|
22 | use Google\Service\SQLAdmin\SqladminEmpty;
|
---|
23 |
|
---|
24 | /**
|
---|
25 | * The "operations" collection of methods.
|
---|
26 | * Typical usage is:
|
---|
27 | * <code>
|
---|
28 | * $sqladminService = new Google\Service\SQLAdmin(...);
|
---|
29 | * $operations = $sqladminService->operations;
|
---|
30 | * </code>
|
---|
31 | */
|
---|
32 | class Operations extends \Google\Service\Resource
|
---|
33 | {
|
---|
34 | /**
|
---|
35 | * Cancels an instance operation that has been performed on an instance.
|
---|
36 | * (operations.cancel)
|
---|
37 | *
|
---|
38 | * @param string $project Project ID of the project that contains the instance.
|
---|
39 | * @param string $operation Instance operation ID.
|
---|
40 | * @param array $optParams Optional parameters.
|
---|
41 | * @return SqladminEmpty
|
---|
42 | * @throws \Google\Service\Exception
|
---|
43 | */
|
---|
44 | public function cancel($project, $operation, $optParams = [])
|
---|
45 | {
|
---|
46 | $params = ['project' => $project, 'operation' => $operation];
|
---|
47 | $params = array_merge($params, $optParams);
|
---|
48 | return $this->call('cancel', [$params], SqladminEmpty::class);
|
---|
49 | }
|
---|
50 | /**
|
---|
51 | * Retrieves an instance operation that has been performed on an instance.
|
---|
52 | * (operations.get)
|
---|
53 | *
|
---|
54 | * @param string $project Project ID of the project that contains the instance.
|
---|
55 | * @param string $operation Instance operation ID.
|
---|
56 | * @param array $optParams Optional parameters.
|
---|
57 | * @return Operation
|
---|
58 | * @throws \Google\Service\Exception
|
---|
59 | */
|
---|
60 | public function get($project, $operation, $optParams = [])
|
---|
61 | {
|
---|
62 | $params = ['project' => $project, 'operation' => $operation];
|
---|
63 | $params = array_merge($params, $optParams);
|
---|
64 | return $this->call('get', [$params], Operation::class);
|
---|
65 | }
|
---|
66 | /**
|
---|
67 | * Lists all instance operations that have been performed on the given Cloud SQL
|
---|
68 | * instance in the reverse chronological order of the start time.
|
---|
69 | * (operations.listOperations)
|
---|
70 | *
|
---|
71 | * @param string $project Project ID of the project that contains the instance.
|
---|
72 | * @param array $optParams Optional parameters.
|
---|
73 | *
|
---|
74 | * @opt_param string instance Cloud SQL instance ID. This does not include the
|
---|
75 | * project ID.
|
---|
76 | * @opt_param string maxResults Maximum number of operations per response.
|
---|
77 | * @opt_param string pageToken A previously-returned page token representing
|
---|
78 | * part of the larger set of results to view.
|
---|
79 | * @return OperationsListResponse
|
---|
80 | * @throws \Google\Service\Exception
|
---|
81 | */
|
---|
82 | public function listOperations($project, $optParams = [])
|
---|
83 | {
|
---|
84 | $params = ['project' => $project];
|
---|
85 | $params = array_merge($params, $optParams);
|
---|
86 | return $this->call('list', [$params], OperationsListResponse::class);
|
---|
87 | }
|
---|
88 | }
|
---|
89 |
|
---|
90 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
91 | class_alias(Operations::class, 'Google_Service_SQLAdmin_Resource_Operations');
|
---|