Import Requests - Get
检索特定的导入请求。
GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/importRequests/{importRequestId}?api-version=7.1
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
import
|
path | True |
integer (int32) |
导入请求的唯一标识符。 |
organization
|
path | True |
string |
Azure DevOps 组织的名称。 |
project
|
path | True |
string |
项目 ID 或项目名称 |
repository
|
path | True |
string |
存储库的名称或 ID。 |
api-version
|
query | True |
string |
要使用的 API 版本。 这应设置为“7.1”才能使用此版本的 API。 |
响应
名称 | 类型 | 说明 |
---|---|---|
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 https://dev.azure.com/fabrikam/Test/_apis/git/repositories/0eb02d2e-fff9-4990-bd45-2f7503f5aae5/importRequests/2?api-version=7.1
示例响应
{
"importRequestId": 2,
"repository": {
"id": "0eb02d2e-fff9-4990-bd45-2f7503f5aae5",
"name": "EmptyGitRepo",
"url": "https://dev.azure.com/fabrikam/_apis/git/repositories/0eb02d2e-fff9-4990-bd45-2f7503f5aae5",
"project": {
"id": "5745879a-8531-41c3-9ed3-ae7fc07309ff",
"name": "Test",
"url": "https://dev.azure.com/fabrikam/_apis/projects/5745879a-8531-41c3-9ed3-ae7fc07309ff",
"state": "wellFormed",
"revision": 7
},
"remoteUrl": "https://dev.azure.com/fabrikam/Test/_git/EmptyGitRepo"
},
"parameters": {
"gitSource": {
"url": "https://github.com/Microsoft/vsts-agent.git"
}
},
"status": "queued",
"detailedStatus": {
"currentStep": 1,
"allSteps": [
"Processing request",
"Analyzing repository objects",
"Storing objects",
"Storing index file",
"Updating references",
"Import completed successfully"
]
},
"_links": {
"self": {
"href": "https://dev.azure.com/fabrikam/Test/_apis/git/repositories/0eb02d2e-fff9-4990-bd45-2f7503f5aae5/importRequests/2"
},
"repository": {
"href": "https://dev.azure.com/fabrikam/_apis/git/repositories/0eb02d2e-fff9-4990-bd45-2f7503f5aae5"
}
},
"url": "https://dev.azure.com/fabrikam/Test/_apis/git/repositories/0eb02d2e-fff9-4990-bd45-2f7503f5aae5/importRequests/2"
}
定义
名称 | 说明 |
---|---|
Git |
|
Git |
源为 Git 版本控制时创建 git 导入请求的参数 |
Git |
从远程源代码管理系统导入数据的请求。 |
Git |
用于创建导入请求的参数 |
Git |
有关导入请求的其他状态信息。 |
Git |
当源为 tfvc 版本控制时创建 git 导入请求的参数 |
Git |
|
Git |
|
Project |
项目状态。 |
Project |
项目可见性。 |
Reference |
表示 REST 引用链接集合的类。 |
Team |
TeamProjectCollection 的引用对象。 |
Team |
表示对 TeamProject 的浅表引用。 |
GitAsyncOperationStatus
值 | 说明 |
---|---|
abandoned |
该作已被放弃。 |
completed |
作已完成。 |
failed |
作失败。 检查是否有错误消息。 |
inProgress |
该作当前正在进行中。 |
queued |
该作正在队列中等待,但尚未启动。 |
GitImportGitSource
源为 Git 版本控制时创建 git 导入请求的参数
名称 | 类型 | 说明 |
---|---|---|
overwrite |
boolean |
指示此请求是否为同步请求 |
url |
string |
源存储库的 URL |
GitImportRequest
从远程源代码管理系统导入数据的请求。
名称 | 类型 | 说明 |
---|---|---|
_links |
指向相关资源的链接。 |
|
detailedStatus |
导入的详细状态,包括当前步骤和错误消息(如果适用)。 |
|
importRequestId |
integer (int32) |
此导入请求的唯一标识符。 |
parameters |
用于创建导入请求的参数。 |
|
repository |
此导入的目标存储库。 |
|
status |
导入的当前状态。 |
|
url |
string |
指向此导入请求资源的链接。 |
GitImportRequestParameters
用于创建导入请求的参数
名称 | 类型 | 说明 |
---|---|---|
deleteServiceEndpointAfterImportIsDone |
boolean |
导入完成后删除服务终结点的选项 |
gitSource |
导入 git 存储库的源 |
|
serviceEndpointId |
string (uuid) |
用于连接到外部终结点的服务终结点 |
tfvcSource |
导入 tfvc 存储库的源 |
GitImportStatusDetail
有关导入请求的其他状态信息。
名称 | 类型 | 说明 |
---|---|---|
allSteps |
string[] |
导入过程的所有有效步骤 |
currentStep |
integer (int32) |
为当前步骤编制索引到 AllSteps |
errorMessage |
string |
如果作失败,则显示错误消息。 |
GitImportTfvcSource
当源为 tfvc 版本控制时创建 git 导入请求的参数
名称 | 类型 | 说明 |
---|---|---|
importHistory |
boolean |
将 true 设置为导入历史记录,否则为 false |
importHistoryDurationInDays |
integer (int32) |
获取过去 n 天的历史记录(允许的最大值为 180 天) |
path |
string |
要导入的路径(可从资源管理器中的路径控件复制) |
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 |
ProjectState
项目状态。
值 | 说明 |
---|---|
all |
所有项目,无论状态如何,都已删除。 |
createPending |
项目已排队创建,但该过程尚未启动。 |
deleted |
项目已被删除。 |
deleting |
项目正在删除。 |
new |
正在创建项目。 |
unchanged |
项目尚未更改。 |
wellFormed |
项目已完全创建并可供使用。 |
ProjectVisibility
项目可见性。
值 | 说明 |
---|---|
private |
只有具有显式访问权限的用户才能看到该项目。 |
public |
项目对所有人可见。 |
ReferenceLinks
表示 REST 引用链接集合的类。
名称 | 类型 | 说明 |
---|---|---|
links |
object |
链接的只读视图。 由于引用链接是只读的,因此我们只想将其公开为只读链接。 |
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 |
项目可见性。 |