Datenprodukte verwalten

Dieses Dokument richtet sich an Inhaber von Datenprodukten, die Datenprodukte in Knowledge Catalog (früher Dataplex Universal Catalog) aktualisieren, löschen und Zugriff darauf gewähren möchten.

Weitere Informationen zur Architektur und zu den wichtigsten Konzepten von Datenprodukten finden Sie unter Datenprodukte.

Hinweis

  1. Aktivieren Sie die Dataplex- und BigQuery-APIs.

    Rollen, die zum Aktivieren von APIs erforderlich sind

    Zum Aktivieren von APIs benötigen Sie die IAM-Rolle „Service Usage-Administrator“ (roles/serviceusage.serviceUsageAdmin), die die Berechtigung serviceusage.services.enable enthält. Weitere Informationen zum Zuweisen von Rollen

    APIs aktivieren

Erforderliche Rollen

Bitten Sie Ihren Administrator, Ihnen die folgenden IAM-Rollen für das Projekt zuzuweisen, damit Sie die nötigen Berechtigungen zum Verwalten von Datenprodukten haben:

Weitere Informationen zum Zuweisen von Rollen finden Sie unter Zugriff auf Projekte, Ordner und Organisationen verwalten.

Diese vordefinierten Rollen enthalten die Berechtigungen, die zum Verwalten von Datenprodukten erforderlich sind. Maximieren Sie den Abschnitt Erforderliche Berechtigungen, um die notwendigen Berechtigungen anzuzeigen:

Erforderliche Berechtigungen

Die folgenden Berechtigungen sind erforderlich, um Datenprodukte zu verwalten:

  • Bearbeiten Sie den Systemaspekttyp overview: dataplex.entryGroups.useOverviewAspect
  • Bearbeiten Sie den Systemaspekttyp refresh cadence: dataplex.entryGroups.useRefreshCadenceAspect
  • Zugriffsanfrage für ein Datenprodukt genehmigen: dataplex.dataProducts.approve

Sie können diese Berechtigungen auch mit benutzerdefinierten Rollen oder anderen vordefinierten Rollen erhalten.

Zugriffssteuerung für BigQuery-Modelle

Der Zugriff auf BigQuery-Modelle in einem Datenprodukt wird über IAM-Bedingungen verwaltet, die auf die IAM-Richtlinie des übergeordneten Datasets angewendet werden.

Wenn Sie ein BigQuery-Modell löschen und dann mit demselben Namen neu erstellen, werden die Berechtigungen, die Google-Gruppen oder Dienstkonten zuvor über das Datenprodukt gewährt wurden, im Knowledge Catalog wiederhergestellt.

Berechtigungen festlegen, damit Datenprodukte auffindbar sind

Damit potenzielle Nutzer nach einem Datenprodukt suchen, es aufrufen und Zugriff darauf anfordern können, müssen Datenprodukteigentümer dafür sorgen, dass das Produkt auffindbar ist. Dazu müssen sie die entsprechenden IAM-Rollen für die Datenproduktressource zuweisen:

  • Nach Datenprodukten suchen, sie ansehen und Zugriff darauf anfordern: Dataplex Data Product Consumer (dataplex.dataProductsConsumer)

  • Definitionen und Metadaten von Datenprodukten ansehen (schreibgeschützter Zugriff): Dataplex Data Product Viewer (dataplex.dataProductsViewer)

Zugriffsanfragen für Datenprodukte verwalten

Wenn ein Nutzer eines Datenprodukts Zugriff anfordert, erhält der Inhaber des Datenprodukts eine E-Mail-Benachrichtigung. Inhaber können diese Anfragen entweder über die Google Cloud Console oder die API prüfen, genehmigen oder ablehnen.

Console

Zugriffsanfragen für ein bestimmtes Datenprodukt prüfen

  1. Rufen Sie in der Google Cloud Console die Seite Datenprodukte des Knowledge Catalog auf.

    Zu Datenprodukten

  2. Klicken Sie auf das Datenprodukt, für das Sie Zugriffsanfragen prüfen möchten.

  3. Klicken Sie auf den Tab Zugriffsanfragen verwalten.

  4. Wählen Sie den Antragsteller aus, dessen Antrag Sie prüfen möchten.

  5. Klicken Sie auf  Aktionen und dann auf Genehmigen oder Ablehnen.

  6. Klicken Sie auf Speichern.

Zugriffsanfragen für mehrere Datenprodukte prüfen

  1. Rufen Sie in der Google Cloud Console die Seite Governance-Workflows des Knowledge Catalog auf.

    Governance-Workflows aufrufen

  2. Klicken Sie auf den Tab Ausstehende Genehmigungen.

  3. Optional: Filtern Sie die Liste nach dem Namen des jeweiligen Datenprodukts, um die Anfragen zu isolieren.

  4. Wählen Sie die Zielanfrage aus und klicken Sie auf Genehmigen oder Ablehnen.

  5. Klicken Sie auf Speichern.

Verhalten nach der Genehmigung

  • Nutzeranfragen: Nutzer, die Zugriff für ihre Nutzeridentität angefordert haben, werden automatisch als Mitglieder der Google-Gruppe hinzugefügt, die der Zugriffsgruppe zugeordnet ist.

  • Dienstkontoanfragen: Nutzern, die Zugriff für ein Dienstkonto angefordert haben, werden Berechtigungen zum Übernehmen der Identität des Dienstkontos des Datenproduzenten gewährt, das der Zugriffsgruppe zugeordnet ist.

Nach der Verarbeitung wird der Anfragestatus automatisch aktualisiert und der Eintrag wird auf den Tab Genehmigungsprotokoll verschoben.

REST

Alle ausstehenden Zugriffsanfragen auflisten

Wenn Sie alle Zugriffsanfragen auflisten möchten, die in einem bestimmten Projekt und an einem bestimmten Standort noch nicht von Ihnen geprüft wurden, senden Sie eine GET-Anfrage mit der benutzerdefinierten Sammlungsmethode :listReviewable:

curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
"https://dataplex.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/changeRequests:listReviewable"

Ersetzen Sie Folgendes:

  • PROJECT_ID: die ID Ihres Google Cloud -Projekts

  • LOCATION: Die Region, in der das Datenprodukt vorhanden ist, z. B. us-central1

Zugriffsanfrage genehmigen

Data Product Owners mit der Berechtigung dataplex.dataProducts.approve können eine ausstehende Anfrage genehmigen, indem sie eine POST-Anfrage an die benutzerdefinierte Methode :approve senden:

curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
"https://dataplex.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/changeRequests/CHANGE_REQUEST_ID:approve"

Ersetzen Sie Folgendes:

  • PROJECT_ID: die ID Ihres Google Cloud -Projekts

  • LOCATION: Die Region, in der das Datenprodukt vorhanden ist, z. B. us-central1

  • CHANGE_REQUEST_ID: die eindeutige ID der Zugriffsanfrage, die Sie genehmigen möchten

Anders als bei konsolenbasierten Genehmigungen werden beim Genehmigen einer Änderungsanfrage über die REST API nicht automatisch Google-Gruppenmitgliedschaften geändert oder die Identitätsübernahme von Dienstkontotokens konfiguriert. Sie müssen die folgenden Schritte zur Verwaltung des Downstream-Zugriffs manuell ausführen:

  • Bei Zugriffsanfragen für Nutzeridentitäten: Fügen Sie den Datenproduktnutzer der zugeordneten Google-Gruppe hinzu. Weitere Informationen finden Sie unter Einer Google-Gruppe eine Mitgliedschaft hinzufügen.

  • Für Zugriffsanfragen für Dienstkonten: Weisen Sie dem Dienstkonto des Datenproduktnutzers die IAM-Rolle Ersteller von Dienstkonto-Tokens (roles/iam.serviceAccountTokenCreator) für die Ressource zu, indem Sie den folgenden Befehl ausführen:

    gcloud iam service-accounts add-iam-policy-binding PRODUCER_SERVICE_ACCOUNT \
      --member="serviceAccount:CONSUMER_SERVICE_ACCOUNT" \
      --role="roles/iam.serviceAccountTokenCreator"
    

    Ersetzen Sie Folgendes:

    • PRODUCER_SERVICE_ACCOUNT: die voll qualifizierte E-Mail-Adresse des Dienstkontos, das der Zugriffsgruppe des Datenprodukts zugeordnet ist.

    • CONSUMER_SERVICE_ACCOUNT: die voll qualifizierte E-Mail-Adresse des Dienstkontos des Nutzers, der Zugriff anfordert.

Zugriffsanfrage ablehnen

Inhaber von Datenprodukten mit der Berechtigung dataplex.dataProducts.approve können eine ausstehende Anfrage ablehnen, indem sie eine POST-Anfrage an die benutzerdefinierte Methode :reject zusammen mit einer Begründungsnutzlast senden:

curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
-d '{
  "comment": "REJECTION_REASON"
}' \
"https://dataplex.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/changeRequests/CHANGE_REQUEST_ID:reject"

