REST Resource: projects.databases.operations

資源:操作

此資源表示長時間運行的操作,該操作是網路 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}結尾的資源名稱。

metadata

object

與操作關聯的特定於服務的元資料。它通常包含進度資訊和通用元數據,例如建立時間。某些服務可能不提供此類元資料。任何傳回長時間運行操作的方法都應記錄元資料類型(如果有)。

包含任意類型欄位的物件。附加欄位"@type"包含標識類型的 URI。範例: { "id": 1234, "@type": "types.example.com/standard/id" }

done

boolean

如果值為false ,則表示操作仍在進行中。如果true ,則操作完成,且errorresponse可用。

聯盟場result 。操作結果,可以是error ,也可以是有效response 。如果done == false ,則不會設定errorresponse 。如果done == true ,則可以設定errorresponse之一。某些服務可能無法提供結果。 result只能是以下之一:
error

object ( Status )

失敗或取消時操作的錯誤結果。

response

object

操作正常、成功的回應。如果原始方法未傳回成功資料(例如Delete ,則回應為google.protobuf.Empty 。如果原始方法是標準Get / Create / Update ,則回應應該是資源。對於其他方法,回應應具有類型XxxResponse ,其中Xxx是原始方法名稱。例如,如果原始方法名稱為TakeSnapshot() ,則推斷的回應類型為TakeSnapshotResponse

包含任意類型欄位的物件。附加欄位"@type"包含標識類型的 URI。範例: { "id": 1234, "@type": "types.example.com/standard/id" }

方法

cancel

開始對長時間運行的操作進行非同步取消。

delete

刪除長時間運行的操作。

get

取得長時間運行的操作的最新狀態。

list

列出與請求中指定過濾器相符的操作。