Logs - Append Log Content
將記錄附加至工作的記錄檔。 記錄應該以 TaskLog 對象數據流的形式傳送到要求主體中。
POST https://dev.azure.com/{organization}/{scopeIdentifier}/_apis/distributedtask/hubs/{hubName}/plans/{planId}/logs/{logId}?api-version=7.1
URI 參數
名稱 | 位於 | 必要 | 類型 | Description |
---|---|---|---|---|
hub
|
path | True |
string |
伺服器中樞的名稱。 常見範例:“build”、“rm”、“checks” |
log
|
path | True |
integer (int32) |
記錄檔的標識碼。 |
organization
|
path | True |
string |
Azure DevOps 組織的名稱。 |
plan
|
path | True |
string (uuid) |
方案的標識碼。 |
scope
|
path | True |
string (uuid) |
要設定要求範圍的專案 GUID |
api-version
|
query | True |
string |
要使用的 API 版本。 這應該設定為 『7.1』 以使用此版本的 API。 |
要求本文
Media Types: "application/octet-stream"
名稱 | 類型 | Description |
---|---|---|
body |
string (Stream) |
要上傳的串流 |
回應
名稱 | 類型 | Description |
---|---|---|
200 OK |
成功作業 |
安全性
accessToken
個人存取令牌。 針對使用者名稱和令牌使用任何值做為密碼。
類型:
basic
範例
Append content to a log
範例要求
POST https://dev.azure.com/{organization}/{scopeIdentifier}/_apis/distributedtask/hubs/{hubName}/plans/{planId}/logs/{logId}?api-version=7.1
範例回覆
{
"path": "logs\\5e6d5dbf-ac69-5f56-8b85-8e9038703a8b",
"lineCount": 36,
"createdOn": "2022-12-02T09:33:14.873Z",
"lastChangedOn": "2022-12-02T09:49:22.097Z",
"id": 3,
"location": null
}
定義
TaskLog
聯機到時間軸記錄的工作記錄。
名稱 | 類型 | Description |
---|---|---|
createdOn |
string (date-time) |
工作記錄建立的時間。 |
id |
integer (int32) |
工作記錄檔的標識碼。 |
indexLocation |
string |
編製索引時工作記錄檔的 REST URL。 |
lastChangedOn |
string (date-time) |
工作記錄檔上次修改的時間。 |
lineCount |
integer (int64) |
工作記錄行的數目。 |
location |
string |
工作記錄的 REST URL。 |
path |
string |
工作記錄檔的路徑。 |