Ersetzen Sie Folgendes:

  • PROJECT_ID: die ID Ihres Google Cloud -Projekts

  • LOCATION: Die Region, in der das Datenprodukt vorhanden ist, z. B. us-central1

  • CHANGE_REQUEST_ID: die eindeutige ID Ihres Zugriffsantrags, den Sie ablehnen möchten

Datenprodukt aktualisieren

Sie können die grundlegenden Details (z. B. Name des Datenprodukts, Beschreibung, Inhaberdetails), Assets, Zugriffsgruppen, Berechtigungen, Vertrag, Aspekte und zusätzliche Dokumentation für ein vorhandenes Datenprodukt aktualisieren.

Grundlegende Details eines Datenprodukts aktualisieren

Console

  1. Rufen Sie in der Google Cloud Console die Seite Datenprodukte des Knowledge Catalog auf.

    Zu Datenprodukten

  2. Klicken Sie auf das Datenprodukt, das Sie aktualisieren möchten.

  3. Klicken Sie auf Bearbeiten.

  4. Aktualisieren Sie bei Bedarf den Namen des Datenprodukts, das Symbol des Datenprodukts, die Beschreibung, die E‑Mail-Adresse des/der Datenproduktinhaber(s), die E‑Mail-Adresse des/der Datenproduktgenehmiger(s) und die Labels.

  5. Klicken Sie auf Speichern.

C#

C#

Bevor Sie dieses Beispiel ausprobieren, folgen Sie der Einrichtungsanleitung für C# in der Knowledge Catalog-Kurzanleitung zur Verwendung von Clientbibliotheken. Weitere Informationen finden Sie in der Referenzdokumentation zur Knowledge Catalog C# API.

Richten Sie zur Authentifizierung bei Knowledge Catalog die Standardanmeldedaten für Anwendungen ein. Weitere Informationen finden Sie unter Authentifizierung für eine lokale Entwicklungsumgebung einrichten.

using Google.Cloud.Dataplex.V1;
using Google.LongRunning;
using Google.Protobuf.WellKnownTypes;

public sealed partial class GeneratedDataProductServiceClientSnippets
{
    /// <summary>Snippet for UpdateDataProduct</summary>
    /// <remarks>
    /// This snippet 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 as shown in
    ///   https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
    /// </remarks>
    public void UpdateDataProductRequestObject()
    {
        // Create client
        DataProductServiceClient dataProductServiceClient = DataProductServiceClient.Create();
        // Initialize request argument(s)
        UpdateDataProductRequest request = new UpdateDataProductRequest
        {
            DataProduct = new DataProduct(),
            UpdateMask = new FieldMask(),
            ValidateOnly = false,
        };
        // Make the request
        Operation<DataProduct, OperationMetadata> response = dataProductServiceClient.UpdateDataProduct(request);

        // Poll until the returned long-running operation is complete
        Operation<DataProduct, OperationMetadata> completedResponse = response.PollUntilCompleted();
        // Retrieve the operation result
        DataProduct result = completedResponse.Result;

        // Or get the name of the operation
        string operationName = response.Name;
        // This name can be stored, then the long-running operation retrieved later by name
        Operation<DataProduct, OperationMetadata> retrievedResponse = dataProductServiceClient.PollOnceUpdateDataProduct(operationName);
        // Check if the retrieved long-running operation has completed
        if (retrievedResponse.IsCompleted)
        {
            // If it has completed, then access the result
            DataProduct retrievedResult = retrievedResponse.Result;
        }
    }
}

Go

Go

Bevor Sie dieses Beispiel ausprobieren, folgen Sie der Einrichtungsanleitung für Go in der Knowledge Catalog-Kurzanleitung zur Verwendung von Clientbibliotheken. Weitere Informationen finden Sie in der Referenzdokumentation zur Knowledge Catalog Go API.

Richten Sie zur Authentifizierung bei Knowledge Catalog die Standardanmeldedaten für Anwendungen ein. Weitere Informationen finden Sie unter Authentifizierung für eine lokale Entwicklungsumgebung einrichten.


//go:build examples

package main

import (
	"context"

	dataplex "cloud.google.com/go/dataplex/apiv1"
	dataplexpb "cloud.google.com/go/dataplex/apiv1/dataplexpb"
)

func main() {
	ctx := context.Background()
	// This snippet 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 as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := dataplex.NewDataProductClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &dataplexpb.UpdateDataProductRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/dataplex/apiv1/dataplexpb#UpdateDataProductRequest.
	}
	op, err := c.UpdateDataProduct(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

	resp, err := op.Wait(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

Java

Java

Bevor Sie dieses Beispiel ausprobieren, folgen Sie der Einrichtungsanleitung für Java in der Knowledge Catalog-Kurzanleitung zur Verwendung von Clientbibliotheken. Weitere Informationen finden Sie in der Referenzdokumentation zur Knowledge Catalog Java API.

Richten Sie zur Authentifizierung bei Knowledge Catalog die Standardanmeldedaten für Anwendungen ein. Weitere Informationen finden Sie unter Authentifizierung für eine lokale Entwicklungsumgebung einrichten.

import com.google.cloud.dataplex.v1.DataProduct;
import com.google.cloud.dataplex.v1.DataProductServiceClient;
import com.google.cloud.dataplex.v1.UpdateDataProductRequest;
import com.google.protobuf.FieldMask;

public class SyncUpdateDataProduct {

  public static void main(String[] args) throws Exception {
    syncUpdateDataProduct();
  }

  public static void syncUpdateDataProduct() throws Exception {
    // This snippet 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 as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    try (DataProductServiceClient dataProductServiceClient = DataProductServiceClient.create()) {
      UpdateDataProductRequest request =
          UpdateDataProductRequest.newBuilder()
              .setDataProduct(DataProduct.newBuilder().build())
              .setUpdateMask(FieldMask.newBuilder().build())
              .setValidateOnly(true)
              .build();
      DataProduct response = dataProductServiceClient.updateDataProductAsync(request).get();
    }
  }
}

Node.js

Node.js

Bevor Sie dieses Beispiel ausprobieren, folgen Sie der Einrichtungsanleitung für Node.js in der Knowledge Catalog-Kurzanleitung zur Verwendung von Clientbibliotheken. Weitere Informationen finden Sie in der Referenzdokumentation zur Knowledge Catalog Node.js API.

Richten Sie zur Authentifizierung bei Knowledge Catalog die Standardanmeldedaten für Anwendungen ein. Weitere Informationen finden Sie unter Authentifizierung für eine lokale Entwicklungsumgebung einrichten.

/**
 * This snippet 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.
 * TODO(developer): Uncomment these variables before running the sample.
 */
/**
 *  Required. The data product to update.
 *  The data product's `name` field is used to identify the data product to
 *  update.
 */
// const dataProduct = {}
/**
 *  Optional. The list of fields to update.
 *  If this is empty or not set, then all the fields will be updated.
 */
// const updateMask = {}
/**
 *  Optional. Validates the request without actually updating the data product.
 *  Default: false.
 */
// const validateOnly = true

// Imports the Dataplex library
const {DataProductServiceClient} = require('@google-cloud/dataplex').v1;

// Instantiates a client
const dataplexClient = new DataProductServiceClient();

async function callUpdateDataProduct() {
  // Construct request
  const request = {
    dataProduct,
  };

  // Run request
  const [operation] = await dataplexClient.updateDataProduct(request);
  const [response] = await operation.promise();
  console.log(response);
}

callUpdateDataProduct();

Python

Python

Bevor Sie dieses Beispiel ausprobieren, folgen Sie der Einrichtungsanleitung für Python in der Knowledge Catalog-Kurzanleitung zur Verwendung von Clientbibliotheken. Weitere Informationen finden Sie in der Referenzdokumentation zur Knowledge Catalog Python API.

Richten Sie zur Authentifizierung bei Knowledge Catalog die Standardanmeldedaten für Anwendungen ein. Weitere Informationen finden Sie unter Authentifizierung für eine lokale Entwicklungsumgebung einrichten.

# This snippet 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 as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dataplex_v1


def sample_update_data_product():
    # Create a client
    client = dataplex_v1.DataProductServiceClient()

    # Initialize request argument(s)
    data_product = dataplex_v1.DataProduct()
    data_product.display_name = "display_name_value"
    data_product.owner_emails = ["owner_emails_value1", "owner_emails_value2"]

    request = dataplex_v1.UpdateDataProductRequest(
        data_product=data_product,
    )

    # Make the request
    operation = client.update_data_product(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)

REST

Verwenden Sie die Methode dataProducts.patch, um die grundlegenden Details eines Datenprodukts zu aktualisieren.

Wenn Sie beispielsweise die Beschreibung eines Datenprodukts aktualisieren möchten, senden Sie die folgende PATCH-Anfrage:

curl -X PATCH \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
-d '{"description": "NEW_DESCRIPTION"}' \
https://dataplex.googleapis.com/v1/projects/PROJECT_ID/locations/ LOCATION/dataProducts/DATA_PRODUCT_ID?update_mask="description"

Ersetzen Sie Folgendes:

  • NEW_DESCRIPTION: eine neue Beschreibung für das Datenprodukt
  • PROJECT_ID: die ID Ihres Google Cloud-Projekts
  • LOCATION: die Region, in der das Datenprodukt vorhanden ist
  • DATA_PRODUCT_ID: die ID Ihres Datenprodukts

Assets eines Datenprodukts aktualisieren

Console

  1. Rufen Sie in der Google Cloud Console die Seite Datenprodukte im Knowledge Catalog auf.

    Zu Datenprodukten

  2. Klicken Sie auf das Datenprodukt, für das Sie Assets aktualisieren möchten.

  3. Klicken Sie auf den Tab Assets.

  4. So fügen Sie ein neues Asset hinzu:

    1. Klicken Sie auf Hinzufügen.

    2. Suchen Sie nach den Assets, die Sie Ihrem Datenprodukt hinzufügen möchten, und wählen Sie sie aus. Die ausgewählten Assets müssen sich in derselben Region wie das Datenprodukt befinden.

      Wenn Sie die erforderlichen Berechtigungen haben, können Sie die Metadaten von Assets aufrufen, indem Sie auf das Asset klicken.

    3. Mit Filtern können Sie die Suchergebnisse eingrenzen.

    4. Klicken Sie nach der Auswahl der Assets auf Hinzufügen.

  5. So entfernen Sie ein Asset aus dem Datenprodukt:

    1. Klicken Sie für das Asset, das Sie entfernen möchten, auf  > Entfernen.

    2. Klicken Sie zur Bestätigung auf Entfernen.

C#

Einem Datenprodukt ein neues Daten-Asset hinzufügen

C#

Bevor Sie dieses Beispiel ausprobieren, folgen Sie der Einrichtungsanleitung für C# in der Knowledge Catalog-Kurzanleitung zur Verwendung von Clientbibliotheken. Weitere Informationen finden Sie in der Referenzdokumentation zur Knowledge Catalog C# API.

Richten Sie zur Authentifizierung bei Knowledge Catalog die Standardanmeldedaten für Anwendungen ein. Weitere Informationen finden Sie unter Authentifizierung für eine lokale Entwicklungsumgebung einrichten.

// Copyright 2026 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. DO NOT EDIT!

namespace GoogleCSharpSnippets
{
    using Google.Cloud.Dataplex.V1;
    using Google.LongRunning;

    public sealed partial class GeneratedDataProductServiceClientSnippets
    {
        /// <summary>Snippet for CreateDataAsset</summary>
        /// <remarks>
        /// This snippet 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 as shown in
        ///   https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
        /// </remarks>
        public void CreateDataAssetRequestObject()
        {
            // Create client
            DataProductServiceClient dataProductServiceClient = DataProductServiceClient.Create();
            // Initialize request argument(s)
            CreateDataAssetRequest request = new CreateDataAssetRequest
            {
                ParentAsDataProductName = DataProductName.FromProjectLocationDataProduct("[PROJECT]", "[LOCATION]", "[DATA_PRODUCT]"),
                DataAssetId = "",
                DataAsset = new DataAsset(),
                ValidateOnly = false,
            };
            // Make the request
            Operation<DataAsset, OperationMetadata> response = dataProductServiceClient.CreateDataAsset(request);

            // Poll until the returned long-running operation is complete
            Operation<DataAsset, OperationMetadata> completedResponse = response.PollUntilCompleted();
            // Retrieve the operation result
            DataAsset result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            Operation<DataAsset, OperationMetadata> retrievedResponse = dataProductServiceClient.PollOnceCreateDataAsset(operationName);
            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                DataAsset retrievedResult = retrievedResponse.Result;
            }
        }
    }
}

