ניהול היבטים והוספת מטא-נתונים

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

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

  • סוג היבט: תבנית JSON שמגדירה נתונים קשורים. לדוגמה, לגבי מידע על תאימות, יכול להיות שיש לכם סיווג של מידע אישי (PII) ותאימות לתקנות ה-GDPR.
  • מאפיין: מופע של סוג מאפיין. לדוגמה, {"pii_classification": "confidential", "gdpr_compliant": true}. אפשר להחיל היבט על טבלה שלמה, על עמודה ספציפית בטבלה או על קישור לרשומה.

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

מידע נוסף זמין במאמר מידע על מטא-נתונים ב-Knowledge Catalog.

מהם סוגי היבטים?

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

קטגוריות של סוגי היבטים

סוגי ההיבטים מסווגים לסוגים מותאמים אישית ולסוגי מערכת:

סוגי היבטים בהתאמה אישית

סוגי אספקטים שיוצרים ב-Knowledge Catalog נקראים סוגי אספקטים בהתאמה אישית.

סוגי היבטים מותאמים אישית יכולים להיות גלובליים או אזוריים:

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

אתם יכולים ליצור סוגי היבטים בהתאמה אישית במיקום אזורי ספציפי (לדוגמה, us-central1) או כמשאב global. המיקום של סוג היבט משפיע על היקף החלות שלו וקובע באילו רשומות אפשר להשתמש בו.

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

סוגי היבטים של המערכת

סוגי ההיבטים ש-Knowledge Catalog מספק, משתמש בהם ומנהל אותם נקראים סוגי היבטים של המערכת. סוגי ההיבטים של המערכת הם תמיד גלובליים, ולכן אפשר להשתמש בהם בכל אזור. סוגי ההיבטים של המערכת מאוחסנים בפרויקט שמנוהל על ידי Google עם מספר הפרויקט 655216118709. לדוגמה, projects/655216118709/locations/global/aspectTypes/schema.

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

סוגי ההיבטים של המערכת מחולקים לקטגוריות של היבטים שאפשר לעשות בהם שימוש חוזר והיבטים מוגבלים. בטבלה הבאה מתוארות הקטגוריות של סוגי ההיבטים במערכת, ורשימת סוגי ההיבטים ש-Knowledge Catalog מספק לכל אחת מהקטגוריות:

קטגוריה של סוג היבט המערכת תיאור סוגי ההיבטים שמופיעים ב-Knowledge Catalog
סוג היבט של מערכת לשימוש חוזר אתם יכולים להשתמש בסוגי ההיבטים האלה כדי ליצור או לשנות היבטים.
  • contacts
  • data-profile
  • data-quality-scorecard
  • generic
  • graph-profile
  • guidelines
  • overview
  • schema-join
  • schema
  • storage
  • usage
סוג היבט מערכת מוגבל ב-Knowledge Catalog מנוהלים סוגי ההיבטים האלה.
אתם יכולים לקרוא מאפיינים שמשויכים לסוגי המאפיינים האלה, אבל לא ליצור או לערוך מאפיינים שמשויכים לסוגי המאפיינים האלה.
כולל, בין היתר:
  • analytics-hub
  • aspecttype-aspect
  • bigquery-dataset
  • bigquery-table
  • cloudsql-database
  • cloudsql-instance
  • cloudsql-table
  • entrygroup-aspect
  • entrytype-aspect
  • sensitive-data-protection-profile
  • storage-bucket
  • storage-folder

מהם היבטים?

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

  • מטא-נתונים עסקיים: מידע שמספק הקשר עסקי, כמו סיווג נתונים.

  • מטא-נתונים טכניים: פרטים טכניים של רשומות או קישורים לרשומות, כולל:

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

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

מיקום ההיבט ורמות היעד

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

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

קטגוריות של היבטים

ההיבטים מסווגים להיבטים שחובה לציין ולהיבטים אופציונליים:

היבטים נדרשים

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

ב-Knowledge Catalog מנוהלים ההיבטים הנדרשים (לדוגמה, סכימה) של רשומות המערכת.

שימו לב לנקודות הבאות:

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

  • אי אפשר למחוק את ההיבטים הנדרשים מרשומה או מקישור לרשומה.

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

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

היבטים אופציונליים

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

שימו לב לנקודות הבאות:

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

  • קישורים להזנת נתונים תומכים רק בהיבטים הנדרשים.

היבטים שקשורים לנתונים

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

סוגי היבטים של המערכת שהם היבטי נתונים כוללים את האפשרויות הבאות:

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

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

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

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

  • קבוצה מלאה של הרשאות למשאבי מטא-נתונים ב-Knowledge Catalog, כולל סוגי היבטים והיבטי נתונים: אדמין של Dataplex Catalog ‏ (roles/dataplex.catalogAdmin)
  • יצירה וניהול של משאבי מטא-נתונים ב-Knowledge Catalog, כולל סוגי היבטים והיבטי נתונים: Dataplex Catalog Editor (roles/dataplex.catalogEditor)
  • סט מלא של הרשאות בסוגי היבטים מותאמים אישית (למעט הרשאות לשימוש בסוגי היבטים כדי ליצור או לערוך רשומות): בעלים של סוג היבט ב-Dataplex (roles/dataplex.aspectTypeOwner)
  • לצפות בסוגי ההיבטים ובמדיניות ה-IAM שמשויכת אליהם: צפייה ב-Dataplex Catalog (roles/dataplex.catalogViewer)
  • משתמשים בסוגי מאפיינים כדי ליצור ולשנות רשומות עם המאפיינים המתאימים: Dataplex Aspect Type User (roles/dataplex.aspectTypeUser)
  • הוספת היבטים של חלק מסוגי ההיבטים של המערכת, כמו schema, schema-join, overview, contacts: בעלים של Dataplex Entry ו-EntryLink (roles/dataplex.entryOwner)

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

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

מידע נוסף זמין במאמר תפקידי IAM ב-Knowledge Catalog.

הפעלת ה-API

מפעילים את Dataplex API בפרויקט Knowledge Catalog. אם אתם משתמשים בפרויקט חדש Google Cloud או בפרויקט שבו BigQuery API מופעל, Dataplex API מופעל כברירת מחדל.

הפעלת ה-API

יצירת סוג היבט בהתאמה אישית

המסוף

  1. במסוף Google Cloud , עוברים לדף Metadata types ב-Knowledge Catalog.

    מעבר אל סוגי מטא-נתונים

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

  3. לוחצים על יצירת סוג מאפיין.

  4. בחלון Create aspect type (יצירת סוג מאפיין), מזינים את הפרטים הבאים:

    1. אופציונלי: בשדה Display name, מזינים שם לסוג ההיבט.
    2. בשדה מזהה סוג ההיבט, מזינים מזהה ייחודי לסוג ההיבט.
    3. אופציונלי: בשדה Description, מזינים תיאור לסוג ההיבט.
    4. בשדה מיקום, בוחרים מיקום לסוג ההיבט. אי אפשר לשנות את המיקום של סוג ההיבט אחרי שיוצרים אותו. כדי להבין את ההשפעה של בחירת מיקום גלובלי לעומת מיקום אזורי, אפשר לעיין בקטע סוגי היבטים מותאמים אישית.
  5. אופציונלי: מגדירים תבנית לסוג ההיבט.

    בקטע תבנית, לוחצים על הוספת שדה. בקטע New field, מזינים את הפרטים הבאים:

    1. בשדה שם, מזינים שם.
    2. אופציונלי: בשדה שם לתצוגה, מזינים שם לתצוגה.
    3. אופציונלי: בשדה תיאור, מזינים תיאור.
    4. בשדה סוג, בוחרים את סוג הנתונים של השדה. בהתאם לבחירה שלכם, יוצגו השדות והאפשרויות הבאים:

      • אם בחרתם באפשרות טקסט כסוג הנתונים, פועלים לפי השלבים הבאים:

        1. בשדה סוג הטקסט, בוחרים את סוג הטקסט.
        2. בשדה ערכי טקסט, מציינים רמז לשדה הטקסט. כדי לעשות את זה, לוחצים על הוספת ערך ומזינים את הרמז. אפשר להוסיף כמה רמזים לשדה טקסט.
        3. לוחצים על סיום.
      • אם בחרתם באפשרות Enum כסוג הנתונים, מוסיפים ערך enum:

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

        1. לוחצים על הוספת פריט למערך.
        2. בשדה Name, מזינים שם לפריטים במערך.
        3. אופציונלי: בשדה Display name, מזינים שם לתצוגה של פריטי המערך.
        4. אופציונלי: בשדה Description, מזינים תיאור של פריטי המערך.
        5. בשדה סוג, בוחרים סוג נתונים לפריטים במערך.

          בהתאם לבחירה שלכם, יוצגו השדות והאפשרויות הבאים. הן דומות לאפשרויות שמתוארות במקומות אחרים בקטע הזה עבור סוגי הנתונים Text,‏ Enum,‏ Map,‏ Array ו-Record.

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

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

        1. לוחצים על הוספת ערך מיפוי.
        2. בשדה שם, מזינים שם למפה.
        3. אופציונלי: בשדה Display name, מזינים שם לתצוגה של המפה.
        4. אופציונלי: בשדה Description, מזינים תיאור למפה.
        5. בשדה סוג, בוחרים סוג נתונים למפה.

          בהתאם לבחירה שלכם, יוצגו השדות והאפשרויות הבאים. הן דומות לאפשרויות שמתוארות לסוגי הנתונים Text,‏ Enum,‏ Map,‏ Array ו-Record במקומות אחרים בקטע הזה.

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

      • אם בחרתם באפשרות רשומה כסוג הנתונים, מזינים את הפרטים הבאים:

        1. בשדה Record ID (מזהה רשומה), מזינים מזהה ייחודי ששדות אחרים של הרשומה יכולים להשתמש בו כדי להתייחס לרשומה הזו. מידע נוסף מופיע בקטע דוגמה לשימוש בשדות Record ID (מזהה רשומה) ו-Record reference (הפניה לרשומה) במסמך הזה.
        2. אופציונלי: אם רוצים להוסיף הפניה לרשומה אחרת מהתבנית הזו, משתמשים בשדה הפניה לרשומה. אי אפשר לשנות את זה אחרי שיוצרים את סוג ההיבט. מידע נוסף מופיע בקטע דוגמה לשימוש בשדות Record ID (מזהה רשומה) ו-Record reference (הפניה לרשומה) במסמך הזה.
        3. בקטע Record fields אפשר להגדיר אובייקט מורכב עם כמה שדות בתצוגת עץ. כדי לעשות את זה, לוחצים על Add record field item ומציינים את הפרטים הבאים:

        4. בשדה Name, מזינים שם לשדה הרשומה.

        5. אופציונלי: בשדה Display name, מזינים שם לתצוגה של שדה הרשומה.

        6. אופציונלי: בשדה Description, מזינים תיאור לשדה הרשומה.

        7. בשדה סוג, בוחרים סוג נתונים.

          בהתאם לבחירה שלכם, יוצגו קבוצת השדות והאפשרויות הבאה. הן דומות לאפשרויות שתוארו קודם לכן בקטע הזה לגבי סוגי הנתונים Text,‏ Enum,‏ Map,‏ Array ו-Record.

        8. לוחצים על סיום.

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

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

    7. כדי להוסיף כמה שדות, לוחצים על הוספת שדה וחוזרים על השלבים הקודמים.

  6. אופציונלי: בקטע Labels (תוויות), מוסיפים למשאבים תוויות שרירותיות בתור צמדי מפתח/ערך:

    1. לוחצים על הוספת תווית.
    2. בשדה Key (מפתח), מזינים מפתח.
    3. בשדה ערך, מזינים ערך למפתח.
    4. כדי להוסיף עוד תוויות, לוחצים על הוספת תווית וחוזרים על השלבים.
  7. לוחצים על Save.

