Method: providers.tasks.batchCreate
HTTP 要求
POST https://fleetengine.googleapis.com/v1/{parent=providers/*}/tasks:batchCreate
這個網址使用 gRPC 轉碼語法。
路徑參數
參數 |
parent |
string
必要欄位。所有工作共用的父項資源。這個值必須採用 providers/{provider} 格式。provider 必須是 Google Cloud 專案 ID。例如 sample-cloud-project 。CreateTaskRequest 訊息中的父項欄位必須為空白,或與這個欄位相符。
|
要求主體
要求主體的資料會採用以下結構:
欄位 |
header |
object (DeliveryRequestHeader )
選用設定。標準 Delivery API 要求標頭。注意:如果您設定這個欄位,CreateTaskRequest 訊息中的標頭欄位必須為空白,或與這個欄位相符。
|
requests[] |
object (CreateTaskRequest )
必要欄位。指定要建立的資源要求訊息。注意:您最多只能建立 500 項工作。
|
回應主體
BatchCreateTask
回應訊息。
如果成功,回應主體會含有以下結構的資料:
JSON 表示法 |
{
"tasks": [
{
object (Task )
}
]
} |
欄位 |
tasks[] |
object (Task )
已建立的工作。
|
CreateTaskRequest
欄位 |
parent |
string
必要欄位。格式必須為 providers/{provider} 。provider 必須是 Google Cloud 專案 ID。例如:sample-cloud-project 。
|
taskId |
string
必要欄位。任務 ID 不得重複,但不應是運送追蹤 ID。如要儲存貨件追蹤 ID,請使用 trackingId 欄位。請注意,多個工作可使用相同的 trackingId 。工作 ID 有下列限制:
|
task |
object (Task )
必要欄位。要建立的 Task 實體。建立工作時,必須填入下列欄位:
type
state (必須設為 OPEN )
trackingId (請勿為 UNAVAILABLE 或 SCHEDULED_STOP 工作項設定,但其他工作項類型都需要設定)
plannedLocation (UNAVAILABLE 工作選用)
taskDuration
您可以選擇設定下列欄位:
targetTimeWindow
taskTrackingViewConfig
attributes
注意:系統會忽略 Task 的 name 欄位。請勿設定其他 Task 欄位,否則系統會傳回錯誤。
|
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-02-26 (世界標準時間)。
[null,null,["上次更新時間:2025-02-26 (世界標準時間)。"],[[["Creates up to 500 `Task` objects at once using the `BatchCreateTasks` method."],["Requires a `parent` resource in the URL path, indicating the Google Cloud Project ID."],["The request body includes an optional `header` and a required list of `requests`, each defining a `Task` to create."],["The response returns a list of created `Task` objects within the `tasks` field."],["Each individual `CreateTaskRequest` requires a `taskId`, `type`, `state`, `trackingId`, and other relevant fields depending on the task type."]]],["This document details how to create a batch of `Task` objects via a `POST` HTTP request to `https://fleetengine.googleapis.com/v1/{parent=providers/*}/tasks:batchCreate`. The `parent` path parameter is required and specifies the provider. The request body should contain a `header` and an array of `requests`, where each request includes a `CreateTaskRequest`. Each `CreateTaskRequest` requires a `parent`, `taskId`, and a `task` entity with specific fields. The response body returns an array of the created `Task` objects.\n"]]