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 参数

名称 必需 类型 说明
hubName
path True

string

服务器中心的名称。 常见示例:“build”、“rm”、“checks”

logId
path True

integer (int32)

日志的 ID。

organization
path True

string

Azure DevOps 组织的名称。

planId
path True

string (uuid)

计划的 ID。

scopeIdentifier
path True

string (uuid)

用于限定请求范围的项目 GUID

api-version
query True

string

要使用的 API 版本。 这应设置为“7.1”才能使用此版本的 API。

请求正文

Media Types: "application/octet-stream"

名称 类型 说明
body

string (Stream)

要上传的流

响应

名称 类型 说明
200 OK

TaskLog

成功作

安全性

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

连接到时间线记录的任务日志。

名称 类型 说明
createdOn

string (date-time)

创建任务日志的时间。

id

integer (int32)

任务日志的 ID。

indexLocation

string

索引时任务日志的 REST URL。

lastChangedOn

string (date-time)

上次修改任务日志的时间。

lineCount

integer (int64)

任务日志行数。

location

string

任务日志的 REST URL。

path

string

任务日志的路径。