gcloud

כדי ליצור סוג מאפיין בהתאמה אישית, משתמשים בפקודה gcloud dataplex aspect-types create.

C#‎

C#

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

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

using Google.Api.Gax.ResourceNames;
using Google.Cloud.Dataplex.V1;
using Google.LongRunning;

public sealed partial class GeneratedCatalogServiceClientSnippets
{
    /// <summary>Snippet for CreateAspectType</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 CreateAspectTypeRequestObject()
    {
        // Create client
        CatalogServiceClient catalogServiceClient = CatalogServiceClient.Create();
        // Initialize request argument(s)
        CreateAspectTypeRequest request = new CreateAspectTypeRequest
        {
            ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
            AspectTypeId = "",
            AspectType = new AspectType(),
            ValidateOnly = false,
        };
        // Make the request
        Operation<AspectType, OperationMetadata> response = catalogServiceClient.CreateAspectType(request);

        // Poll until the returned long-running operation is complete
        Operation<AspectType, OperationMetadata> completedResponse = response.PollUntilCompleted();
        // Retrieve the operation result
        AspectType 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<AspectType, OperationMetadata> retrievedResponse = catalogServiceClient.PollOnceCreateAspectType(operationName);
        // Check if the retrieved long-running operation has completed
        if (retrievedResponse.IsCompleted)
        {
            // If it has completed, then access the result
            AspectType 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.NewCatalogClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &dataplexpb.CreateAspectTypeRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/dataplex/apiv1/dataplexpb#CreateAspectTypeRequest.
	}
	op, err := c.CreateAspectType(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.AspectType;
import com.google.cloud.dataplex.v1.CatalogServiceClient;
import com.google.cloud.dataplex.v1.CreateAspectTypeRequest;
import com.google.cloud.dataplex.v1.LocationName;

public class SyncCreateAspectType {

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

  public static void syncCreateAspectType() 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 (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
      CreateAspectTypeRequest request =
          CreateAspectTypeRequest.newBuilder()
              .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
              .setAspectTypeId("aspectTypeId-423030675")
              .setAspectType(AspectType.newBuilder().build())
              .setValidateOnly(true)
              .build();
      AspectType response = catalogServiceClient.createAspectTypeAsync(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 resource name of the AspectType, of the form:
 *  projects/{project_number}/locations/{location_id}
 *  where `location_id` refers to a Google Cloud region.
 */
// const parent = 'abc123'
/**
 *  Required. AspectType identifier.
 */
// const aspectTypeId = 'abc123'
/**
 *  Required. AspectType Resource.
 */
// const aspectType = {}
/**
 *  Optional. The service validates the request without performing any
 *  mutations. The default is false.
 */
// const validateOnly = true

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

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

async function callCreateAspectType() {
  // Construct request
  const request = {
    parent,
    aspectTypeId,
    aspectType,
  };

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

callCreateAspectType();

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_create_aspect_type():
    # Create a client
    client = dataplex_v1.CatalogServiceClient()

    # Initialize request argument(s)
    aspect_type = dataplex_v1.AspectType()
    aspect_type.metadata_template.name = "name_value"
    aspect_type.metadata_template.type_ = "type__value"

    request = dataplex_v1.CreateAspectTypeRequest(
        parent="parent_value",
        aspect_type_id="aspect_type_id_value",
        aspect_type=aspect_type,
    )

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

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

    response = operation.result()

    # Handle the response
    print(response)

Ruby

Ruby

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

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

require "google/cloud/dataplex/v1"

##
# Snippet for the create_aspect_type call in the CatalogService service
#
# 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/ruby/docs/reference.
#
# This is an auto-generated example demonstrating basic usage of
# Google::Cloud::Dataplex::V1::CatalogService::Client#create_aspect_type.
#
def create_aspect_type
  # Create a client object. The client can be reused for multiple calls.
  client = Google::Cloud::Dataplex::V1::CatalogService::Client.new

  # Create a request. To set request fields, pass in keyword arguments.
  request = Google::Cloud::Dataplex::V1::CreateAspectTypeRequest.new

  # Call the create_aspect_type method.
  result = client.create_aspect_type request

  # The returned object is of type Gapic::Operation. You can use it to
  # check the status of an operation, cancel it, or wait for results.
  # Here is how to wait for a response.
  result.wait_until_done! timeout: 60
  if result.response?
    p result.response
  else
    puts "No response received."
  end
end

REST

כדי ליצור סוג מאפיין בהתאמה אישית, משתמשים בשיטה aspectType.create.

אחרי שיוצרים סוג היבט בהתאמה אישית, אפשר להוסיף היבטים לרשומות.

דוגמה לשימוש בשדות Record ID (מזהה רשומה) ו-Record reference (הפניה לרשומה)

אפשר להשתמש בשדות Record ID ו-Record reference להפניות רקורסיביות. בדוגמה הבאה אפשר לראות איך משתמשים בשדות האלה:

נניח שיש לכם סוג היבט שנקרא Employee, עם השדות הבאים:

  • שם (סוג: Text)
  • תאריך התחלה (סוג: Date & time)
  • שם (סוג: Text)
  • הכתובת הנוכחית (סוג: Record)
  • כתובת קבועה (סוג: Record)

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

כשמגדירים את השדה כתובת נוכחית, אפשר לציין את מזהה הרשומה בתור address-field. בשדה כתובת קבועה, אפשר לציין את אותו ערך (address-field) בשדה הפניה לרשומה. לדוגמה:

  • שם (סוג: Text)
  • תאריך התחלה (סוג: Date & time)
  • שם (סוג: Text)
  • הכתובת הנוכחית (סוג: Record, מזהה רשומה: address-field)
  • כתובת קבועה (סוג: Record, הפניה לרשומה: address-field)

כך לא צריך לשכפל את השדות של כתובת אחרת.

הוספת היבטים לערך

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

שימו לב לנקודות הבאות:

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

המסוף

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

    לחיפוש Google

  2. מחפשים את הרשומה שרוצים להוסיף לה היבטים ולוחצים עליה. ייפתח דף הפרטים של הרשומה.

  3. כדי להוסיף היבטים לערך, פועלים לפי השלבים הבאים:

    1. לוחצים על הכרטיסייה פרטים.
    2. כדי להוסיף היבטים נדרשים או אופציונליים לרשומה, בקטע Aspects לוחצים על Add בקטגוריה הרלוונטית.
      אי אפשר להוסיף היבטים נדרשים אם לא הוגדרו היבטים נדרשים לסוג הרשומה של הרשומה שנבחרה.
    3. מחפשים ובוחרים את ההיבט שרוצים להוסיף.
    4. בחלון Add aspect, מזינים את הערכים בשדות.
    5. לוחצים על Save.

    6. כדי להוסיף היבטים לעמודה של הרשומה, פועלים לפי השלבים הבאים:

    7. בדף הפרטים של הרשומה, לוחצים על הכרטיסייה Schema.

    8. בוחרים את העמודות שרוצים להוסיף להן היבטים.

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

    10. מחפשים ובוחרים את ההיבט שרוצים להוסיף.

    11. בחלון Add aspect, מזינים את הערכים בשדות.

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

gcloud

כדי להוסיף היבטים לרשומה או לעמודה של רשומה, משתמשים בפקודה gcloud dataplex entries update.

C#‎

C#

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

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

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

public sealed partial class GeneratedCatalogServiceClientSnippets
{
    /// <summary>Snippet for UpdateEntry</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 UpdateEntryRequestObject()
    {
        // Create client
        CatalogServiceClient catalogServiceClient = CatalogServiceClient.Create();
        // Initialize request argument(s)
        UpdateEntryRequest request = new UpdateEntryRequest
        {
            Entry = new Entry(),
            UpdateMask = new FieldMask(),
            AllowMissing = false,
            DeleteMissingAspects = false,
            AspectKeys = { "", },
        };
        // Make the request
        Entry response = catalogServiceClient.UpdateEntry(request);
    }
}

כדי להוסיף היבטים לאובייקט של הרשומה, ראו היבטים.

המשך

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.NewCatalogClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &dataplexpb.UpdateEntryRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/dataplex/apiv1/dataplexpb#UpdateEntryRequest.
	}
	resp, err := c.UpdateEntry(ctx, req)
	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.Aspect;
import com.google.cloud.dataplex.v1.CatalogServiceClient;
import com.google.cloud.dataplex.v1.Entry;
import com.google.cloud.dataplex.v1.EntryName;
import com.google.cloud.dataplex.v1.EntrySource;
import com.google.protobuf.FieldMask;
import com.google.protobuf.Struct;
import com.google.protobuf.Value;
import java.util.Map;

public class UpdateEntry {

  public static void main(String[] args) throws Exception {
    // TODO(developer): Replace these variables before running the sample.
    String projectId = "MY_PROJECT_ID";
    // Available locations: https://cloud.google.com/dataplex/docs/locations
    String location = "MY_LOCATION";
    String entryGroupId = "MY_ENTRY_GROUP_ID";
    String entryId = "MY_ENTRY_ID";

    Entry createdEntry = updateEntry(projectId, location, entryGroupId, entryId);
    System.out.println("Successfully updated entry: " + createdEntry.getName());
  }

  // Method to update Entry located in projectId, location, entryGroupId and with entryId
  public static Entry updateEntry(
      String projectId, String location, String entryGroupId, String entryId) throws Exception {
    // Initialize client that will be used to send requests. This client only needs to be created
    // once, and can be reused for multiple requests.
    try (CatalogServiceClient client = CatalogServiceClient.create()) {
      Entry entry =
          Entry.newBuilder()
              .setName(EntryName.of(projectId, location, entryGroupId, entryId).toString())
              .setEntrySource(
                  EntrySource.newBuilder()
                      .setDescription("updated description of the entry")
                      .build())
              .putAllAspects(
                  Map.of(
                      "dataplex-types.global.generic",
                      Aspect.newBuilder()
                          .setAspectType(
                              "projects/dataplex-types/locations/global/aspectTypes/generic")
                          .setData(
                              Struct.newBuilder()
                                  // "Generic" Aspect Type have fields called "type" and "system.
                                  // The values below are a sample of possible options.
                                  .putFields(
                                      "type",
                                      Value.newBuilder()
                                          .setStringValue("updated example value")
                                          .build())
                                  .putFields(
                                      "system",
                                      Value.newBuilder()
                                          .setStringValue("updated example system")
                                          .build())
                                  .build())
                          .build()))
              .build();

      // Update mask specifies which fields will be updated.
      // For more information on update masks, see: https://google.aip.dev/161
      FieldMask updateMask =
          FieldMask.newBuilder().addPaths("aspects").addPaths("entry_source.description").build();
      return client.updateEntry(entry, updateMask);
    }
  }
}

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. Entry resource.
 */
// const entry = {}
/**
 *  Optional. Mask of fields to update. To update Aspects, the update_mask must
 *  contain the value "aspects".
 *  If the update_mask is empty, the service will update all modifiable fields
 *  present in the request.
 */
// const updateMask = {}
/**
 *  Optional. If set to true and the entry doesn't exist, the service will
 *  create it.
 */
// const allowMissing = true
/**
 *  Optional. If set to true and the aspect_keys specify aspect ranges, the
 *  service deletes any existing aspects from that range that weren't provided
 *  in the request.
 */
// const deleteMissingAspects = true
/**
 *  Optional. The map keys of the Aspects which the service should modify. It
 *  supports the following syntaxes:
 *  * `<aspect_type_reference>` - matches an aspect of the given type and empty
 *  path.
 *  * `<aspect_type_reference>@path` - matches an aspect of the given type and
 *  specified path. For example, to attach an aspect to a field that is
 *  specified by the `schema` aspect, the path should have the format
 *  `Schema.<field_name>`.
 *  * `<aspect_type_reference>@*` - matches aspects of the given type for all
 *  paths.
 *  * `*@path` - matches aspects of all types on the given path.
 *  The service will not remove existing aspects matching the syntax unless
 *  `delete_missing_aspects` is set to true.
 *  If this field is left empty, the service treats it as specifying
 *  exactly those Aspects present in the request.
 */
// const aspectKeys = ['abc','def']

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

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

async function callUpdateEntry() {
  // Construct request
  const request = {
    entry,
  };

  // Run request
  const response = await dataplexClient.updateEntry(request);
  console.log(response);
}

callUpdateEntry();

Python

Python

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

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

from google.cloud import dataplex_v1
from google.protobuf import struct_pb2


def update_entry(
    project_id: str, location: str, entry_group_id: str, entry_id: str
) -> dataplex_v1.Entry:
    """Method to update Entry located in project_id, location, entry_group_id and with entry_id"""

    # Initialize client that will be used to send requests across threads. This
    # client only needs to be created once, and can be reused for multiple requests.
    # After completing all of your requests, call the "__exit__()" method to safely
    # clean up any remaining background resources. Alternatively, use the client as
    # a context manager.
    with dataplex_v1.CatalogServiceClient() as client:
        # The resource name of the Entry
        name = f"projects/{project_id}/locations/{location}/entryGroups/{entry_group_id}/entries/{entry_id}"
        entry = dataplex_v1.Entry(
            name=name,
            entry_source=dataplex_v1.EntrySource(
                description="updated description of the entry"
            ),
            aspects={
                "dataplex-types.global.generic": dataplex_v1.Aspect(
                    aspect_type="projects/dataplex-types/locations/global/aspectTypes/generic",
                    data=struct_pb2.Struct(
                        fields={
                            # "Generic" Aspect Type have fields called "type" and "system.
                            # The values below are a sample of possible options.
                            "type": struct_pb2.Value(
                                string_value="updated example value"
                            ),
                            "system": struct_pb2.Value(
                                string_value="updated example system"
                            ),
                        }
                    ),
                )
            },
        )

        # Update mask specifies which fields will be updated.
        # For more information on update masks, see: https://google.aip.dev/161
        update_mask = {"paths": ["aspects", "entry_source.description"]}
        return client.update_entry(entry=entry, update_mask=update_mask)


if __name__ == "__main__":
    # TODO(developer): Replace these variables before running the sample.
    project_id = "MY_PROJECT_ID"
    # Available locations: https://cloud.google.com/dataplex/docs/locations
    location = "MY_LOCATION"
    entry_group_id = "MY_ENTRY_GROUP_ID"
    entry_id = "MY_ENTRY_ID"

    updated_entry = update_entry(project_id, location, entry_group_id, entry_id)
    print(f"Successfully updated entry: {updated_entry.name}")

Ruby

Ruby

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

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

require "google/cloud/dataplex/v1"

##
# Snippet for the update_entry call in the CatalogService service
#
# 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/ruby/docs/reference.
#
# This is an auto-generated example demonstrating basic usage of
# Google::Cloud::Dataplex::V1::CatalogService::Client#update_entry.
#
def update_entry
  # Create a client object. The client can be reused for multiple calls.
  client = Google::Cloud::Dataplex::V1::CatalogService::Client.new

  # Create a request. To set request fields, pass in keyword arguments.
  request = Google::Cloud::Dataplex::V1::UpdateEntryRequest.new

  # Call the update_entry method.
  result = client.update_entry request

  # The returned object is of type Google::Cloud::Dataplex::V1::Entry.
  p result
end

כדי להוסיף היבטים לאובייקט של הרשומה, ראו #required_aspects=.

REST

כדי להוסיף היבטים לרשומה או לעמודה של רשומה, משתמשים ב-method‏ entry.patch.

אין תמיכה ביצירה ובשימוש בהיבטים ברשומה שבה סוג ההיבט והרשומה נמצאים בארגונים שונים. Google Cloud

צירוף היבטים של סוגי היבטים של מערכת לשימוש חוזר

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

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

כרטיס להערכת איכות הנתונים

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

השדה data בהיבט data-quality-scorecard יכול לכלול את השדות הבאים:

  • ‫job: אופציונלי. רשומה שמכילה פרטים על המשרה שיצרה את כרטיס הניקוד.

    • ‫name: שם המשאב של עבודת איכות הנתונים.

    • ‫runTime: זמן הריצה של משימת איכות הנתונים.

  • ‫score: אופציונלי. ציון איכות הנתונים הכולל. הציון נע בין 0 ל-100.

  • ‫status: שדה חובה. הסטטוס של כרטיס המידע על איכות הנתונים, שמציין אם הנתונים עברו את סף האיכות (PASS) או לא (FAIL).

  • ‫dimensions: אופציונלי. מערך של תוצאות המאפיינים. כל תוצאה כוללת:

    • ‫name: השם של המאפיין. הערך יכול להיות אחד מהערכים הבאים: ACCURACY,‏ COMPLETENESS,‏ CONSISTENCY,‏ FRESHNESS,‏ UNIQUENESS,‏ VALIDITY או VOLUME, או שם של מאפיין מותאם אישית. שמות של מאפיינים מותאמים אישית צריכים להכיל אותיות רישיות בלבד, ולא יכולים להיות ארוכים מ-30 תווים.

    • ‫score: הציון הכולל ברמת המאפיין, בטווח [0, 100].

    • ‫status: הסטטוס של המאפיין, שמציין אם הוא עבר או נכשל בסף האיכות (PASS או FAIL).

  • ‫columns: אופציונלי. מערך של תוצאות בעמודות. כל תוצאה כוללת:

    • ‫name: שם העמודה.

    • ‫score: הציון הכולל ברמת העמודה, בטווח שבין [0, 100].

    • ‫status: הסטטוס של העמודה, שמציין אם היא עברה את סף האיכות (PASS או FAIL).

    • ‫dimensions: מערך של ציוני מאפיינים לעמודה. כל ציון של מאפיין כולל:

      • ‫name: שם המאפיין.

      • ‫score: הציון של המאפיין, בטווח שבין 0 ל-100.

      • ‫status: הסטטוס של המאפיין בעמודה, שמציין אם הוא עבר או נכשל בסף האיכות (PASS או FAIL).

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

כדי לצרף כרטיס מידע על איכות הנתונים:

gcloud

כדי לעדכן היבטים של רשומה, משתמשים בפקודה gcloud dataplex entries update-aspects.

  1. יוצרים קובץ JSON‏ (dq-aspect.json) עם התוכן הבא.

      {
        "dataplex-types.global.data-quality-scorecard": {
          "data": {
            "score": 0.8,
            "status": "PASS",
            "dimensions": [
              {
                "name": "completeness",
                "score": 0.9,
                "status": "PASS"
              },
              {
                "name": "uniqueness",
                "score": 0.7,
                "status": "FAIL"
              }
            ],
            "columns": [
              {
                "name": "col1",
                "score": 0.85,
                "status": "PASS"
              }
            ]
          }
        }
      }
    }
    
  2. מריצים את הפקודה הבאה:

      gcloud dataplex entries update-aspects ENTRY_ID
      --location=LOCATION
      --entry-group=ENTRY_GROUP_ID
      --project=PROJECT_ID
      --aspects=dq-aspect.json
    

    מחליפים את המשתנים הבאים:

    • ‫ENTRY_ID: המזהה של הרשומה, לדוגמה: example-entry
    • ‫LOCATION: המיקום של הרשומה. לדוגמה, us-central1
    • ‫ENTRY_GROUP_ID: המזהה של קבוצת הרשומות, לדוגמה example-entry-group
    • ‫PROJECT_ID: מזהה הפרויקט, לדוגמה: example-project

REST

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

  1. יוצרים קובץ בשם payload.json ומדביקים בו את תוכן ה-JSON מהבקשה.

    
      {
        "aspects": {
          "dataplex-types.global.data-quality-scorecard": {
            "data": {
              "score": 80,
              "status": "PASS",
              "dimensions": [
                {
                  "name": "completeness",
                  "score": 90,
                  "status": "PASS"
                },
                {
                  "name": "uniqueness",
                  "score": 70,
                  "status": "FAIL"
                }
              ],
              "columns": [
                {
                  "name": "col1",
                  "score": 85,
                  "status": "PASS"
                }
              ]
            }
          }
        }
      }
    
  2. מריצים את הפקודה הבאה בטרמינל:

     curl -X PATCH \
     -H "Authorization: Bearer $(gcloud auth print-access-token)" \
     -H "Content-Type: application/json" \
     -d @payload.json \
     "https://dataplex.googleapis.com/v1/projects/<var>PROJECT_ID</var>/locations/<var>LOCATION</var>/entryGroups/<var>ENTRY_GROUP_ID</var>/entries/<var>ENTRY_ID</var>?updateMask=aspects"
    

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

    • ‫PROJECT_ID: מזהה הפרויקט – לדוגמה, example-project
    • ‫LOCATION: המיקום של הרשומה. לדוגמה, us-central1
    • ‫ENTRY_GROUP_ID: המזהה של קבוצת הרשומות, לדוגמה: example-entry-group
    • ‫ENTRY_ID: המזהה של הרשומה, לדוגמה example-entry

סוגים אחרים של היבטים לשימוש חוזר

אפשר להשתמש גם בסוגי ההיבטים הבאים של המערכת. אפשר לצרף אותם באמצעות אותן שיטות של gcloud או של API בארכיטקטורת REST שמוצגות בכרטיס הניקוד של איכות הנתונים. לסוגי היבטים ללא שדות מקוננים, למשל generic, אפשר להשתמש במסוף.

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

    • ‫identities (מערך): רשימה של אנשי קשר. כל איש קשר כולל:
      • ‫role (string): התפקיד של איש הקשר (לדוגמה, owner,‏ steward,‏ producer או admin).
      • ‫name (string): השם של איש הקשר.
      • ‫id (מחרוזת): כתובת האימייל או המזהה של איש הקשר.

    יוצרים את הקובץ payload.json באופן הבא:

     {
       "aspects": {
         "dataplex-types.global.contacts": {
           "data": {
             "identities": [
               {
                 "role": "steward",
                 "name": "Jane Doe",
                 "id": "jane.doe@example.com"
               }
             ]
           }
         }
       }
     }
    
  • פרופיל נתונים. משתמשים בסוג ההיבט data-profile כדי לתעד תוצאות של פרופיל נתונים. מידע נוסף מופיע במאמר מידע על פרופיל נתונים.

    השדות כוללים את הפרטים הבאים:

    • ‫sourceDataInfo (רשומה): מידע על נתוני המקור שנסרקו כדי ליצור את הפרופיל.
      • ‫scope (enum): היקף הפרופיל (PREVIEW,‏ SAMPLED או ALL). הערך PREVIEW מתאים לתוצאות של סריקת פרופילים קלה.
      • ‫scannedRows (int): מספר השורות שנסרקו.
      • ‫samplingPercentage (double): אחוז הדגימה שבו נעשה שימוש.
    • ‫fields (map): מפה של שמות העמודות לפרופילי הנתונים שלהן, כולל מדדים כמו ערכי uniqueness,‏ nullness ו-topN, וסטטיסטיקות ספציפיות לסוגים של עמודות numeric,‏ string,‏ datetime ו-array.

    יוצרים את הקובץ payload.json באופן הבא:

     {
       "aspects": {
         "dataplex-types.global.data-profile": {
           "data": {
             "sourceDataInfo": {
             "scope": "ALL",
             "scannedRows": 100
           },
           "fields": {
             "col1": {
               "nullness": 0.0,
               "uniqueness": 0.1,
          "string": {
            "length": {
              "min": 1,
              "max": 20,
              "avg": 12.54
            }
          }
             }
           }
         }
       }
     }}
    

  • כללי. אפשר להשתמש בסוג ההיבט generic לפרטי כניסה כלליים. השדות כוללים את הפרטים הבאים:

    • type (מחרוזת): שדה בפורמט חופשי לאחסון סוג שהמשתמש ציין.
    • ‫system (מחרוזת): המערכת של הרשומה בהתאמה אישית.

    יוצרים את הקובץ payload.json באופן הבא:

    {
      "aspects": {
        "dataplex-types.global.generic": {
          "data": {
            "type": "custom-type",
            "system": "custom-system"
          }
        }
      }
    }
    
  • סקירה כללית. משתמשים בoverview aspect type כדי לספק תיאור בטקסט עשיר. השדות כוללים את הפרטים הבאים:

    • ‫content (string): סקירה כללית של הרשומה, עם תמיכה בפורמט HTML.
    • ‫links (מערך): רשימה של קישורים למערכת המקור. כל קישור כולל:
      • url (מחרוזת): כתובת ה-URL של הקישור.
      • ‫title (מחרוזת): שם הקישור.

    יוצרים את הקובץ payload.json באופן הבא:

    {
      "aspects": {
        "dataplex-types.global.overview": {
          "data": {
            "content": "This is a <b>rich text</b> description.",
          "links": [
            {
              "url": "https://example.com",
              "title": "Example Link"
            }
          ]
        }
      }
    }}
    
  • סכימה. משתמשים בסוג ההיבט schema כדי לתאר את מבנה הנתונים.

    • ‫fields (array): רשימה של שדות סכימה. השדות כוללים את הפרטים הבאים:
      • ‫name (מחרוזת): שם השדה.
      • ‫dataType (string): סוג הנתונים של השדה.
      • ‫metadataType (enum): סוג המטא-נתונים (לדוגמה, STRING,‏ BOOLEAN).
      • ‫mode (enum): המצב של השדה (NULLABLE, ‏ REQUIRED,‏ REPEATED).
      • ‫description (מחרוזת): תיאור השדה.

    יוצרים את הקובץ payload.json באופן הבא:

    {
      "aspects": {
        "dataplex-types.global.schema": {
          "data": {
            "fields": [
            {
              "name": "id",
              "dataType": "string",
              "metadataType": "STRING",
              "mode": "REQUIRED"
            }
          ]
        }
      }
    }}
    
  • שימוש. כדי לעקוב אחרי מדדי השימוש, משתמשים בסוג ההיבט usage. השדות כוללים את הפרטים הבאים:

    • ‫metrics (מערך): רשימה של מדדי שימוש. כל מדד כולל:
      • ‫name (מחרוזת): שם המדד (לדוגמה, views,‏ reads).
      • ‫timeSeries (מערך): רשימה של נתונים של פעולות על ציר הזמן. כל פריט כולל:
        • ‫interval (מחרוזת): מרווח הצבירה (לדוגמה, 30d).
        • ‫value (מספר שלם): הערך המצטבר.
    • ‫refreshTime (תאריך ושעה): המועד שבו המדדים עודכנו בפעם האחרונה.

    יוצרים את הקובץ payload.json באופן הבא:

    {
      "aspects": {
        "dataplex-types.global.usage": {
          "data": {
            "metrics": [
            {
              "name": "views",
              "timeSeries": [
                {
                  "interval": "30d",
                  "value": 100
                }
              ]
            }
          ],
          "refreshTime": "2025-01-01T12:00:00Z"
        }
      }
    }}
    

יצירת קישור כניסה

אתם יכולים ליצור קשר בין שני פריטים על ידי יצירת קישור לפריט.

קישור כניסה יכול להיות סימטרי, כמו synonym, או אסימטרי, כמו definition.

C#‎

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

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

using Google.Cloud.Dataplex.V1;

public sealed partial class GeneratedCatalogServiceClientSnippets
{
    /// <summary>Snippet for CreateEntryLink</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 CreateEntryLinkRequestObject()
    {
        // Create client
        CatalogServiceClient catalogServiceClient = CatalogServiceClient.Create();
        // Initialize request argument(s)
        CreateEntryLinkRequest request = new CreateEntryLinkRequest
        {
            ParentAsEntryGroupName = EntryGroupName.FromProjectLocationEntryGroup("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]"),
            EntryLinkId = "",
            EntryLink = new EntryLink(),
        };
        // Make the request
        EntryLink response = catalogServiceClient.CreateEntryLink(request);
    }
}

המשך

לפני שמנסים את הדוגמה הזו, צריך לפעול לפי 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.NewCatalogClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

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

Java

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

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

import com.google.cloud.dataplex.v1.CatalogServiceClient;
import com.google.cloud.dataplex.v1.CreateEntryLinkRequest;
import com.google.cloud.dataplex.v1.EntryGroupName;
import com.google.cloud.dataplex.v1.EntryLink;

public class SyncCreateEntryLink {

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

  public static void syncCreateEntryLink() 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 (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
      CreateEntryLinkRequest request =
          CreateEntryLinkRequest.newBuilder()
              .setParent(EntryGroupName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]").toString())
              .setEntryLinkId("entryLinkId-1349584441")
              .setEntryLink(EntryLink.newBuilder().build())
              .build();
      EntryLink response = catalogServiceClient.createEntryLink(request);
    }
  }
}

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 resource name of the parent Entry Group:
 *  `projects/{project_id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}`.
 */
// const parent = 'abc123'
/**
 *  Required. Entry Link identifier
 *  * Must contain only lowercase letters, numbers and hyphens.
 *  * Must start with a letter.
 *  * Must be between 1-63 characters.
 *  * Must end with a number or a letter.
 *  * Must be unique within the EntryGroup.
 */
// const entryLinkId = 'abc123'
/**
 *  Required. Entry Link resource.
 */
// const entryLink = {}

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

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

async function callCreateEntryLink() {
  // Construct request
  const request = {
    parent,
    entryLinkId,
    entryLink,
  };

  // Run request
  const response = await dataplexClient.createEntryLink(request);
  console.log(response);
}

callCreateEntryLink();

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_create_entry_link():
    # Create a client
    client = dataplex_v1.CatalogServiceClient()

    # Initialize request argument(s)
    entry_link = dataplex_v1.EntryLink()
    entry_link.entry_link_type = "entry_link_type_value"
    entry_link.entry_references.name = "name_value"
    entry_link.entry_references.type_ = "TARGET"

    request = dataplex_v1.CreateEntryLinkRequest(
        parent="parent_value",
        entry_link_id="entry_link_id_value",
        entry_link=entry_link,
    )

    # Make the request
    response = client.create_entry_link(request=request)

    # Handle the response
    print(response)

REST

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

הוספת היבטים לקישור כניסה

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

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

אפשר להוסיף את ההיבטים האלה כשיוצרים קישור לכניסה, או לעדכן קישור קיים לכניסה, באופן הבא:

C#‎

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

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

using Google.Cloud.Dataplex.V1;

public sealed partial class GeneratedCatalogServiceClientSnippets
{
    /// <summary>Snippet for UpdateEntryLink</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 UpdateEntryLinkRequestObject()
    {
        // Create client
        CatalogServiceClient catalogServiceClient = CatalogServiceClient.Create();
        // Initialize request argument(s)
        UpdateEntryLinkRequest request = new UpdateEntryLinkRequest
        {
            EntryLink = new EntryLink(),
            AllowMissing = false,
            AspectKeys = { "", },
        };
        // Make the request
        EntryLink response = catalogServiceClient.UpdateEntryLink(request);
    }
}

המשך

לפני שמנסים את הדוגמה הזו, צריך לפעול לפי 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.NewCatalogClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

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

Java

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

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

import com.google.cloud.dataplex.v1.CatalogServiceClient;
import com.google.cloud.dataplex.v1.EntryLink;
import com.google.cloud.dataplex.v1.UpdateEntryLinkRequest;
import java.util.ArrayList;

public class SyncUpdateEntryLink {

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

  public static void syncUpdateEntryLink() 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 (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
      UpdateEntryLinkRequest request =
          UpdateEntryLinkRequest.newBuilder()
              .setEntryLink(EntryLink.newBuilder().build())
              .setAllowMissing(true)
              .addAllAspectKeys(new ArrayList<String>())
              .build();
      EntryLink response = catalogServiceClient.updateEntryLink(request);
    }
  }
}

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. Entry Link resource.
 */
// const entryLink = {}
/**
 *  Optional. If set to true and the entry link doesn't exist, the service will
 *  create it.
 */
// const allowMissing = true
/**
 *  Optional. The map keys of the Aspects which the service should modify.
 *  It should be the aspect type reference in the format
 *  `{project_id_or_number}.{location_id}.{aspect_type_id}`.
 *  If this field is left empty, the service treats it as specifying
 *  exactly those Aspects present in the request.
 */
// const aspectKeys = ['abc','def']

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

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

async function callUpdateEntryLink() {
  // Construct request
  const request = {
    entryLink,
  };

  // Run request
  const response = await dataplexClient.updateEntryLink(request);
  console.log(response);
}

callUpdateEntryLink();

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_entry_link():
    # Create a client
    client = dataplex_v1.CatalogServiceClient()

    # Initialize request argument(s)
    entry_link = dataplex_v1.EntryLink()
    entry_link.entry_link_type = "entry_link_type_value"
    entry_link.entry_references.name = "name_value"
    entry_link.entry_references.type_ = "TARGET"

    request = dataplex_v1.UpdateEntryLinkRequest(
        entry_link=entry_link,
    )

    # Make the request
    response = client.update_entry_link(request=request)

    # Handle the response
    print(response)

REST

כדי לעדכן קישור לרשומה, משתמשים בשיטה entryLinks.patch, כולל נתוני ההיבט בגוף entryLink.

שימו לב למגבלות הבאות לגבי שימוש בהיבטים עם קישורים לדף נחיתה:

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

ניהול היבטים קיימים של רשומה

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

עדכון היבט

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

ברשומות של מערכות צד ראשון (1P), כמו טבלאות ב-BigQuery, אפשר לעדכן היבטים באמצעות ה-API של modifyEntry. כך תוכלו להשתמש בהרשאות העדכון של המטא-נתונים של מערכת המקור (למשל BigQueryData Editor).

המסוף

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

    לחיפוש Google

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

ייפתח דף הפרטים של הרשומה.

  1. לוחצים על הכרטיסייה פרטים.
  2. בקטע Aspects, מרחיבים את ההיבט שרוצים לעדכן ולוחצים על Edit.
  3. בחלון עריכת היבט, מעדכנים את שדות החובה.
  4. לוחצים על Save.

gcloud

כדי לעדכן היבטים של רשומה או של עמודה ברשומה, משתמשים בפקודה gcloud dataplex entries update.

C#‎

C#

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

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

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

public sealed partial class GeneratedCatalogServiceClientSnippets
{
    /// <summary>Snippet for UpdateEntry</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 UpdateEntryRequestObject()
    {
        // Create client
        CatalogServiceClient catalogServiceClient = CatalogServiceClient.Create();
        // Initialize request argument(s)
        UpdateEntryRequest request = new UpdateEntryRequest
        {
            Entry = new Entry(),
            UpdateMask = new FieldMask(),
            AllowMissing = false,
            DeleteMissingAspects = false,
            AspectKeys = { "", },
        };
        // Make the request
        Entry response = catalogServiceClient.UpdateEntry(request);
    }
}

המשך

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.NewCatalogClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &dataplexpb.UpdateEntryRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/dataplex/apiv1/dataplexpb#UpdateEntryRequest.
	}
	resp, err := c.UpdateEntry(ctx, req)
	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.CatalogServiceClient;
import com.google.cloud.dataplex.v1.Entry;
import com.google.cloud.dataplex.v1.UpdateEntryRequest;
import com.google.protobuf.FieldMask;
import java.util.ArrayList;

public class SyncUpdateEntry {

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

  public static void syncUpdateEntry() 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 (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
      UpdateEntryRequest request =
          UpdateEntryRequest.newBuilder()
              .setEntry(Entry.newBuilder().build())
              .setUpdateMask(FieldMask.newBuilder().build())
              .setAllowMissing(true)
              .setDeleteMissingAspects(true)
              .addAllAspectKeys(new ArrayList<String>())
              .build();
      Entry response = catalogServiceClient.updateEntry(request);
    }
  }
}

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. Entry resource.
 */
// const entry = {}
/**
 *  Optional. Mask of fields to update. To update Aspects, the update_mask must
 *  contain the value "aspects".
 *  If the update_mask is empty, the service will update all modifiable fields
 *  present in the request.
 */
// const updateMask = {}
/**
 *  Optional. If set to true and the entry doesn't exist, the service will
 *  create it.
 */
// const allowMissing = true
/**
 *  Optional. If set to true and the aspect_keys specify aspect ranges, the
 *  service deletes any existing aspects from that range that weren't provided
 *  in the request.
 */
// const deleteMissingAspects = true
/**
 *  Optional. The map keys of the Aspects which the service should modify. It
 *  supports the following syntaxes:
 *  * `<aspect_type_reference>` - matches an aspect of the given type and empty
 *  path.
 *  * `<aspect_type_reference>@path` - matches an aspect of the given type and
 *  specified path. For example, to attach an aspect to a field that is
 *  specified by the `schema` aspect, the path should have the format
 *  `Schema.<field_name>`.
 *  * `<aspect_type_reference>@*` - matches aspects of the given type for all
 *  paths.
 *  * `*@path` - matches aspects of all types on the given path.
 *  The service will not remove existing aspects matching the syntax unless
 *  `delete_missing_aspects` is set to true.
 *  If this field is left empty, the service treats it as specifying
 *  exactly those Aspects present in the request.
 */
// const aspectKeys = ['abc','def']

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

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

async function callUpdateEntry() {
  // Construct request
  const request = {
    entry,
  };

  // Run request
  const response = await dataplexClient.updateEntry(request);
  console.log(response);
}

callUpdateEntry();

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_entry():
    # Create a client
    client = dataplex_v1.CatalogServiceClient()

