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

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

הוספת הקשר משמעותי לערכי הנתונים מאפשרת לכם להפיק מהנתונים יותר תועלת ולגלות בהם תובנות חדשות. ‫Dataplex Universal Catalog מאפשר להבין את ההקשר באמצעות:

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

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

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

היבטים

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

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

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

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

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

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

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

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

Google Cloud

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

ההיבטים מחולקים לקטגוריות הבאות:

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

    ‫Dataplex Universal Catalog מנהל את ההיבטים הנדרשים (לדוגמה, סכימה) של רשומות המערכת.

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

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

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

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

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

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

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

מאפייני הנתונים

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

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

סוגי היבטים

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

קטגוריות של סוגי מאפיינים

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

סוגי יחס גובה-רוחב בהתאמה אישית

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

הפעלת ה-API

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

הפעלת ה-API

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

המסוף

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

    מעבר אל קטלוג

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

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

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

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

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

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

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

        1. בשדה סוג הטקסט, בוחרים את סוג הטקסט.
        2. בשדה Text values, מספקים רמז לשדה הטקסט. כדי לעשות את זה, לוחצים על הוספת ערך ומזינים את הרמז. אפשר להוסיף כמה רמזים לשדה טקסט.
        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. בשדה Name, מזינים שם למפה.
        3. אופציונלי: בשדה השם המוצג, מזינים שם מוצג למפה.
        4. אופציונלי: בשדה Description, מזינים תיאור של המפה.
        5. בשדה סוג, בוחרים סוג נתונים למפה.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

gcloud

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

C#‎

C#

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

כדי לבצע אימות ב-Dataplex Universal 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

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

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


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

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

Python

Python

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

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

כדי לבצע אימות ב-Dataplex Universal Catalog, צריך להגדיר את 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 (הפניה לרשומה)

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

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

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

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

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

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

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

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

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

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

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

המסוף

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

    לחיפוש Google

  2. אם פלטפורמת החיפוש מוגדרת כ-Data Catalog, בתפריט Choose search platform בוחרים באפשרות Dataplex Universal Catalog.

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

  4. כדי להוסיף מאפיינים לרשומה:

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

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

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

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

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

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

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

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

gcloud

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

C#‎

C#

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

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

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

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


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

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

Python

Python

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

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

כדי לבצע אימות ב-Dataplex Universal 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

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

REST

כדי להוסיף היבטים לרשומה או לעמודה של רשומה, משתמשים בשיטה 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 (מחרוזת): התפקיד של איש הקשר (לדוגמה, owner,‏ steward,‏ producer או admin).
      • name (מחרוזת): השם של איש הקשר.
      • id (string): כתובת האימייל או המזהה של איש הקשר.

    יוצרים את הקובץ 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).
      • 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 (string): שדה חופשי לאחסון סוג שצוין על ידי המשתמש.
    • system (מחרוזת): המערכת של הרשומה המותאמת אישית.

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

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

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

    יוצרים את הקובץ 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 (מערך): רשימה של שדות סכימה. השדות כוללים את הפרטים הבאים:
      • name (string): שם השדה.
      • 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 (array): רשימה של נתונים של פעולות על ציר הזמן. כל פריט כולל את הפרמטרים הבאים:
        • interval (מחרוזת): מרווח הצבירה (לדוגמה, 30d).
        • value (מספר שלם): הערך המצטבר.
    • refreshTime (datetime): השעה שבה המדדים עודכנו לאחרונה.

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

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

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

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

עדכון של היבט

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

המסוף

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

    לחיפוש Google

  2. אם פלטפורמת החיפוש מוגדרת כ-Data Catalog, בתפריט Choose search platform בוחרים באפשרות Dataplex Universal Catalog.

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

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

1.  Click the **Details** tab.
  1. בקטע Tags & aspects (תגים והיבטים), מרחיבים את ההיבט או התג שרוצים לעדכן ולוחצים על Edit (עריכה).
  2. בחלון עריכת היבט, מעדכנים את שדות החובה.
  3. לוחצים על Save.

gcloud

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

C#‎

C#

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

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

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

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


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

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

Python

Python

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

כדי לבצע אימות ב-Dataplex Universal 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():
    # 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במדריך למתחילים בנושא Dataplex Universal Catalog באמצעות ספריות לקוח. מידע נוסף מופיע במאמרי העזרה של Dataplex Universal Catalog Ruby API.

כדי לבצע אימות ב-Dataplex Universal 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 של Dataplex Universal Catalog במסוף Google Cloud .

    לחיפוש Google

  2. אם פלטפורמת החיפוש מוגדרת כ-Data Catalog, בתפריט Choose search platform בוחרים באפשרות Dataplex Universal Catalog.

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

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

1.  Click the **Details** tab.
  1. בקטע תגים ומאפיינים, מרחיבים את המאפיין או התג שרוצים למחוק, לוחצים על מחיקה.
  2. לוחצים על אישור.

gcloud

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

C#‎

C#

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

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

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

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


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

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

Python

Python

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

כדי לבצע אימות ב-Dataplex Universal 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():
    # 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במדריך למתחילים בנושא Dataplex Universal Catalog באמצעות ספריות לקוח. מידע נוסף מופיע במאמרי העזרה של Dataplex Universal Catalog Ruby API.

כדי לבצע אימות ב-Dataplex Universal 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. נכנסים לדף Catalog של Dataplex Universal Catalog במסוף Google Cloud .

    מעבר אל קטלוג

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

בדף הזה מפורטים כל סוגי ההיבטים הזמינים של Dataplex Universal Catalog ותבניות התגים של Data Catalog.

  1. כדי לראות תבניות תגים וסוגים מותאמים אישית של היבטים, לוחצים על הכרטיסייה Custom (מותאם אישית). בעמודה מקור הקטלוג שבכרטיסייה מותאם אישית מוצג המקום שבו המשאב נמצא – Dataplex Universal Catalog או Data Catalog.

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

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

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

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

gcloud

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

C#‎

C#

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

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

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

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


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

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

Python

Python

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

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

כדי לבצע אימות ב-Dataplex Universal 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. נכנסים לדף Catalog של Dataplex Universal Catalog במסוף Google Cloud .

    מעבר אל קטלוג

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

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

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

gcloud

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

C#‎

C#

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

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

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

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


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

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

Python

Python

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

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

כדי לבצע אימות ב-Dataplex Universal 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

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

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

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

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

המסוף

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

    מעבר אל קטלוג

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

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

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

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

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

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

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

gcloud

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

C#‎

C#

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

כדי לבצע אימות ב-Dataplex Universal 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

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

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


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

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

Python

Python

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

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

כדי לבצע אימות ב-Dataplex Universal Catalog, צריך להגדיר את 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. נכנסים לדף Catalog של Dataplex Universal Catalog במסוף Google Cloud .

    מעבר אל קטלוג

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

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

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

gcloud

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

C#‎

C#

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

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

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

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


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

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

Python

Python

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

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

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

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