ניהול מוצרים מבוססי-נתונים

המסמך הזה מיועד לבעלי מוצרי נתונים שרוצים לעדכן, למחוק ולהעניק גישה למוצרי נתונים ב-Knowledge Catalog (לשעבר Dataplex Universal Catalog).

מידע נוסף על הארכיטקטורה ומושגי המפתח של מוצרי נתונים זמין במאמר מידע על מוצרי נתונים.

לפני שמתחילים

  1. מפעילים את ממשקי ה-API של Dataplex ו-BigQuery.

    תפקידים שנדרשים להפעלת ממשקי API

    כדי להפעיל ממשקי API, צריך את תפקיד ה-IAM 'אדמין של Service Usage' (roles/serviceusage.serviceUsageAdmin), שכולל את ההרשאה serviceusage.services.enable. איך מקצים תפקידים

    הפעלת ממשקי ה-API

התפקידים הנדרשים

כדי לקבל את ההרשאות שדרושות לניהול מוצרי נתונים, צריך לבקש מהאדמין להקצות לכם את תפקידי ה-IAM הבאים בפרויקט:

להסבר על מתן תפקידים, ראו איך מנהלים את הגישה ברמת הפרויקט, התיקייה והארגון.

התפקידים המוגדרים מראש האלה כוללים את ההרשאות שנדרשות לניהול מוצרי נתונים. כדי לראות בדיוק אילו הרשאות נדרשות, אפשר להרחיב את הקטע ההרשאות הנדרשות:

ההרשאות הנדרשות

כדי לנהל מוצרי נתונים, נדרשות ההרשאות הבאות:

  • עורכים את סוג היחס overview של המערכת: dataplex.entryGroups.useOverviewAspect
  • עורכים את סוג היחס refresh cadence של המערכת: dataplex.entryGroups.useRefreshCadenceAspect
  • אישור בקשת גישה למוצר נתונים: dataplex.dataProducts.approve

יכול להיות שתקבלו את ההרשאות האלה באמצעות תפקידים בהתאמה אישית או תפקידים מוגדרים מראש אחרים.

בקרת גישה למודלים של BigQuery

הגישה למודלים של BigQuery במוצר נתונים מנוהלת באמצעות תנאי IAM שחלים על מדיניות ה-IAM של מערך הנתונים הראשי.

אם מוחקים מודל BigQuery ואז יוצרים אותו מחדש עם אותו שם, Knowledge Catalog משחזר את ההרשאות שניתנו בעבר לקבוצות Google או לחשבונות שירות דרך מוצר הנתונים.

הגדרת הרשאות כדי לאפשר גילוי של מוצר נתונים

כדי לאפשר לצרכנים פוטנציאליים לחפש מוצר נתונים, לצפות בו ולבקש גישה אליו, בעלי מוצר הנתונים צריכים לוודא שאפשר לגלות את המוצר על ידי הקצאת תפקידי ה-IAM המתאימים במשאב של מוצר הנתונים:

  • חיפוש מוצרי נתונים, צפייה בהם וגישה אליהם: צרכן מוצרי נתונים ב-Dataplex‏ (dataplex.dataProductsConsumer)

  • צפייה בהגדרות ובמטא-נתונים של מוצרי נתונים (גישת קריאה בלבד): בעל הרשאת צפייה במוצר נתונים ב-Dataplex‏ (dataplex.dataProductsViewer)

ניהול בקשות גישה למוצרי נתונים

כשצרכן של מוצר נתונים מבקש גישה, הבעלים של מוצר הנתונים מקבל התראה באימייל. הבעלים יכולים לבדוק, לאשר או לדחות את הבקשות האלה דרך מסוף Google Cloud או דרך ה-API.

המסוף

בדיקת בקשות גישה למוצר נתונים ספציפי

  1. נכנסים לדף Knowledge Catalog Data products במסוף Google Cloud .

    מעבר אל 'מוצרי נתונים'

  2. לוחצים על מוצר הנתונים שרוצים לבדוק את בקשות הגישה אליו.

  3. לוחצים על הכרטיסייה ניהול בקשות גישה.

  4. בוחרים את השם של השולח שרוצים לבדוק את הבקשה שלו.

  5. לוחצים על פעולות ואז על אישור או על דחייה.

  6. לוחצים על Save.