    # Initialize request argument(s)
    entry = dataplex_v1.Entry()
    entry.entry_type = "entry_type_value"

    request = dataplex_v1.UpdateEntryRequest(
        entry=entry,
    )

    # Make the request
    response = client.update_entry(request=request)

    # Handle the response
    print(response)

Ruby

Ruby

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

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

require "google/cloud/dataplex/v1"

##
# Snippet for the update_entry call in the CatalogService service
#
# 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/ruby/docs/reference.
#
# This is an auto-generated example demonstrating basic usage of
# Google::Cloud::Dataplex::V1::CatalogService::Client#update_entry.
#
def update_entry
  # Create a client object. The client can be reused for multiple calls.
  client = Google::Cloud::Dataplex::V1::CatalogService::Client.new

  # Create a request. To set request fields, pass in keyword arguments.
  request = Google::Cloud::Dataplex::V1::UpdateEntryRequest.new

  # Call the update_entry method.
  result = client.update_entry request

  # The returned object is of type Google::Cloud::Dataplex::V1::Entry.
  p result
end

REST

כדי לעדכן היבטים של רשומה או עמודה של רשומה, משתמשים בשיטה entry.patch.

מחיקת היבט

המסוף

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

    לחיפוש Google

  2. אם פלטפורמת החיפוש מוגדרת לקטלוג נתונים, בתפריט בחירת פלטפורמת חיפוש בוחרים באפשרות Dataplex Universal Catalog.

