Method: projects.locations.dataStores.branches.documents.purge

מחיקה סופית של כל ה-Document שנבחרו בענף.

התהליך הזה הוא אסינכרוני. בהתאם למספר ה-Document שיש למחוק, הפעולה הזו יכולה להימשך שעות. לפני שהפעולה של המחיקה מסתיימת, יכול להיות ש-DocumentService.GetDocument או DocumentService.ListDocuments עדיין יחזירו חלק מDocument.

כדי לקבל רשימה של Documents למחיקה, מגדירים את PurgeDocumentsRequest.force כ-false.

בקשת HTTP


POST https://discoveryengine.googleapis.com/v1alpha/{parent=projects/*/locations/*/dataStores/*/branches/*}/documents:purge

כתובות ה-URL כתובות בתחביר של gRPC Transcoding.

פרמטרים של נתיב

פרמטרים
parent

string

חובה. שם משאב ההורה, למשל projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}/branches/{branch}.

גוף הבקשה

גוף הבקשה מכיל נתונים במבנה הבא:

ייצוג ב-JSON
{
  "filter": string,
  "errorConfig": {
    object (PurgeErrorConfig)
  },
  "force": boolean,

  // The following is a list of mutually exclusive fields. At most one of the
  // fields will be set in a response:
  "gcsSource": {
    object (GcsSource)
  },
  "inlineSource": {
    object (InlineSource)
  }
  // End of mutually exclusive fields.
}
שדות
filter

string

חובה. מסננים את המסמכים התואמים למחיקה. הערך הנתמך היחיד כרגע הוא * (כל הפריטים).

errorConfig

object (PurgeErrorConfig)

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

force

boolean

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

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

object (GcsSource)

מיקום ב-Cloud Storage של תוכן הקלט. ערכים נתמכים dataSchema: * documentId: ערך Document.id תקין אחד בכל שורה.

inlineSource

object (InlineSource)

מקור מוטמע לתוכן הקלט של הטיהור.

סוף השדות הבלעדיים.

גוף התשובה

אם הפעולה בוצעה ללא שגיאות, גוף התגובה יכיל מופע של Operation.

היקפי הרשאות

נדרש אחד מהיקפי ההרשאות הבאים של OAuth:

  • https://www.googleapis.com/auth/cloud-platform
  • https://www.googleapis.com/auth/discoveryengine.readwrite
  • https://www.googleapis.com/auth/discoveryengine.serving.readwrite

ניתן למצוא מידע נוסף כאן: Authentication Overview.

הרשאות IAM

נדרשת הרשאת IAM הבאה במשאב parent:

  • discoveryengine.documents.purge

מידע נוסף מופיע במאמרי העזרה בנושא IAM.