בדיקת בקשות גישה בכמה מוצרים של נתונים

  1. במסוף Google Cloud , נכנסים לדף Knowledge Catalog (קטלוג הידע) Governance workflows (תהליכי עבודה של ניהול).

    מעבר אל 'תהליכי עבודה של ניהול'

  2. לוחצים על הכרטיסייה Pending Approvals (אישורים בהמתנה).

  3. אופציונלי: מסננים את הרשימה לפי שם המוצר הספציפי כדי לבודד את הבקשות שלו.

  4. בוחרים את בקשת היעד ולוחצים על אישור או על דחייה.

  5. לוחצים על Save.

התנהגות אחרי אישור

  • בקשות משתמשים: צרכנים שביקשו גישה לזהות המשתמש שלהם מתווספים אוטומטית כחברים לקבוצת Google שממופה לקבוצת הגישה.

  • בקשות של חשבונות שירות: לצרכנים שביקשו גישה לחשבון שירות ניתנות הרשאות להתחזות לחשבון השירות של יוצר הנתונים שממופה לקבוצת הגישה.

אחרי שהבקשה תעובד, הסטטוס שלה יתעדכן אוטומטית והיא תעבור לכרטיסייה יומן האישורים.

REST

הצגת רשימה של כל בקשות הגישה שממתינות לאישור

כדי לראות את רשימת כל בקשות הגישה שממתינות לבדיקה שלכם בפרויקט ובמיקום ספציפיים, שולחים בקשת GET באמצעות שיטת האוסף בהתאמה אישית :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"

מחליפים את מה שכתוב בשדות הבאים:

  • PROJECT_ID: מזהה הפרויקט ב- Google Cloud

  • LOCATION: האזור שבו קיים מוצר הנתונים (לדוגמה, us-central1)

אישור בקשת גישה

בעלי מוצרי נתונים עם הרשאת dataplex.dataProducts.approve יכולים לאשר בקשה בהמתנה על ידי שליחת בקשת POST לשיטה המותאמת אישית :approve:

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"

מחליפים את מה שכתוב בשדות הבאים:

  • PROJECT_ID: מזהה הפרויקט ב- Google Cloud

  • LOCATION: האזור שבו קיים מוצר הנתונים (לדוגמה, us-central1)

  • CHANGE_REQUEST_ID: המזהה הייחודי של בקשת הגישה שרוצים לאשר

בניגוד לאישורים שמתבצעים דרך המסוף, אישור של בקשה לשינוי באמצעות REST API לא משנה באופן אוטומטי את החברויות בקבוצת Google ולא מגדיר התחזות לטוקן של חשבון שירות. צריך לבצע את השלבים הבאים לניהול גישה במורד הזרם באופן ידני:

  • לגבי בקשות גישה לזהות משתמש: מוסיפים את הצרכן של מוצר הנתונים לקבוצת Google הממופה. מידע נוסף זמין במאמר בנושא הוספת חברות לקבוצת Google.

  • לגבי בקשות גישה לחשבון שירות: מריצים את הפקודה הבאה כדי להעניק את תפקיד ה-IAM ‏Service Account Token Creator ‏ (roles/iam.serviceAccountTokenCreator) בחשבון השירות של צרכן מוצר הנתונים במשאב:

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

    מחליפים את מה שכתוב בשדות הבאים:

    • PRODUCER_SERVICE_ACCOUNT: כתובת האימייל המוגדרת במלואה של חשבון השירות שממופה לקבוצת הגישה של מוצר הנתונים

    • CONSUMER_SERVICE_ACCOUNT: כתובת האימייל המוגדרת במלואה של חשבון השירות ששייך ללקוח שמבקש גישה

דחיית בקשת גישה

בעלי מוצרי נתונים עם הרשאת dataplex.dataProducts.approve יכולים לדחות בקשה בהמתנה על ידי שליחת בקשת POST לשיטה המותאמת אישית :reject עם מטען ייעודי (payload) של הצדקה:

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"

מחליפים את מה שכתוב בשדות הבאים:

  • PROJECT_ID: מזהה הפרויקט ב- Google Cloud

  • LOCATION: האזור שבו קיים מוצר הנתונים (לדוגמה, us-central1)

  • CHANGE_REQUEST_ID: המזהה הייחודי של בקשת הגישה שרוצים לדחות

עדכון של מוצר נתונים

אתם יכולים לעדכן את הפרטים הבסיסיים (לדוגמה, שם מוצר הנתונים, תיאור, פרטי הבעלים), נכסים, קבוצות גישה, הרשאות, חוזה, היבטים ומסמכים נוספים של מוצר נתונים קיים.

