Package google.longrunning
作業
這個資源表示屬於網路 API 呼叫結果的長時間執行作業。
欄位 |
name |
string
伺服器指派的名稱,而且只在當初傳回這個名稱的服務中是唯一的。如果您使用預設的 HTTP 對應,則 name 應為以 operations/{unique_id} 結尾的資源名稱。
|
metadata |
Any
服務專屬,且與該作業相關聯的中繼資料,通常包含進度資訊和常用中繼資料 (例如建立時間)。部分服務可能不會提供這類中繼資料。凡是會傳回長時間執行作業的方法,都應記錄中繼資料類型 (如果有的話)。
|
done |
bool
如果值為 false ,代表作業仍在執行中。如果值為 true ,則表示作業已完成,並會顯示 error 或 response 。
|
聯集欄位 result 。這是作業的執行結果,可能為 error ,或是有效的 response 。如果 done == false ,系統不會將結果設定為 error ,也不會設定為 response 。如果 done == true ,則可以設定 error 或 response 其中之一。部分服務可能無法提供結果。result 只能是下列其中一個設定: |
error |
Status
作業失敗或取消時顯示的錯誤結果。
|
response |
Any
作業的一般成功回應。如果原始方法在執行成功時沒有傳回資料 (例如 Delete ),則回應為 google.protobuf.Empty 。如果原始方法是標準的 Get /Create /Update ,回應則應該為資源。如果是其他方法,回應必須包含類型 XxxResponse ,其中 Xxx 是原始方法的名稱。舉例來說,如果原始方法的名稱為 TakeSnapshot() ,您就能推測出回應類型應該是 TakeSnapshotResponse 。
|
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2023-12-01 (世界標準時間)。
[null,null,["上次更新時間:2023-12-01 (世界標準時間)。"],[[["The `Operation` resource represents a long-running operation initiated by a network API call."],["Each operation has a unique name, metadata (often with progress information), and a status indicating if it's done."],["Upon completion (`done` is `true`), an operation provides either an `error` or a `response` indicating the outcome."],["The `response` field contains the operation's result, which varies depending on the original API method called."]]],["A long-running network API call is represented by an \"Operation\" resource. This resource includes a unique `name`, service-specific `metadata` about progress, and a `done` status flag. Upon completion (`done` is true), the `result` field will contain either an `error` status or a successful `response`. If the operation is in progress (`done` is false) `result` will not be set. The `response` contains data if it was a successful operation.\n"]]