Daten-Asset aus einem Datenprodukt löschen

C#

Bevor Sie dieses Beispiel ausprobieren, folgen Sie der Einrichtungsanleitung für C# in der Knowledge Catalog-Kurzanleitung zur Verwendung von Clientbibliotheken. Weitere Informationen finden Sie in der Referenzdokumentation zur Knowledge Catalog C# API.

Richten Sie zur Authentifizierung bei Knowledge Catalog die Standardanmeldedaten für Anwendungen ein. Weitere Informationen finden Sie unter Authentifizierung für eine lokale Entwicklungsumgebung einrichten.

// Copyright 2026 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. DO NOT EDIT!

namespace GoogleCSharpSnippets
{
    using Google.Cloud.Dataplex.V1;
    using Google.LongRunning;
    using Google.Protobuf.WellKnownTypes;

    public sealed partial class GeneratedDataProductServiceClientSnippets
    {
        /// <summary>Snippet for DeleteDataAsset</summary>
        /// <remarks>
        /// This snippet 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 as shown in
        ///   https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
        /// </remarks>
        public void DeleteDataAssetRequestObject()
        {
            // Create client
            DataProductServiceClient dataProductServiceClient = DataProductServiceClient.Create();
            // Initialize request argument(s)
            DeleteDataAssetRequest request = new DeleteDataAssetRequest
            {
                DataAssetName = DataAssetName.FromProjectLocationDataProductDataAsset("[PROJECT]", "[LOCATION]", "[DATA_PRODUCT]", "[DATA_ASSET]"),
                Etag = "",
                ValidateOnly = false,
            };
            // Make the request
            Operation<Empty, OperationMetadata> response = dataProductServiceClient.DeleteDataAsset(request);

            // Poll until the returned long-running operation is complete
            Operation<Empty, OperationMetadata> completedResponse = response.PollUntilCompleted();
            // Retrieve the operation result
            Empty result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            Operation<Empty, OperationMetadata> retrievedResponse = dataProductServiceClient.PollOnceDeleteDataAsset(operationName);
            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Empty retrievedResult = retrievedResponse.Result;
            }
        }
    }
}

Go

Einem Datenprodukt ein neues Daten-Asset hinzufügen

Go

Bevor Sie dieses Beispiel ausprobieren, folgen Sie der Einrichtungsanleitung für Go in der Knowledge Catalog-Kurzanleitung zur Verwendung von Clientbibliotheken. Weitere Informationen finden Sie in der Referenzdokumentation zur Knowledge Catalog Go API.

Richten Sie zur Authentifizierung bei Knowledge Catalog die Standardanmeldedaten für Anwendungen ein. Weitere Informationen finden Sie unter Authentifizierung für eine lokale Entwicklungsumgebung einrichten.

// Copyright 2026 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.

// Code generated by protoc-gen-go_gapic. DO NOT EDIT.


//go:build examples

package main

import (
	"context"

	dataplex "cloud.google.com/go/dataplex/apiv1"
	dataplexpb "cloud.google.com/go/dataplex/apiv1/dataplexpb"
)

func main() {
	ctx := context.Background()
	// This snippet 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 as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := dataplex.NewDataProductClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &dataplexpb.CreateDataAssetRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/dataplex/apiv1/dataplexpb#CreateDataAssetRequest.
	}
	op, err := c.CreateDataAsset(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

	resp, err := op.Wait(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

Daten-Asset aus einem Datenprodukt löschen

Go

Bevor Sie dieses Beispiel ausprobieren, folgen Sie der Einrichtungsanleitung für Go in der Knowledge Catalog-Kurzanleitung zur Verwendung von Clientbibliotheken. Weitere Informationen finden Sie in der Referenzdokumentation zur Knowledge Catalog Go API.

Richten Sie zur Authentifizierung bei Knowledge Catalog die Standardanmeldedaten für Anwendungen ein. Weitere Informationen finden Sie unter Authentifizierung für eine lokale Entwicklungsumgebung einrichten.

// Copyright 2026 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.

// Code generated by protoc-gen-go_gapic. DO NOT EDIT.


//go:build examples

package main

import (
	"context"

	dataplex "cloud.google.com/go/dataplex/apiv1"
	dataplexpb "cloud.google.com/go/dataplex/apiv1/dataplexpb"
)

func main() {
	ctx := context.Background()
	// This snippet 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 as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := dataplex.NewDataProductClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &dataplexpb.DeleteDataAssetRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/dataplex/apiv1/dataplexpb#DeleteDataAssetRequest.
	}
	op, err := c.DeleteDataAsset(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

	err = op.Wait(ctx)
	if err != nil {
		// TODO: Handle error.
	}
}

Java

Einem Datenprodukt ein neues Daten-Asset hinzufügen

Java

Bevor Sie dieses Beispiel ausprobieren, folgen Sie der Einrichtungsanleitung für Java in der Knowledge Catalog-Kurzanleitung zur Verwendung von Clientbibliotheken. Weitere Informationen finden Sie in der Referenzdokumentation zur Knowledge Catalog Java API.

Richten Sie zur Authentifizierung bei Knowledge Catalog die Standardanmeldedaten für Anwendungen ein. Weitere Informationen finden Sie unter Authentifizierung für eine lokale Entwicklungsumgebung einrichten.

/*
 * Copyright 2026 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.
 */

package com.google.cloud.dataplex.v1.samples;

import com.google.cloud.dataplex.v1.CreateDataAssetRequest;
import com.google.cloud.dataplex.v1.DataAsset;
import com.google.cloud.dataplex.v1.DataProductName;
import com.google.cloud.dataplex.v1.DataProductServiceClient;

public class SyncCreateDataAsset {

  public static void main(String[] args) throws Exception {
    syncCreateDataAsset();
  }

  public static void syncCreateDataAsset() throws Exception {
    // This snippet 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 as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    try (DataProductServiceClient dataProductServiceClient = DataProductServiceClient.create()) {
      CreateDataAssetRequest request =
          CreateDataAssetRequest.newBuilder()
              .setParent(DataProductName.of("[PROJECT]", "[LOCATION]", "[DATA_PRODUCT]").toString())
              .setDataAssetId("dataAssetId2108984609")
              .setDataAsset(DataAsset.newBuilder().build())
              .setValidateOnly(true)
              .build();
      DataAsset response = dataProductServiceClient.createDataAssetAsync(request).get();
    }
  }
}

Daten-Asset aus einem Datenprodukt löschen

Java

Bevor Sie dieses Beispiel ausprobieren, folgen Sie der Einrichtungsanleitung für Java in der Knowledge Catalog-Kurzanleitung zur Verwendung von Clientbibliotheken. Weitere Informationen finden Sie in der Referenzdokumentation zur Knowledge Catalog Java API.

Richten Sie zur Authentifizierung bei Knowledge Catalog die Standardanmeldedaten für Anwendungen ein. Weitere Informationen finden Sie unter Authentifizierung für eine lokale Entwicklungsumgebung einrichten.

/*
 * Copyright 2026 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.
 */

package com.google.cloud.dataplex.v1.samples;

import com.google.cloud.dataplex.v1.DataAssetName;
import com.google.cloud.dataplex.v1.DataProductServiceClient;
import com.google.cloud.dataplex.v1.DeleteDataAssetRequest;
import com.google.protobuf.Empty;

public class SyncDeleteDataAsset {

  public static void main(String[] args) throws Exception {
    syncDeleteDataAsset();
  }

  public static void syncDeleteDataAsset() throws Exception {
    // This snippet 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 as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    try (DataProductServiceClient dataProductServiceClient = DataProductServiceClient.create()) {
      DeleteDataAssetRequest request =
          DeleteDataAssetRequest.newBuilder()
              .setName(
                  DataAssetName.of("[PROJECT]", "[LOCATION]", "[DATA_PRODUCT]", "[DATA_ASSET]")
                      .toString())
              .setEtag("etag3123477")
              .setValidateOnly(true)
              .build();
      dataProductServiceClient.deleteDataAssetAsync(request).get();
    }
  }
}

