Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for new ImportEntries() API, including format of th…
…e dump (#5964) feat: add support for new ImportEntries() API, including format of the dump feat: add support for entries associated with Looker and CloudSQL feat: add support for a ReconcileTags() API method PiperOrigin-RevId: 516484690 Source-Link: googleapis/googleapis@50eef0f Source-Link: googleapis/googleapis-gen@09b2058 Copy-Tag: eyJwIjoiRGF0YUNhdGFsb2cvLk93bEJvdC55YW1sIiwiaCI6IjA5YjIwNTgxOWFhNmQ4MjM5M2VmODY1YjU5NjU3MTgxNGM1ZDE4NDAifQ==
- Loading branch information
1 parent
534f8ab
commit cd27d6a
Showing
80 changed files
with
4,136 additions
and
194 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95 changes: 95 additions & 0 deletions
95
DataCatalog/samples/V1/DataCatalogClient/import_entries.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
<?php | ||
/* | ||
* Copyright 2023 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/* | ||
* GENERATED CODE WARNING | ||
* This file was automatically generated - do not edit! | ||
*/ | ||
|
||
require_once __DIR__ . '/../../../vendor/autoload.php'; | ||
|
||
// [START datacatalog_v1_generated_DataCatalog_ImportEntries_sync] | ||
use Google\ApiCore\ApiException; | ||
use Google\ApiCore\OperationResponse; | ||
use Google\Cloud\DataCatalog\V1\DataCatalogClient; | ||
use Google\Cloud\DataCatalog\V1\ImportEntriesResponse; | ||
use Google\Rpc\Status; | ||
|
||
/** | ||
* Imports entries from a source, such as data previously dumped into a | ||
* Cloud Storage bucket, into Data Catalog. Import of entries | ||
* is a sync operation that reconciles the state of the third-party system | ||
* with the Data Catalog. | ||
* | ||
* `ImportEntries` accepts source data snapshots of a third-party system. | ||
* Snapshot should be delivered as a .wire or base65-encoded .txt file | ||
* containing a sequence of Protocol Buffer messages of | ||
* [DumpItem][google.cloud.datacatalog.v1.DumpItem] type. | ||
* | ||
* `ImportEntries` returns a [long-running operation] | ||
* [google.longrunning.Operation] resource that can be queried with | ||
* [Operations.GetOperation][google.longrunning.Operations.GetOperation] | ||
* to return | ||
* [ImportEntriesMetadata][google.cloud.datacatalog.v1.ImportEntriesMetadata] | ||
* and an | ||
* [ImportEntriesResponse][google.cloud.datacatalog.v1.ImportEntriesResponse] | ||
* message. | ||
* | ||
* @param string $formattedParent Target entry group for ingested entries. Please see | ||
* {@see DataCatalogClient::entryGroupName()} for help formatting this field. | ||
*/ | ||
function import_entries_sample(string $formattedParent): void | ||
{ | ||
// Create a client. | ||
$dataCatalogClient = new DataCatalogClient(); | ||
|
||
// Call the API and handle any network failures. | ||
try { | ||
/** @var OperationResponse $response */ | ||
$response = $dataCatalogClient->importEntries($formattedParent); | ||
$response->pollUntilComplete(); | ||
|
||
if ($response->operationSucceeded()) { | ||
/** @var ImportEntriesResponse $result */ | ||
$result = $response->getResult(); | ||
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); | ||
} else { | ||
/** @var Status $error */ | ||
$error = $response->getError(); | ||
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); | ||
} | ||
} catch (ApiException $ex) { | ||
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); | ||
} | ||
} | ||
|
||
/** | ||
* Helper to execute the sample. | ||
* | ||
* This sample has been automatically generated and should be regarded as a code | ||
* template only. It will require modifications to work: | ||
* - It may require correct/in-range values for request initialization. | ||
* - It may require specifying regional endpoints when creating the service client, | ||
* please see the apiEndpoint client configuration option for more details. | ||
*/ | ||
function callSample(): void | ||
{ | ||
$formattedParent = DataCatalogClient::entryGroupName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]'); | ||
|
||
import_entries_sample($formattedParent); | ||
} | ||
// [END datacatalog_v1_generated_DataCatalog_ImportEntries_sync] |
102 changes: 102 additions & 0 deletions
102
DataCatalog/samples/V1/DataCatalogClient/reconcile_tags.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
<?php | ||
/* | ||
* Copyright 2023 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/* | ||
* GENERATED CODE WARNING | ||
* This file was automatically generated - do not edit! | ||
*/ | ||
|
||
require_once __DIR__ . '/../../../vendor/autoload.php'; | ||
|
||
// [START datacatalog_v1_generated_DataCatalog_ReconcileTags_sync] | ||
use Google\ApiCore\ApiException; | ||
use Google\ApiCore\OperationResponse; | ||
use Google\Cloud\DataCatalog\V1\DataCatalogClient; | ||
use Google\Cloud\DataCatalog\V1\ReconcileTagsResponse; | ||
use Google\Rpc\Status; | ||
|
||
/** | ||
* `ReconcileTags` creates or updates a list of tags on the entry. | ||
* If the | ||
* [ReconcileTagsRequest.force_delete_missing][google.cloud.datacatalog.v1.ReconcileTagsRequest.force_delete_missing] | ||
* parameter is set, the operation deletes tags not included in the input tag | ||
* list. | ||
* | ||
* `ReconcileTags` returns a [long-running operation] | ||
* [google.longrunning.Operation] resource that can be queried with | ||
* [Operations.GetOperation][google.longrunning.Operations.GetOperation] | ||
* to return [ReconcileTagsMetadata] | ||
* [google.cloud.datacatalog.v1.ReconcileTagsMetadata] and | ||
* a [ReconcileTagsResponse] | ||
* [google.cloud.datacatalog.v1.ReconcileTagsResponse] message. | ||
* | ||
* @param string $formattedParent Name of [Entry][google.cloud.datacatalog.v1.Entry] to be tagged. Please see | ||
* {@see DataCatalogClient::entryName()} for help formatting this field. | ||
* @param string $formattedTagTemplate The name of the tag template, which is used for reconciliation. Please see | ||
* {@see DataCatalogClient::tagTemplateName()} for help formatting this field. | ||
*/ | ||
function reconcile_tags_sample(string $formattedParent, string $formattedTagTemplate): void | ||
{ | ||
// Create a client. | ||
$dataCatalogClient = new DataCatalogClient(); | ||
|
||
// Call the API and handle any network failures. | ||
try { | ||
/** @var OperationResponse $response */ | ||
$response = $dataCatalogClient->reconcileTags($formattedParent, $formattedTagTemplate); | ||
$response->pollUntilComplete(); | ||
|
||
if ($response->operationSucceeded()) { | ||
/** @var ReconcileTagsResponse $result */ | ||
$result = $response->getResult(); | ||
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); | ||
} else { | ||
/** @var Status $error */ | ||
$error = $response->getError(); | ||
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); | ||
} | ||
} catch (ApiException $ex) { | ||
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); | ||
} | ||
} | ||
|
||
/** | ||
* Helper to execute the sample. | ||
* | ||
* This sample has been automatically generated and should be regarded as a code | ||
* template only. It will require modifications to work: | ||
* - It may require correct/in-range values for request initialization. | ||
* - It may require specifying regional endpoints when creating the service client, | ||
* please see the apiEndpoint client configuration option for more details. | ||
*/ | ||
function callSample(): void | ||
{ | ||
$formattedParent = DataCatalogClient::entryName( | ||
'[PROJECT]', | ||
'[LOCATION]', | ||
'[ENTRY_GROUP]', | ||
'[ENTRY]' | ||
); | ||
$formattedTagTemplate = DataCatalogClient::tagTemplateName( | ||
'[PROJECT]', | ||
'[LOCATION]', | ||
'[TAG_TEMPLATE]' | ||
); | ||
|
||
reconcile_tags_sample($formattedParent, $formattedTagTemplate); | ||
} | ||
// [END datacatalog_v1_generated_DataCatalog_ReconcileTags_sync] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.