Properties - Update Build Properties

更新生成的属性。

PATCH https://dev.azure.com/{organization}/{project}/_apis/build/builds/{buildId}/properties?api-version=7.1

URI 参数

名称 必需 类型 说明
buildId
path True

integer (int32)

生成的 ID。

organization
path True

string

Azure DevOps 组织的名称。

project
path True

string

项目 ID 或项目名称

api-version
query True

string

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

请求正文

Media Types: "application/json-patch+json"

名称 类型 说明
from

string

要从中复制移动/复制作的路径。

op

Operation

修补作

path

string

作的路径。 对于数组,可以使用从零开始的索引来指定数组中的位置(例如 /biscuits/0/name)。 可以使用“-”字符而不是索引插入数组末尾(例如 /biscuits/-)。

value

object

作的值。 这是基元或 JToken。

响应

名称 类型 说明
200 OK

PropertiesCollection

成功作

安全性

oauth2

类型: oauth2
流向: accessCode
授权 URL: https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
令牌 URL: https://app.vssps.visualstudio.com/oauth2/token?client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer&grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer

作用域

名称 说明
vso.build_execute 授予访问生成项目(包括生成结果、定义和请求)以及排队生成、更新生成属性的功能,以及通过服务挂钩接收有关生成事件的通知的能力。

定义

名称 说明
JsonPatchDocument

JSON 修补作的 JSON 模型

Operation

修补作

PropertiesCollection

类将属性包表示为键值对的集合。 接受除 DBNull 以外的所有基元类型(具有 TypeCode != TypeCode.Object的任何类型)的值。 Byte[]、Int32、Double、DateType 和 String 类型的值将保留其类型,其他基元将重新调整为 String。 Byte[] 应为 base64 编码字符串。

JsonPatchDocument

JSON 修补作的 JSON 模型

名称 类型 说明
from

string

要从中复制移动/复制作的路径。

op

Operation

修补作

path

string

作的路径。 对于数组,可以使用从零开始的索引来指定数组中的位置(例如 /biscuits/0/name)。 可以使用“-”字符而不是索引插入数组末尾(例如 /biscuits/-)。

value

object

作的值。 这是基元或 JToken。

Operation

修补作

说明
add
copy
move
remove
replace
test

PropertiesCollection

类将属性包表示为键值对的集合。 接受除 DBNull 以外的所有基元类型(具有 TypeCode != TypeCode.Object的任何类型)的值。 Byte[]、Int32、Double、DateType 和 String 类型的值将保留其类型,其他基元将重新调整为 String。 Byte[] 应为 base64 编码字符串。

名称 类型 说明
count

integer (int32)

集合中的属性计数。

item

object

keys

string[]

集合中的键集。

values

string[]

集合中的值集。