עדכון הפרטים הבסיסיים של מוצר נתונים

המסוף

  1. נכנסים לדף Knowledge Catalog Data products במסוף Google Cloud .

    מעבר אל 'מוצרי נתונים'

  2. לוחצים על מוצר הנתונים שרוצים לעדכן.

  3. לוחצים על Edit.

  4. מעדכנים את שם מוצר הנתונים, הסמל של מוצר הנתונים, התיאור, כתובת האימייל של הבעלים של מוצר הנתונים, כתובת האימייל של המאשרים של מוצר הנתונים והתוויות לפי הצורך.

  5. לוחצים על Save.

C#‎

C#

לפני שמנסים את הדוגמה הזו, צריך לפעול לפי C#ההוראות להגדרה במאמר מדריך למתחילים לעבודה עם Knowledge Catalog באמצעות ספריות לקוח. מידע נוסף מופיע במאמרי העזרה של Knowledge Catalog C# API.

כדי לבצע אימות לקטלוג הידע, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

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ההוראות להגדרה במאמר מדריך למתחילים לעבודה עם Knowledge Catalog באמצעות ספריות לקוח. מידע נוסף מופיע במאמרי העזרה של Knowledge Catalog Go API.

כדי לבצע אימות לקטלוג הידע, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.


//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

לפני שמנסים את הדוגמה הזו, צריך לפעול לפי Javaההוראות להגדרה במאמר מדריך למתחילים לעבודה עם Knowledge Catalog באמצעות ספריות לקוח. מידע נוסף מופיע במאמרי העזרה של Knowledge Catalog Java API.

כדי לבצע אימות לקטלוג הידע, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

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

לפני שמנסים את הדוגמה הזו, צריך לפעול לפי Node.jsההוראות להגדרה במאמר מדריך למתחילים לעבודה עם Knowledge Catalog באמצעות ספריות לקוח. מידע נוסף מופיע במאמרי העזרה של Knowledge Catalog Node.js API.

כדי לבצע אימות לקטלוג הידע, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