  3. מחפשים את הרשומה שרוצים למחוק את ההיבטים שלה ולוחצים על הרשומה.

ייפתח דף הפרטים של הרשומה.

  1. לוחצים על הכרטיסייה פרטים.
  2. בקטע Aspects, מרחיבים את ההיבט שרוצים למחוק ולוחצים על Delete.
  3. לוחצים על אישור.

gcloud

כדי למחוק היבט של רשומה, משתמשים בפקודה gcloud dataplex entries update.

C#‎

C#

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

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

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

public sealed partial class GeneratedCatalogServiceClientSnippets
{
    /// <summary>Snippet for UpdateEntry</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 UpdateEntryRequestObject()
    {
        // Create client
        CatalogServiceClient catalogServiceClient = CatalogServiceClient.Create();
        // Initialize request argument(s)
        UpdateEntryRequest request = new UpdateEntryRequest
        {
            Entry = new Entry(),
            UpdateMask = new FieldMask(),
            AllowMissing = false,
            DeleteMissingAspects = false,
            AspectKeys = { "", },
        };
        // Make the request
        Entry response = catalogServiceClient.UpdateEntry(request);
    }
}

המשך

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.NewCatalogClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &dataplexpb.UpdateEntryRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/dataplex/apiv1/dataplexpb#UpdateEntryRequest.
	}
	resp, err := c.UpdateEntry(ctx, req)
	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.CatalogServiceClient;
