How to set a Agent Queue in a Release definition using REST API?

╄→гoц情女王★ 提交于 2021-02-08 05:09:35

问题


I'm creating/updating a Release Pipeline in Azure DevOps using REST API and want to update the Release with a specific Agent Pool. In the UI the setting is located under: Release pipeline->Agent job-> Agent Selection-> Agent pool setting.

Currenly I am using the Release definition Creation API, but not sure what parameter to pass within the request, to update the agent pool setting.

Azure DevOps Release Definition Creation API I am using is: https://docs.microsoft.com/en-us/rest/api/azure/devops/release/definitions/create?view=azure-devops-rest-5.1 Thank you


回答1:


First you need to GET the Agent Queue ID. Below is the API to get the Agent Queue details.

GET https://dev.azure.com/{organization}/{project}/_apis/distributedtask/queues?queueNames={queueNames}&api-version=5.1-preview.1

Once you get this information you will need to use the Pool ID in your JSON request body to create/update your Release definitions using the same API you mentioned in your question.



来源:https://stackoverflow.com/questions/58597833/how-to-set-a-agent-queue-in-a-release-definition-using-rest-api

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!