Pushes - Get
检索特定推送。
GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/pushes/{pushId}?api-version=7.1
GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/pushes/{pushId}?includeCommits={includeCommits}&includeRefUpdates={includeRefUpdates}&api-version=7.1
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
organization
|
path | True |
string |
Azure DevOps 组织的名称。 |
|
push
|
path | True |
integer (int32) |
推送的 ID。 |
|
repository
|
path | True |
string |
存储库的名称或 ID。 |
|
project
|
path |
string |
项目 ID 或项目名称 |
|
|
api-version
|
query | True |
string |
要使用的 API 版本。 这应设置为“7.1”才能使用此版本的 API。 |
|
include
|
query |
integer (int32) |
要包含在结果中的提交数。 |
|
|
include
|
query |
boolean |
如果为 true,请包含推送更新的 refs 列表。 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 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 | 授予读取有关提交、更改集、分支和其他版本控制项目的源代码和元数据的能力。 此外,还可以通过服务挂钩搜索代码并获取有关版本控制事件的通知。 |
示例
Just the push
示例请求
GET https://dev.azure.com/fabrikam/_apis/git/repositories/278d5cd2-584d-4b63-824a-2ba458937249/pushes/23?api-version=7.1
示例响应
{
"commits": [],
"pushedBy": {
"id": "d6245f20-2af8-44f4-9451-8107cb2767db",
"displayName": "Normal Paulk",
"uniqueName": "fabrikamfiber16@hotmail.com",
"url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/d6245f20-2af8-44f4-9451-8107cb2767db",
"imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=d6245f20-2af8-44f4-9451-8107cb2767db"
},
"pushId": 23,
"date": "2014-06-30T18:11:18.0929091Z",
"url": "https://dev.azure.com/fabrikam/_apis/git/repositories/278d5cd2-584d-4b63-824a-2ba458937249/pushes/23",
"_links": {
"self": {
"href": "https://dev.azure.com/fabrikam/_apis/git/repositories/278d5cd2-584d-4b63-824a-2ba458937249/pushes/23"
},
"repository": {
"href": "https://dev.azure.com/fabrikam/_apis/git/repositories/278d5cd2-584d-4b63-824a-2ba458937249"
},
"commits": {
"href": "https://dev.azure.com/fabrikam/_apis/git/repositories/278d5cd2-584d-4b63-824a-2ba458937249/pushes/23/commits"
},
"pusher": {
"href": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/d6245f20-2af8-44f4-9451-8107cb2767db"
}
}
}
定义
| 名称 | 说明 |
|---|---|
|
Change |
|
|
Git |
|
|
Git |
提供描述 Git 提交和关联元数据的属性。 |
|
Git |
|
|
Git |
|
|
Git |
|
|
Git |
|
|
Git |
|
|
Git |
此类包含发布状态的服务/扩展的元数据。 |
|
Git |
唯一标识状态的状态上下文。 |
|
Git |
状态。 |
|
Git |
|
|
Git |
Git作的用户信息和日期。 |
|
Identity |
|
|
Item |
|
|
Item |
|
|
Project |
项目状态。 |
|
Project |
项目可见性。 |
|
Reference |
表示 REST 引用链接集合的类。 |
|
Resource |
|
|
Team |
TeamProjectCollection 的引用对象。 |
|
Team |
表示对 TeamProject 的浅表引用。 |
|
Version |
对项所做的更改的类型。 |
ChangeCountDictionary
GitChange
| 名称 | 类型 | 说明 |
|---|---|---|
| changeId |
integer (int32) |
更改组中更改的 ID。 |
| changeType |
对项所做的更改的类型。 |
|
| item |
string (T) |
当前版本。 |
| newContent |
更改后项的内容。 |
|
| newContentTemplate |
推送新更改时要使用的新内容模板。 |
|
| originalPath |
string |
项目的原始路径(如果与当前路径不同)。 |
| sourceServerItem |
string |
服务器上的项的路径。 |
| url |
string |
用于检索项的 URL。 |
GitCommitRef
提供描述 Git 提交和关联元数据的属性。
| 名称 | 类型 | 说明 |
|---|---|---|
| _links |
相关 REST 引用链接的集合。 |
|
| author |
提交作者。 |
|
| changeCounts |
提交中包含的更改类型(编辑、删除等)的计数。 |
|
| changes |
提交中包含的更改的枚举。 |
|
| comment |
string |
提交注释或消息。 |
| commentTruncated |
boolean |
指示注释是否从完整的 Git 提交注释消息中截断。 |
| commitId |
string |
提交的 ID (SHA-1)。 |
| commitTooManyChanges |
boolean |
指示提交包含过多的更改无法显示 |
| committer |
提交者。 |
|
| parents |
string[] |
此提交的父提交 ID 的枚举。 |
| push |
与此提交关联的推送。 |
|
| remoteUrl |
string |
提交远程 URL 路径。 |
| statuses |
服务和扩展中的状态元数据列表,这些元数据可能会将其他信息与提交相关联。 |
|
| url |
string |
此资源的 REST URL。 |
| workItems |
与此提交关联的工作项列表。 |
GitPush
| 名称 | 类型 | 说明 |
|---|---|---|
| _links |
表示 REST 引用链接集合的类。 |
|
| commits |
提供描述 Git 提交和关联元数据的属性。 |
|
| date |
string (date-time) |
|
| pushId |
integer (int32) |
|
| pushedBy | ||
| refUpdates | ||
| repository | ||
| url |
string |
GitPushRef
| 名称 | 类型 | 说明 |
|---|---|---|
| _links |
表示 REST 引用链接集合的类。 |
|
| date |
string (date-time) |
|
| pushId |
integer (int32) |
|
| pushedBy | ||
| url |
string |
GitRefUpdate
| 名称 | 类型 | 说明 |
|---|---|---|
| isLocked |
boolean |
|
| name |
string |
|
| newObjectId |
string |
|
| oldObjectId |
string |
|
| repositoryId |
string (uuid) |
GitRepository
| 名称 | 类型 | 说明 |
|---|---|---|
| _links |
表示 REST 引用链接集合的类。 |
|
| defaultBranch |
string |
|
| id |
string (uuid) |
|
| isDisabled |
boolean |
如果禁用存储库,则为 True。 否则为 False。 |
| isFork |
boolean |
如此 如果存储库创建为分叉。 |
| isInMaintenance |
boolean |
如此 如果存储库处于维护状态。 否则为 False。 |
| name |
string |
|
| parentRepository | ||
| project |
表示对 TeamProject 的浅表引用。 |
|
| remoteUrl |
string |
|
| size |
integer (int64) |
存储库的压缩大小(字节)。 |
| sshUrl |
string |
|
| url |
string |
|
| validRemoteUrls |
string[] |
|
| webUrl |
string |
GitRepositoryRef
| 名称 | 类型 | 说明 |
|---|---|---|
| collection |
此分支所在的团队项目集合 |
|
| id |
string (uuid) |
|
| isFork |
boolean |
如此 如果存储库创建为分叉 |
| name |
string |
|
| project |
表示对 TeamProject 的浅表引用。 |
|
| remoteUrl |
string |
|
| sshUrl |
string |
|
| url |
string |
GitStatus
此类包含发布状态的服务/扩展的元数据。
| 名称 | 类型 | 说明 |
|---|---|---|
| _links |
参考链接。 |
|
| context |
状态的上下文。 |
|
| createdBy |
创建状态的标识。 |
|
| creationDate |
string (date-time) |
状态的创建日期和时间。 |
| description |
string |
状态说明。 通常描述状态的当前状态。 |
| id |
integer (int32) |
状态标识符。 |
| state |
状态。 |
|
| targetUrl |
string |
包含状态详细信息的 URL。 |
| updatedDate |
string (date-time) |
状态的上次更新日期和时间。 |
GitStatusContext
唯一标识状态的状态上下文。
| 名称 | 类型 | 说明 |
|---|---|---|
| genre |
string |
状态的流派。 通常,生成状态的服务/工具的名称可以为空。 |
| name |
string |
状态的名称标识符不能为 null 或为空。 |
GitStatusState
状态。
| 值 | 说明 |
|---|---|
| error |
状态,出现错误。 |
| failed |
状态失败。 |
| notApplicable |
状态不适用于目标对象。 |
| notSet |
未设置状态。 默认状态。 |
| pending |
状态挂起。 |
| succeeded |
状态成功。 |
GitTemplate
| 名称 | 类型 | 说明 |
|---|---|---|
| name |
string |
模板的名称 |
| type |
string |
模板的类型 |
GitUserDate
Git作的用户信息和日期。
| 名称 | 类型 | 说明 |
|---|---|---|
| date |
string (date-time) |
Git作的日期。 |
|
string |
执行 Git作的用户的电子邮件地址。 |
|
| imageUrl |
string |
用户的头像的 URL。 |
| name |
string |
执行 Git作的用户的名称。 |
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 是指向此图形主题的源资源的完整路由。 |
ItemContent
| 名称 | 类型 | 说明 |
|---|---|---|
| content |
string |
|
| contentType |
ItemContentType
| 值 | 说明 |
|---|---|
| base64Encoded | |
| rawText |
ProjectState
项目状态。
| 值 | 说明 |
|---|---|
| all |
所有项目,无论状态如何,都已删除。 |
| createPending |
项目已排队创建,但该过程尚未启动。 |
| deleted |
项目已被删除。 |
| deleting |
项目正在删除。 |
| new |
正在创建项目。 |
| unchanged |
项目尚未更改。 |
| wellFormed |
项目已完全创建并可供使用。 |
ProjectVisibility
项目可见性。
| 值 | 说明 |
|---|---|
| private |
只有具有显式访问权限的用户才能看到该项目。 |
| public |
项目对所有人可见。 |
ReferenceLinks
表示 REST 引用链接集合的类。
| 名称 | 类型 | 说明 |
|---|---|---|
| links |
object |
链接的只读视图。 由于引用链接是只读的,因此我们只想将其公开为只读链接。 |
ResourceRef
| 名称 | 类型 | 说明 |
|---|---|---|
| id |
string |
|
| url |
string |
TeamProjectCollectionReference
TeamProjectCollection 的引用对象。
| 名称 | 类型 | 说明 |
|---|---|---|
| avatarUrl |
string |
集合头像 URL。 |
| id |
string (uuid) |
集合 ID。 |
| name |
string |
集合名称。 |
| url |
string |
集合 REST URL。 |
TeamProjectReference
表示对 TeamProject 的浅表引用。
| 名称 | 类型 | 说明 |
|---|---|---|
| abbreviation |
string |
项目缩写。 |
| defaultTeamImageUrl |
string |
指向默认团队标识映像的 URL。 |
| description |
string |
项目的说明(如果有)。 |
| id |
string (uuid) |
项目标识符。 |
| lastUpdateTime |
string (date-time) |
上次更新时间的项目。 |
| name |
string |
项目名称。 |
| revision |
integer (int64) |
项目修订。 |
| state |
项目状态。 |
|
| url |
string |
指向对象完整版本的 URL。 |
| visibility |
项目可见性。 |
VersionControlChangeType
对项所做的更改的类型。
| 值 | 说明 |
|---|---|
| add | |
| all | |
| branch | |
| delete | |
| edit | |
| encoding | |
| lock | |
| merge | |
| none | |
| property | |
| rename | |
| rollback | |
| sourceRename | |
| targetRename | |
| undelete |