import com.google.cloud.dataplex.v1.Entry;
import com.google.cloud.dataplex.v1.UpdateEntryRequest;
import com.google.protobuf.FieldMask;
import java.util.ArrayList;

public class SyncUpdateEntry {

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

  public static void syncUpdateEntry() 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 (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
      UpdateEntryRequest request =
          UpdateEntryRequest.newBuilder()
              .setEntry(Entry.newBuilder().build())
              .setUpdateMask(FieldMask.newBuilder().build())
              .setAllowMissing(true)
              .setDeleteMissingAspects(true)
              .addAllAspectKeys(new ArrayList<String>())
              .build();
      Entry response = catalogServiceClient.updateEntry(request);
    }
  }
}

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. Entry resource.
 */
// const entry = {}
/**
 *  Optional. Mask of fields to update. To update Aspects, the update_mask must
 *  contain the value "aspects".
 *  If the update_mask is empty, the service will update all modifiable fields
 *  present in the request.
 */
// const updateMask = {}
/**
 *  Optional. If set to true and the entry doesn't exist, the service will
 *  create it.
 */
// const allowMissing = true
/**
 *  Optional. If set to true and the aspect_keys specify aspect ranges, the
 *  service deletes any existing aspects from that range that weren't provided
 *  in the request.
 */
