简体   繁体   中英

Getting the successful deployments between dates or onbefore

I am using the below API to get the successful deployment of a particular pipeline. I am not able to get the deployments happened between particular dates or before particular date.

I tried like below but not getting desired outputs any modification to the below API

Documentation can be found here ( https://docs.microsoft.com/en-us/rest/api/azure/devops/release/deployments/list?view=azure-devops-rest-6.0#releasequeryorder )

https://vsrm.dev.azure.com/ABC/DEF/_apis/release/deployments?definitionId=111&sourceBranch=master&createdOn=2022-10-06

Based on your requirement, you need to get the deployments between particular dates or before particular date.

You need to use the parameter: minStartedTime and maxStartedTime to replace the CreatedOn to set the date .

For example:

Between particular dates

Rest API: use minStartedTime and maxStartedTime

Get https://vsrm.dev.azure.com/{OrganizationName}/{ProjectName}/_apis/release/deployments?definitionId=xx&minStartedTime=2022-02-01&maxStartedTime=2022-02-17&api-version=6.0

Before particular date use maxStartedTime

Get https://vsrm.dev.azure.com/{OrganizationName}/{ProjectName}/_apis/release/deployments?definitionId=xx&maxStartedTime=2022-02-17&api-version=6.0

For more detailed info, you can refer to this doc: Deployments - List

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM