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\DataprocMetastore\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\DataprocMetastore\AlterMetadataResourceLocationRequest;
|
---|
21 | use Google\Service\DataprocMetastore\AlterTablePropertiesRequest;
|
---|
22 | use Google\Service\DataprocMetastore\CancelMigrationRequest;
|
---|
23 | use Google\Service\DataprocMetastore\CompleteMigrationRequest;
|
---|
24 | use Google\Service\DataprocMetastore\ExportMetadataRequest;
|
---|
25 | use Google\Service\DataprocMetastore\ListServicesResponse;
|
---|
26 | use Google\Service\DataprocMetastore\MoveTableToDatabaseRequest;
|
---|
27 | use Google\Service\DataprocMetastore\Operation;
|
---|
28 | use Google\Service\DataprocMetastore\Policy;
|
---|
29 | use Google\Service\DataprocMetastore\QueryMetadataRequest;
|
---|
30 | use Google\Service\DataprocMetastore\RestoreServiceRequest;
|
---|
31 | use Google\Service\DataprocMetastore\Service;
|
---|
32 | use Google\Service\DataprocMetastore\SetIamPolicyRequest;
|
---|
33 | use Google\Service\DataprocMetastore\StartMigrationRequest;
|
---|
34 | use Google\Service\DataprocMetastore\TestIamPermissionsRequest;
|
---|
35 | use Google\Service\DataprocMetastore\TestIamPermissionsResponse;
|
---|
36 |
|
---|
37 | /**
|
---|
38 | * The "services" collection of methods.
|
---|
39 | * Typical usage is:
|
---|
40 | * <code>
|
---|
41 | * $metastoreService = new Google\Service\DataprocMetastore(...);
|
---|
42 | * $services = $metastoreService->projects_locations_services;
|
---|
43 | * </code>
|
---|
44 | */
|
---|
45 | class ProjectsLocationsServices extends \Google\Service\Resource
|
---|
46 | {
|
---|
47 | /**
|
---|
48 | * Alter metadata resource location. The metadata resource can be a database,
|
---|
49 | * table, or partition. This functionality only updates the parent directory for
|
---|
50 | * the respective metadata resource and does not transfer any existing data to
|
---|
51 | * the new location. (services.alterLocation)
|
---|
52 | *
|
---|
53 | * @param string $service Required. The relative resource name of the metastore
|
---|
54 | * service to mutate metadata, in the following
|
---|
55 | * format:projects/{project_id}/locations/{location_id}/services/{service_id}.
|
---|
56 | * @param AlterMetadataResourceLocationRequest $postBody
|
---|
57 | * @param array $optParams Optional parameters.
|
---|
58 | * @return Operation
|
---|
59 | * @throws \Google\Service\Exception
|
---|
60 | */
|
---|
61 | public function alterLocation($service, AlterMetadataResourceLocationRequest $postBody, $optParams = [])
|
---|
62 | {
|
---|
63 | $params = ['service' => $service, 'postBody' => $postBody];
|
---|
64 | $params = array_merge($params, $optParams);
|
---|
65 | return $this->call('alterLocation', [$params], Operation::class);
|
---|
66 | }
|
---|
67 | /**
|
---|
68 | * Alter metadata table properties. (services.alterTableProperties)
|
---|
69 | *
|
---|
70 | * @param string $service Required. The relative resource name of the Dataproc
|
---|
71 | * Metastore service that's being used to mutate metadata table properties, in
|
---|
72 | * the following
|
---|
73 | * format:projects/{project_id}/locations/{location_id}/services/{service_id}.
|
---|
74 | * @param AlterTablePropertiesRequest $postBody
|
---|
75 | * @param array $optParams Optional parameters.
|
---|
76 | * @return Operation
|
---|
77 | * @throws \Google\Service\Exception
|
---|
78 | */
|
---|
79 | public function alterTableProperties($service, AlterTablePropertiesRequest $postBody, $optParams = [])
|
---|
80 | {
|
---|
81 | $params = ['service' => $service, 'postBody' => $postBody];
|
---|
82 | $params = array_merge($params, $optParams);
|
---|
83 | return $this->call('alterTableProperties', [$params], Operation::class);
|
---|
84 | }
|
---|
85 | /**
|
---|
86 | * Cancels the ongoing Managed Migration process. (services.cancelMigration)
|
---|
87 | *
|
---|
88 | * @param string $service Required. The relative resource name of the metastore
|
---|
89 | * service to cancel the ongoing migration to, in the following
|
---|
90 | * format:projects/{project_id}/locations/{location_id}/services/{service_id}.
|
---|
91 | * @param CancelMigrationRequest $postBody
|
---|
92 | * @param array $optParams Optional parameters.
|
---|
93 | * @return Operation
|
---|
94 | * @throws \Google\Service\Exception
|
---|
95 | */
|
---|
96 | public function cancelMigration($service, CancelMigrationRequest $postBody, $optParams = [])
|
---|
97 | {
|
---|
98 | $params = ['service' => $service, 'postBody' => $postBody];
|
---|
99 | $params = array_merge($params, $optParams);
|
---|
100 | return $this->call('cancelMigration', [$params], Operation::class);
|
---|
101 | }
|
---|
102 | /**
|
---|
103 | * Completes the managed migration process. The Dataproc Metastore service will
|
---|
104 | * switch to using its own backend database after successful migration.
|
---|
105 | * (services.completeMigration)
|
---|
106 | *
|
---|
107 | * @param string $service Required. The relative resource name of the metastore
|
---|
108 | * service to complete the migration to, in the following
|
---|
109 | * format:projects/{project_id}/locations/{location_id}/services/{service_id}.
|
---|
110 | * @param CompleteMigrationRequest $postBody
|
---|
111 | * @param array $optParams Optional parameters.
|
---|
112 | * @return Operation
|
---|
113 | * @throws \Google\Service\Exception
|
---|
114 | */
|
---|
115 | public function completeMigration($service, CompleteMigrationRequest $postBody, $optParams = [])
|
---|
116 | {
|
---|
117 | $params = ['service' => $service, 'postBody' => $postBody];
|
---|
118 | $params = array_merge($params, $optParams);
|
---|
119 | return $this->call('completeMigration', [$params], Operation::class);
|
---|
120 | }
|
---|
121 | /**
|
---|
122 | * Creates a metastore service in a project and location. (services.create)
|
---|
123 | *
|
---|
124 | * @param string $parent Required. The relative resource name of the location in
|
---|
125 | * which to create a metastore service, in the following
|
---|
126 | * form:projects/{project_number}/locations/{location_id}.
|
---|
127 | * @param Service $postBody
|
---|
128 | * @param array $optParams Optional parameters.
|
---|
129 | *
|
---|
130 | * @opt_param string requestId Optional. A request ID. Specify a unique request
|
---|
131 | * ID to allow the server to ignore the request if it has completed. The server
|
---|
132 | * will ignore subsequent requests that provide a duplicate request ID for at
|
---|
133 | * least 60 minutes after the first request.For example, if an initial request
|
---|
134 | * times out, followed by another request with the same request ID, the server
|
---|
135 | * ignores the second request to prevent the creation of duplicate
|
---|
136 | * commitments.The request ID must be a valid UUID
|
---|
137 | * (https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) A zero
|
---|
138 | * UUID (00000000-0000-0000-0000-000000000000) is not supported.
|
---|
139 | * @opt_param string serviceId Required. The ID of the metastore service, which
|
---|
140 | * is used as the final component of the metastore service's name.This value
|
---|
141 | * must be between 2 and 63 characters long inclusive, begin with a letter, end
|
---|
142 | * with a letter or number, and consist of alpha-numeric ASCII characters or
|
---|
143 | * hyphens.
|
---|
144 | * @return Operation
|
---|
145 | * @throws \Google\Service\Exception
|
---|
146 | */
|
---|
147 | public function create($parent, Service $postBody, $optParams = [])
|
---|
148 | {
|
---|
149 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
150 | $params = array_merge($params, $optParams);
|
---|
151 | return $this->call('create', [$params], Operation::class);
|
---|
152 | }
|
---|
153 | /**
|
---|
154 | * Deletes a single service. (services.delete)
|
---|
155 | *
|
---|
156 | * @param string $name Required. The relative resource name of the metastore
|
---|
157 | * service to delete, in the following
|
---|
158 | * form:projects/{project_number}/locations/{location_id}/services/{service_id}.
|
---|
159 | * @param array $optParams Optional parameters.
|
---|
160 | *
|
---|
161 | * @opt_param string requestId Optional. A request ID. Specify a unique request
|
---|
162 | * ID to allow the server to ignore the request if it has completed. The server
|
---|
163 | * will ignore subsequent requests that provide a duplicate request ID for at
|
---|
164 | * least 60 minutes after the first request.For example, if an initial request
|
---|
165 | * times out, followed by another request with the same request ID, the server
|
---|
166 | * ignores the second request to prevent the creation of duplicate
|
---|
167 | * commitments.The request ID must be a valid UUID
|
---|
168 | * (https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) A zero
|
---|
169 | * UUID (00000000-0000-0000-0000-000000000000) is not supported.
|
---|
170 | * @return Operation
|
---|
171 | * @throws \Google\Service\Exception
|
---|
172 | */
|
---|
173 | public function delete($name, $optParams = [])
|
---|
174 | {
|
---|
175 | $params = ['name' => $name];
|
---|
176 | $params = array_merge($params, $optParams);
|
---|
177 | return $this->call('delete', [$params], Operation::class);
|
---|
178 | }
|
---|
179 | /**
|
---|
180 | * Exports metadata from a service. (services.exportMetadata)
|
---|
181 | *
|
---|
182 | * @param string $service Required. The relative resource name of the metastore
|
---|
183 | * service to run export, in the following
|
---|
184 | * form:projects/{project_id}/locations/{location_id}/services/{service_id}.
|
---|
185 | * @param ExportMetadataRequest $postBody
|
---|
186 | * @param array $optParams Optional parameters.
|
---|
187 | * @return Operation
|
---|
188 | * @throws \Google\Service\Exception
|
---|
189 | */
|
---|
190 | public function exportMetadata($service, ExportMetadataRequest $postBody, $optParams = [])
|
---|
191 | {
|
---|
192 | $params = ['service' => $service, 'postBody' => $postBody];
|
---|
193 | $params = array_merge($params, $optParams);
|
---|
194 | return $this->call('exportMetadata', [$params], Operation::class);
|
---|
195 | }
|
---|
196 | /**
|
---|
197 | * Gets the details of a single service. (services.get)
|
---|
198 | *
|
---|
199 | * @param string $name Required. The relative resource name of the metastore
|
---|
200 | * service to retrieve, in the following
|
---|
201 | * form:projects/{project_number}/locations/{location_id}/services/{service_id}.
|
---|
202 | * @param array $optParams Optional parameters.
|
---|
203 | * @return Service
|
---|
204 | * @throws \Google\Service\Exception
|
---|
205 | */
|
---|
206 | public function get($name, $optParams = [])
|
---|
207 | {
|
---|
208 | $params = ['name' => $name];
|
---|
209 | $params = array_merge($params, $optParams);
|
---|
210 | return $this->call('get', [$params], Service::class);
|
---|
211 | }
|
---|
212 | /**
|
---|
213 | * Gets the access control policy for a resource. Returns an empty policy if the
|
---|
214 | * resource exists and does not have a policy set. (services.getIamPolicy)
|
---|
215 | *
|
---|
216 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
217 | * requested. See Resource names
|
---|
218 | * (https://cloud.google.com/apis/design/resource_names) for the appropriate
|
---|
219 | * value for this field.
|
---|
220 | * @param array $optParams Optional parameters.
|
---|
221 | *
|
---|
222 | * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
|
---|
223 | * version that will be used to format the policy.Valid values are 0, 1, and 3.
|
---|
224 | * Requests specifying an invalid value will be rejected.Requests for policies
|
---|
225 | * with any conditional role bindings must specify version 3. Policies with no
|
---|
226 | * conditional role bindings may specify any valid value or leave the field
|
---|
227 | * unset.The policy in the response might use the policy version that you
|
---|
228 | * specified, or it might use a lower policy version. For example, if you
|
---|
229 | * specify version 3, but the policy has no conditional role bindings, the
|
---|
230 | * response uses version 1.To learn which resources support conditions in their
|
---|
231 | * IAM policies, see the IAM documentation
|
---|
232 | * (https://cloud.google.com/iam/help/conditions/resource-policies).
|
---|
233 | * @return Policy
|
---|
234 | * @throws \Google\Service\Exception
|
---|
235 | */
|
---|
236 | public function getIamPolicy($resource, $optParams = [])
|
---|
237 | {
|
---|
238 | $params = ['resource' => $resource];
|
---|
239 | $params = array_merge($params, $optParams);
|
---|
240 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
241 | }
|
---|
242 | /**
|
---|
243 | * Lists services in a project and location.
|
---|
244 | * (services.listProjectsLocationsServices)
|
---|
245 | *
|
---|
246 | * @param string $parent Required. The relative resource name of the location of
|
---|
247 | * metastore services to list, in the following
|
---|
248 | * form:projects/{project_number}/locations/{location_id}.
|
---|
249 | * @param array $optParams Optional parameters.
|
---|
250 | *
|
---|
251 | * @opt_param string filter Optional. The filter to apply to list results.
|
---|
252 | * @opt_param string orderBy Optional. Specify the ordering of results as
|
---|
253 | * described in Sorting Order
|
---|
254 | * (https://cloud.google.com/apis/design/design_patterns#sorting_order). If not
|
---|
255 | * specified, the results will be sorted in the default order.
|
---|
256 | * @opt_param int pageSize Optional. The maximum number of services to return.
|
---|
257 | * The response may contain less than the maximum number. If unspecified, no
|
---|
258 | * more than 500 services are returned. The maximum value is 1000; values above
|
---|
259 | * 1000 are changed to 1000.
|
---|
260 | * @opt_param string pageToken Optional. A page token, received from a previous
|
---|
261 | * DataprocMetastore.ListServices call. Provide this token to retrieve the
|
---|
262 | * subsequent page.To retrieve the first page, supply an empty page token.When
|
---|
263 | * paginating, other parameters provided to DataprocMetastore.ListServices must
|
---|
264 | * match the call that provided the page token.
|
---|
265 | * @return ListServicesResponse
|
---|
266 | * @throws \Google\Service\Exception
|
---|
267 | */
|
---|
268 | public function listProjectsLocationsServices($parent, $optParams = [])
|
---|
269 | {
|
---|
270 | $params = ['parent' => $parent];
|
---|
271 | $params = array_merge($params, $optParams);
|
---|
272 | return $this->call('list', [$params], ListServicesResponse::class);
|
---|
273 | }
|
---|
274 | /**
|
---|
275 | * Move a table to another database. (services.moveTableToDatabase)
|
---|
276 | *
|
---|
277 | * @param string $service Required. The relative resource name of the metastore
|
---|
278 | * service to mutate metadata, in the following
|
---|
279 | * format:projects/{project_id}/locations/{location_id}/services/{service_id}.
|
---|
280 | * @param MoveTableToDatabaseRequest $postBody
|
---|
281 | * @param array $optParams Optional parameters.
|
---|
282 | * @return Operation
|
---|
283 | * @throws \Google\Service\Exception
|
---|
284 | */
|
---|
285 | public function moveTableToDatabase($service, MoveTableToDatabaseRequest $postBody, $optParams = [])
|
---|
286 | {
|
---|
287 | $params = ['service' => $service, 'postBody' => $postBody];
|
---|
288 | $params = array_merge($params, $optParams);
|
---|
289 | return $this->call('moveTableToDatabase', [$params], Operation::class);
|
---|
290 | }
|
---|
291 | /**
|
---|
292 | * Updates the parameters of a single service. (services.patch)
|
---|
293 | *
|
---|
294 | * @param string $name Immutable. The relative resource name of the metastore
|
---|
295 | * service, in the following format:projects/{project_number}/locations/{locatio
|
---|
296 | * n_id}/services/{service_id}.
|
---|
297 | * @param Service $postBody
|
---|
298 | * @param array $optParams Optional parameters.
|
---|
299 | *
|
---|
300 | * @opt_param string requestId Optional. A request ID. Specify a unique request
|
---|
301 | * ID to allow the server to ignore the request if it has completed. The server
|
---|
302 | * will ignore subsequent requests that provide a duplicate request ID for at
|
---|
303 | * least 60 minutes after the first request.For example, if an initial request
|
---|
304 | * times out, followed by another request with the same request ID, the server
|
---|
305 | * ignores the second request to prevent the creation of duplicate
|
---|
306 | * commitments.The request ID must be a valid UUID
|
---|
307 | * (https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) A zero
|
---|
308 | * UUID (00000000-0000-0000-0000-000000000000) is not supported.
|
---|
309 | * @opt_param string updateMask Required. A field mask used to specify the
|
---|
310 | * fields to be overwritten in the metastore service resource by the update.
|
---|
311 | * Fields specified in the update_mask are relative to the resource (not to the
|
---|
312 | * full request). A field is overwritten if it is in the mask.
|
---|
313 | * @return Operation
|
---|
314 | * @throws \Google\Service\Exception
|
---|
315 | */
|
---|
316 | public function patch($name, Service $postBody, $optParams = [])
|
---|
317 | {
|
---|
318 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
319 | $params = array_merge($params, $optParams);
|
---|
320 | return $this->call('patch', [$params], Operation::class);
|
---|
321 | }
|
---|
322 | /**
|
---|
323 | * Query Dataproc Metastore metadata. (services.queryMetadata)
|
---|
324 | *
|
---|
325 | * @param string $service Required. The relative resource name of the metastore
|
---|
326 | * service to query metadata, in the following
|
---|
327 | * format:projects/{project_id}/locations/{location_id}/services/{service_id}.
|
---|
328 | * @param QueryMetadataRequest $postBody
|
---|
329 | * @param array $optParams Optional parameters.
|
---|
330 | * @return Operation
|
---|
331 | * @throws \Google\Service\Exception
|
---|
332 | */
|
---|
333 | public function queryMetadata($service, QueryMetadataRequest $postBody, $optParams = [])
|
---|
334 | {
|
---|
335 | $params = ['service' => $service, 'postBody' => $postBody];
|
---|
336 | $params = array_merge($params, $optParams);
|
---|
337 | return $this->call('queryMetadata', [$params], Operation::class);
|
---|
338 | }
|
---|
339 | /**
|
---|
340 | * Restores a service from a backup. (services.restore)
|
---|
341 | *
|
---|
342 | * @param string $service Required. The relative resource name of the metastore
|
---|
343 | * service to run restore, in the following
|
---|
344 | * form:projects/{project_id}/locations/{location_id}/services/{service_id}.
|
---|
345 | * @param RestoreServiceRequest $postBody
|
---|
346 | * @param array $optParams Optional parameters.
|
---|
347 | * @return Operation
|
---|
348 | * @throws \Google\Service\Exception
|
---|
349 | */
|
---|
350 | public function restore($service, RestoreServiceRequest $postBody, $optParams = [])
|
---|
351 | {
|
---|
352 | $params = ['service' => $service, 'postBody' => $postBody];
|
---|
353 | $params = array_merge($params, $optParams);
|
---|
354 | return $this->call('restore', [$params], Operation::class);
|
---|
355 | }
|
---|
356 | /**
|
---|
357 | * Sets the access control policy on the specified resource. Replaces any
|
---|
358 | * existing policy.Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED
|
---|
359 | * errors. (services.setIamPolicy)
|
---|
360 | *
|
---|
361 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
362 | * specified. See Resource names
|
---|
363 | * (https://cloud.google.com/apis/design/resource_names) for the appropriate
|
---|
364 | * value for this field.
|
---|
365 | * @param SetIamPolicyRequest $postBody
|
---|
366 | * @param array $optParams Optional parameters.
|
---|
367 | * @return Policy
|
---|
368 | * @throws \Google\Service\Exception
|
---|
369 | */
|
---|
370 | public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
|
---|
371 | {
|
---|
372 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
373 | $params = array_merge($params, $optParams);
|
---|
374 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
375 | }
|
---|
376 | /**
|
---|
377 | * Starts the Managed Migration process. (services.startMigration)
|
---|
378 | *
|
---|
379 | * @param string $service Required. The relative resource name of the metastore
|
---|
380 | * service to start migrating to, in the following
|
---|
381 | * format:projects/{project_id}/locations/{location_id}/services/{service_id}.
|
---|
382 | * @param StartMigrationRequest $postBody
|
---|
383 | * @param array $optParams Optional parameters.
|
---|
384 | * @return Operation
|
---|
385 | * @throws \Google\Service\Exception
|
---|
386 | */
|
---|
387 | public function startMigration($service, StartMigrationRequest $postBody, $optParams = [])
|
---|
388 | {
|
---|
389 | $params = ['service' => $service, 'postBody' => $postBody];
|
---|
390 | $params = array_merge($params, $optParams);
|
---|
391 | return $this->call('startMigration', [$params], Operation::class);
|
---|
392 | }
|
---|
393 | /**
|
---|
394 | * Returns permissions that a caller has on the specified resource. If the
|
---|
395 | * resource does not exist, this will return an empty set of permissions, not a
|
---|
396 | * NOT_FOUND error.Note: This operation is designed to be used for building
|
---|
397 | * permission-aware UIs and command-line tools, not for authorization checking.
|
---|
398 | * This operation may "fail open" without warning. (services.testIamPermissions)
|
---|
399 | *
|
---|
400 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
401 | * being requested. See Resource names
|
---|
402 | * (https://cloud.google.com/apis/design/resource_names) for the appropriate
|
---|
403 | * value for this field.
|
---|
404 | * @param TestIamPermissionsRequest $postBody
|
---|
405 | * @param array $optParams Optional parameters.
|
---|
406 | * @return TestIamPermissionsResponse
|
---|
407 | * @throws \Google\Service\Exception
|
---|
408 | */
|
---|
409 | public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
410 | {
|
---|
411 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
412 | $params = array_merge($params, $optParams);
|
---|
413 | return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
|
---|
414 | }
|
---|
415 | }
|
---|
416 |
|
---|
417 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
418 | class_alias(ProjectsLocationsServices::class, 'Google_Service_DataprocMetastore_Resource_ProjectsLocationsServices');
|
---|