// const deleteMissingAspects = true
/**
 *  Optional. The map keys of the Aspects which the service should modify. It
 *  supports the following syntaxes:
 *  * `<aspect_type_reference>` - matches an aspect of the given type and empty
 *  path.
 *  * `<aspect_type_reference>@path` - matches an aspect of the given type and
 *  specified path. For example, to attach an aspect to a field that is
 *  specified by the `schema` aspect, the path should have the format
 *  `Schema.<field_name>`.
 *  * `<aspect_type_reference>@*` - matches aspects of the given type for all
 *  paths.
 *  * `*@path` - matches aspects of all types on the given path.
 *  The service will not remove existing aspects matching the syntax unless
 *  `delete_missing_aspects` is set to true.
 *  If this field is left empty, the service treats it as specifying
 *  exactly those Aspects present in the request.
 */
// const aspectKeys = ['abc','def']

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

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

async function callUpdateEntry() {
  // Construct request
  const request = {
    entry,
  };

  // Run request
  const response = await dataplexClient.updateEntry(request);
  console.log(response);
}

callUpdateEntry();

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_entry():
    # Create a client
    client = dataplex_v1.CatalogServiceClient()

    # Initialize request argument(s)
    entry = dataplex_v1.Entry()
    entry.entry_type = "entry_type_value"

    request = dataplex_v1.UpdateEntryRequest(
        entry=entry,
    )

    # Make the request
    response = client.update_entry(request=request)

    # Handle the response
    print(response)

Ruby

Ruby

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

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

require "google/cloud/dataplex/v1"

##
# Snippet for the update_entry call in the CatalogService service
#
# 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/ruby/docs/reference.
#
# This is an auto-generated example demonstrating basic usage of
# Google::Cloud::Dataplex::V1::CatalogService::Client#update_entry.
#
def update_entry
  # Create a client object. The client can be reused for multiple calls.
  client = Google::Cloud::Dataplex::V1::CatalogService::Client.new

  # Create a request. To set request fields, pass in keyword arguments.
  request = Google::Cloud::Dataplex::V1::UpdateEntryRequest.new

  # Call the update_entry method.
  result = client.update_entry request

  # The returned object is of type Google::Cloud::Dataplex::V1::Entry.
  p result