Node.js

Einem Datenprodukt ein neues Daten-Asset hinzufügen

Node.js

Bevor Sie dieses Beispiel ausprobieren, folgen Sie der Einrichtungsanleitung für Node.js in der Knowledge Catalog-Kurzanleitung zur Verwendung von Clientbibliotheken. Weitere Informationen finden Sie in der Referenzdokumentation zur Knowledge Catalog Node.js API.

Richten Sie zur Authentifizierung bei Knowledge Catalog die Standardanmeldedaten für Anwendungen ein. Weitere Informationen finden Sie unter Authentifizierung für eine lokale Entwicklungsumgebung einrichten.

// Copyright 2026 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.
//
// ** This file is automatically generated by gapic-generator-typescript. **
// ** https://github.com/googleapis/gapic-generator-typescript **
// ** All changes to this file may be overwritten. **



'use strict';

function main(parent, dataAsset) {
  /**
   * This snippet 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.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The parent resource where this data asset will be created.
   *  Format:
   *  projects/{project_id_or_number}/locations/{location_id}/dataProducts/{data_product_id}
   */
  // const parent = 'abc123'
  /**
   *  Optional. The ID of the data asset to create.
   *  The ID must conform to RFC-1034 and contain only lower-case letters (a-z),
   *  numbers (0-9), or hyphens, with the first character a letter, the last a
   *  letter or a number, and a 63 character maximum. Characters outside of
   *  ASCII are not permitted.
   *  Valid format regex: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`
   *  If not provided, a system generated ID will be used.
   */
  // const dataAssetId = 'abc123'
  /**
   *  Required. The data asset to create.
   */
  // const dataAsset = {}
  /**
   *  Optional. Validates the request without actually creating the data asset.
   *  Defaults to false.
   */
  // const validateOnly = true

  // Imports the Dataplex library
  const {DataProductServiceClient} = require('@google-cloud/dataplex').v1;

  // Instantiates a client
  const dataplexClient = new DataProductServiceClient();

  async function callCreateDataAsset() {
    // Construct request
    const request = {
      parent,
      dataAsset,
    };

    // Run request
    const [operation] = await dataplexClient.createDataAsset(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCreateDataAsset();
}

process.on('unhandledRejection', err => {
  console.error(err.message);
  process.exitCode = 1;
});
main(...process.argv.slice(2));

Daten-Asset aus einem Datenprodukt löschen

Node.js

Bevor Sie dieses Beispiel ausprobieren, folgen Sie der Einrichtungsanleitung für Node.js in der Knowledge Catalog-Kurzanleitung zur Verwendung von Clientbibliotheken. Weitere Informationen finden Sie in der Referenzdokumentation zur Knowledge Catalog Node.js API.

Richten Sie zur Authentifizierung bei Knowledge Catalog die Standardanmeldedaten für Anwendungen ein. Weitere Informationen finden Sie unter Authentifizierung für eine lokale Entwicklungsumgebung einrichten.

// Copyright 2026 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.
//
// ** This file is automatically generated by gapic-generator-typescript. **
// ** https://github.com/googleapis/gapic-generator-typescript **
// ** All changes to this file may be overwritten. **



'use strict';

function main(name) {
  /**
   * This snippet 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.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the data asset to delete.
   *  Format:
   *  projects/{project_id_or_number}/locations/{location_id}/dataProducts/{data_product_id}/dataAssets/{data_asset_id}
   */
  // const name = 'abc123'
  /**
   *  Optional. The etag of the data asset.
   *  If this is provided, it must match the server's etag.
   *  If the etag is provided and does not match the server-computed etag,
   *  the request must fail with a ABORTED error code.
   */
  // const etag = 'abc123'
  /**
   *  Optional. Validates the request without actually deleting the data asset.
   *  Defaults to false.
   */
  // const validateOnly = true

  // Imports the Dataplex library
  const {DataProductServiceClient} = require('@google-cloud/dataplex').v1;

  // Instantiates a client
  const dataplexClient = new DataProductServiceClient();

  async function callDeleteDataAsset() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await dataplexClient.deleteDataAsset(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callDeleteDataAsset();
}

process.on('unhandledRejection', err => {
  console.error(err.message);
  process.exitCode = 1;
});
main(...process.argv.slice(2));

Python

Einem Datenprodukt ein neues Daten-Asset hinzufügen

Python

Bevor Sie dieses Beispiel ausprobieren, folgen Sie der Einrichtungsanleitung für Python in der Knowledge Catalog-Kurzanleitung zur Verwendung von Clientbibliotheken. Weitere Informationen finden Sie in der Referenzdokumentation zur Knowledge Catalog Python API.

Richten Sie zur Authentifizierung bei Knowledge Catalog die Standardanmeldedaten für Anwendungen ein. Weitere Informationen finden Sie unter Authentifizierung für eine lokale Entwicklungsumgebung einrichten.

# -*- coding: utf-8 -*-
# Copyright 2026 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
#
#     http://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. DO NOT EDIT!
#
# Snippet for CreateDataAsset
# NOTE: This snippet has been automatically generated for illustrative purposes only.
# It may require modifications to work in your environment.

# To install the latest published package dependency, execute the following:
#   python3 -m pip install google-cloud-dataplex


# This snippet 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 as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dataplex_v1


def sample_create_data_asset():
    # Create a client
    client = dataplex_v1.DataProductServiceClient()

    # Initialize request argument(s)
    data_asset = dataplex_v1.DataAsset()
    data_asset.resource = "resource_value"

    request = dataplex_v1.CreateDataAssetRequest(
        parent="parent_value",
        data_asset=data_asset,
    )

    # Make the request
    operation = client.create_data_asset(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)


Daten-Asset aus einem Datenprodukt löschen

Python

Bevor Sie dieses Beispiel ausprobieren, folgen Sie der Einrichtungsanleitung für Python in der Knowledge Catalog-Kurzanleitung zur Verwendung von Clientbibliotheken. Weitere Informationen finden Sie in der Referenzdokumentation zur Knowledge Catalog Python API.

Richten Sie zur Authentifizierung bei Knowledge Catalog die Standardanmeldedaten für Anwendungen ein. Weitere Informationen finden Sie unter Authentifizierung für eine lokale Entwicklungsumgebung einrichten.

# -*- coding: utf-8 -*-
# Copyright 2026 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
#
#     http://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. DO NOT EDIT!
#
# Snippet for DeleteDataAsset
# NOTE: This snippet has been automatically generated for illustrative purposes only.
# It may require modifications to work in your environment.

# To install the latest published package dependency, execute the following:
#   python3 -m pip install google-cloud-dataplex


# This snippet 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 as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dataplex_v1


def sample_delete_data_asset():
    # Create a client
    client = dataplex_v1.DataProductServiceClient()

    # Initialize request argument(s)
    request = dataplex_v1.DeleteDataAssetRequest(
        name="name_value",
    )

    # Make the request
    operation = client.delete_data_asset(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)


REST

Wenn Sie dem Datenprodukt ein neues Daten-Asset hinzufügen möchten, verwenden Sie die Methode dataAssets.create. Ein Codebeispiel finden Sie unter Optional: Add assets.

Wenn Sie ein Daten-Asset aus dem Datenprodukt löschen möchten, verwenden Sie die Methode dataAssets.delete. Senden Sie beispielsweise die folgende DELETE-Anfrage:

curl -X DELETE \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://dataplex.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/dataProducts/DATA_PRODUCT_ID/dataAssets/DATA_ASSET_ID"

Ersetzen Sie Folgendes:

  • PROJECT_ID: die ID Ihres Google Cloud-Projekts
  • LOCATION: die Region, in der Sie das Datenprodukt erstellen möchten
  • DATA_PRODUCT_ID: Eine eindeutige ID für Ihr Datenprodukt.
  • DATA_ASSET_ID: die ID des Daten-Assets, das Sie aus dem Datenprodukt entfernen möchten

Zugriffsgruppen und Asset-Berechtigungen aktualisieren

Console

  1. Rufen Sie in der Google Cloud Console die Seite Datenprodukte des Knowledge Catalog auf.

    Zu Datenprodukten

  2. Klicken Sie auf das Datenprodukt, für das Sie die Zugriffsgruppen und Berechtigungen aktualisieren möchten.

  3. Klicken Sie auf den Tab Zugriffsgruppen und ‑berechtigungen.

  4. So aktualisieren Sie eine Zugriffsgruppe:

    1. Klicken Sie auf  Bearbeiten.

    2. Aktualisieren Sie den Namen, die Beschreibung und die Kennung der Zugriffsgruppe nach Bedarf.

    3. Wenn Sie eine neue Zugriffsgruppe hinzufügen möchten, klicken Sie auf Zugriffsgruppe hinzufügen und folgen Sie dieser Anleitung:

      1. Geben Sie im Feld Name der Zugriffsgruppe einen Namen für die neue Zugriffsgruppe ein. Beispiel: Analyst.

      2. Geben Sie im Feld Beschreibung der Zugriffsgruppe eine Beschreibung für die Zugriffsgruppe ein.

      3. Geben Sie im Feld Zugriffsgruppen-ID die E-Mail-Adresse einer Google-Gruppe oder eines Dienstkontos oder beider ein, die Sie dieser Zugriffsgruppe zuweisen möchten:

        • Google-Gruppe: Datenproduktnutzer, die Zugriff für sich selbst anfordern, werden der zugeordneten Google-Gruppe als Mitglieder hinzugefügt.

        • Dienstkonto: Datenproduktnutzer, die Zugriff für ihre Dienstkonten anfordern, erhalten die IAM-Rolle „Ersteller von Dienstkonto-Tokens“ (roles/iam.serviceAccountTokenCreator), um die Identität des Dienstkontos des Datenproduzenten zu übernehmen, das der Zugriffsgruppe zugeordnet ist.

    4. Klicken Sie auf Hinzufügen.

  5. So entfernen Sie eine Zugriffsgruppe:

    1. Klicken Sie für die Zugriffsgruppe, die Sie entfernen möchten, auf  > Entfernen.

    2. Klicken Sie zur Bestätigung auf Entfernen.

  6. Wenn für das ausgewählte Datenprodukt keine Zugriffsgruppen konfiguriert sind, können Sie eine neue Zugriffsgruppe hinzufügen, indem Sie auf Zugriffsgruppe hinzufügen klicken.

  7. So aktualisieren Sie die Berechtigungen für Assets:

    1. Klicken Sie für das Asset, dessen Berechtigungen Sie aktualisieren möchten, auf  > Berechtigungen.

    2. Aktualisieren Sie die erforderlichen Zugriffsgruppen und IAM-Rollen.

    3. Klicken Sie auf Konfigurieren.

C#

Zugriffsgruppen aktualisieren

C#

Bevor Sie dieses Beispiel ausprobieren, folgen Sie der Einrichtungsanleitung für C# in der Knowledge Catalog-Kurzanleitung zur Verwendung von Clientbibliotheken. Weitere Informationen finden Sie in der Referenzdokumentation zur Knowledge Catalog C# API.

Richten Sie zur Authentifizierung bei Knowledge Catalog die Standardanmeldedaten für Anwendungen ein. Weitere Informationen finden Sie unter Authentifizierung für eine lokale Entwicklungsumgebung einrichten.

// Copyright 2026 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. DO NOT EDIT!

namespace GoogleCSharpSnippets
{
    using Google.Cloud.Dataplex.V1;
    using Google.LongRunning;
    using Google.Protobuf.WellKnownTypes;

    public sealed partial class GeneratedDataProductServiceClientSnippets
    {
        /// <summary>Snippet for UpdateDataProduct</summary>
        /// <remarks>
        /// This snippet 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 as shown in
        ///   https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
        /// </remarks>
        public void UpdateDataProductRequestObject()
        {
            // Create client
            DataProductServiceClient dataProductServiceClient = DataProductServiceClient.Create();
            // Initialize request argument(s)
            UpdateDataProductRequest request = new UpdateDataProductRequest
            {
                DataProduct = new DataProduct(),
                UpdateMask = new FieldMask(),
                ValidateOnly = false,
            };
            // Make the request
            Operation<DataProduct, OperationMetadata> response = dataProductServiceClient.UpdateDataProduct(request);

            // Poll until the returned long-running operation is complete
            Operation<DataProduct, OperationMetadata> completedResponse = response.PollUntilCompleted();
            // Retrieve the operation result
            DataProduct result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            Operation<DataProduct, OperationMetadata> retrievedResponse = dataProductServiceClient.PollOnceUpdateDataProduct(operationName);
            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                DataProduct retrievedResult = retrievedResponse.Result;
            }
        }
    }
}

Asset-Berechtigungen aktualisieren

C#

Bevor Sie dieses Beispiel ausprobieren, folgen Sie der Einrichtungsanleitung für C# in der Knowledge Catalog-Kurzanleitung zur Verwendung von Clientbibliotheken. Weitere Informationen finden Sie in der Referenzdokumentation zur Knowledge Catalog C# API.

Richten Sie zur Authentifizierung bei Knowledge Catalog die Standardanmeldedaten für Anwendungen ein. Weitere Informationen finden Sie unter Authentifizierung für eine lokale Entwicklungsumgebung einrichten.

// Copyright 2026 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. DO NOT EDIT!

namespace GoogleCSharpSnippets
{
    using Google.Cloud.Dataplex.V1;
    using Google.LongRunning;
    using Google.Protobuf.WellKnownTypes;

    public sealed partial class GeneratedDataProductServiceClientSnippets
    {
        /// <summary>Snippet for UpdateDataAsset</summary>
        /// <remarks>
        /// This snippet 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 as shown in
        ///   https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
        /// </remarks>
        public void UpdateDataAssetRequestObject()
        {
            // Create client
            DataProductServiceClient dataProductServiceClient = DataProductServiceClient.Create();
            // Initialize request argument(s)
            UpdateDataAssetRequest request = new UpdateDataAssetRequest
            {
                DataAsset = new DataAsset(),
                UpdateMask = new FieldMask(),
                ValidateOnly = false,
            };
            // Make the request
            Operation<DataAsset, OperationMetadata> response = dataProductServiceClient.UpdateDataAsset(request);

            // Poll until the returned long-running operation is complete
            Operation<DataAsset, OperationMetadata> completedResponse = response.PollUntilCompleted();
            // Retrieve the operation result
            DataAsset result = completedResponse.Result;

            // Or get the name of the operation
            string operationName = response.Name;
            // This name can be stored, then the long-running operation retrieved later by name
            Operation<DataAsset, OperationMetadata> retrievedResponse = dataProductServiceClient.PollOnceUpdateDataAsset(operationName);
            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                DataAsset retrievedResult = retrievedResponse.Result;
            }
        }
    }
}

Go

Zugriffsgruppen aktualisieren

Java

Bevor Sie dieses Beispiel ausprobieren, folgen Sie der Einrichtungsanleitung für Java in der Knowledge Catalog-Kurzanleitung zur Verwendung von Clientbibliotheken. Weitere Informationen finden Sie in der Referenzdokumentation zur Knowledge Catalog Java API.

Richten Sie zur Authentifizierung bei Knowledge Catalog die Standardanmeldedaten für Anwendungen ein. Weitere Informationen finden Sie unter Authentifizierung für eine lokale Entwicklungsumgebung einrichten.

/*
 * Copyright 2026 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.
 */

package com.google.cloud.dataplex.v1.samples;

import com.google.cloud.dataplex.v1.DataProduct;
import com.google.cloud.dataplex.v1.DataProductServiceClient;
import com.google.cloud.dataplex.v1.UpdateDataProductRequest;
import com.google.protobuf.FieldMask;

public class SyncUpdateDataProduct {

  public static void main(String[] args) throws Exception {
    syncUpdateDataProduct();
  }

  public static void syncUpdateDataProduct() throws Exception {
    // This snippet 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 as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    try (DataProductServiceClient dataProductServiceClient = DataProductServiceClient.create()) {
      UpdateDataProductRequest request =
          UpdateDataProductRequest.newBuilder()
              .setDataProduct(DataProduct.newBuilder().build())
              .setUpdateMask(FieldMask.newBuilder().build())
              .setValidateOnly(true)
              .build();
      DataProduct response = dataProductServiceClient.updateDataProductAsync(request).get();
    }
  }
}

