המשאב הזה מייצג פעולה ממושכת שהיא תוצאה של קריאה ל-API ברשת.
ייצוג JSON
{"name": string,"metadata": {"@type": string,field1: ...,...},"done": boolean,// Union field result can be only one of the following:"error": {object (Status)},"response": {"@type": string,field1: ...,...}// End of list of possible types for union field result.}
שדות
name
string
השם שמוקצה על ידי השרת, שהוא ייחודי באותו שירות שהחזיר אותו במקור. אם משתמשים במיפוי ה-HTTP שמוגדר כברירת מחדל, name צריך להיות שם משאב שמסתיים ב-operations/{unique_id}.
אובייקט שמכיל שדות מסוג שרירותי. שדה נוסף "@type" מכיל URI המזהה את הסוג. לדוגמה: { "id": 1234, "@type": "types.example.com/standard/id" }.
done
boolean
אם הערך הוא false, המשמעות היא שהפעולה עדיין מתבצעת. אם הערך הוא true, הפעולה הושלמה ואפשר להזין error או response.
שדה איחוד result. תוצאת הפעולה, שיכולה להיות error או response חוקית. אם done == false, לא מוגדר error וגם response. אם done == true, אפשר להגדיר בדיוק אחד מהערכים error או response. יכול להיות ששירותים מסוימים לא יספקו את התוצאה. result יכול להיות רק אחת מהאפשרויות הבאות:
אובייקט שמכיל שדות מסוג שרירותי. שדה נוסף "@type" מכיל URI המזהה את הסוג. לדוגמה: { "id": 1234, "@type": "types.example.com/standard/id" }.
סטטוס
הסוג Status מגדיר מודל שגיאות לוגי שמתאים לסביבות תכנות שונות, כולל ממשקי API ל-REST וממשקי API ל-RPC. הוא נמצא בשימוש של gRPC. כל הודעת Status מכילה שלושה נתונים: קוד שגיאה, הודעת שגיאה ופרטי שגיאה.
במדריך לעיצוב API אפשר לקרוא מידע נוסף על מודל השגיאות הזה ולהבין איך לעבוד איתו.
קוד הסטטוס, שצריך להיות ערך enum של google.rpc.Code.
message
string
הודעת שגיאה שמיועדת למפתחים וצריכה להיות באנגלית. כל הודעת שגיאה שמוצגת למשתמשים צריכה להיות מותאמת לשוק המקומי ולשלוח אותה בשדה google.rpc.Status.details או להתאים אותה לשוק המקומי.
details[]
object
רשימה של הודעות שכוללות את פרטי השגיאה. יש כמה סוגים של הודעות שאפשר להשתמש בהם בממשקי API.
אובייקט שמכיל שדות מסוג שרירותי. שדה נוסף "@type" מכיל URI המזהה את הסוג. לדוגמה: { "id": 1234, "@type": "types.example.com/standard/id" }.
[[["התוכן קל להבנה","easyToUnderstand","thumb-up"],["התוכן עזר לי לפתור בעיה","solvedMyProblem","thumb-up"],["סיבה אחרת","otherUp","thumb-up"]],[["חסרים לי מידע או פרטים","missingTheInformationINeed","thumb-down"],["התוכן מורכב מדי או עם יותר מדי שלבים","tooComplicatedTooManySteps","thumb-down"],["התוכן לא עדכני","outOfDate","thumb-down"],["בעיה בתרגום","translationIssue","thumb-down"],["בעיה בדוגמאות/בקוד","samplesCodeIssue","thumb-down"],["סיבה אחרת","otherDown","thumb-down"]],["עדכון אחרון: 2024-08-29 (שעון UTC)."],[[["This content defines the `Operation` resource, representing a long-running operation resulting from a network API call."],["The `Operation` resource includes fields like `name`, `metadata`, and `done`, along with a union field `result` that can be either an `error` or a `response`."],["The `Status` resource defines a logical error model for APIs, including error `code`, `message`, and `details`."],["The provided methods for working with operations are limited to `get`, which allows retrieval of the latest state of a long running operation."]]],["The content details two key components: `Operation` and `Status`. `Operation` represents a long-running API task, identified by a unique `name`. It tracks progress with a `done` boolean and provides either an `error` or `response` upon completion. `Status` defines the error model, containing an error `code`, `message`, and detailed `details`. The method described allows for getting the latest state of a long-running `operation`.\n"]]