Targets - Update

Update tags of a list of deployment targets in a deployment group.

PATCH https://dev.azure.com/{organization}/{project}/_apis/distributedtask/deploymentgroups/{deploymentGroupId}/targets?api-version=5.0-preview.1

URI Parameters

Name In Required Type Description
deploymentGroupId
path True

integer

int32

ID of the deployment group in which deployment targets are updated.

organization
path True

string

The name of the Azure DevOps organization.

project
path True

string

Project ID or project name

api-version
query True

string

Version of the API to use. This should be set to '5.0-preview.1' to use this version of the api.

Request Body

Name Type Description
body

DeploymentTargetUpdateParameter[]

Deployment targets with tags to udpdate.

Responses

Name Type Description
200 OK

DeploymentMachine[]

successful operation

Security

oauth2

Type: oauth2
Flow: accessCode
Authorization URL: https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
Token URL: https://app.vssps.visualstudio.com/oauth2/token?client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer&grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer

Scopes

Name Description
vso.machinegroup_manage Provides ability to manage deployment group and agent pools

Examples

Update tags of a deployment target

Sample request

PATCH https://dev.azure.com/fabrikam/{project}/_apis/distributedtask/deploymentgroups/{deploymentGroupId}/targets?api-version=5.0-preview.1

[
  {
    "tags": [
      "db",
      "web",
      "newTag5248232320667898861"
    ],
    "id": 7
  },
  {
    "tags": [
      "db",
      "newTag5248232320667898861"
    ],
    "id": 6
  }
]

Sample response

{
  "count": 2,
  "value": [
    {
      "tags": [
        "db",
        "newTag5248232320667898861"
      ],
      "id": 6,
      "agent": {
        "_links": {
          "self": {
            "href": "https://dev.azure.com/fabrikam/_apis/distributedtask/pools/17/agents/6"
          },
          "web": {
            "href": "https://dev.azure.com/fabrikam/_admin/_AgentPool#_a=agents&poolId=17&agentId=6"
          }
        },
        "maxParallelism": 1,
        "createdOn": "2018-02-19T09:23:58.267Z",
        "id": 6,
        "name": "demoTarget2",
        "version": "2.127.0",
        "osDescription": "Microsoft Windows 10.0.14393 ",
        "enabled": true,
        "status": "offline"
      }
    },
    {
      "tags": [
        "db",
        "newTag5248232320667898861",
        "web"
      ],
      "id": 7,
      "agent": {
        "_links": {
          "self": {
            "href": "https://dev.azure.com/fabrikam/_apis/distributedtask/pools/17/agents/7"
          },
          "web": {
            "href": "https://dev.azure.com/fabrikam/_admin/_AgentPool#_a=agents&poolId=17&agentId=7"
          }
        },
        "maxParallelism": 1,
        "createdOn": "2018-02-19T09:26:48.11Z",
        "id": 7,
        "name": "demoTarget11",
        "version": "2.127.0",
        "osDescription": "Microsoft Windows 10.0.14393 ",
        "enabled": true,
        "status": "offline"
      }
    }
  ]
}

Definitions

Name Description
Demand
DeploymentMachine

Deployment target.

DeploymentTargetUpdateParameter

Deployment target update parameter.

IdentityRef
JObject
JToken
PackageVersion
PropertiesCollection

The class represents a property bag as a collection of key-value pairs. Values of all primitive types (any type with a TypeCode != TypeCode.Object) except for DBNull are accepted. Values of type Byte[], Int32, Double, DateType and String preserve their type, other primitives are retuned as a String. Byte[] expected as base64 encoded string.

ReferenceLinks

The class to represent a collection of REST reference links.

TaskAgent
TaskAgentAuthorization

Provides data necessary for authorizing the agent using OAuth 2.0 authentication flows.

TaskAgentCloudRequest
TaskAgentDelaySource
TaskAgentJobRequest
TaskAgentPoolReference
TaskAgentPoolType

Gets or sets the type of the pool

TaskAgentPublicKey

Represents the public key portion of an RSA asymmetric key.

TaskAgentReference
TaskAgentStatus

Gets the current connectivity status of the agent.

TaskAgentUpdate
TaskAgentUpdateReason
TaskAgentUpdateReasonType
TaskOrchestrationOwner
TaskResult

Demand

Name Type Description
name

string

value

string

DeploymentMachine

Deployment target.

Name Type Description
agent

TaskAgent

Deployment agent.

id

integer

Deployment target Identifier.

tags

string[]

Tags of the deployment target.

DeploymentTargetUpdateParameter

Deployment target update parameter.

Name Type Description
id

integer

Identifier of the deployment target.

tags

string[]

IdentityRef

Name Type Description
_links

ReferenceLinks

This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject.

descriptor

string

The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations.

directoryAlias

string

displayName

string

This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider.

id

string

imageUrl

string

inactive

boolean

isAadIdentity

boolean

isContainer

boolean

isDeletedInOrigin

boolean

profileUrl

string

uniqueName

string

url

string

This url is the full route to the source resource of this graph subject.

JObject

Name Type Description
item

JToken

type

string

JToken

Name Type Description
first

JToken

hasValues

boolean

item

JToken

last

JToken

next

JToken

parent

string

path

string

previous

JToken

root

JToken

type

string

PackageVersion

Name Type Description
major

integer

minor

integer

patch

integer

PropertiesCollection

The class represents a property bag as a collection of key-value pairs. Values of all primitive types (any type with a TypeCode != TypeCode.Object) except for DBNull are accepted. Values of type Byte[], Int32, Double, DateType and String preserve their type, other primitives are retuned as a String. Byte[] expected as base64 encoded string.