Asset-Berechtigungen aktualisieren

Go

Bevor Sie dieses Beispiel ausprobieren, folgen Sie der Einrichtungsanleitung für Go in der Knowledge Catalog-Kurzanleitung zur Verwendung von Clientbibliotheken. Weitere Informationen finden Sie in der Referenzdokumentation zur Knowledge Catalog Go API.

Richten Sie zur Authentifizierung bei Knowledge Catalog die Standardanmeldedaten für Anwendungen ein. Weitere Informationen finden Sie unter Authentifizierung für eine lokale Entwicklungsumgebung einrichten.

// Copyright 2026 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.

// Code generated by protoc-gen-go_gapic. DO NOT EDIT.


//go:build examples

package main

import (
	"context"

	dataplex "cloud.google.com/go/dataplex/apiv1"
	dataplexpb "cloud.google.com/go/dataplex/apiv1/dataplexpb"
)

func main() {
	ctx := context.Background()
	// This snippet 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 as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := dataplex.NewDataProductClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &dataplexpb.UpdateDataAssetRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/dataplex/apiv1/dataplexpb#UpdateDataAssetRequest.
	}
	op, err := c.UpdateDataAsset(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

	resp, err := op.Wait(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

Java

Zugriffsgruppen aktualisieren

Java

Bevor Sie dieses Beispiel ausprobieren, folgen Sie der Einrichtungsanleitung für Java in der Knowledge Catalog-Kurzanleitung zur Verwendung von Clientbibliotheken. Weitere Informationen finden Sie in der Referenzdokumentation zur Knowledge Catalog Java API.

Richten Sie zur Authentifizierung bei Knowledge Catalog die Standardanmeldedaten für Anwendungen ein. Weitere Informationen finden Sie unter Authentifizierung für eine lokale Entwicklungsumgebung einrichten.

/*
 * Copyright 2026 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.
 */

package com.google.cloud.dataplex.v1.samples;

import com.google.cloud.dataplex.v1.DataProduct;
import com.google.cloud.dataplex.v1.DataProductServiceClient;
import com.google.cloud.dataplex.v1.UpdateDataProductRequest;
import com.google.protobuf.FieldMask;

public class SyncUpdateDataProduct {

  public static void main(String[] args) throws Exception {
    syncUpdateDataProduct();
  }

  public static void syncUpdateDataProduct() throws Exception {
    // This snippet 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 as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    try (DataProductServiceClient dataProductServiceClient = DataProductServiceClient.create()) {
      UpdateDataProductRequest request =
          UpdateDataProductRequest.newBuilder()
              .setDataProduct(DataProduct.newBuilder().build())
              .setUpdateMask(FieldMask.newBuilder().build())
              .setValidateOnly(true)
              .build();
      DataProduct response = dataProductServiceClient.updateDataProductAsync(request).get();
    }
  }
}

Asset-Berechtigungen aktualisieren

Java

Bevor Sie dieses Beispiel ausprobieren, folgen Sie der Einrichtungsanleitung für Java in der Knowledge Catalog-Kurzanleitung zur Verwendung von Clientbibliotheken. Weitere Informationen finden Sie in der Referenzdokumentation zur Knowledge Catalog Java API.

Richten Sie zur Authentifizierung bei Knowledge Catalog die Standardanmeldedaten für Anwendungen ein. Weitere Informationen finden Sie unter Authentifizierung für eine lokale Entwicklungsumgebung einrichten.

/*
 * Copyright 2026 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.
 */

package com.google.cloud.dataplex.v1.samples;

import com.google.cloud.dataplex.v1.DataAsset;
import com.google.cloud.dataplex.v1.DataProductServiceClient;
import com.google.cloud.dataplex.v1.UpdateDataAssetRequest;
import com.google.protobuf.FieldMask;

public class SyncUpdateDataAsset {

  public static void main(String[] args) throws Exception {
    syncUpdateDataAsset();
  }

  public static void syncUpdateDataAsset() throws Exception {
    // This snippet 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 as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    try (DataProductServiceClient dataProductServiceClient = DataProductServiceClient.create()) {
      UpdateDataAssetRequest request =
          UpdateDataAssetRequest.newBuilder()
              .setDataAsset(DataAsset.newBuilder().build())
              .setUpdateMask(FieldMask.newBuilder().build())
              .setValidateOnly(true)
              .build();
      DataAsset response = dataProductServiceClient.updateDataAssetAsync(request).get();
    }
  }
}

