Branches - Get
获取给定路径上的单个分支层次结构,其中指定了父级或子级。
GET https://dev.azure.com/{organization}/{project}/_apis/tfvc/branches?path={path}&api-version=7.1
GET https://dev.azure.com/{organization}/{project}/_apis/tfvc/branches?path={path}&includeParent={includeParent}&includeChildren={includeChildren}&api-version=7.1
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
organization
|
path | True |
string |
Azure DevOps 组织的名称。 |
project
|
path |
string |
项目 ID 或项目名称 |
|
api-version
|
query | True |
string |
要使用的 API 版本。 这应设置为“7.1”才能使用此版本的 API。 |
path
|
query | True |
string |
分支的完整路径。 默认值:$/ 示例:$/、$/MyProject、$/MyProject/SomeFolder。 |
include
|
query |
boolean |
返回子分支(如果有)。 默认值:False |
|
include
|
query |
boolean |
返回父分支(如果有)。 默认值:False |
响应
名称 | 类型 | 说明 |
---|---|---|
200 OK |
成功作 |
安全性
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.code | 授予读取有关提交、更改集、分支和其他版本控制项目的源代码和元数据的能力。 此外,还可以通过服务挂钩搜索代码并获取有关版本控制事件的通知。 |
示例
GET a branch |
GET a branch with children |
GET a branch with deleted |
GET a branch with parents |
GET a branch
示例请求
GET https://dev.azure.com/fabrikam/_apis/tfvc/branches?path=$&api-version=7.1
示例响应
{
"path": "$/Fabrikam-Fiber-TFVC/AuthSample-dev",
"description": "",
"owner": {
"id": "8c8c7d32-6b1b-47f4-b2e9-30b477b5ab3d",
"displayName": "Chuck Reinhart",
"uniqueName": "fabrikamfiber3@hotmail.com"
},
"createdDate": "2014-03-24T16:46:48.253Z",
"relatedBranches": [],
"mappings": []
}
GET a branch with children
示例请求
GET https://dev.azure.com/fabrikam/_apis/tfvc/branches?path=$&includeChildren=true&api-version=7.1
示例响应
{
"_links": {
"self": {
"href": "https://dev.azure.com/fabrikam/_apis/tfvc/branches/%24/Fabrikam-Fiber-TFVC/AuthSample-Dev"
},
"childBranches": {
"href": "https://dev.azure.com/fabrikam/_apis/tfvc/branches/%24/Fabrikam-Fiber-TFVC/AuthSample%2bSpecial"
},
"owner": {
"href": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/8c8c7d32-6b1b-47f4-b2e9-30b477b5ab3d"
}
},
"path": "$/Fabrikam-Fiber-TFVC/AuthSample-dev",
"description": "",
"owner": {
"id": "8c8c7d32-6b1b-47f4-b2e9-30b477b5ab3d",
"displayName": "Chuck Reinhart",
"uniqueName": "fabrikamfiber3@hotmail.com",
"url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/8c8c7d32-6b1b-47f4-b2e9-30b477b5ab3d",
"imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=8c8c7d32-6b1b-47f4-b2e9-30b477b5ab3d"
},
"createdDate": "2014-03-24T16:46:48.253Z",
"url": "https://dev.azure.com/fabrikam/_apis/tfvc/branches/%24/Fabrikam-Fiber-TFVC/AuthSample-Dev",
"relatedBranches": [],
"mappings": [],
"children": [
{
"path": "$/Fabrikam-Fiber-TFVC/AuthSample+Special",
"description": "Branched from $/Fabrikam-Fiber-TFVC/AuthSample-dev",
"owner": {
"id": "8c8c7d32-6b1b-47f4-b2e9-30b477b5ab3d",
"displayName": "Chuck Reinhart",
"uniqueName": "fabrikamfiber3@hotmail.com",
"url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/8c8c7d32-6b1b-47f4-b2e9-30b477b5ab3d",
"imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=8c8c7d32-6b1b-47f4-b2e9-30b477b5ab3d"
},
"createdDate": "2014-03-24T16:52:10.407Z",
"relatedBranches": [],
"mappings": [],
"children": []
}
]
}
GET a branch with deleted
示例请求
GET https://dev.azure.com/fabrikam/_apis/tfvc/branches?api-version=7.1
示例响应
{
"path": "$/Fabrikam-Fiber-TFVC/MyBranch",
"description": "Branched from $/Fabrikam-Fiber-TFVC/AuthSample",
"owner": {
"id": "8c8c7d32-6b1b-47f4-b2e9-30b477b5ab3d",
"displayName": "Chuck Reinhart",
"uniqueName": "fabrikamfiber3@hotmail.com"
},
"createdDate": "2014-03-24T16:44:13.277Z",
"isDeleted": true,
"relatedBranches": [
{
"path": "$/Fabrikam-Fiber-TFVC/AuthSample"
}
],
"mappings": []
}
GET a branch with parents
示例请求
GET https://dev.azure.com/fabrikam/_apis/tfvc/branches?path=$&includeParent=true&api-version=7.1
示例响应
{
"path": "$/Fabrikam-Fiber-TFVC/AuthSample-dev",
"description": "",
"owner": {
"id": "8c8c7d32-6b1b-47f4-b2e9-30b477b5ab3d",
"displayName": "Chuck Reinhart",
"uniqueName": "fabrikamfiber3@hotmail.com"
},
"createdDate": "2014-03-24T16:46:48.253Z",
"parent": {
"path": "$/Fabrikam-Fiber-TFVC/AuthSample"
},
"relatedBranches": [],
"mappings": []
}
定义
名称 | 说明 |
---|---|
Identity |
|
Reference |
表示 REST 引用链接集合的类。 |
Tfvc |
表示分支对象的类。 |
Tfvc |
分支映射。 |
Tfvc |
这是浅分支引用类。 |
IdentityRef
名称 | 类型 | 说明 |
---|---|---|
_links |
此字段包含有关图形主题的零个或多个有趣的链接。 可以调用这些链接以获取有关此图形主题的其他关系或更详细的信息。 |
|
descriptor |
string |
描述符是在系统运行时引用图形主题的主要方法。 此字段将唯一标识帐户和组织中的同一图形主题。 |
directoryAlias |
string |
已弃用 - 可以通过查询 IdentityRef“_links”字典的“self”条目中引用的 Graph 用户来检索 |
displayName |
string |
这是图形主题的非唯一显示名称。 若要更改此字段,必须在源提供程序中更改其值。 |
id |
string |
|
imageUrl |
string |
已弃用 - 在 IdentityRef“_links”字典的“虚拟形象”条目中可用 |
inactive |
boolean |
已弃用 - 可以通过查询 GraphUser“_links”字典的“membershipState”条目中引用的 Graph 成员身份状态来检索 |
isAadIdentity |
boolean |
已弃用 - 可以从描述符的主题类型推断(Descriptor.IsAadUserType/Descriptor.IsAadGroupType) |
isContainer |
boolean |
已弃用 - 可以从描述符的主题类型推断(描述符.IsGroupType) |
isDeletedInOrigin |
boolean |
|
profileUrl |
string |
已弃用 - 不在 ToIdentityRef 的大多数预先存在的实现中使用 |
uniqueName |
string |
已弃用 - 请改用 Domain+PrincipalName |
url |
string |
此 URL 是指向此图形主题的源资源的完整路由。 |
ReferenceLinks
表示 REST 引用链接集合的类。
名称 | 类型 | 说明 |
---|---|---|
links |
object |
链接的只读视图。 由于引用链接是只读的,因此我们只想将其公开为只读链接。 |
TfvcBranch
表示分支对象的类。
名称 | 类型 | 说明 |
---|---|---|
_links |
REST 引用链接的集合。 |
|
children |
分支的子级列表。 |
|
createdDate |
string (date-time) |
分支的创建日期。 |
description |
string |
分支说明。 |
isDeleted |
boolean |
是否删除了分支? |
mappings |
分支映射列表。 |
|
owner |
用户的别名或显示名称 |
|
parent |
分支的父级的路径。 |
|
path |
string |
分支的路径。 |
relatedBranches |
相关分支的路径列表。 |
|
url |
string |
用于检索项的 URL。 |
TfvcBranchMapping
分支映射。
名称 | 类型 | 说明 |
---|---|---|
depth |
string |
分支的深度。 |
serverItem |
string |
分支的服务器项。 |
type |
string |
分支的类型。 |
TfvcShallowBranchRef
这是浅分支引用类。
名称 | 类型 | 说明 |
---|---|---|
path |
string |
分支的路径。 |