Name Type Description
count

integer

The count of properties in the collection.

item

object

keys

string[]

The set of keys in the collection.

values

string[]

The set of values in the collection.

The class to represent a collection of REST reference links.

Name Type Description
links

object

The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only.

TaskAgent

Name Type Description
_links

ReferenceLinks

The class to represent a collection of REST reference links.

accessPoint

string

Gets the access point of the agent.

assignedAgentCloudRequest

TaskAgentCloudRequest

Gets the Agent Cloud Request that's currently associated with this agent

assignedRequest

TaskAgentJobRequest

Gets the request which is currently assigned to this agent.

authorization

TaskAgentAuthorization

Gets or sets the authorization information for this agent.

createdOn

string

Gets the date on which this agent was created.

enabled

boolean

Gets or sets a value indicating whether or not this agent should be enabled for job execution.

id

integer

Gets the identifier of the agent.

lastCompletedRequest

TaskAgentJobRequest

Gets the last request which was completed by this agent.

maxParallelism

integer

Gets or sets the maximum job parallelism allowed on this host.

name

string

Gets the name of the agent.

oSDescription

string

Gets the OS of the agent.

pendingUpdate

TaskAgentUpdate

Gets the pending update for this agent.

properties

PropertiesCollection

The class represents a property bag as a collection of key-value pairs. Values of all primitive types (any type with a TypeCode != TypeCode.Object) except for DBNull are accepted. Values of type Byte[], Int32, Double, DateType and String preserve their type, other primitives are retuned as a String. Byte[] expected as base64 encoded string.

provisioningState

string

Gets or sets the current provisioning state of this agent

status

TaskAgentStatus

Gets the current connectivity status of the agent.

statusChangedOn

string

Gets the date on which the last connectivity status change occurred.

systemCapabilities

object

userCapabilities

object

version

string

Gets the version of the agent.

TaskAgentAuthorization

Provides data necessary for authorizing the agent using OAuth 2.0 authentication flows.

Name Type Description
authorizationUrl

string

Gets or sets the endpoint used to obtain access tokens from the configured token service.

clientId

string

Gets or sets the client identifier for this agent.

publicKey

TaskAgentPublicKey

Gets or sets the public key used to verify the identity of this agent.

TaskAgentCloudRequest

Name Type Description
agent

TaskAgentReference

agentCloudId

integer

agentConnectedTime

string

agentData

JObject

agentSpecification

JObject

pool

TaskAgentPoolReference

provisionRequestTime

string

provisionedTime

string

releaseRequestTime

string

requestId

string

TaskAgentDelaySource

Name Type Description
delays

string[]

taskAgent

TaskAgentReference

TaskAgentJobRequest

Name Type Description
agentDelays

TaskAgentDelaySource[]

agentSpecification

JObject

assignTime

string

data

object

definition

TaskOrchestrationOwner

demands

Demand[]

expectedDuration

string

finishTime

string

hostId

string

jobId

string

jobName

string

lockedUntil

string

matchedAgents

TaskAgentReference[]

orchestrationId

string

owner

TaskOrchestrationOwner

planGroup

string

planId

string

planType

string

poolId

integer

queueId

integer

queueTime

string

receiveTime

string

requestId

integer

reservedAgent

TaskAgentReference

result

TaskResult

scopeId

string

serviceOwner

string

TaskAgentPoolReference

Name Type Description
id

integer

isHosted

boolean

Gets or sets a value indicating whether or not this pool is managed by the service.

name

string

poolType

TaskAgentPoolType

Gets or sets the type of the pool

scope

string

size

integer

Gets the current size of the pool.

TaskAgentPoolType

Gets or sets the type of the pool

Name Type Description
automation

string

deployment

string

TaskAgentPublicKey

Represents the public key portion of an RSA asymmetric key.

Name Type Description
exponent

string[]

Gets or sets the exponent for the public key.

modulus

string[]

Gets or sets the modulus for the public key.

TaskAgentReference

Name Type Description
_links

ReferenceLinks

The class to represent a collection of REST reference links.

accessPoint

string

Gets the access point of the agent.

enabled

boolean

Gets or sets a value indicating whether or not this agent should be enabled for job execution.

id

integer

Gets the identifier of the agent.

name

string

Gets the name of the agent.

oSDescription

string

Gets the OS of the agent.

provisioningState

string

Gets or sets the current provisioning state of this agent

status

TaskAgentStatus

Gets the current connectivity status of the agent.

version

string

Gets the version of the agent.

TaskAgentStatus

Gets the current connectivity status of the agent.

Name Type Description
offline

string

online

string

TaskAgentUpdate

Name Type Description
currentState

string

The current state of this agent update

reason

TaskAgentUpdateReason

The reason of this agent update

requestTime

string

Gets the date on which this agent update was requested.

requestedBy

IdentityRef

The identity that request the agent update

sourceVersion

PackageVersion

Gets or sets the source agent version of the agent update

targetVersion

PackageVersion

Gets or sets the target agent version of the agent update

TaskAgentUpdateReason

Name Type Description
code

TaskAgentUpdateReasonType

TaskAgentUpdateReasonType

Name Type Description
manual

string

minAgentVersionRequired

string

TaskOrchestrationOwner

Name Type Description
_links

ReferenceLinks

The class to represent a collection of REST reference links.

id

integer

name

string

TaskResult

Name Type Description
abandoned

string

canceled

string

failed

string

skipped

string

succeeded

string

succeededWithIssues

string