end

REST

כדי למחוק היבט של רשומה, משתמשים ב-method‏ entry.patch.

ניהול היבטים קיימים של קישור לכניסה

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

עדכון היבט

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

מידע נוסף זמין במאמר הרשאות IAM לפעולות של קישורי כניסה.

REST

כדי לעדכן קישור לרשומה עם ההיבט הנדרש, משתמשים בשיטה entryLinks.patch, כולל נתוני ההיבט בגוף הבקשה.

מחיקת היבט

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

ניהול סוגי ההיבטים

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

הצגת רשימה של סוגי ההיבטים הזמינים

המסוף

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

    מעבר אל סוגי מטא-נתונים

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

בדף הזה מפורטים כל סוגי ההיבטים שזמינים ב-Knowledge Catalog.

  1. כדי לראות סוגי היבטים בהתאמה אישית, לוחצים על הכרטיסייה Custom. בכרטיסייה Custom, בעמודה Catalog source מוצג המיקום של המשאב ב-Knowledge Catalog.

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

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

  1. אופציונלי: כדי לראות את רשימת סוגי יחסי הגובה-רוחב בפרויקט שבחרתם, לוחצים על הכרטיסייה Custom ואז על המתג Show from all projects כדי להעביר אותו למצב מושבת.

המתג Show from all projects מופעל כברירת מחדל, והרשימה כוללת משאבים של Knowledge Catalog מהארגון שבחרתם.

gcloud

כדי להציג רשימה של כל סוגי ההיבטים הזמינים, משתמשים בפקודה gcloud dataplex aspect-types list.

C#‎

C#

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

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

using Google.Api.Gax;
using Google.Api.Gax.ResourceNames;
using Google.Cloud.Dataplex.V1;
using System;

public sealed partial class GeneratedCatalogServiceClientSnippets
{
    /// <summary>Snippet for ListAspectTypes</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 ListAspectTypesRequestObject()
    {
        // Create client
        CatalogServiceClient catalogServiceClient = CatalogServiceClient.Create();
        // Initialize request argument(s)
        ListAspectTypesRequest request = new ListAspectTypesRequest
        {
            ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
            Filter = "",
            OrderBy = "",
        };
        // Make the request
        PagedEnumerable<ListAspectTypesResponse, AspectType> response = catalogServiceClient.ListAspectTypes(request);

        // Iterate over all response items, lazily performing RPCs as required
        foreach (AspectType item in response)
        {
            // Do something with each item
            Console.WriteLine(item);
        }

        // Or iterate over pages (of server-defined size), performing one RPC per page
        foreach (ListAspectTypesResponse page in response.AsRawResponses())
        {
            // Do something with each page of items
            Console.WriteLine("A page of results:");
            foreach (AspectType item in page)
            {
                // Do something with each item
                Console.WriteLine(item);
            }
        }

        // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
        int pageSize = 10;
        Page<AspectType> singlePage = response.ReadPage(pageSize);
        // Do something with the page of items
        Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
        foreach (AspectType item in singlePage)
        {
            // Do something with each item
            Console.WriteLine(item);
        }
        // Store the pageToken, for when the next page is required.
        string nextPageToken = singlePage.NextPageToken;
    }
}

המשך

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"
	"google.golang.org/api/iterator"
)

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.NewCatalogClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &dataplexpb.ListAspectTypesRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/dataplex/apiv1/dataplexpb#ListAspectTypesRequest.
	}
	it := c.ListAspectTypes(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp

		// If you need to access the underlying RPC response,
		// you can do so by casting the `Response` as below.
		// Otherwise, remove this line. Only populated after
		// first call to Next(). Not safe for concurrent access.
		_ = it.Response.(*dataplexpb.ListAspectTypesResponse)
	}
}

Java

Java

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

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

import com.google.cloud.dataplex.v1.AspectType;
import com.google.cloud.dataplex.v1.CatalogServiceClient;
import com.google.cloud.dataplex.v1.ListAspectTypesRequest;
import com.google.cloud.dataplex.v1.LocationName;

public class SyncListAspectTypes {

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

  public static void syncListAspectTypes() 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 (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
      ListAspectTypesRequest request =
          ListAspectTypesRequest.newBuilder()
              .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
              .setPageSize(883849137)
              .setPageToken("pageToken873572522")
              .setFilter("filter-1274492040")
              .setOrderBy("orderBy-1207110587")
              .build();
      for (AspectType element : catalogServiceClient.listAspectTypes(request).iterateAll()) {
        // doThingsWith(element);
      }
    }
  }
}

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 resource name of the AspectType location, of the form:
 *  `projects/{project_number}/locations/{location_id}`
 *  where `location_id` refers to a Google Cloud region.
 */
// const parent = 'abc123'
/**
 *  Optional. Maximum number of AspectTypes to return. The service may return
 *  fewer than this value. If unspecified, the service returns at most 10
 *  AspectTypes. The maximum value is 1000; values above 1000 will be coerced
 *  to 1000.
 */
// const pageSize = 1234
/**
 *  Optional. Page token received from a previous `ListAspectTypes` call.
 *  Provide this to retrieve the subsequent page. When paginating, all other
 *  parameters you provide to `ListAspectTypes` must match the call that
 *  provided the page token.
 */
// const pageToken = 'abc123'
/**
 *  Optional. Filter request. Filters are case-sensitive.
 *  The service supports the following formats:
 *  * labels.key1 = "value1"
 *  * labels:key1
 *  * name = "value"
 *  These restrictions can be conjoined with AND, OR, and NOT conjunctions.
 */
// const filter = 'abc123'
/**
 *  Optional. Orders the result by `name` or `create_time` fields.
 *  If not specified, the ordering is undefined.
 */
// const orderBy = 'abc123'

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

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

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

  // Run request
  const iterable = dataplexClient.listAspectTypesAsync(request);
  for await (const response of iterable) {
      console.log(response);
  }
}

callListAspectTypes();

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_list_aspect_types():
    # Create a client
    client = dataplex_v1.CatalogServiceClient()

    # Initialize request argument(s)
    request = dataplex_v1.ListAspectTypesRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_aspect_types(request=request)

    # Handle the response
    for response in page_result:
        print(response)

Ruby

Ruby

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

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

require "google/cloud/dataplex/v1"

##
# Snippet for the list_aspect_types call in the CatalogService service
#
# 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/ruby/docs/reference.
#
# This is an auto-generated example demonstrating basic usage of
# Google::Cloud::Dataplex::V1::CatalogService::Client#list_aspect_types.
#
def list_aspect_types
  # Create a client object. The client can be reused for multiple calls.
  client = Google::Cloud::Dataplex::V1::CatalogService::Client.new

  # Create a request. To set request fields, pass in keyword arguments.
  request = Google::Cloud::Dataplex::V1::ListAspectTypesRequest.new

  # Call the list_aspect_types method.
  result = client.list_aspect_types request

  # The returned object is of type Gapic::PagedEnumerable. You can iterate
  # over elements, and API calls will be issued to fetch pages as needed.
  result.each do |item|
    # Each element is of type ::Google::Cloud::Dataplex::V1::AspectType.
    p item
  end
end

REST

כדי להציג רשימה של כל סוגי ההיבטים הזמינים, משתמשים בשיטה aspectTypes.list.

הצגת פרטים של סוג היבט

המסוף

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

    מעבר אל סוגי מטא-נתונים

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

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

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

gcloud

כדי לקבל את הפרטים של סוג היבט, משתמשים בפקודה gcloud dataplex aspect-types describe.

C#‎

C#

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

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

using Google.Cloud.Dataplex.V1;

public sealed partial class GeneratedCatalogServiceClientSnippets
{
    /// <summary>Snippet for GetAspectType</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 GetAspectTypeRequestObject()
    {
        // Create client
        CatalogServiceClient catalogServiceClient = CatalogServiceClient.Create();
        // Initialize request argument(s)
        GetAspectTypeRequest request = new GetAspectTypeRequest
        {
            AspectTypeName = AspectTypeName.FromProjectLocationAspectType("[PROJECT]", "[LOCATION]", "[ASPECT_TYPE]"),
        };
        // Make the request
        AspectType response = catalogServiceClient.GetAspectType(request);
    }
}

המשך

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.NewCatalogClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &dataplexpb.GetAspectTypeRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/dataplex/apiv1/dataplexpb#GetAspectTypeRequest.
	}
	resp, err := c.GetAspectType(ctx, req)
	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.AspectType;
import com.google.cloud.dataplex.v1.AspectTypeName;
import com.google.cloud.dataplex.v1.CatalogServiceClient;
import com.google.cloud.dataplex.v1.GetAspectTypeRequest;

public class SyncGetAspectType {

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

  public static void syncGetAspectType() 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 (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
      GetAspectTypeRequest request =
          GetAspectTypeRequest.newBuilder()
              .setName(AspectTypeName.of("[PROJECT]", "[LOCATION]", "[ASPECT_TYPE]").toString())
              .build();
      AspectType response = catalogServiceClient.getAspectType(request);
    }
  }
}

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 resource name of the AspectType:
 *  `projects/{project_number}/locations/{location_id}/aspectTypes/{aspect_type_id}`.
 */
// const name = 'abc123'

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

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

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

  // Run request
  const response = await dataplexClient.getAspectType(request);
  console.log(response);
}

