Pull Request Statuses - Create
pull request 状態を作成します。
状態に必要なフィールドは、 Context.Name 状態を一意に識別することだけです。
要求本文で iterationId を指定して、イテレーションに状態を投稿できることに注意してください。
POST https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/statuses?api-version=4.1-preview.1
URI パラメーター
| 名前 | / | 必須 | 型 | 説明 |
|---|---|---|---|---|
|
organization
|
path | True |
string |
Azure DevOps 組織の名前です。 |
|
pull
|
path | True |
integer int32 |
pull request の ID。 |
|
repository
|
path | True |
string |
pull request のターゲット ブランチのリポジトリ ID。 |
|
project
|
path |
string |
プロジェクト ID またはプロジェクト名 |
|
|
api-version
|
query | True |
string |
使う API のバージョン。 このバージョンの API を使用するには、これを '4.1-preview.1' に設定する必要があります。 |
要求本文
| 名前 | 型 | 説明 |
|---|---|---|
| _links |
参照リンク。 |
|
| context |
状態のコンテキスト。 |
|
| createdBy |
状態を作成した ID。 |
|
| creationDate |
string |
状態の作成日時。 |
| description |
string |
状態の説明。 通常、状態の現在の状態について説明します。 |
| id |
integer |
状態識別子。 |
| iterationId |
integer |
状態を関連付けるイテレーションの ID。 最大値は 1 です。 |
| properties |
状態のカスタム プロパティ。 |
|
| state |
状態の状態。 |
|
| targetUrl |
string |
状態の詳細を含む URL。 |
| updatedDate |
string |
状態の最終更新日時。 |
応答
| 名前 | 型 | 説明 |
|---|---|---|
| 200 OK |
正常な操作 |
セキュリティ
oauth2
型:
oauth2
フロー:
accessCode
Authorization URL (承認 URL):
https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
Token URL (トークン 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_write | ソース コードの読み取り、更新、削除、コミット、変更セット、ブランチ、およびその他のバージョン管理成果物に関するメタデータへのアクセスを許可します。 また、pull request とコード レビューを作成および管理したり、サービス フックを介してバージョン管理イベントに関する通知を受信したりすることもできます。 |
| vso.code_status | コミットとプル要求の状態を読み書きする機能を付与します。 |
例
| On iteration |
| On pull request |
| With properties |
On iteration
要求のサンプル
POST https://dev.azure.com/fabrikam/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/statuses?api-version=4.1-preview.1
{
"iterationId": 1,
"state": "succeeded",
"description": "Sample status succeeded",
"context": {
"name": "sample-status-2",
"genre": "vsts-samples"
},
"targetUrl": "http://fabrikam-fiber-inc.com/CI/builds/1"
}
応答のサンプル
{
"iterationId": 1,
"id": 1,
"state": "succeeded",
"description": "Sample status succeeded",
"context": {
"name": "sample-status-2",
"genre": "vsts-samples"
},
"creationDate": "2017-09-19T14:50:26.4429056Z",
"updatedDate": "2017-09-19T14:50:26.4429056Z",
"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/2/statuses/1"
},
"repository": {
"href": "https://dev.azure.com/fabrikam/_apis/git/repositories/b92c8408-a0c9-4292-88af-bc005a1b8272"
}
}
}
On pull request
要求のサンプル
POST https://dev.azure.com/fabrikam/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/statuses?api-version=4.1-preview.1
{
"state": "succeeded",
"description": "Sample status succeeded",
"context": {
"name": "sample-status-4",
"genre": "vsts-samples"
},
"targetUrl": "http://fabrikam-fiber-inc.com/CI/builds/1"
}
応答のサンプル
{
"id": 1,
"state": "succeeded",
"description": "Sample status succeeded",
"context": {
"name": "sample-status-4",
"genre": "vsts-samples"
},
"creationDate": "2017-09-19T14:50:25.1680228Z",
"updatedDate": "2017-09-19T14:50:25.1680228Z",
"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/1/statuses/1"
},
"repository": {
"href": "https://dev.azure.com/fabrikam/_apis/git/repositories/b92c8408-a0c9-4292-88af-bc005a1b8272"
}
}
}
With properties
要求のサンプル
POST https://dev.azure.com/fabrikam/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/statuses?api-version=4.1-preview.1
{
"properties": {
"sampleId": 7,
"customInfo": "Custom status information",
"startedDateTime": {
"$type": "System.DateTime",
"$value": "2017-09-19T14:50:26.7410146Z"
},
"weight": {
"$type": "System.Double",
"$value": 1.75
},
"bytes": {
"$type": "System.Byte[]",
"$value": "dGhpcyBpcyBzYW1wbGUgYmFzZTY0IGVuY29kZWQgc3RyaW5n"
},
"globalId": {
"$type": "System.Guid",
"$value": "1e788cb9-9d3d-4dc6-ac05-822092d17f90"
}
},
"state": "succeeded",
"description": "Sample status succeeded",
"context": {
"name": "sample-status-1",
"genre": "vsts-samples"
},
"targetUrl": "http://fabrikam-fiber-inc.com/CI/builds/1"
}
応答のサンプル
{
"properties": {
"bytes": {
"$type": "System.Byte[]",
"$value": "dGhpcyBpcyBzYW1wbGUgYmFzZTY0IGVuY29kZWQgc3RyaW5n"
},
"customInfo": {
"$type": "System.String",
"$value": "Custom status information"
},
"globalId": {
"$type": "System.String",
"$value": "1e788cb99d3d4dc6ac05822092d17f90"
},
"sampleId": {
"$type": "System.Int32",
"$value": 7
},
"startedDateTime": {
"$type": "System.DateTime",
"$value": "2017-09-19T14:50:26.74Z"
},
"weight": {
"$type": "System.Double",
"$value": 1.75
}
},
"id": 1,
"state": "succeeded",
"description": "Sample status succeeded",
"context": {
"name": "sample-status-1",
"genre": "vsts-samples"
},
"creationDate": "2017-09-19T14:50:26.7780242Z",
"updatedDate": "2017-09-19T14:50:26.7780242Z",
"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/3/statuses/1"
},
"repository": {
"href": "https://dev.azure.com/fabrikam/_apis/git/repositories/b92c8408-a0c9-4292-88af-bc005a1b8272"
}
}
}
定義
| 名前 | 説明 |
|---|---|
|
Git |
このクラスには、pull request 状態を投稿するサービス/拡張機能のメタデータが含まれています。 状態は、pull request またはイテレーションに関連付けることができます。 |
|
Git |
状態を一意に識別する状態コンテキスト。 |
|
Git |
状態の状態。 |
|
Identity |
|
|
Properties |
クラスは、キーと値のペアのコレクションとしてプロパティ バッグを表します。 を除くすべてのプリミティブ型 (を持つ任意の |
|
Reference |
REST 参照リンクのコレクションを表す クラス。 |
GitPullRequestStatus
このクラスには、pull request 状態を投稿するサービス/拡張機能のメタデータが含まれています。 状態は、pull request またはイテレーションに関連付けることができます。
| 名前 | 型 | 説明 |
|---|---|---|
| _links |
参照リンク。 |
|
| context |
状態のコンテキスト。 |
|
| createdBy |
状態を作成した ID。 |
|
| creationDate |
string |
状態の作成日時。 |
| description |
string |
状態の説明。 通常、状態の現在の状態について説明します。 |
| id |
integer |
状態識別子。 |
| iterationId |
integer |
状態を関連付けるイテレーションの ID。 最大値は 1 です。 |
| properties |
状態のカスタム プロパティ。 |
|
| state |
状態の状態。 |
|
| targetUrl |
string |
状態の詳細を含む URL。 |
| updatedDate |
string |
状態の最終更新日時。 |
GitStatusContext
状態を一意に識別する状態コンテキスト。
| 名前 | 型 | 説明 |
|---|---|---|
| genre |
string |
状態のジャンル。 通常、状態を生成するサービスまたはツールの名前は空にすることができます。 |
| name |
string |
状態の名前識別子を null または空にすることはできません。 |
GitStatusState
状態の状態。
| 値 | 説明 |
|---|---|
| error |
エラーが発生した状態。 |
| failed |
状態が失敗しました。 |
| notApplicable |
状態はターゲット オブジェクトには適用されません。 |
| notSet |
状態の状態が設定されていません。 既定の状態です。 |
| pending |
状態は保留中です。 |
| succeeded |
状態が成功しました。 |
IdentityRef
| 名前 | 型 | 説明 |
|---|---|---|
| _links |
このフィールドには、グラフの件名に関する 0 個以上の興味深いリンクが含まれています。 これらのリンクを呼び出して、このグラフの主題に関する追加のリレーションシップや詳細情報を取得できます。 |
|
| 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 でエンコードされた文字列として必要です。
| 名前 | 型 | 説明 |
|---|---|---|
| count |
integer |
コレクション内のプロパティの数。 |
| item |
object |
|
| keys |
string[] |
コレクション内のキーのセット。 |
| values |
string[] |
コレクション内の値のセット。 |
ReferenceLinks
REST 参照リンクのコレクションを表す クラス。
| 名前 | 型 | 説明 |
|---|---|---|
| links |
object |
リンクの読み取り時ビュー。 参照リンクは読み取り専用であるため、参照リンクは読み取り専用として公開する必要があります。 |