Node.js

Zugriffsgruppen aktualisieren

Node.js

Bevor Sie dieses Beispiel ausprobieren, folgen Sie der Einrichtungsanleitung für Node.js in der Knowledge Catalog-Kurzanleitung zur Verwendung von Clientbibliotheken. Weitere Informationen finden Sie in der Referenzdokumentation zur Knowledge Catalog Node.js API.

Richten Sie zur Authentifizierung bei Knowledge Catalog die Standardanmeldedaten für Anwendungen ein. Weitere Informationen finden Sie unter Authentifizierung für eine lokale Entwicklungsumgebung einrichten.

// Copyright 2026 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.
//
// ** This file is automatically generated by gapic-generator-typescript. **
// ** https://github.com/googleapis/gapic-generator-typescript **
// ** All changes to this file may be overwritten. **



'use strict';

function main(dataProduct) {
  /**
   * This snippet 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.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The data product to update.
   *  The data product's `name` field is used to identify the data product to
   *  update.
   */
  // const dataProduct = {}
  /**
   *  Optional. The list of fields to update.
   *  If this is empty or not set, then all the fields will be updated.
   */
  // const updateMask = {}
  /**
   *  Optional. Validates the request without actually updating the data product.
   *  Default: false.
   */
  // const validateOnly = true

  // Imports the Dataplex library
  const {DataProductServiceClient} = require('@google-cloud/dataplex').v1;

  // Instantiates a client
  const dataplexClient = new DataProductServiceClient();

  async function callUpdateDataProduct() {
    // Construct request
    const request = {
      dataProduct,
    };

    // Run request
    const [operation] = await dataplexClient.updateDataProduct(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callUpdateDataProduct();
}

process.on('unhandledRejection', err => {
  console.error(err.message);
  process.exitCode = 1;
});
main(...process.argv.slice(2));

Asset-Berechtigungen aktualisieren

Node.js

Bevor Sie dieses Beispiel ausprobieren, folgen Sie der Einrichtungsanleitung für Node.js in der Knowledge Catalog-Kurzanleitung zur Verwendung von Clientbibliotheken. Weitere Informationen finden Sie in der Referenzdokumentation zur Knowledge Catalog Node.js API.

Richten Sie zur Authentifizierung bei Knowledge Catalog die Standardanmeldedaten für Anwendungen ein. Weitere Informationen finden Sie unter Authentifizierung für eine lokale Entwicklungsumgebung einrichten.

// Copyright 2026 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.
//
// ** This file is automatically generated by gapic-generator-typescript. **
// ** https://github.com/googleapis/gapic-generator-typescript **
// ** All changes to this file may be overwritten. **



'use strict';

function main(dataAsset) {
  /**
   * This snippet 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.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The data asset to update.
   *  The data asset's `name` field is used to identify the data asset to update.
   */
  // const dataAsset = {}
  /**
   *  Optional. The list of fields to update.
   *  If this is empty or not set, then all the fields will be updated.
   */
  // const updateMask = {}
  /**
   *  Optional. Validates the request without actually updating the data asset.
   *  Defaults to false.
   */
  // const validateOnly = true

  // Imports the Dataplex library
  const {DataProductServiceClient} = require('@google-cloud/dataplex').v1;

  // Instantiates a client
  const dataplexClient = new DataProductServiceClient();

  async function callUpdateDataAsset() {
    // Construct request
    const request = {
      dataAsset,
    };

    // Run request
    const [operation] = await dataplexClient.updateDataAsset(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callUpdateDataAsset();
}

process.on('unhandledRejection', err => {
  console.error(err.message);
  process.exitCode = 1;
});
main(...process.argv.slice(2));

Python

Zugriffsgruppen aktualisieren

Python

Bevor Sie dieses Beispiel ausprobieren, folgen Sie der Einrichtungsanleitung für Python in der Knowledge Catalog-Kurzanleitung zur Verwendung von Clientbibliotheken. Weitere Informationen finden Sie in der Referenzdokumentation zur Knowledge Catalog Python API.

Richten Sie zur Authentifizierung bei Knowledge Catalog die Standardanmeldedaten für Anwendungen ein. Weitere Informationen finden Sie unter Authentifizierung für eine lokale Entwicklungsumgebung einrichten.

# -*- coding: utf-8 -*-
# Copyright 2026 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
#
#     http://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. DO NOT EDIT!
#
# Snippet for UpdateDataProduct
# NOTE: This snippet has been automatically generated for illustrative purposes only.
# It may require modifications to work in your environment.

# To install the latest published package dependency, execute the following:
#   python3 -m pip install google-cloud-dataplex


# This snippet 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 as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dataplex_v1


def sample_update_data_product():
    # Create a client
    client = dataplex_v1.DataProductServiceClient()

    # Initialize request argument(s)
    data_product = dataplex_v1.DataProduct()
    data_product.display_name = "display_name_value"
    data_product.owner_emails = ["owner_emails_value1", "owner_emails_value2"]

    request = dataplex_v1.UpdateDataProductRequest(
        data_product=data_product,
    )

    # Make the request
    operation = client.update_data_product(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)


Asset-Berechtigungen aktualisieren

Python

Bevor Sie dieses Beispiel ausprobieren, folgen Sie der Einrichtungsanleitung für Python in der Knowledge Catalog-Kurzanleitung zur Verwendung von Clientbibliotheken. Weitere Informationen finden Sie in der Referenzdokumentation zur Knowledge Catalog Python API.

Richten Sie zur Authentifizierung bei Knowledge Catalog die Standardanmeldedaten für Anwendungen ein. Weitere Informationen finden Sie unter Authentifizierung für eine lokale Entwicklungsumgebung einrichten.

# -*- coding: utf-8 -*-
# Copyright 2026 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
#
#     http://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. DO NOT EDIT!
#
# Snippet for UpdateDataAsset
# NOTE: This snippet has been automatically generated for illustrative purposes only.
# It may require modifications to work in your environment.

# To install the latest published package dependency, execute the following:
#   python3 -m pip install google-cloud-dataplex


# This snippet 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 as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dataplex_v1


def sample_update_data_asset():
    # Create a client
    client = dataplex_v1.DataProductServiceClient()

    # Initialize request argument(s)
    data_asset = dataplex_v1.DataAsset()
    data_asset.resource = "resource_value"

    request = dataplex_v1.UpdateDataAssetRequest(
        data_asset=data_asset,
    )

    # Make the request
    operation = client.update_data_asset(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)


REST

Mit der Methode dataProducts.patch können Sie die mit einem Datenprodukt verknüpften Zugriffsgruppen aktualisieren. Ein Codebeispiel finden Sie unter Zugriffsgruppen konfigurieren.

Verwenden Sie die Methode dataAssets.patch, um die Asset-Berechtigungen zu aktualisieren. Ein Codebeispiel finden Sie unter Asset-Berechtigungen konfigurieren.

Vertrag für das Datenprodukt aktualisieren

Console

  1. Rufen Sie in der Google Cloud Console die Seite Datenprodukte des Knowledge Catalog auf.

    Zu Datenprodukten

  2. Klicken Sie auf das Datenprodukt, für das Sie den Vertrag aktualisieren möchten.

  3. Klicken Sie auf den Tab Vertrag.

  4. So aktualisieren Sie den bestehenden Vertrag:

    1. Klicken Sie auf  Bearbeiten.

    2. Aktualisieren Sie die erforderlichen Felder.

    3. Klicken Sie auf Speichern.

  5. Wenn dem ausgewählten Datenprodukt kein Vertrag angehängt ist, können Sie einen hinzufügen, indem Sie auf Vertrag hinzufügen klicken.

REST

Verwenden Sie zum Aktualisieren eines Vertrags die Methode entries.patch. Ein Codebeispiel finden Sie unter Vertrag hinzufügen.

Aspekte eines Datenprodukts aktualisieren

Console

  1. Rufen Sie in der Google Cloud Console die Seite Datenprodukte des Knowledge Catalog auf.

    Zu Datenprodukten

  2. Klicken Sie auf das Datenprodukt, dessen Aspekte Sie aktualisieren möchten.

  3. Klicken Sie auf den Tab Aspekte.

  4. So aktualisieren Sie einen Aspekt:

    1. Klicken Sie auf den Aspekt, den Sie aktualisieren möchten.

    2. Klicken Sie auf  Bearbeiten.

    3. Aktualisieren Sie bei Bedarf Aspekttyp, Land und Region.

    4. Klicken Sie auf Speichern.

  5. So fügen Sie dem Datenprodukt einen neuen Aspekt hinzu:

    1. Klicken Sie auf + Aspekt hinzufügen.

    2. Suchen Sie im Feld Aspekttyp auswählen nach einem Aspekttyp und wählen Sie ihn aus der Liste aus. Beispiel: Geo context.

    3. Wählen Sie im Feld Land das Land aus, zu dem das Asset gehört.

    4. Wählen Sie im Feld Region die Geschäftsregion aus, zu der das Asset gehört.

    5. Klicken Sie auf Speichern.

  6. So löschen Sie einen Aspekt:

    1. Klicken Sie auf den Aspekt, den Sie löschen möchten.

    2. Klicken Sie auf  Löschen.

    3. Klicken Sie auf Bestätigen, um die Aktion zu bestätigen.

REST

Verwenden Sie die Methode entries.patch, um einen beliebigen Aspekt des Datenprodukteintrags zu aktualisieren.

Dokumentation des Datenprodukts aktualisieren

Console

  1. Rufen Sie in der Google Cloud Console die Seite Datenprodukte des Knowledge Catalog auf.

    Zu Datenprodukten

  2. Klicken Sie auf das Datenprodukt, für das Sie die Dokumentation aktualisieren möchten.

  3. Klicken Sie auf den Tab Übersicht.

  4. Klicken Sie neben Dokumentation auf  Bearbeiten.

  5. Aktualisieren Sie das Nutzerhandbuch, Beispielabfragen und andere Dokumentationen nach Bedarf.

  6. Klicken Sie auf Speichern.

REST

Die Dokumentation ist Teil des Aspekts overview. Verwenden Sie die Methode entries.patch, um die Dokumentation des Datenprodukts zu aktualisieren.

Datenprodukt löschen

Wenn Sie ein Datenprodukt löschen möchten, müssen Sie zuerst alle Assets daraus entfernen.

Console

  1. Rufen Sie in der Google Cloud Console die Seite Datenprodukte des Knowledge Catalog auf.

    Zu Datenprodukten

  2. Klicken Sie auf das Datenprodukt, das Sie löschen möchten.

  3. Klicken Sie auf den Tab Assets.

  4. Klicken Sie für jedes aufgeführte Asset auf  > Entfernen. Bestätigen Sie die Aktion, indem Sie auf Entfernen klicken.

  5. Nachdem Sie alle Assets entfernt haben, löschen Sie das Datenprodukt, indem Sie auf  Löschen klicken.

  6. Geben Sie im Bestätigungsdialogfeld delete ein und klicken Sie auf Löschen.

C#

C#

Bevor Sie dieses Beispiel ausprobieren, folgen Sie der Einrichtungsanleitung für C# in der Knowledge Catalog-Kurzanleitung zur Verwendung von Clientbibliotheken. Weitere Informationen finden Sie in der Referenzdokumentation zur Knowledge Catalog C# API.

Richten Sie zur Authentifizierung bei Knowledge Catalog die Standardanmeldedaten für Anwendungen ein. Weitere Informationen finden Sie unter Authentifizierung für eine lokale Entwicklungsumgebung einrichten.

using Google.Cloud.Dataplex.V1;
using Google.LongRunning;
using Google.Protobuf.WellKnownTypes;

public sealed partial class GeneratedDataProductServiceClientSnippets
{
    /// <summary>Snippet for DeleteDataProduct</summary>
    /// <remarks>
    /// This snippet 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 as shown in
    ///   https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
    /// </remarks>
    public void DeleteDataProductRequestObject()
    {
        // Create client
        DataProductServiceClient dataProductServiceClient = DataProductServiceClient.Create();
        // Initialize request argument(s)
        DeleteDataProductRequest request = new DeleteDataProductRequest
        {
            DataProductName = DataProductName.FromProjectLocationDataProduct("[PROJECT]", "[LOCATION]", "[DATA_PRODUCT]"),
            Etag = "",
            ValidateOnly = false,
        };
        // Make the request
        Operation<Empty, OperationMetadata> response = dataProductServiceClient.DeleteDataProduct(request);

        // Poll until the returned long-running operation is complete
        Operation<Empty, OperationMetadata> completedResponse = response.PollUntilCompleted();
        // Retrieve the operation result
        Empty result = completedResponse.Result;

        // Or get the name of the operation
        string operationName = response.Name;
        // This name can be stored, then the long-running operation retrieved later by name
        Operation<Empty, OperationMetadata> retrievedResponse = dataProductServiceClient.PollOnceDeleteDataProduct(operationName);
        // Check if the retrieved long-running operation has completed
        if (retrievedResponse.IsCompleted)
        {
            // If it has completed, then access the result
            Empty retrievedResult = retrievedResponse.Result;
        }
    }
}

Go

Go

Bevor Sie dieses Beispiel ausprobieren, folgen Sie der Einrichtungsanleitung für Go in der Knowledge Catalog-Kurzanleitung zur Verwendung von Clientbibliotheken. Weitere Informationen finden Sie in der Referenzdokumentation zur Knowledge Catalog Go API.

Richten Sie zur Authentifizierung bei Knowledge Catalog die Standardanmeldedaten für Anwendungen ein. Weitere Informationen finden Sie unter Authentifizierung für eine lokale Entwicklungsumgebung einrichten.


//go:build examples

package main

import (
	"context"

	dataplex "cloud.google.com/go/dataplex/apiv1"
	dataplexpb "cloud.google.com/go/dataplex/apiv1/dataplexpb"
)

func main() {
	ctx := context.Background()
	// This snippet 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 as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := dataplex.NewDataProductClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &dataplexpb.DeleteDataProductRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/dataplex/apiv1/dataplexpb#DeleteDataProductRequest.
	}
	op, err := c.DeleteDataProduct(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

	err = op.Wait(ctx)
	if err != nil {
		// TODO: Handle error.
	}
}

Java

Java

Bevor Sie dieses Beispiel ausprobieren, folgen Sie der Einrichtungsanleitung für Java in der Knowledge Catalog-Kurzanleitung zur Verwendung von Clientbibliotheken. Weitere Informationen finden Sie in der Referenzdokumentation zur Knowledge Catalog Java API.

Richten Sie zur Authentifizierung bei Knowledge Catalog die Standardanmeldedaten für Anwendungen ein. Weitere Informationen finden Sie unter Authentifizierung für eine lokale Entwicklungsumgebung einrichten.

import com.google.cloud.dataplex.v1.DataProductName;
import com.google.cloud.dataplex.v1.DataProductServiceClient;
import com.google.cloud.dataplex.v1.DeleteDataProductRequest;
import com.google.protobuf.Empty;

public class SyncDeleteDataProduct {

  public static void main(String[] args) throws Exception {
    syncDeleteDataProduct();
  }

  public static void syncDeleteDataProduct() throws Exception {
    // This snippet 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 as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    try (DataProductServiceClient dataProductServiceClient = DataProductServiceClient.create()) {
      DeleteDataProductRequest request =
          DeleteDataProductRequest.newBuilder()
              .setName(DataProductName.of("[PROJECT]", "[LOCATION]", "[DATA_PRODUCT]").toString())
              .setEtag("etag3123477")
              .setValidateOnly(true)
              .build();
      dataProductServiceClient.deleteDataProductAsync(request).get();
    }
  }
}

Node.js

Node.js

Bevor Sie dieses Beispiel ausprobieren, folgen Sie der Einrichtungsanleitung für Node.js in der Knowledge Catalog-Kurzanleitung zur Verwendung von Clientbibliotheken. Weitere Informationen finden Sie in der Referenzdokumentation zur Knowledge Catalog Node.js API.

Richten Sie zur Authentifizierung bei Knowledge Catalog die Standardanmeldedaten für Anwendungen ein. Weitere Informationen finden Sie unter Authentifizierung für eine lokale Entwicklungsumgebung einrichten.

/**
 * This snippet 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.
 * TODO(developer): Uncomment these variables before running the sample.
 */
/**
 *  Required. The name of the data product to delete.
 *  Format:
 *  projects/{project_id_or_number}/locations/{location_id}/dataProducts/{data_product_id}
 */
// const name = 'abc123'
/**
 *  Optional. The etag of the data product.
 *  If an etag is provided and does not match the current etag of the data
 *  product, then the deletion will be blocked and an ABORTED error will be
 *  returned.
 */
// const etag = 'abc123'
/**
 *  Optional. Validates the request without actually deleting the data product.
 *  Default: false.
 */
// const validateOnly = true

// Imports the Dataplex library
const {DataProductServiceClient} = require('@google-cloud/dataplex').v1;

// Instantiates a client
const dataplexClient = new DataProductServiceClient();

async function callDeleteDataProduct() {
  // Construct request
  const request = {
    name,
  };

  // Run request
  const [operation] = await dataplexClient.deleteDataProduct(request);
  const [response] = await operation.promise();
  console.log(response);
}

callDeleteDataProduct();

Python

Python

Bevor Sie dieses Beispiel ausprobieren, folgen Sie der Einrichtungsanleitung für Python in der Knowledge Catalog-Kurzanleitung zur Verwendung von Clientbibliotheken. Weitere Informationen finden Sie in der Referenzdokumentation zur Knowledge Catalog Python API.

Richten Sie zur Authentifizierung bei Knowledge Catalog die Standardanmeldedaten für Anwendungen ein. Weitere Informationen finden Sie unter Authentifizierung für eine lokale Entwicklungsumgebung einrichten.

# This snippet 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 as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dataplex_v1


def sample_delete_data_product():
    # Create a client
    client = dataplex_v1.DataProductServiceClient()

    # Initialize request argument(s)
    request = dataplex_v1.DeleteDataProductRequest(
        name="name_value",
    )

    # Make the request
    operation = client.delete_data_product(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)

REST

Wenn Sie ein Datenprodukt löschen möchten, verwenden Sie die Methode dataProducts.delete.

Senden Sie beispielsweise die folgende DELETE-Anfrage:

curl -X DELETE \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
https://dataplex.googleapis.com/v1/projects/PROJECT_ID/locations/ LOCATION/dataProducts/DATA_PRODUCT_ID

Ersetzen Sie Folgendes:

  • PROJECT_ID: die ID Ihres Google Cloud-Projekts
  • LOCATION: die Region, in der das Datenprodukt vorhanden ist
  • DATA_PRODUCT_ID: die ID des Datenprodukts, das Sie löschen möchten

Datenaufbewahrung und Projektlöschung

Wenn Sie ein Google Cloud Projekt löschen, das Datenprodukte enthält, folgen die zugehörigen Ressourcen dem standardmäßigen Google Cloud Löschzyklus, der auch als Wipeout bezeichnet wird. Einen detaillierten Überblick über die technischen Prozesse und Zeitpläne, die dieses Verhalten regeln, finden Sie unter Löschen von Daten in Google Cloud.

Ressourcenlebenszyklus beim Löschen von Projekten

Der Lebenszyklus Ihrer Datenprodukte und Daten-Assets wird nach einem Antrag auf Löschung des Projekts in zwei primären Phasen verwaltet:

  • Vorläufiges Löschen (Status Hidden): Unmittelbar nach dem Initiieren des Löschens eines Projekts werden alle Datenprodukte und Daten-Assets im Projekt als Hidden markiert. Während dieser 30-tägigen Kulanzfrist bleiben die Metadaten erhalten, sind aber nicht mehr über Dataplex-APIs oder die Google Cloud Console zugänglich. Sie können das Projekt und seine Ressourcen jederzeit während dieses Zeitraums wiederherstellen.

  • Dauerhaftes Löschen (Status Purged): Nach Ablauf der 30-tägigen Kulanzfrist werden das Projekt und alle zugehörigen Knowledge Catalog-Metadaten dauerhaft gelöscht. Knowledge Catalog verwendet eine interne Richtlinie zur Datenlöschung, um diese Datensätze nachweislich aus dem Speicher zu entfernen.

Verhalten von IAM-Richtlinien für projektübergreifende Ressourcen

Es gibt einen wichtigen betrieblichen Unterschied zwischen Knowledge Catalog-Metadaten und den IAM-Richtlinien, die für Ihre zugrunde liegenden physischen Daten (z. B. BigQuery-Datasets oder Cloud Storage-Buckets) erzwungen werden.

Die Knowledge Catalog-Metadaten im Projekt werden zwar automatisch gelöscht, aber alle IAM-Bindungen, die auf Datenressourcen in einem anderen Projekt (Projekt B) angewendet werden, werden nicht automatisch widerrufen, wenn das Projekt des Datenproduktinhabers (Projekt A) gelöscht wird.

  • Verwaiste Bindungen: Da die physischen Ressourcen im Zielprojekt aktiv bleiben, werden die Prinzipal-IDs, die mit dem gelöschten Projekt verknüpft sind, nicht automatisch aus dem IAM-System entfernt.

  • Zombieberechtigungen verhindern: Damit der Datenzugriff vollständig deaktiviert wird, müssen Sie Daten-Assets manuell aus Ihren Datenprodukten löschen oder die zugehörigen IAM-Bindungen explizit aus Ihren projektübergreifenden Ressourcen entfernen, bevor Sie ein Projekt löschen.

Projekt wiederherstellen (Löschvorgang rückgängig machen)

Wenn Sie ein gelöschtes Projekt innerhalb des Kulanzzeitraums von 30 Tagen wiederherstellen, versucht Knowledge Catalog, Ihre Ressourcen und ihre Sichtbarkeit im Katalog wiederherzustellen. Bei projektübergreifenden Assets wird der Datenzugriff für das wiederhergestellte Projekt in der Regel sofort wieder aufgenommen, da die zugrunde liegenden IAM-Bindungen während des Löschvorgangs nicht automatisch widerrufen wurden.

Nächste Schritte