/**
 * 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

לפני שמנסים את הדוגמה הזו, צריך לפעול לפי Pythonההוראות להגדרה במאמר מדריך למתחילים לעבודה עם Knowledge Catalog באמצעות ספריות לקוח. מידע נוסף מופיע במאמרי העזרה של Knowledge Catalog Python API.

כדי לבצע אימות לקטלוג הידע, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

# 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

כדי לעדכן את הפרטים הבסיסיים של מוצר נתונים, משתמשים בשיטה dataProducts.patch.

לדוגמה, כדי לעדכן את התיאור של מוצר נתונים, שולחים את הבקשה הבאה מסוג PATCH:

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"

מחליפים את מה שכתוב בשדות הבאים:

  • NEW_DESCRIPTION: תיאור חדש של מוצר הנתונים
  • PROJECT_ID: מזהה הפרויקט ב- Google Cloud
  • LOCATION: האזור שבו קיים מוצר הנתונים
  • DATA_PRODUCT_ID: המזהה של מוצר הנתונים

עדכון נכסים של מוצר נתונים

המסוף

  1. נכנסים לדף Data products בקטלוג הידע במסוף Google Cloud .

    מעבר אל 'מוצרי נתונים'

  2. לוחצים על מוצר הנתונים שרוצים לעדכן את הנכסים שלו.

  3. לוחצים על הכרטיסייה נכסים.

  4. כדי להוסיף נכס חדש:

    1. לוחצים על +הוספה.

    2. מחפשים את הנכסים שרוצים להוסיף למוצר הנתונים ובוחרים אותם. הנכסים שאתם בוחרים צריכים להיות באותו אזור כמו מוצר הנתונים.

      אם יש לכם את ההרשאות הדרושות, אתם יכולים ללחוץ על הנכס כדי לראות את המטא-נתונים שלו.

    3. כדי למקד את תוצאות החיפוש, משתמשים במסננים.

    4. אחרי שבוחרים את הנכסים, לוחצים על הוספה.

  5. כדי להסיר נכס ממוצר הנתונים, פועלים לפי השלבים הבאים:

    1. בנכס שרוצים להסיר, לוחצים על > הסרה.

    2. כדי לאשר את הפעולה, לוחצים על הסרה.

C#‎

הוספת נכס נתונים חדש למוצר נתונים

C#

לפני שמנסים את הדוגמה הזו, צריך לפעול לפי C#ההוראות להגדרה במאמר מדריך למתחילים לעבודה עם Knowledge Catalog באמצעות ספריות לקוח. מידע נוסף מופיע במאמרי העזרה של Knowledge Catalog C# API.

כדי לבצע אימות לקטלוג הידע, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

// 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;
            }
        }
    }
}

מחיקת נכס נתונים ממוצר נתונים

C#

לפני שמנסים את הדוגמה הזו, צריך לפעול לפי C#ההוראות להגדרה במאמר מדריך למתחילים לעבודה עם Knowledge Catalog באמצעות ספריות לקוח. מידע נוסף מופיע במאמרי העזרה של Knowledge Catalog C# API.

כדי לבצע אימות לקטלוג הידע, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

// 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

לפני שמנסים את הדוגמה הזו, צריך לפעול לפי Goההוראות להגדרה במאמר מדריך למתחילים לעבודה עם Knowledge Catalog באמצעות ספריות לקוח. מידע נוסף מופיע במאמרי העזרה של Knowledge Catalog Go API.

כדי לבצע אימות לקטלוג הידע, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

// 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
}

מחיקת נכס נתונים ממוצר נתונים

Go

לפני שמנסים את הדוגמה הזו, צריך לפעול לפי Goההוראות להגדרה במאמר מדריך למתחילים לעבודה עם Knowledge Catalog באמצעות ספריות לקוח. מידע נוסף מופיע במאמרי העזרה של Knowledge Catalog Go API.

כדי לבצע אימות לקטלוג הידע, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

// 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

הוספת נכס נתונים חדש למוצר נתונים

Java

לפני שמנסים את הדוגמה הזו, צריך לפעול לפי Javaההוראות להגדרה במאמר מדריך למתחילים לעבודה עם Knowledge Catalog באמצעות ספריות לקוח. מידע נוסף מופיע במאמרי העזרה של Knowledge Catalog Java API.

כדי לבצע אימות לקטלוג הידע, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

/*
 * 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();
    }
  }
}

מחיקת נכס נתונים ממוצר נתונים

Java

לפני שמנסים את הדוגמה הזו, צריך לפעול לפי Javaההוראות להגדרה במאמר מדריך למתחילים לעבודה עם Knowledge Catalog באמצעות ספריות לקוח. מידע נוסף מופיע במאמרי העזרה של Knowledge Catalog Java API.

כדי לבצע אימות לקטלוג הידע, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

/*
 * 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

הוספת נכס נתונים חדש למוצר נתונים

Node.js

לפני שמנסים את הדוגמה הזו, צריך לפעול לפי Node.jsההוראות להגדרה במאמר מדריך למתחילים לעבודה עם Knowledge Catalog באמצעות ספריות לקוח. מידע נוסף מופיע במאמרי העזרה של Knowledge Catalog Node.js API.

כדי לבצע אימות לקטלוג הידע, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

// 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));

מחיקת נכס נתונים ממוצר נתונים

Node.js

לפני שמנסים את הדוגמה הזו, צריך לפעול לפי Node.jsההוראות להגדרה במאמר מדריך למתחילים לעבודה עם Knowledge Catalog באמצעות ספריות לקוח. מידע נוסף מופיע במאמרי העזרה של Knowledge Catalog Node.js API.

כדי לבצע אימות לקטלוג הידע, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

// 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

הוספת נכס נתונים חדש למוצר נתונים

Python

לפני שמנסים את הדוגמה הזו, צריך לפעול לפי Pythonההוראות להגדרה במאמר מדריך למתחילים לעבודה עם Knowledge Catalog באמצעות ספריות לקוח. מידע נוסף מופיע במאמרי העזרה של Knowledge Catalog Python API.

כדי לבצע אימות לקטלוג הידע, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

# -*- 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)


מחיקת נכס נתונים ממוצר נתונים

Python

לפני שמנסים את הדוגמה הזו, צריך לפעול לפי Pythonההוראות להגדרה במאמר מדריך למתחילים לעבודה עם Knowledge Catalog באמצעות ספריות לקוח. מידע נוסף מופיע במאמרי העזרה של Knowledge Catalog Python API.

כדי לבצע אימות לקטלוג הידע, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

# -*- 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

כדי להוסיף נכס נתונים חדש למוצר הנתונים, משתמשים בשיטה dataAssets.create. דוגמה לקוד מופיעה בקטע אופציונלי: הוספת נכסים.

כדי למחוק נכס נתונים ממוצר הנתונים, משתמשים בשיטה dataAssets.delete. לדוגמה, שולחים את הבקשה הבאה DELETE:

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"

מחליפים את מה שכתוב בשדות הבאים:

  • PROJECT_ID: מזהה הפרויקט ב- Google Cloud
  • LOCATION: האזור שבו רוצים ליצור את מוצר הנתונים
  • DATA_PRODUCT_ID: מזהה ייחודי של מוצר הנתונים
  • DATA_ASSET_ID: המזהה של נכס הנתונים שרוצים להסיר ממוצר הנתונים

עדכון קבוצות הגישה וההרשאות לנכסים

המסוף

  1. נכנסים לדף Data products בקטלוג הידע במסוף Google Cloud .

    מעבר אל 'מוצרי נתונים'

  2. לוחצים על מוצר הנתונים שרוצים לעדכן את קבוצות הגישה וההרשאות שלו.

  3. לוחצים על הכרטיסייה קבוצות גישה והרשאות.

  4. כדי לעדכן קבוצת גישה:

    1. לוחצים על עריכה.

    2. מעדכנים את השם, התיאור והמזהה של קבוצת הגישה לפי הצורך.

    3. כדי להוסיף קבוצת גישה חדשה, לוחצים על הוספת קבוצת גישה ופועלים לפי השלבים הבאים:

      1. בשדה שם קבוצת הגישה, מזינים שם לקבוצת הגישה החדשה. לדוגמה, Analyst.

      2. בשדה תיאור קבוצת הגישה, מזינים תיאור לקבוצת הגישה.

      3. בשדה Access group identifier מזינים את כתובת האימייל של קבוצת Google או של חשבון שירות, או של שניהם, שרוצים להקצות לקבוצת הגישה הזו:

        • קבוצת Google: משתמשים במוצר נתונים שמבקשים גישה לעצמם מתווספים כחברים לקבוצת Google הממופה.

        • חשבון שירות: לצרכני מוצרי נתונים שמבקשים גישה לחשבונות השירות שלהם מוקצה תפקיד ה-IAM ‏Service Account Token Creator (roles/iam.serviceAccountTokenCreator) כדי להתחזות לחשבון השירות של יצרן הנתונים שממופה לקבוצת הגישה.

    4. לוחצים על הוספה.

  5. כדי להסיר קבוצת גישה:

    1. לצד קבוצת הגישה שרוצים להסיר, לוחצים על > הסרה.

    2. כדי לאשר את הפעולה, לוחצים על הסרה.

  6. אם לא הוגדרו קבוצות גישה למוצר הנתונים שנבחר, אפשר להוסיף קבוצת גישה חדשה בלחיצה על הוספת קבוצת גישה.

  7. כדי לעדכן את הרשאות הנכסים, פועלים לפי השלבים הבאים:

    1. לצד הנכס שרוצים לעדכן את ההרשאות שלו, לוחצים על > הרשאות.

    2. מעדכנים את קבוצות הגישה ואת תפקידי ה-IAM הנדרשים.

    3. לוחצים על Configure (הגדרה).

C#‎

עדכון קבוצות גישה

C#

לפני שמנסים את הדוגמה הזו, צריך לפעול לפי C#ההוראות להגדרה במאמר מדריך למתחילים לעבודה עם Knowledge Catalog באמצעות ספריות לקוח. מידע נוסף מופיע במאמרי העזרה של Knowledge Catalog C# API.

כדי לבצע אימות לקטלוג הידע, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

// 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;
            }
        }
    }
}

עדכון הרשאות הגישה לנכסים

C#

לפני שמנסים את הדוגמה הזו, צריך לפעול לפי C#ההוראות להגדרה במאמר מדריך למתחילים לעבודה עם Knowledge Catalog באמצעות ספריות לקוח. מידע נוסף מופיע במאמרי העזרה של Knowledge Catalog C# API.

כדי לבצע אימות לקטלוג הידע, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

// 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;
            }
        }
    }
}

המשך

עדכון קבוצות גישה

Java

לפני שמנסים את הדוגמה הזו, צריך לפעול לפי Javaההוראות להגדרה במאמר מדריך למתחילים לעבודה עם Knowledge Catalog באמצעות ספריות לקוח. מידע נוסף מופיע במאמרי העזרה של Knowledge Catalog Java API.

כדי לבצע אימות לקטלוג הידע, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

/*
 * 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();
    }
  }
}

עדכון הרשאות הגישה לנכסים

Go

לפני שמנסים את הדוגמה הזו, צריך לפעול לפי Goההוראות להגדרה במאמר מדריך למתחילים לעבודה עם Knowledge Catalog באמצעות ספריות לקוח. מידע נוסף מופיע במאמרי העזרה של Knowledge Catalog Go API.

כדי לבצע אימות לקטלוג הידע, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

// 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

עדכון קבוצות גישה

Java

לפני שמנסים את הדוגמה הזו, צריך לפעול לפי Javaההוראות להגדרה במאמר מדריך למתחילים לעבודה עם Knowledge Catalog באמצעות ספריות לקוח. מידע נוסף מופיע במאמרי העזרה של Knowledge Catalog Java API.

כדי לבצע אימות לקטלוג הידע, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

/*
 * 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();
    }
  }
}

עדכון הרשאות הגישה לנכסים

Java

לפני שמנסים את הדוגמה הזו, צריך לפעול לפי Javaההוראות להגדרה במאמר מדריך למתחילים לעבודה עם Knowledge Catalog באמצעות ספריות לקוח. מידע נוסף מופיע במאמרי העזרה של Knowledge Catalog Java API.

כדי לבצע אימות לקטלוג הידע, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

/*
 * 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

עדכון קבוצות גישה

Node.js

לפני שמנסים את הדוגמה הזו, צריך לפעול לפי Node.jsההוראות להגדרה במאמר מדריך למתחילים לעבודה עם Knowledge Catalog באמצעות ספריות לקוח. מידע נוסף מופיע במאמרי העזרה של Knowledge Catalog Node.js API.

כדי לבצע אימות לקטלוג הידע, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

// 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));

עדכון הרשאות הגישה לנכסים

Node.js

לפני שמנסים את הדוגמה הזו, צריך לפעול לפי Node.jsההוראות להגדרה במאמר מדריך למתחילים לעבודה עם Knowledge Catalog באמצעות ספריות לקוח. מידע נוסף מופיע במאמרי העזרה של Knowledge Catalog Node.js API.

כדי לבצע אימות לקטלוג הידע, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

// 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

עדכון קבוצות גישה

Python

לפני שמנסים את הדוגמה הזו, צריך לפעול לפי Pythonההוראות להגדרה במאמר מדריך למתחילים לעבודה עם Knowledge Catalog באמצעות ספריות לקוח. מידע נוסף מופיע במאמרי העזרה של Knowledge Catalog Python API.

כדי לבצע אימות לקטלוג הידע, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

# -*- 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)


עדכון הרשאות הגישה לנכסים

Python

לפני שמנסים את הדוגמה הזו, צריך לפעול לפי Pythonההוראות להגדרה במאמר מדריך למתחילים לעבודה עם Knowledge Catalog באמצעות ספריות לקוח. מידע נוסף מופיע במאמרי העזרה של Knowledge Catalog Python API.

כדי לבצע אימות לקטלוג הידע, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

# -*- 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

כדי לעדכן את קבוצות הגישה שמשויכות למוצר נתונים, משתמשים בשיטה dataProducts.patch. דוגמה לקוד מופיעה במאמר בנושא הגדרת קבוצות גישה.

כדי לעדכן את הרשאות הנכס, משתמשים ב-method ‏dataAssets.patch. דוגמת קוד מופיעה במאמר בנושא הגדרת הרשאות לנכסים.

עדכון החוזה של מוצר הנתונים

המסוף

  1. נכנסים לדף Knowledge Catalog Data products במסוף Google Cloud .

    מעבר אל 'מוצרי נתונים'

  2. לוחצים על מוצר הנתונים שרוצים לעדכן את החוזה שלו.

  3. לוחצים על הכרטיסייה חוזה.

  4. כדי לעדכן את החוזה הקיים:

    1. לוחצים על עריכה.

    2. מעדכנים את השדות הנדרשים.

    3. לוחצים על Save.

  5. אם לא מצורף חוזה למוצר הנתונים שנבחר, אפשר להוסיף חוזה על ידי לחיצה על הוספת חוזה.

REST

כדי לעדכן חוזה, משתמשים בשיטה entries.patch. דוגמה לקוד מופיעה במאמר בנושא הוספת חוזה.

עדכון של היבטים במוצר נתונים

המסוף

  1. נכנסים לדף Knowledge Catalog Data products במסוף Google Cloud .

    מעבר אל 'מוצרי נתונים'

  2. לוחצים על מוצר הנתונים שרוצים לעדכן את ההיבטים שלו.

  3. לוחצים על הכרטיסייה מאפיינים.

  4. כדי לעדכן היבט:

    1. לוחצים על ההיבט שרוצים לעדכן.

    2. לוחצים על עריכה.

    3. מעדכנים את סוג ההיבט, המדינה והאזור לפי הצורך.

    4. לוחצים על Save.

  5. כדי להוסיף היבט חדש למוצר הנתונים, פועלים לפי השלבים הבאים:

    1. לוחצים על + הוספת היבט.

    2. בשדה בחירת סוג היבט, מחפשים ובוחרים סוג היבט מהרשימה. לדוגמה, Geo context.

    3. בשדה מדינה בוחרים את המדינה שאליה משויך הנכס.

    4. בשדה Region, בוחרים את האזור העסקי שאליו שייך הנכס.

    5. לוחצים על Save.

  6. כדי למחוק היבט, פועלים לפי השלבים הבאים:

    1. לוחצים על ההיבט שרוצים למחוק.

    2. לוחצים על מחיקה.

    3. כדי לאשר את הפעולה, לוחצים על אישור.

REST

כדי לעדכן היבט כלשהו ברשומה של נתוני המוצר, משתמשים בשיטה entries.patch.

עדכון התיעוד של מוצר הנתונים

המסוף

  1. נכנסים לדף Knowledge Catalog Data products במסוף Google Cloud .

    מעבר אל 'מוצרי נתונים'

  2. לוחצים על מוצר הנתונים שרוצים לעדכן את התיעוד שלו.

  3. לוחצים על הכרטיסייה סקירה כללית.

  4. לוחצים על עריכה לצד תיעוד.

  5. לעדכן את מדריך למשתמש, שאילתות לדוגמה ומסמכים אחרים לפי הצורך.

  6. לוחצים על Save.

REST

התיעוד הוא חלק מההיבט overview. כדי לעדכן את התיעוד של מוצר הנתונים, משתמשים בשיטה entries.patch.

מחיקת מוצר נתונים

כדי למחוק מוצר נתונים, קודם צריך להסיר ממנו את כל הנכסים.

המסוף

  1. נכנסים לדף Knowledge Catalog Data products במסוף Google Cloud .

    מעבר אל 'מוצרי נתונים'

  2. לוחצים על מוצר הנתונים שרוצים למחוק.

  3. לוחצים על הכרטיסייה נכסים.

  4. לכל נכס שמופיע ברשימה, לוחצים על > הסרה. לוחצים על הסרה כדי לאשר את הפעולה.

  5. אחרי שמסירים את כל הנכסים, מוחקים את מוצר הנתונים על ידי לחיצה על מחיקה.

  6. בתיבת הדו-שיח לאישור, מזינים delete ולוחצים על מחיקה.

C#‎

C#

לפני שמנסים את הדוגמה הזו, צריך לפעול לפי C#ההוראות להגדרה במאמר מדריך למתחילים לעבודה עם Knowledge Catalog באמצעות ספריות לקוח. מידע נוסף מופיע במאמרי העזרה של Knowledge Catalog C# API.

כדי לבצע אימות לקטלוג הידע, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

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ההוראות להגדרה במאמר מדריך למתחילים לעבודה עם Knowledge Catalog באמצעות ספריות לקוח. מידע נוסף מופיע במאמרי העזרה של Knowledge Catalog Go API.

כדי לבצע אימות לקטלוג הידע, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.


//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

לפני שמנסים את הדוגמה הזו, צריך לפעול לפי Javaההוראות להגדרה במאמר מדריך למתחילים לעבודה עם Knowledge Catalog באמצעות ספריות לקוח. מידע נוסף מופיע במאמרי העזרה של Knowledge Catalog Java API.

כדי לבצע אימות לקטלוג הידע, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

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

לפני שמנסים את הדוגמה הזו, צריך לפעול לפי Node.jsההוראות להגדרה במאמר מדריך למתחילים לעבודה עם Knowledge Catalog באמצעות ספריות לקוח. מידע נוסף מופיע במאמרי העזרה של Knowledge Catalog Node.js API.

כדי לבצע אימות לקטלוג הידע, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

/**
 * 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

לפני שמנסים את הדוגמה הזו, צריך לפעול לפי Pythonההוראות להגדרה במאמר מדריך למתחילים לעבודה עם Knowledge Catalog באמצעות ספריות לקוח. מידע נוסף מופיע במאמרי העזרה של Knowledge Catalog Python API.

כדי לבצע אימות לקטלוג הידע, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

# 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

כדי למחוק מוצר נתונים, משתמשים ב-method‏ dataProducts.delete.

לדוגמה, שולחים את הבקשה הבאה DELETE:

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

מחליפים את מה שכתוב בשדות הבאים:

  • PROJECT_ID: מזהה הפרויקט ב- Google Cloud
  • LOCATION: האזור שבו קיים מוצר הנתונים
  • DATA_PRODUCT_ID: המזהה של מוצר הנתונים שרוצים למחוק

שמירת נתונים ומחיקת פרויקטים

כשמוחקים פרויקט שמכיל מוצרי נתונים, המשאבים המשויכים עוברים את מחזור החיים הרגיל של המחיקה, שנקרא גם מחיקה מוחלטת. Google Cloud Google Cloud סקירה מפורטת של התהליכים הטכניים ולוחות הזמנים שקובעים את ההתנהגות הזו זמינה במאמר מחיקת נתונים ב- Google Cloud.

מחזור החיים של משאבים במהלך מחיקת פרויקט

מחזור החיים של מוצרי הנתונים ונכסי הנתונים שלכם מתנהל בשני שלבים עיקריים אחרי בקשה למחיקת פרויקט:

  • מחיקה עם אפשרות שחזור (מצב Hidden): מיד לאחר הפעלת מחיקת הפרויקט, כל מוצרי הנתונים ונכסי הנתונים בפרויקט מסומנים כ-Hidden. במהלך תקופת החסד של 30 הימים, המטא-נתונים נשמרים אבל אי אפשר יותר לגשת אליהם דרך ממשקי ה-API של Dataplex או דרך מסוף Google Cloud . במהלך התקופה הזו, אפשר לשחזר את הפרויקט ואת המשאבים שלו בכל שלב.

  • מחיקה סופית (מצב Purged): אחרי שתקופת החסד בת 30 הימים מסתיימת, הפרויקט וכל המטא-נתונים שלו ב-Knowledge Catalog נמחקים באופן סופי. ב-Knowledge Catalog נעשה שימוש במדיניות פנימית למחיקת שורות כדי למחוק את הרשומות האלה מהאחסון בצורה שניתן לאמת.

התנהגות של מדיניות IAM במשאבים חוצי-פרויקטים

קיים הבדל תפעולי קריטי בין המטא-נתונים של Knowledge Catalog לבין מדיניות IAM שנאכפת על הנתונים הפיזיים הבסיסיים (למשל מערכי נתונים של BigQuery או מאגרי Cloud Storage).

המטא-נתונים של Knowledge Catalog בפרויקט נמחקים אוטומטית, אבל הרשאות IAM שחלות על משאבי נתונים שנמצאים בפרויקט אחר (פרויקט ב') לא מבוטלות אוטומטית כשפרויקט הבעלים של מוצר הנתונים (פרויקט א') נמחק.

  • קישורים יתומים: מכיוון שהמשאבים הפיזיים בפרויקט היעד נשארים פעילים, מערכת IAM לא מסירה אוטומטית את מזהי הגורמים הראשיים שמשויכים לפרויקט שנמחק.

  • מניעת הרשאות זומבי: כדי להבטיח השבתה מלאה של הגישה לנתונים, צריך למחוק באופן ידני נכסי נתונים ממוצרי הנתונים, או להסיר באופן מפורש את ההרשאות המשויכות של IAM מהמשאבים שלכם בפרויקטים שונים, לפני שמתחילים למחוק פרויקט.

שחזור פרויקט (ביטול מחיקה)

אם תשחזרו פרויקט שנמחק במהלך תקופת החסד של 30 יום, Knowledge Catalog ינסה לשחזר את המשאבים שלכם ואת ההרשאות שלהם בקטלוג. בנכסים חוצי-פרויקטים, מכיוון שהקישורים הבסיסיים של IAM לא בוטלו אוטומטית במהלך תהליך המחיקה, הגישה לנתונים מתחדשת בדרך כלל באופן מיידי בפרויקט המשוחזר.

המאמרים הבאים