« Azure devops api » : différence entre les versions
Apparence
(16 versions intermédiaires par le même utilisateur non affichées) | |||
Ligne 13 : | Ligne 13 : | ||
"id": "111" | "id": "111" | ||
} | } | ||
</kode> | |||
== [https://docs.microsoft.com/en-us/rest/api/azure/devops/build/builds/get%20changes%20between%20builds?view=azure-devops-rest-6.0 Get Changes Between Builds] == | |||
<pre>GET https://dev.azure.com/{organization}/{project}/_apis/build/changes?api-version=6.0-preview.2</pre> | |||
<kode lang='json' collapsed> | |||
{ | |||
"count": 1, | |||
"value": [ | |||
{ | |||
"id": "1267ccdc5f768d9e158fa49c1de7e4363850b946", | |||
"message": "Merged PR 12345: PR title", | |||
"type": "TfsGit", | |||
"author": { | |||
"uniqueName": "email address" | |||
} | |||
} | |||
] | |||
} | |||
</kode> | </kode> | ||
= Work Item = | = Work Item = | ||
== [https://docs.microsoft.com/en-us/rest/api/azure/devops/wit/work%20items/get%20work%20item Get Work Item] == | == [https://docs.microsoft.com/en-us/rest/api/azure/devops/wit/work%20items/get%20work%20item Get Work Item] == | ||
<pre>GET https://dev.azure.com/{organization}/{project}/_apis/wit/workitems/{id}?api-version=6.0</pre> | <pre>GET https://dev.azure.com/{organization}/{project}/_apis/wit/workitems/{id}?$expand=relations&api-version=6.0</pre> | ||
<kode lang='json' collapsed> | <kode lang='json' collapsed> | ||
{ | { | ||
Ligne 34 : | Ligne 52 : | ||
}, | }, | ||
"System.Title": "My title", | "System.Title": "My title", | ||
} | }, | ||
"relations": [ | |||
{ | |||
"rel": "ArtifactLink", | |||
"url": "vstfs:///Git/PullRequestId/{organization}%2F{project}%2F{PRid}", | |||
"attributes": { | |||
"id": 12345678, | |||
"name": "Pull Request" | |||
} | |||
} | |||
] | |||
} | } | ||
</kode> | </kode> | ||
Ligne 120 : | Ligne 148 : | ||
} | } | ||
} | } | ||
</kode> | |||
= Task agent = | |||
== [https://docs.microsoft.com/en-us/rest/api/azure/devops/distributedtask/environmentdeployment%20records/list?view=azure-devops-rest-6.0 Environmentdeployment Records - List] == | |||
<pre>GET https://dev.azure.com/{organization}/{project}/_apis/distributedtask/environments/{environmentId}/environmentdeploymentrecords?api-version=6.0-preview.1</pre> | |||
<kode lang='json' collapsed> | |||
{ | |||
"count": 1, | |||
"value": [ | |||
{ | |||
"id": 111, | |||
"planType": "Build", | |||
"stageName": "DEMO", | |||
"jobName": "DeployPresentation", | |||
"stageAttempt": 1, | |||
"jobAttempt": 1, | |||
"definition": { | |||
"id": 111, // pipeline id | |||
"name": "My pipeline" | |||
}, | |||
"owner": { | |||
"id": 111, // build id | |||
"name": "20210128.4" | |||
}, | |||
"result": "succeeded", | |||
"queueTime": "2021-01-28T15:10:54.8233333Z", | |||
"startTime": "2021-01-28T15:10:54.9466667Z", | |||
"finishTime": "2021-01-28T15:14:05.21Z" | |||
} | |||
</kode> | |||
= Git = | |||
== Pull request == | |||
=== [https://docs.microsoft.com/en-us/rest/api/azure/devops/git/pull%20requests/get%20pull%20requests Get] === | |||
<pre>GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repository}/pullrequests?api-version=6.0</pre> | |||
{| class="wikitable wtp wtmono1 wtmono2" | |||
|+ Query parameters | |||
! name | |||
! value | |||
|- | |||
| searchCriteria.creatorId || creatorId | |||
|- | |||
| searchCriteria.status || active, completed, abandoned, notSet, all<br>(active by default) | |||
|- | |||
| $top || \d+ | |||
|} | |||
<kode lang='json' collapsed> | |||
{ | |||
"count": 1, | |||
"value": [ | |||
{ | |||
"pullRequestId": 66034, | |||
"status": "active", | |||
"createdBy": { | |||
"displayName": "Firstname Lastname", | |||
"id": "12345678-1234-1234-1234-123456789012", | |||
"uniqueName": "firstname.lastname@organization.net" | |||
}, | |||
"creationDate": "2020-12-16T17:41:23.5291166Z", | |||
"title": "PR title", | |||
"description": "description", | |||
"sourceRefName": "refs/heads/bugfix/sonar/branch-name", | |||
"targetRefName": "refs/heads/master", | |||
"mergeStatus": "succeeded", | |||
"isDraft": false, | |||
"mergeId": "12345678-1234-1234-1234-123456789012" | |||
} | |||
] | |||
} | |||
</kode> | |||
=== [https://docs.microsoft.com/en-us/rest/api/azure/devops/git/pull%20requests/get%20pull%20request%20by%20id?view=azure-devops-rest-6.0 Get Pull Request By Id] === | |||
<pre>GET https://dev.azure.com/{organization}/{project}/_apis/git/pullrequests/{pullRequestId}?api-version=6.0</pre> | |||
<kode lang='json' collapsed> | |||
{ | |||
"pullRequestId": 12345, | |||
"status": "completed", | |||
"title": "PR title", | |||
"targetRefName": "refs/heads/master", | |||
"mergeStatus": "succeeded", | |||
"isDraft": false, | |||
} | |||
</kode> | |||
=== [https://docs.microsoft.com/en-us/rest/api/azure/devops/git/pull%20request%20work%20items/list Work Items - List] === | |||
<pre>GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repository}/pullrequests/{pullRequestId}/workitems?api-version=6.0</pre> | |||
<kode lang='json' collapsed> | |||
{ | |||
"count": 1, | |||
"value": [ | |||
{ | |||
"id": "123456", | |||
"url": "https://dev.azure.com/{organization}/_apis/wit/workItems/123456" | |||
} | |||
] | |||
} | |||
</kode> | |||
=== [https://docs.microsoft.com/en-us/rest/api/azure/devops/git/pull%20request%20commits/get%20pull%20request%20commits?view=azure-devops-rest-6.0 Get Pull Request Commits] === | |||
<pre>GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/commits?api-version=6.0</pre> | |||
<kode lang='json' collapsed> | |||
{ | |||
"count": 1, | |||
"value": [ | |||
{ | |||
"commitId": "384d5606d55ff94bc798bca274098bf3d0022fbb", | |||
"comment": "commit message" | |||
} | |||
} | |||
</kode> | </kode> |
Dernière version du 29 mars 2021 à 13:13
Links
Build
Get Build Work Items Refs
GET https://dev.azure.com/{organization}/{project}/_apis/build/builds/{buildId}/workitems?api-version=6.0
|
Get Changes Between Builds
GET https://dev.azure.com/{organization}/{project}/_apis/build/changes?api-version=6.0-preview.2
|
Work Item
Get Work Item
GET https://dev.azure.com/{organization}/{project}/_apis/wit/workitems/{id}?$expand=relations&api-version=6.0
|
Pipeline
List
GET https://dev.azure.com/{organization}/{project}/_apis/pipelines?api-version=6.0-preview.1
|
Runs - List
GET https://dev.azure.com/{organization}/{project}/_apis/pipelines/{pipelineId}/runs?api-version=6.0-preview.1
|
Team
List
GET https://dev.azure.com/{organization}/_apis/projects/{project}/teams?api-version=6.0
|
Iteration / Sprint
List
GET https://dev.azure.com/{organization}/{project}/{team}/_apis/work/teamsettings/iterations?api-version=6.0
|
Get Iteration Work Items
GET https://dev.azure.com/{organization}/{project}/{team}/_apis/work/teamsettings/iterations/{iterationId}/workitems?api-version=6.0-preview.1
|
Task agent
Environmentdeployment Records - List
GET https://dev.azure.com/{organization}/{project}/_apis/distributedtask/environments/{environmentId}/environmentdeploymentrecords?api-version=6.0-preview.1
|
Git
Pull request
Get
GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repository}/pullrequests?api-version=6.0
name | value |
---|---|
searchCriteria.creatorId | creatorId |
searchCriteria.status | active, completed, abandoned, notSet, all (active by default) |
$top | \d+ |
|
Get Pull Request By Id
GET https://dev.azure.com/{organization}/{project}/_apis/git/pullrequests/{pullRequestId}?api-version=6.0
|
Work Items - List
GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repository}/pullrequests/{pullRequestId}/workitems?api-version=6.0
|
Get Pull Request Commits
GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/pullRequests/{pullRequestId}/commits?api-version=6.0
|