Pull Request Statuses - Get
依識別碼取得特定的提取要求狀態。 狀態識別碼在所有反覆運算的提取要求內是唯一的。
GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/statuses/{statusId}?api-version=4.1-preview.1
URI 參數
| 名稱 | 位於 | 必要 | 類型 | Description |
|---|---|---|---|---|
|
organization
|
path | True |
string |
Azure DevOps 組織的名稱。 |
|
pull
|
path | True |
integer int32 |
提取要求的識別碼。 |
|
repository
|
path | True |
string |
提取要求目標分支的存放庫識別碼。 |
|
status
|
path | True |
integer int32 |
提取要求狀態的識別碼。 |
|
project
|
path |
string |
專案識別碼或專案名稱 |
|
|
api-version
|
query | True |
string |
要使用的 API 版本。 這應該設定為 '4.1-preview.1' 以使用此版本的 API。 |
回應
| 名稱 | 類型 | Description |
|---|---|---|
| 200 OK |
成功的作業 |
安全性
oauth2
類型:
oauth2
Flow:
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
範圍
| 名稱 | Description |
|---|---|
| vso.code | 授與讀取認可、變更集、分支和其他版本控制成品之原始程式碼和中繼資料的能力。 也授與透過服務勾點取得版本控制事件通知的能力。 |
| vso.code_status | 授與讀取和寫入認可和提取要求狀態的能力。 |
範例
範例要求
GET https://dev.azure.com/fabrikam/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/statuses/{statusId}?api-version=4.1-preview.1
範例回覆
{
"id": 1,
"state": "succeeded",
"description": "Sample status succeeded",
"context": {
"name": "sample-status-1",
"genre": "vsts-samples"
},
"creationDate": "2017-09-19T14:50:27.4949745Z",
"updatedDate": "2017-09-19T14:50:27.4949745Z",
"createdBy": {
"id": "6f168adb-59d4-4fc0-be3b-fb21b939b2a6",
"displayName": "Normal Paulk",
"uniqueName": "fabrikamfiber16@hotmail.com",
"url": "https://dev.azure.com/fabrikam/_apis/Identities/6f168adb-59d4-4fc0-be3b-fb21b939b2a6",
"imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=6f168adb-59d4-4fc0-be3b-fb21b939b2a6"
},
"targetUrl": "http://fabrikam-fiber-inc.com/CI/builds/1",
"_links": {
"self": {
"href": "https://dev.azure.com/fabrikam/_apis/git/repositories/b92c8408-a0c9-4292-88af-bc005a1b8272/pullRequests/5/statuses/1"
},
"repository": {
"href": "https://dev.azure.com/fabrikam/_apis/git/repositories/b92c8408-a0c9-4292-88af-bc005a1b8272"
}
}
}
定義
| 名稱 | Description |
|---|---|
|
Git |
這個類別包含服務/延伸模組張貼提取要求狀態的中繼資料。 狀態可以與提取要求或反復專案相關聯。 |
|
Git |
可唯一識別狀態的狀態內容。 |
|
Git |
狀態的狀態。 |
|
Identity |
|
|
Properties |
類別會將屬性包表示為索引鍵/值組的集合。 所有基本類型的值都會 (接受任何具有 |
|
Reference |
表示 REST 參考連結集合的類別。 |
GitPullRequestStatus
這個類別包含服務/延伸模組張貼提取要求狀態的中繼資料。 狀態可以與提取要求或反復專案相關聯。
| 名稱 | 類型 | Description |
|---|---|---|
| _links |
參考連結。 |
|
| context |
狀態的內容。 |
|
| createdBy |
建立狀態的身分識別。 |
|
| creationDate |
string |
狀態的建立日期和時間。 |
| description |
string |
狀態原因。 通常描述狀態的目前狀態。 |
| id |
integer |
狀態識別碼。 |
| iterationId |
integer |
要與狀態產生關聯之反復專案的識別碼。 最小值為 1。 |
| properties |
狀態的自訂屬性。 |
|
| state |
狀態的狀態。 |
|
| targetUrl |
string |
具有狀態詳細資料的 URL。 |
| updatedDate |
string |
狀態的上次更新日期和時間。 |
GitStatusContext
可唯一識別狀態的狀態內容。
| 名稱 | 類型 | Description |
|---|---|---|
| genre |
string |
狀態的內容類型。 通常產生狀態的服務/工具名稱可以是空的。 |
| name |
string |
狀態的名稱識別碼不可以是 Null 或空白。 |
GitStatusState
狀態的狀態。
| 值 | Description |
|---|---|
| error |
發生錯誤的狀態。 |
| failed |
狀態失敗。 |
| notApplicable |
狀態不適用於目標物件。 |
| notSet |
未設定狀態。 預設狀態。 |
| pending |
狀態擱置中。 |
| succeeded |
狀態成功。 |
IdentityRef
| 名稱 | 類型 | Description |
|---|---|---|
| _links |
此欄位包含有關圖表主旨的零個或多個有趣連結。 您可以叫用這些連結來取得其他關聯性,或取得此圖表主體的詳細資訊。 |
|
| descriptor |
string |
描述項是在系統執行時參考圖形主旨的主要方式。 此欄位可唯一識別帳戶和組織之間的相同圖表主旨。 |
| directoryAlias |
string |
|
| displayName |
string |
這是圖表主旨的非唯一顯示名稱。 若要變更此欄位,您必須在來源提供者中變更其值。 |
| id |
string |
|
| imageUrl |
string |
|
| inactive |
boolean |
|
| isAadIdentity |
boolean |
|
| isContainer |
boolean |
|
| profileUrl |
string |
|
| uniqueName |
string |
|
| url |
string |
此 URL 是此圖表主體來源資源的完整路由。 |
PropertiesCollection
類別會將屬性包表示為索引鍵/值組的集合。 所有基本類型的值都會 (接受任何具有 TypeCode != TypeCode.Object) DBNull 的型別。 Byte[]、Int32、Double、DateType 和 String 類型的值會保留其類型,其他基本類型則會重新調整為 String。 Byte[] 預期為 base64 編碼字串。
| 名稱 | 類型 | Description |
|---|---|---|
| count |
integer |
集合中的屬性計數。 |
| item |
object |
|
| keys |
string[] |
集合中的索引鍵集合。 |
| values |
string[] |
集合中的值集合。 |
ReferenceLinks
表示 REST 參考連結集合的類別。
| 名稱 | 類型 | Description |
|---|---|---|
| links |
object |
連結的唯讀檢視。 因為參考連結是唯讀的,所以我們只想要將它們公開為唯讀。 |