如何使用REST API在发布定义中设置代理队列? [英] How to set a Agent Queue in a Release definition using REST API?

查看:64
本文介绍了如何使用REST API在发布定义中设置代理队列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用REST API在Azure DevOps中创建/更新发布管道,并希望使用特定的代理程序池更新发布.在UI中,该设置位于:下达发布管道->代理作业->代理选择->代理池设置.

目前,我正在使用发布定义创建API,但不确定在请求中传递哪个参数来更新代理程序池设置.

我正在使用的

Azure DevOps版本定义创建API:谢谢

解决方案

首先,您需要获取代理队列ID.以下是获取代理队列详细信息的API.

获取

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

解决方案

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.

这篇关于如何使用REST API在发布定义中设置代理队列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