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

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

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

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

  1. מפעילים את Knowledge Catalog ואת BigQuery API, אם הם עדיין לא מופעלים.

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

    כדי להפעיל ממשקי API, צריך את ההרשאה serviceusage.services.enable. אם יצרתם את הפרויקט, סביר להניח שכבר יש לכם את ההרשאה הזו דרך התפקיד "בעלים" (roles/owner). אחרת, תוכלו לקבל את ההרשאה הזו דרך התפקיד "אדמין בממשק 'שימוש בשירות'" (roles/serviceusage.serviceUsageAdmin). איך מקצים תפקידים

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  • חיפוש, הצגה ובקשת גישה למוצרי נתונים: Dataplex Data Products Consumer‏ (roles/dataplex.dataProductsConsumer)

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

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

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

המסוף

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

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

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

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

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

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

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

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

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

  1. נכנסים לדף Governance workflows ב-Knowledge Catalog במסוף Google Cloud .

    לדף Governance workflows

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

  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 ל-method המותאם אישית :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: המזהה הייחודי של בקשת הגישה שרוצים לאשר

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

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

  • לבקשות גישה לחשבון שירות: מריצים את הפקודה הבאה כדי להקצות את תפקיד ה-IAM יצירת אסימונים בחשבון שירות (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 ל-method המותאם אישית :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. נכנסים לדף Data products ב-Knowledge Catalog במסוף Google Cloud .

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

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

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

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

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

C#‎

C#

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

כדי לבצע אימות ב-Knowledge Catalog, צריך להגדיר את 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.

כדי לבצע אימות ב-Knowledge Catalog, צריך להגדיר את 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.

כדי לבצע אימות ב-Knowledge Catalog, צריך להגדיר את 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.

כדי לבצע אימות ב-Knowledge Catalog, צריך להגדיר את 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.

כדי לבצע אימות ב-Knowledge Catalog, צריך להגדיר את 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

כדי לעדכן את הפרטים הבסיסיים של מוצר נתונים, משתמשים ב-method‏ 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 ב-Knowledge Catalog במסוף Google Cloud .

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

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

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

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

    1. לוחצים על ‎+Add (הוספה).

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

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

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

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

  5. כדי להסיר נכס ממוצר הנתונים:

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

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

C#‎

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

C#

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

כדי לבצע אימות ב-Knowledge Catalog, צריך להגדיר את 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.

כדי לבצע אימות ב-Knowledge Catalog, צריך להגדיר את 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.

כדי לבצע אימות ב-Knowledge Catalog, צריך להגדיר את 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.

כדי לבצע אימות ב-Knowledge Catalog, צריך להגדיר את 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.

כדי לבצע אימות ב-Knowledge Catalog, צריך להגדיר את 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.

כדי לבצע אימות ב-Knowledge Catalog, צריך להגדיר את 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.

כדי לבצע אימות ב-Knowledge Catalog, צריך להגדיר את 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.

כדי לבצע אימות ב-Knowledge Catalog, צריך להגדיר את 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.

כדי לבצע אימות ב-Knowledge Catalog, צריך להגדיר את 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.

כדי לבצע אימות ב-Knowledge Catalog, צריך להגדיר את 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

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

כדי למחוק נכס נתונים ממוצר הנתונים, משתמשים ב-method‏ 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. במסוף Google Cloud , נכנסים לדף Data products ב-Knowledge Catalog.

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

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

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

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

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

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

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

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

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

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

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

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

      4. אופציונלי: בשדה Default role, בוחרים תפקיד IAM כברירת מחדל שיוקצה באופן אוטומטי לכל הנכסים הנתמכים במוצר הנתונים. אם תפקידי IAM כבר הוקצו ישירות לנכסים ספציפיים, הוספת תפקיד ברירת מחדל לא מבטלת את ההרשאות הישירות האלה.

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

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

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

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

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

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

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

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

    3. לוחצים על הגדרה. בעמודה Permissions בטבלת הנכסים מוצגות ההרשאות המעודכנות ומצב ההגדרה שלהן:

      • Applied: תפקיד ה-IAM (ברירת המחדל או ספציפי לנכס) פעיל במשאב הבסיסי.
      • נכשל: לא הצלחנו להחיל את תפקיד ה-IAM על המשאב הבסיסי. הסיבה המפורטת לכישלון מופיעה ב-Cloud Logging.
      • לא נתמך: אי אפשר להחיל הרשאות על סוג המשאב של הנכס הזה.

C#‎

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

C#

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

כדי לבצע אימות ב-Knowledge Catalog, צריך להגדיר את 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.

כדי לבצע אימות ב-Knowledge Catalog, צריך להגדיר את 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;
            }
        }
    }
}

המשך

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

Go

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

כדי לבצע אימות ב-Knowledge Catalog, צריך להגדיר את 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.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
}

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

Go

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

כדי לבצע אימות ב-Knowledge Catalog, צריך להגדיר את 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.

כדי לבצע אימות ב-Knowledge Catalog, צריך להגדיר את 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.

כדי לבצע אימות ב-Knowledge Catalog, צריך להגדיר את 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.

כדי לבצע אימות ב-Knowledge Catalog, צריך להגדיר את 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.

כדי לבצע אימות ב-Knowledge Catalog, צריך להגדיר את 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.

כדי לבצע אימות ב-Knowledge Catalog, צריך להגדיר את 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.

כדי לבצע אימות ב-Knowledge Catalog, צריך להגדיר את 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

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

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

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

המסוף

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

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

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

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

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

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

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

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

  5. אם אין חוזה שמצורף למוצר הנתונים שבחרתם, אתם יכולים ללחוץ על Add contract כדי להוסיף חוזה.

REST

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

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

המסוף

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

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

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

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

  4. כדי לעדכן היבט, פועלים לפי השלבים הבאים:

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

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

    3. מעדכנים את השדות Aspect type,‏ Country ו-Region לפי הצורך.

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

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

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

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

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

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

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

  6. כדי למחוק היבט:

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

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

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

REST

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

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

המסוף

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

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

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

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

  4. לוחצים על Edit ליד Documentation.

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

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

REST

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

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

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

המסוף

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

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

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

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

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

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

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

C#‎

C#

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

כדי לבצע אימות ב-Knowledge Catalog, צריך להגדיר את 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.

כדי לבצע אימות ב-Knowledge Catalog, צריך להגדיר את 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.

כדי לבצע אימות ב-Knowledge Catalog, צריך להגדיר את 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.

כדי לבצע אימות ב-Knowledge Catalog, צריך להגדיר את 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.

כדי לבצע אימות ב-Knowledge Catalog, צריך להגדיר את 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 לא בוטלו באופן אוטומטי בתהליך המחיקה.

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