callGetAspectType();

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_get_aspect_type():
    # Create a client
    client = dataplex_v1.CatalogServiceClient()

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

    # Make the request
    response = client.get_aspect_type(request=request)

    # Handle the response
    print(response)

Ruby

Ruby

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

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

require "google/cloud/dataplex/v1"

##
# Snippet for the get_aspect_type call in the CatalogService service
#
# 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/ruby/docs/reference.
#
# This is an auto-generated example demonstrating basic usage of
# Google::Cloud::Dataplex::V1::CatalogService::Client#get_aspect_type.
#
def get_aspect_type
  # Create a client object. The client can be reused for multiple calls.
  client = Google::Cloud::Dataplex::V1::CatalogService::Client.new

  # Create a request. To set request fields, pass in keyword arguments.
  request = Google::Cloud::Dataplex::V1::GetAspectTypeRequest.new

  # Call the get_aspect_type method.
  result = client.get_aspect_type request

  # The returned object is of type Google::Cloud::Dataplex::V1::AspectType.
  p result
end

REST

כדי לקבל את הפרטים של סוג היבט, משתמשים ב-method‏ aspectTypes.get.

עדכון סוג יחס גובה-רוחב מותאם אישית

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

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

המסוף

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

    מעבר אל סוגי מטא-נתונים

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

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

  4. בדף Aspect type details, לוחצים על Edit.

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

  6. אופציונלי: כדי לסמן שדה בסוג ההיבט כלא מומלץ לשימוש, פועלים לפי השלבים הבאים:

    1. בקטע Template, מרחיבים את השדה.
    2. בוחרים באפשרות הוצא משימוש.
    3. בשדה Deprecation reason, מזינים את הסיבה להוצאה משימוש של השדה שנבחר.
    4. לוחצים על סיום.

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

gcloud

כדי לעדכן סוג היבט בהתאמה אישית, משתמשים בפקודה gcloud dataplex aspect-types update.

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 GeneratedCatalogServiceClientSnippets
{
    /// <summary>Snippet for UpdateAspectType</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 UpdateAspectTypeRequestObject()
    {
        // Create client
        CatalogServiceClient catalogServiceClient = CatalogServiceClient.Create();
        // Initialize request argument(s)
        UpdateAspectTypeRequest request = new UpdateAspectTypeRequest
        {
            AspectType = new AspectType(),
            UpdateMask = new FieldMask(),
            ValidateOnly = false,
        };
        // Make the request
        Operation<AspectType, OperationMetadata> response = catalogServiceClient.UpdateAspectType(request);

        // Poll until the returned long-running operation is complete
        Operation<AspectType, OperationMetadata> completedResponse = response.PollUntilCompleted();
        // Retrieve the operation result
        AspectType 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<AspectType, OperationMetadata> retrievedResponse = catalogServiceClient.PollOnceUpdateAspectType(operationName);
        // Check if the retrieved long-running operation has completed
        if (retrievedResponse.IsCompleted)
        {
            // If it has completed, then access the result
            AspectType 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.NewCatalogClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &dataplexpb.UpdateAspectTypeRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/dataplex/apiv1/dataplexpb#UpdateAspectTypeRequest.
	}
	op, err := c.UpdateAspectType(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.AspectType;
import com.google.cloud.dataplex.v1.CatalogServiceClient;
import com.google.cloud.dataplex.v1.UpdateAspectTypeRequest;
import com.google.protobuf.FieldMask;

public class SyncUpdateAspectType {

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

  public static void syncUpdateAspectType() 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 (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
      UpdateAspectTypeRequest request =
          UpdateAspectTypeRequest.newBuilder()
              .setAspectType(AspectType.newBuilder().build())
              .setUpdateMask(FieldMask.newBuilder().build())
              .setValidateOnly(true)
              .build();
      AspectType response = catalogServiceClient.updateAspectTypeAsync(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. AspectType Resource
 */
// const aspectType = {}
/**
 *  Required. Mask of fields to update.
 */
// const updateMask = {}
/**
 *  Optional. Only validate the request, but do not perform mutations.
 *  The default is false.
 */
// const validateOnly = true

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

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

async function callUpdateAspectType() {
  // Construct request
  const request = {
    aspectType,
    updateMask,
  };

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

callUpdateAspectType();

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_aspect_type():
    # Create a client
    client = dataplex_v1.CatalogServiceClient()

    # Initialize request argument(s)
    aspect_type = dataplex_v1.AspectType()
    aspect_type.metadata_template.name = "name_value"
    aspect_type.metadata_template.type_ = "type__value"

    request = dataplex_v1.UpdateAspectTypeRequest(
        aspect_type=aspect_type,
    )

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

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

    response = operation.result()

    # Handle the response
    print(response)

Ruby

Ruby

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

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

require "google/cloud/dataplex/v1"

##
# Snippet for the update_aspect_type call in the CatalogService service
#
# 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/ruby/docs/reference.
#
# This is an auto-generated example demonstrating basic usage of
# Google::Cloud::Dataplex::V1::CatalogService::Client#update_aspect_type.
#
def update_aspect_type
  # Create a client object. The client can be reused for multiple calls.
  client = Google::Cloud::Dataplex::V1::CatalogService::Client.new

  # Create a request. To set request fields, pass in keyword arguments.
  request = Google::Cloud::Dataplex::V1::UpdateAspectTypeRequest.new

  # Call the update_aspect_type method.
  result = client.update_aspect_type request

  # The returned object is of type Gapic::Operation. You can use it to
  # check the status of an operation, cancel it, or wait for results.
  # Here is how to wait for a response.
  result.wait_until_done! timeout: 60
  if result.response?
    p result.response
  else
    puts "No response received."
  end
end

REST

כדי לעדכן סוג מאפיין בהתאמה אישית, משתמשים בשיטה aspectTypes.patch.

מחיקת סוג היבט מותאם אישית

המסוף

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

    מעבר אל סוגי מטא-נתונים

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

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

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

gcloud

כדי למחוק סוג היבט בהתאמה אישית, משתמשים בפקודה gcloud dataplex aspect-types 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 GeneratedCatalogServiceClientSnippets
{
    /// <summary>Snippet for DeleteAspectType</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 DeleteAspectTypeRequestObject()
    {
        // Create client
        CatalogServiceClient catalogServiceClient = CatalogServiceClient.Create();
        // Initialize request argument(s)
        DeleteAspectTypeRequest request = new DeleteAspectTypeRequest
        {
            AspectTypeName = AspectTypeName.FromProjectLocationAspectType("[PROJECT]", "[LOCATION]", "[ASPECT_TYPE]"),
            Etag = "",
        };
        // Make the request
        Operation<Empty, OperationMetadata> response = catalogServiceClient.DeleteAspectType(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 = catalogServiceClient.PollOnceDeleteAspectType(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.NewCatalogClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &dataplexpb.DeleteAspectTypeRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/dataplex/apiv1/dataplexpb#DeleteAspectTypeRequest.
	}
	op, err := c.DeleteAspectType(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.AspectTypeName;
import com.google.cloud.dataplex.v1.CatalogServiceClient;
import com.google.cloud.dataplex.v1.DeleteAspectTypeRequest;
import com.google.protobuf.Empty;

public class SyncDeleteAspectType {

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

  public static void syncDeleteAspectType() 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 (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
      DeleteAspectTypeRequest request =
          DeleteAspectTypeRequest.newBuilder()
              .setName(AspectTypeName.of("[PROJECT]", "[LOCATION]", "[ASPECT_TYPE]").toString())
              .setEtag("etag3123477")
              .build();
      catalogServiceClient.deleteAspectTypeAsync(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 resource name of the AspectType:
 *  `projects/{project_number}/locations/{location_id}/aspectTypes/{aspect_type_id}`.
 */
// const name = 'abc123'
/**
 *  Optional. If the client provided etag value does not match the current etag
 *  value, the DeleteAspectTypeRequest method returns an ABORTED error
 *  response.
 */
// const etag = 'abc123'

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

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

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

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

callDeleteAspectType();

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_aspect_type():
    # Create a client
    client = dataplex_v1.CatalogServiceClient()

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

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

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

    response = operation.result()

    # Handle the response
    print(response)

Ruby

Ruby

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

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

require "google/cloud/dataplex/v1"

##
# Snippet for the delete_aspect_type call in the CatalogService service
#
# 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/ruby/docs/reference.
#
# This is an auto-generated example demonstrating basic usage of
# Google::Cloud::Dataplex::V1::CatalogService::Client#delete_aspect_type.
#
def delete_aspect_type
  # Create a client object. The client can be reused for multiple calls.
  client = Google::Cloud::Dataplex::V1::CatalogService::Client.new

  # Create a request. To set request fields, pass in keyword arguments.
  request = Google::Cloud::Dataplex::V1::DeleteAspectTypeRequest.new

  # Call the delete_aspect_type method.
  result = client.delete_aspect_type request

  # The returned object is of type Gapic::Operation. You can use it to
  # check the status of an operation, cancel it, or wait for results.
  # Here is how to wait for a response.
  result.wait_until_done! timeout: 60
  if result.response?
    p result.response
  else
    puts "No response received."
  end
end

REST

כדי למחוק סוג מאפיין בהתאמה אישית, משתמשים בשיטה aspectTypes.delete.

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