Agent queues

Last Update: 12/5/2016

api-version = 3.0-preview.1

An Agent queue provides visibility to an agent pool from within a team project.

If you haven't already, look at the information on getting started with these APIs.

Get a list of queues

GET https://{instance}/DefaultCollection/{project}/_apis/distributedtask/queues?api-version={version}[&queueName={string}][&actionFilter={string}]
Parameter Type Notes
URL
instance string VS Team Services account ({account}.visualstudio.com) or TFS server ({server:port}).
project string Team project ID or name.
Query
api-version string Version of the API to use.
queueName string Filters queues whose names start with this prefix.
actionFilter enum { None, Manage, Use } Filter Queues based on the permission mentioned.

Sample request

GET https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/Fabrikam-Fiber-Git/_apis/distributedtask/queues?api-version=3.0-preview.1

Sample response

Status code: 200
{
  "count": 2,
  "value": [
    {
      "id": 1,
      "projectId": "7b626022-ff88-4bba-9e1c-b444a5305d23",
      "name": "Default",
      "groupScopeId": "12692c9b-aa22-45df-8622-21d6c7126de4",
      "pool": {
        "id": 1,
        "scope": "175d1091-ab63-44a7-a6b5-122709ade15d",
        "name": "Default"
      }
    },
    {
      "id": 4,
      "projectId": "7b626022-ff88-4bba-9e1c-b444a5305d23",
      "name": "myNewQueue",
      "groupScopeId": "07079879-f7ee-49d5-8c03-17a75c2ea000",
      "pool": {
        "id": 1,
        "scope": "175d1091-ab63-44a7-a6b5-122709ade15d",
        "name": "Default"
      }
    }
  ]
}

Get a queue

GET https://{instance}/DefaultCollection/{project}/_apis/distributedtask/queues/{queueId}?api-version={version}
Parameter Type Notes
URL
instance string VS Team Services account ({account}.visualstudio.com) or TFS server ({server:port}).
project string Team project ID or name.
queueId int The queue id.
Query
api-version string Version of the API to use.
actionFilter enum { None, Manage, Use } Filter Queues based on the permission mentioned.

Sample request

GET https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/Fabrikam-Fiber-Git/_apis/distributedtask/queues/4?api-version=3.0-preview.1

Sample response

Status code: 200
{
  "id": 4,
  "projectId": "7b626022-ff88-4bba-9e1c-b444a5305d23",
  "name": "myNewQueue",
  "groupScopeId": "07079879-f7ee-49d5-8c03-17a75c2ea000",
  "pool": {
    "id": 1,
    "scope": "175d1091-ab63-44a7-a6b5-122709ade15d",
    "name": "Default"
  }
}

Create a queue

POST https://{instance}/DefaultCollection/{project}/_apis/distributedTask/queues?api-version={version}
Parameter Type Notes
URL
instance string VS Team Services account ({account}.visualstudio.com) or TFS server ({server:port}).
project string Team project ID or name.
Query
api-version string Version of the API to use.

Sample request

POST https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/Fabrikam-Fiber-Git/_apis/distributedtask/queues?api-version=3.0-preview.1
Content-Type: application/json
{
  "name": "myNewQueue",
  "pool": {
    "id": 1
  }
}

Sample response

Status code: 200
{
  "id": 4,
  "projectId": "7b626022-ff88-4bba-9e1c-b444a5305d23",
  "name": "myNewQueue",
  "groupScopeId": "07079879-f7ee-49d5-8c03-17a75c2ea000",
  "pool": {
    "id": 1
  }
}

Delete a queue

DELETE https://{instance}/DefaultCollection/{project}/_apis/distributedtask/queues/{queueId}?api-version={version}
Parameter Type Notes
URL
instance string VS Team Services account ({account}.visualstudio.com) or TFS server ({server:port}).
project string Team project ID or name.
queueId int The queue id.
Query
api-version string Version of the API to use.

Sample request

DELETE https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/Fabrikam-Fiber-Git/_apis/distributedtask/queues/4?api-version=3.0-preview.1
Content-Type: application/json
4

Sample response

Status code: 204