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\Backupdr\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Backupdr\AbandonBackupRequest;
|
---|
21 | use Google\Service\Backupdr\DataSource;
|
---|
22 | use Google\Service\Backupdr\FetchAccessTokenRequest;
|
---|
23 | use Google\Service\Backupdr\FetchAccessTokenResponse;
|
---|
24 | use Google\Service\Backupdr\FinalizeBackupRequest;
|
---|
25 | use Google\Service\Backupdr\InitiateBackupRequest;
|
---|
26 | use Google\Service\Backupdr\InitiateBackupResponse;
|
---|
27 | use Google\Service\Backupdr\ListDataSourcesResponse;
|
---|
28 | use Google\Service\Backupdr\Operation;
|
---|
29 | use Google\Service\Backupdr\RemoveDataSourceRequest;
|
---|
30 | use Google\Service\Backupdr\SetInternalStatusRequest;
|
---|
31 |
|
---|
32 | /**
|
---|
33 | * The "dataSources" collection of methods.
|
---|
34 | * Typical usage is:
|
---|
35 | * <code>
|
---|
36 | * $backupdrService = new Google\Service\Backupdr(...);
|
---|
37 | * $dataSources = $backupdrService->projects_locations_backupVaults_dataSources;
|
---|
38 | * </code>
|
---|
39 | */
|
---|
40 | class ProjectsLocationsBackupVaultsDataSources extends \Google\Service\Resource
|
---|
41 | {
|
---|
42 | /**
|
---|
43 | * Internal only. Abandons a backup. (dataSources.abandonBackup)
|
---|
44 | *
|
---|
45 | * @param string $dataSource Required. The resource name of the instance, in the
|
---|
46 | * format 'projects/locations/backupVaults/dataSources/'.
|
---|
47 | * @param AbandonBackupRequest $postBody
|
---|
48 | * @param array $optParams Optional parameters.
|
---|
49 | * @return Operation
|
---|
50 | * @throws \Google\Service\Exception
|
---|
51 | */
|
---|
52 | public function abandonBackup($dataSource, AbandonBackupRequest $postBody, $optParams = [])
|
---|
53 | {
|
---|
54 | $params = ['dataSource' => $dataSource, 'postBody' => $postBody];
|
---|
55 | $params = array_merge($params, $optParams);
|
---|
56 | return $this->call('abandonBackup', [$params], Operation::class);
|
---|
57 | }
|
---|
58 | /**
|
---|
59 | * Internal only. Fetch access token for a given data source.
|
---|
60 | * (dataSources.fetchAccessToken)
|
---|
61 | *
|
---|
62 | * @param string $name Required. The resource name for the location for which
|
---|
63 | * static IPs should be returned. Must be in the format
|
---|
64 | * 'projects/locations/backupVaults/dataSources'.
|
---|
65 | * @param FetchAccessTokenRequest $postBody
|
---|
66 | * @param array $optParams Optional parameters.
|
---|
67 | * @return FetchAccessTokenResponse
|
---|
68 | * @throws \Google\Service\Exception
|
---|
69 | */
|
---|
70 | public function fetchAccessToken($name, FetchAccessTokenRequest $postBody, $optParams = [])
|
---|
71 | {
|
---|
72 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
73 | $params = array_merge($params, $optParams);
|
---|
74 | return $this->call('fetchAccessToken', [$params], FetchAccessTokenResponse::class);
|
---|
75 | }
|
---|
76 | /**
|
---|
77 | * Internal only. Finalize a backup that was started by a call to
|
---|
78 | * InitiateBackup. (dataSources.finalizeBackup)
|
---|
79 | *
|
---|
80 | * @param string $dataSource Required. The resource name of the instance, in the
|
---|
81 | * format 'projects/locations/backupVaults/dataSources/'.
|
---|
82 | * @param FinalizeBackupRequest $postBody
|
---|
83 | * @param array $optParams Optional parameters.
|
---|
84 | * @return Operation
|
---|
85 | * @throws \Google\Service\Exception
|
---|
86 | */
|
---|
87 | public function finalizeBackup($dataSource, FinalizeBackupRequest $postBody, $optParams = [])
|
---|
88 | {
|
---|
89 | $params = ['dataSource' => $dataSource, 'postBody' => $postBody];
|
---|
90 | $params = array_merge($params, $optParams);
|
---|
91 | return $this->call('finalizeBackup', [$params], Operation::class);
|
---|
92 | }
|
---|
93 | /**
|
---|
94 | * Gets details of a DataSource. (dataSources.get)
|
---|
95 | *
|
---|
96 | * @param string $name Required. Name of the data source resource name, in the
|
---|
97 | * format 'projects/{project_id}/locations/{location}/backupVaults/{resource_nam
|
---|
98 | * e}/dataSource/{resource_name}'
|
---|
99 | * @param array $optParams Optional parameters.
|
---|
100 | * @return DataSource
|
---|
101 | * @throws \Google\Service\Exception
|
---|
102 | */
|
---|
103 | public function get($name, $optParams = [])
|
---|
104 | {
|
---|
105 | $params = ['name' => $name];
|
---|
106 | $params = array_merge($params, $optParams);
|
---|
107 | return $this->call('get', [$params], DataSource::class);
|
---|
108 | }
|
---|
109 | /**
|
---|
110 | * Internal only. Initiates a backup. (dataSources.initiateBackup)
|
---|
111 | *
|
---|
112 | * @param string $dataSource Required. The resource name of the instance, in the
|
---|
113 | * format 'projects/locations/backupVaults/dataSources/'.
|
---|
114 | * @param InitiateBackupRequest $postBody
|
---|
115 | * @param array $optParams Optional parameters.
|
---|
116 | * @return InitiateBackupResponse
|
---|
117 | * @throws \Google\Service\Exception
|
---|
118 | */
|
---|
119 | public function initiateBackup($dataSource, InitiateBackupRequest $postBody, $optParams = [])
|
---|
120 | {
|
---|
121 | $params = ['dataSource' => $dataSource, 'postBody' => $postBody];
|
---|
122 | $params = array_merge($params, $optParams);
|
---|
123 | return $this->call('initiateBackup', [$params], InitiateBackupResponse::class);
|
---|
124 | }
|
---|
125 | /**
|
---|
126 | * Lists DataSources in a given project and location.
|
---|
127 | * (dataSources.listProjectsLocationsBackupVaultsDataSources)
|
---|
128 | *
|
---|
129 | * @param string $parent Required. The project and location for which to
|
---|
130 | * retrieve data sources information, in the format
|
---|
131 | * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR,
|
---|
132 | * locations map to Google Cloud regions, for example **us-central1**. To
|
---|
133 | * retrieve data sources for all locations, use "-" for the '{location}' value.
|
---|
134 | * @param array $optParams Optional parameters.
|
---|
135 | *
|
---|
136 | * @opt_param string filter Optional. Filtering results.
|
---|
137 | * @opt_param string orderBy Optional. Hint for how to order the results.
|
---|
138 | * @opt_param int pageSize Optional. Requested page size. Server may return
|
---|
139 | * fewer items than requested. If unspecified, server will pick an appropriate
|
---|
140 | * default.
|
---|
141 | * @opt_param string pageToken Optional. A token identifying a page of results
|
---|
142 | * the server should return.
|
---|
143 | * @return ListDataSourcesResponse
|
---|
144 | * @throws \Google\Service\Exception
|
---|
145 | */
|
---|
146 | public function listProjectsLocationsBackupVaultsDataSources($parent, $optParams = [])
|
---|
147 | {
|
---|
148 | $params = ['parent' => $parent];
|
---|
149 | $params = array_merge($params, $optParams);
|
---|
150 | return $this->call('list', [$params], ListDataSourcesResponse::class);
|
---|
151 | }
|
---|
152 | /**
|
---|
153 | * Updates the settings of a DataSource. (dataSources.patch)
|
---|
154 | *
|
---|
155 | * @param string $name Output only. Identifier. Name of the datasource to
|
---|
156 | * create. It must have the format`"projects/{project}/locations/{location}/back
|
---|
157 | * upVaults/{backupvault}/dataSources/{datasource}"`. `{datasource}` cannot be
|
---|
158 | * changed after creation. It must be between 3-63 characters long and must be
|
---|
159 | * unique within the backup vault.
|
---|
160 | * @param DataSource $postBody
|
---|
161 | * @param array $optParams Optional parameters.
|
---|
162 | *
|
---|
163 | * @opt_param bool allowMissing Optional. Enable upsert.
|
---|
164 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
165 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
166 | * the server will know to ignore the request if it has already been completed.
|
---|
167 | * The server will guarantee that for at least 60 minutes since the first
|
---|
168 | * request. For example, consider a situation where you make an initial request
|
---|
169 | * and the request times out. If you make the request again with the same
|
---|
170 | * request ID, the server can check if original operation with the same request
|
---|
171 | * ID was received, and if so, will ignore the second request. This prevents
|
---|
172 | * clients from accidentally creating duplicate commitments. The request ID must
|
---|
173 | * be a valid UUID with the exception that zero UUID is not supported
|
---|
174 | * (00000000-0000-0000-0000-000000000000).
|
---|
175 | * @opt_param string updateMask Required. Field mask is used to specify the
|
---|
176 | * fields to be overwritten in the DataSource resource by the update. The fields
|
---|
177 | * specified in the update_mask are relative to the resource, not the full
|
---|
178 | * request. A field will be overwritten if it is in the mask. If the user does
|
---|
179 | * not provide a mask then the request will fail.
|
---|
180 | * @return Operation
|
---|
181 | * @throws \Google\Service\Exception
|
---|
182 | */
|
---|
183 | public function patch($name, DataSource $postBody, $optParams = [])
|
---|
184 | {
|
---|
185 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
186 | $params = array_merge($params, $optParams);
|
---|
187 | return $this->call('patch', [$params], Operation::class);
|
---|
188 | }
|
---|
189 | /**
|
---|
190 | * Deletes a DataSource. This is a custom method instead of a standard delete
|
---|
191 | * method because external clients will not delete DataSources except for
|
---|
192 | * BackupDR backup appliances. (dataSources.remove)
|
---|
193 | *
|
---|
194 | * @param string $name Required. Name of the resource.
|
---|
195 | * @param RemoveDataSourceRequest $postBody
|
---|
196 | * @param array $optParams Optional parameters.
|
---|
197 | * @return Operation
|
---|
198 | * @throws \Google\Service\Exception
|
---|
199 | */
|
---|
200 | public function remove($name, RemoveDataSourceRequest $postBody, $optParams = [])
|
---|
201 | {
|
---|
202 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
203 | $params = array_merge($params, $optParams);
|
---|
204 | return $this->call('remove', [$params], Operation::class);
|
---|
205 | }
|
---|
206 | /**
|
---|
207 | * Sets the internal status of a DataSource. (dataSources.setInternalStatus)
|
---|
208 | *
|
---|
209 | * @param string $dataSource Required. The resource name of the instance, in the
|
---|
210 | * format 'projects/locations/backupVaults/dataSources/'.
|
---|
211 | * @param SetInternalStatusRequest $postBody
|
---|
212 | * @param array $optParams Optional parameters.
|
---|
213 | * @return Operation
|
---|
214 | * @throws \Google\Service\Exception
|
---|
215 | */
|
---|
216 | public function setInternalStatus($dataSource, SetInternalStatusRequest $postBody, $optParams = [])
|
---|
217 | {
|
---|
218 | $params = ['dataSource' => $dataSource, 'postBody' => $postBody];
|
---|
219 | $params = array_merge($params, $optParams);
|
---|
220 | return $this->call('setInternalStatus', [$params], Operation::class);
|
---|
221 | }
|
---|
222 | }
|
---|
223 |
|
---|
224 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
225 | class_alias(ProjectsLocationsBackupVaultsDataSources::class, 'Google_Service_Backupdr_Resource_ProjectsLocationsBackupVaultsDataSources');
|
---|