TaskAgentRestClient class

Base class that should be used (derived from) to make requests to VSS REST apis

Extends

Constructors

TaskAgentRestClient(IVssRestClientOptions)

Properties

RESOURCE_AREA_ID

Methods

addAgent(TaskAgent, number)

Adds an agent to a pool. You probably don't want to call this endpoint directly. Instead, configure an agent using the agent download package.

addAgentCloud(TaskAgentCloud)
addAgentPool(TaskAgentPool)

Create an agent pool.

addAgentQueue(TaskAgentQueue, string, boolean)

Create a new agent queue to connect a project to an agent pool.

addDeploymentGroup(DeploymentGroupCreateParameter, string)

Create a deployment group.

addDeploymentMachine(DeploymentMachine, string, number)
addDeploymentMachineGroup(DeploymentMachineGroup, string)
addDeploymentTarget(DeploymentMachine, string, number)

Register a deployment target to a deployment group. Generally this is called by agent configuration tool.

addEnvironment(EnvironmentCreateParameter, string)

Create an environment.

addKubernetesResource(KubernetesResourceCreateParameters, string, number)
addTaskGroup(TaskGroupCreateParameter, string)

Create a task group.

addVariableGroup(VariableGroupParameters)

Add a variable group.

addVirtualMachineGroup(VirtualMachineGroupCreateParameters, string, number)
createAadOAuthRequest(string, string, AadLoginPromptOption, string, boolean)
createAgentPoolMaintenanceDefinition(TaskAgentPoolMaintenanceDefinition, number)
createAgentSession(TaskAgentSession, number)
createTeamProject(string)

Create a new team project.

deleteAgent(number, number)

Delete an agent. You probably don't want to call this endpoint directly. Instead, use the agent configuration script to remove an agent from your organization.

deleteAgentCloud(number)
deleteAgentPool(number)

Delete an agent pool.

deleteAgentPoolMaintenanceDefinition(number, number)
deleteAgentPoolMaintenanceJob(number, number)
deleteAgentQueue(number, string)

Removes an agent queue from a project.

deleteAgentRequest(number, number, string, TaskResult, boolean)
deleteAgentSession(number, string)
deleteDeploymentGroup(string, number)

Delete a deployment group.

deleteDeploymentMachine(string, number, number)
deleteDeploymentMachineGroup(string, number)
deleteDeploymentTarget(string, number, number)

Delete a deployment target in a deployment group. This deletes the agent from associated deployment pool too.

deleteEnvironment(string, number)

Delete the specified environment.

deleteKubernetesResource(string, number, number)
deleteMessage(number, number, string)
deleteSecureFile(string, string)

Delete a secure file

deleteTaskDefinition(string)
deleteTaskGroup(string, string, string)

Delete a task group.

deleteVariableGroup(number, string[])

Delete a variable group

deleteVirtualMachineGroup(string, number, number)
downloadSecureFile(string, string, string, boolean)

Download a secure file by Id

generateDeploymentGroupAccessToken(string, number)

GET a PAT token for managing (configuring, removing, tagging) deployment targets in a deployment group.

generateDeploymentMachineGroupAccessToken(string, number)
generateDeploymentPoolAccessToken(number)

GET a PAT token for managing (configuring, removing, tagging) deployment agents in a deployment pool.

getAgent(number, number, boolean, boolean, boolean, string[])

Get information about an agent.

getAgentCloud(number)
getAgentCloudRequests(number)
getAgentClouds()
getAgentCloudTypes()

Get agent cloud types.

getAgentPool(number, string[], TaskAgentPoolActionFilter)

Get information about an agent pool.

getAgentPoolMaintenanceDefinition(number, number)
getAgentPoolMaintenanceDefinitions(number)
getAgentPoolMaintenanceJob(number, number)
getAgentPoolMaintenanceJobLogs(number, number)
getAgentPoolMaintenanceJobs(number, number)
getAgentPoolMetadata(number)
getAgentPools(string, string[], TaskAgentPoolType, TaskAgentPoolActionFilter)

Get a list of agent pools.

getAgentPoolsByIds(number[], TaskAgentPoolActionFilter)

Get a list of agent pools.

getAgentQueue(number, string, TaskAgentQueueActionFilter)

Get information about an agent queue.

getAgentQueues(string, string, TaskAgentQueueActionFilter)

Get a list of agent queues.

getAgentQueuesByIds(number[], string, TaskAgentQueueActionFilter)

Get a list of agent queues by their IDs

getAgentQueuesByNames(string[], string, TaskAgentQueueActionFilter)

Get a list of agent queues by their names

getAgentQueuesForPools(number[], string, TaskAgentQueueActionFilter)

Get a list of agent queues by pool ids

getAgentRequest(number, number, boolean)
getAgentRequests(number, number, string)
getAgentRequestsForAgent(number, number, number)
getAgentRequestsForAgents(number, number[], number)
getAgentRequestsForDeploymentMachine(string, number, number, number)
getAgentRequestsForDeploymentMachines(string, number, number[], number)
getAgentRequestsForDeploymentTarget(string, number, number, number)

Get agent requests for a deployment target.

getAgentRequestsForDeploymentTargets(string, number, number[], number, Date, number)

Get agent requests for a list deployment targets.

getAgentRequestsForPlan(number, string, string)
getAgentRequestsForQueue(string, number, number, string)
getAgents(number, string, boolean, boolean, boolean, string[], string[])

Get a list of agents.

getAzureManagementGroups()

Returns list of azure subscriptions

getAzureSubscriptions()

Returns list of azure subscriptions

getDeploymentGroup(string, number, DeploymentGroupActionFilter, DeploymentGroupExpands)

Get a deployment group by its ID.

getDeploymentGroups(string, string, DeploymentGroupActionFilter, DeploymentGroupExpands, string, number, number[])

Get a list of deployment groups by name or IDs.

getDeploymentGroupsMetrics(string, string, string, number)

Get a list of deployment group metrics.

getDeploymentMachine(string, number, number, DeploymentMachineExpands)
getDeploymentMachineGroup(string, number, MachineGroupActionFilter)
getDeploymentMachineGroupMachines(string, number, string[])
getDeploymentMachineGroups(string, string, MachineGroupActionFilter)
getDeploymentMachines(string, number, string[], string, DeploymentMachineExpands)
getDeploymentPoolsSummary(string, DeploymentPoolSummaryExpands, number[])

Get a list of deployment pool summaries.

getDeploymentTarget(string, number, number, DeploymentTargetExpands)

Get a deployment target by its ID in a deployment group

getDeploymentTargets(string, number, string[], string, boolean, DeploymentTargetExpands, TaskAgentStatusFilter, TaskAgentJobResultFilter, string, number, boolean, string[])

Get a list of deployment targets in a deployment group.

getEnvironmentById(string, number, EnvironmentExpands)

Get an environment by its ID.

getEnvironmentDeploymentExecutionRecords(string, number, string, number)

Get environment deployment execution history

getEnvironments(string, string, string, number)

Get all environments.

getKubernetesResource(string, number, number)
getMessage(number, string, number)
getPackage(string, string, string)
getPackages(string, string, number)
getResourceLimits()
getResourceUsage(string, boolean, boolean)
getSecureFile(string, string, boolean, SecureFileActionFilter)

Get a secure file

getSecureFiles(string, string, boolean, SecureFileActionFilter)

Get secure files

getSecureFilesByIds(string, string[], boolean, SecureFileActionFilter)

Get secure files

getSecureFilesByNames(string, string[], boolean, SecureFileActionFilter)

Get secure files

getTaskContentZip(string, string, string[], boolean)
getTaskDefinition(string, string, string[], boolean)
getTaskDefinitions(string, string[], boolean, boolean)
getTaskGroup(string, string, string, TaskGroupExpands)

Get task group.

getTaskGroupHistory(string, string)
getTaskGroupRevision(string, string, number)
getTaskGroups(string, string, boolean, string, boolean, number, Date, TaskGroupQueryOrder)

List task groups.

getTaskHubLicenseDetails(string, boolean, boolean)
getVariableGroup(string, number)

Get a variable group.

getVariableGroups(string, string, VariableGroupActionFilter, number, number, VariableGroupQueryOrder)

Get variable groups.

getVariableGroupsById(string, number[], boolean)

Get variable groups by ids.

getVirtualMachineGroup(string, number, number)
getVirtualMachines(string, number, number, string, string, boolean, string[], number)
getVstsAadTenantId()
getYamlSchema(boolean)

GET the Yaml schema used for Yaml file validation.

hasPoolPermissions(number, number)

Checks if current identity has passed permissions on a pool.

publishTaskGroup(PublishTaskGroupMetadata, string, string)
queryEndpoint(TaskDefinitionEndpoint)

Proxy for a GET request defined by an 'endpoint'. The request is authorized using a service connection. The response is filtered using an XPath/Json based selector.

querySecureFilesByProperties(string, string, string)

Query secure files using a name pattern and a condition on file properties.

queueAgentPoolMaintenanceJob(TaskAgentPoolMaintenanceJob, number)
queueAgentRequest(TaskAgentJobRequest, string, number)
queueAgentRequestByPool(TaskAgentJobRequest, number)
refreshAgent(number, number)
refreshAgents(number)
refreshDeploymentMachines(string, number)
refreshDeploymentTargets(string, number)

Upgrade the deployment targets in a deployment group.

replaceAgent(TaskAgent, number, number)

Replace an agent. You probably don't want to call this endpoint directly. Instead, use the agent configuration script to remove and reconfigure an agent from your organization.

replaceDeploymentMachine(DeploymentMachine, string, number, number)
replaceDeploymentTarget(DeploymentMachine, string, number, number)

Replace a deployment target in a deployment group. Generally this is called by agent configuration tool.

sendMessage(TaskAgentMessage, number, number)
setAgentPoolMetadata(any, number)
shareVariableGroup(VariableGroupProjectReference[], number)

Add a variable group.

undeleteTaskGroup(TaskGroup, string)
updateAgent(TaskAgent, number, number)

Update agent details.

updateAgentCloud(TaskAgentCloud, number)
updateAgentPool(TaskAgentPool, number)

Update properties on an agent pool

updateAgentPoolMaintenanceDefinition(TaskAgentPoolMaintenanceDefinition, number, number)
updateAgentPoolMaintenanceJob(TaskAgentPoolMaintenanceJob, number, number)
updateAgentRequest(TaskAgentJobRequest, number, number, string, TaskAgentRequestUpdateOptions)
updateAgentUpdateState(number, number, string)
updateAgentUserCapabilities({[key: string]: string}, number, number)
updateDeploymentGroup(DeploymentGroupUpdateParameter, string, number)

Update a deployment group.

updateDeploymentMachine(DeploymentMachine, string, number, number)
updateDeploymentMachineGroup(DeploymentMachineGroup, string, number)
updateDeploymentMachineGroupMachines(DeploymentMachine[], string, number)
updateDeploymentMachines(DeploymentMachine[], string, number)
updateDeploymentTarget(DeploymentMachine, string, number, number)

Update a deployment target and its agent properties in a deployment group. Generally this is called by agent configuration tool.

updateDeploymentTargets(DeploymentTargetUpdateParameter[], string, number)

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

updateEnvironment(EnvironmentUpdateParameter, string, number)

Update the specified environment.

updateSecureFile(SecureFile, string, string)

Update the name or properties of an existing secure file

updateSecureFiles(SecureFile[], string)

Update properties and/or names of a set of secure files. Files are identified by their IDs. Properties provided override the existing one entirely, i.e. do not merge.

updateTaskGroup(TaskGroupUpdateParameter, string, string)

Update a task group.

updateTaskGroupProperties(TaskGroupUpdatePropertiesBase, string, string, boolean)
updateTaskHubLicenseDetails(TaskHubLicenseDetails, string)
updateVariableGroup(VariableGroupParameters, number)

Update a variable group.

updateVirtualMachineGroup(VirtualMachineGroup, string, number)
updateVirtualMachines(VirtualMachine[], string, number, number)
uploadSecureFile(any, string, string, boolean)

Upload a secure file, include the file stream in the request body

validateInputs(InputValidationRequest)

Constructor Details

TaskAgentRestClient(IVssRestClientOptions)

new TaskAgentRestClient(options: IVssRestClientOptions)

Parameters

Property Details

RESOURCE_AREA_ID

static RESOURCE_AREA_ID: string

Property Value

string

Method Details

addAgent(TaskAgent, number)

Adds an agent to a pool. You probably don't want to call this endpoint directly. Instead, configure an agent using the agent download package.

function addAgent(agent: TaskAgent, poolId: number): Promise<TaskAgent>

Parameters

agent
TaskAgent

Details about the agent being added

poolId

number

The agent pool in which to add the agent

Returns

Promise<TaskAgent>

addAgentCloud(TaskAgentCloud)

function addAgentCloud(agentCloud: TaskAgentCloud): Promise<TaskAgentCloud>

Parameters

agentCloud
TaskAgentCloud

Returns

Promise<TaskAgentCloud>

addAgentPool(TaskAgentPool)

Create an agent pool.

function addAgentPool(pool: TaskAgentPool): Promise<TaskAgentPool>

Parameters

pool
TaskAgentPool

Details about the new agent pool

Returns

Promise<TaskAgentPool>

addAgentQueue(TaskAgentQueue, string, boolean)

Create a new agent queue to connect a project to an agent pool.

function addAgentQueue(queue: TaskAgentQueue, project?: string, authorizePipelines?: boolean): Promise<TaskAgentQueue>

Parameters

queue
TaskAgentQueue

Details about the queue to create

project

string

Project ID or project name

authorizePipelines

boolean

Automatically authorize this queue when using YAML

Returns

Promise<TaskAgentQueue>

addDeploymentGroup(DeploymentGroupCreateParameter, string)

Create a deployment group.

function addDeploymentGroup(deploymentGroup: DeploymentGroupCreateParameter, project: string): Promise<DeploymentGroup>

Parameters

deploymentGroup
DeploymentGroupCreateParameter

Deployment group to create.

project

string

Project ID or project name

Returns

Promise<DeploymentGroup>

addDeploymentMachine(DeploymentMachine, string, number)

function addDeploymentMachine(machine: DeploymentMachine, project: string, deploymentGroupId: number): Promise<DeploymentMachine>

Parameters

project

string

Project ID or project name

deploymentGroupId

number

Returns

addDeploymentMachineGroup(DeploymentMachineGroup, string)

function addDeploymentMachineGroup(machineGroup: DeploymentMachineGroup, project: string): Promise<DeploymentMachineGroup>

Parameters

machineGroup
DeploymentMachineGroup
project

string

Project ID or project name

Returns

addDeploymentTarget(DeploymentMachine, string, number)

Register a deployment target to a deployment group. Generally this is called by agent configuration tool.

function addDeploymentTarget(machine: DeploymentMachine, project: string, deploymentGroupId: number): Promise<DeploymentMachine>

Parameters

machine
DeploymentMachine

Deployment target to register.

project

string

Project ID or project name

deploymentGroupId

number

ID of the deployment group to which the deployment target is registered.

Returns

addEnvironment(EnvironmentCreateParameter, string)

Create an environment.

function addEnvironment(environmentCreateParameter: EnvironmentCreateParameter, project: string): Promise<EnvironmentInstance>

Parameters

environmentCreateParameter
EnvironmentCreateParameter

Environment to create.

project

string

Project ID or project name

Returns

addKubernetesResource(KubernetesResourceCreateParameters, string, number)

function addKubernetesResource(createParameters: KubernetesResourceCreateParameters, project: string, environmentId: number): Promise<KubernetesResource>

Parameters

project

string

Project ID or project name

environmentId

number

Returns

addTaskGroup(TaskGroupCreateParameter, string)

Create a task group.

function addTaskGroup(taskGroup: TaskGroupCreateParameter, project: string): Promise<TaskGroup>

Parameters

taskGroup
TaskGroupCreateParameter

Task group object to create.

project

string

Project ID or project name

Returns

Promise<TaskGroup>

addVariableGroup(VariableGroupParameters)

Add a variable group.

function addVariableGroup(variableGroupParameters: VariableGroupParameters): Promise<VariableGroup>

Parameters

variableGroupParameters
VariableGroupParameters

Returns

Promise<VariableGroup>

addVirtualMachineGroup(VirtualMachineGroupCreateParameters, string, number)

function addVirtualMachineGroup(createParameters: VirtualMachineGroupCreateParameters, project: string, environmentId: number): Promise<VirtualMachineGroup>

Parameters

project

string

Project ID or project name

environmentId

number

Returns

createAadOAuthRequest(string, string, AadLoginPromptOption, string, boolean)

function createAadOAuthRequest(tenantId: string, redirectUri: string, promptOption?: AadLoginPromptOption, completeCallbackPayload?: string, completeCallbackByAuthCode?: boolean): Promise<string>

Parameters

tenantId

string

redirectUri

string

promptOption
AadLoginPromptOption
completeCallbackPayload

string

completeCallbackByAuthCode

boolean

Returns

Promise<string>

createAgentPoolMaintenanceDefinition(TaskAgentPoolMaintenanceDefinition, number)

function createAgentPoolMaintenanceDefinition(definition: TaskAgentPoolMaintenanceDefinition, poolId: number): Promise<TaskAgentPoolMaintenanceDefinition>

Parameters

poolId

number

Returns

createAgentSession(TaskAgentSession, number)

function createAgentSession(session: TaskAgentSession, poolId: number): Promise<TaskAgentSession>

Parameters

poolId

number

Returns

Promise<TaskAgentSession>

createTeamProject(string)

Create a new team project.

function createTeamProject(project?: string): Promise<void>

Parameters

project

string

Project ID or project name

Returns

Promise<void>

deleteAgent(number, number)

Delete an agent. You probably don't want to call this endpoint directly. Instead, use the agent configuration script to remove an agent from your organization.

function deleteAgent(poolId: number, agentId: number): Promise<void>

Parameters

poolId

number

The pool ID to remove the agent from

agentId

number

The agent ID to remove

Returns

Promise<void>

deleteAgentCloud(number)

function deleteAgentCloud(agentCloudId: number): Promise<TaskAgentCloud>

Parameters

agentCloudId

number

Returns

Promise<TaskAgentCloud>

deleteAgentPool(number)

Delete an agent pool.

function deleteAgentPool(poolId: number): Promise<void>

Parameters

poolId

number

ID of the agent pool to delete

Returns

Promise<void>

deleteAgentPoolMaintenanceDefinition(number, number)

function deleteAgentPoolMaintenanceDefinition(poolId: number, definitionId: number): Promise<void>

Parameters

poolId

number

definitionId

number

Returns

Promise<void>

deleteAgentPoolMaintenanceJob(number, number)

function deleteAgentPoolMaintenanceJob(poolId: number, jobId: number): Promise<void>

Parameters

poolId

number

jobId

number

Returns

Promise<void>

deleteAgentQueue(number, string)

Removes an agent queue from a project.

function deleteAgentQueue(queueId: number, project?: string): Promise<void>

Parameters

queueId

number

The agent queue to remove

project

string

Project ID or project name

Returns

Promise<void>

deleteAgentRequest(number, number, string, TaskResult, boolean)

function deleteAgentRequest(poolId: number, requestId: number, lockToken: string, result?: TaskResult, agentShuttingDown?: boolean): Promise<void>

Parameters

poolId

number

requestId

number

lockToken

string

result
TaskResult
agentShuttingDown

boolean

Returns

Promise<void>

deleteAgentSession(number, string)

function deleteAgentSession(poolId: number, sessionId: string): Promise<void>

Parameters

poolId

number

sessionId

string

Returns

Promise<void>

deleteDeploymentGroup(string, number)

Delete a deployment group.

function deleteDeploymentGroup(project: string, deploymentGroupId: number): Promise<void>

Parameters

project

string

Project ID or project name

deploymentGroupId

number

ID of the deployment group to be deleted.

Returns

Promise<void>

deleteDeploymentMachine(string, number, number)

function deleteDeploymentMachine(project: string, deploymentGroupId: number, machineId: number): Promise<void>

Parameters

project

string

Project ID or project name

deploymentGroupId

number

machineId

number

Returns

Promise<void>

deleteDeploymentMachineGroup(string, number)

function deleteDeploymentMachineGroup(project: string, machineGroupId: number): Promise<void>

Parameters

project

string

Project ID or project name

machineGroupId

number

Returns

Promise<void>

deleteDeploymentTarget(string, number, number)

Delete a deployment target in a deployment group. This deletes the agent from associated deployment pool too.

function deleteDeploymentTarget(project: string, deploymentGroupId: number, targetId: number): Promise<void>

Parameters

project

string

Project ID or project name

deploymentGroupId

number

ID of the deployment group in which deployment target is deleted.

targetId

number

ID of the deployment target to delete.

Returns

Promise<void>

deleteEnvironment(string, number)

Delete the specified environment.

function deleteEnvironment(project: string, environmentId: number): Promise<void>

Parameters

project

string

Project ID or project name

environmentId

number

ID of the environment.

Returns

Promise<void>

deleteKubernetesResource(string, number, number)

function deleteKubernetesResource(project: string, environmentId: number, resourceId: number): Promise<void>

Parameters

project

string

Project ID or project name

environmentId

number

resourceId

number

Returns

Promise<void>

deleteMessage(number, number, string)

function deleteMessage(poolId: number, messageId: number, sessionId: string): Promise<void>

Parameters

poolId

number

messageId

number

sessionId

string

Returns

Promise<void>

deleteSecureFile(string, string)

Delete a secure file

function deleteSecureFile(project: string, secureFileId: string): Promise<void>

Parameters

project

string

Project ID or project name

secureFileId

string

The unique secure file Id

Returns

Promise<void>

deleteTaskDefinition(string)

function deleteTaskDefinition(taskId: string): Promise<void>

Parameters

taskId

string

Returns

Promise<void>

deleteTaskGroup(string, string, string)

Delete a task group.

function deleteTaskGroup(project: string, taskGroupId: string, comment?: string): Promise<void>

Parameters

project

string

Project ID or project name

taskGroupId

string

Id of the task group to be deleted.

comment

string

Comments to delete.

Returns

Promise<void>

deleteVariableGroup(number, string[])

Delete a variable group

function deleteVariableGroup(groupId: number, projectIds: string[]): Promise<void>

Parameters

groupId

number

Id of the variable group.

projectIds

string[]

Returns

Promise<void>

deleteVirtualMachineGroup(string, number, number)

function deleteVirtualMachineGroup(project: string, environmentId: number, resourceId: number): Promise<void>

Parameters

project

string

Project ID or project name

environmentId

number

resourceId

number

Returns

Promise<void>

downloadSecureFile(string, string, string, boolean)

Download a secure file by Id

function downloadSecureFile(project: string, secureFileId: string, ticket: string, download?: boolean): Promise<ArrayBuffer>

Parameters

project

string

Project ID or project name

secureFileId

string

The unique secure file Id

ticket

string

A valid download ticket

download

boolean

If download is true, the file is sent as attachement in the response body. If download is false, the response body contains the file stream.

Returns

Promise<ArrayBuffer>

generateDeploymentGroupAccessToken(string, number)

GET a PAT token for managing (configuring, removing, tagging) deployment targets in a deployment group.

function generateDeploymentGroupAccessToken(project: string, deploymentGroupId: number): Promise<string>

Parameters

project

string

Project ID or project name

deploymentGroupId

number

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

Returns

Promise<string>

generateDeploymentMachineGroupAccessToken(string, number)

function generateDeploymentMachineGroupAccessToken(project: string, machineGroupId: number): Promise<string>

Parameters

project

string

Project ID or project name

machineGroupId

number

Returns

Promise<string>

generateDeploymentPoolAccessToken(number)

GET a PAT token for managing (configuring, removing, tagging) deployment agents in a deployment pool.

function generateDeploymentPoolAccessToken(poolId: number): Promise<string>

Parameters

poolId

number

ID of the deployment pool in which deployment agents are managed.

Returns

Promise<string>

getAgent(number, number, boolean, boolean, boolean, string[])

Get information about an agent.

function getAgent(poolId: number, agentId: number, includeCapabilities?: boolean, includeAssignedRequest?: boolean, includeLastCompletedRequest?: boolean, propertyFilters?: string[]): Promise<TaskAgent>

Parameters

poolId

number

The agent pool containing the agent

agentId

number

The agent ID to get information about

includeCapabilities

boolean

Whether to include the agent's capabilities in the response

includeAssignedRequest

boolean

Whether to include details about the agent's current work

includeLastCompletedRequest

boolean

Whether to include details about the agents' most recent completed work

propertyFilters

string[]

Filter which custom properties will be returned

Returns

Promise<TaskAgent>

getAgentCloud(number)

function getAgentCloud(agentCloudId: number): Promise<TaskAgentCloud>

Parameters

agentCloudId

number

Returns

Promise<TaskAgentCloud>

getAgentCloudRequests(number)

function getAgentCloudRequests(agentCloudId: number): Promise<TaskAgentCloudRequest[]>

Parameters

agentCloudId

number

Returns

getAgentClouds()

function getAgentClouds(): Promise<TaskAgentCloud[]>

Returns

Promise<TaskAgentCloud[]>

getAgentCloudTypes()

Get agent cloud types.

function getAgentCloudTypes(): Promise<TaskAgentCloudType[]>

Returns

Promise<TaskAgentCloudType[]>

getAgentPool(number, string[], TaskAgentPoolActionFilter)

Get information about an agent pool.

function getAgentPool(poolId: number, properties?: string[], actionFilter?: TaskAgentPoolActionFilter): Promise<TaskAgentPool>

Parameters

poolId

number

An agent pool ID

properties

string[]

Agent pool properties (comma-separated)

actionFilter
TaskAgentPoolActionFilter

Filter by whether the calling user has use or manage permissions

Returns

Promise<TaskAgentPool>

getAgentPoolMaintenanceDefinition(number, number)

function getAgentPoolMaintenanceDefinition(poolId: number, definitionId: number): Promise<TaskAgentPoolMaintenanceDefinition>

Parameters

poolId

number

definitionId

number

Returns

getAgentPoolMaintenanceDefinitions(number)

function getAgentPoolMaintenanceDefinitions(poolId: number): Promise<TaskAgentPoolMaintenanceDefinition[]>

Parameters

poolId

number

Returns

getAgentPoolMaintenanceJob(number, number)

function getAgentPoolMaintenanceJob(poolId: number, jobId: number): Promise<TaskAgentPoolMaintenanceJob>

Parameters

poolId

number

jobId

number

Returns

getAgentPoolMaintenanceJobLogs(number, number)

function getAgentPoolMaintenanceJobLogs(poolId: number, jobId: number): Promise<ArrayBuffer>

Parameters

poolId

number

jobId

number

Returns

Promise<ArrayBuffer>

getAgentPoolMaintenanceJobs(number, number)

function getAgentPoolMaintenanceJobs(poolId: number, definitionId?: number): Promise<TaskAgentPoolMaintenanceJob[]>

Parameters

poolId

number

definitionId

number

Returns

getAgentPoolMetadata(number)

function getAgentPoolMetadata(poolId: number): Promise<string>

Parameters

poolId

number

Returns

Promise<string>

getAgentPools(string, string[], TaskAgentPoolType, TaskAgentPoolActionFilter)

Get a list of agent pools.

function getAgentPools(poolName?: string, properties?: string[], poolType?: TaskAgentPoolType, actionFilter?: TaskAgentPoolActionFilter): Promise<TaskAgentPool[]>

Parameters

poolName

string

Filter by name

properties

string[]

Filter by agent pool properties (comma-separated)

poolType
TaskAgentPoolType

Filter by pool type

actionFilter
TaskAgentPoolActionFilter

Filter by whether the calling user has use or manage permissions

Returns

Promise<TaskAgentPool[]>

getAgentPoolsByIds(number[], TaskAgentPoolActionFilter)

Get a list of agent pools.

function getAgentPoolsByIds(poolIds: number[], actionFilter?: TaskAgentPoolActionFilter): Promise<TaskAgentPool[]>

Parameters

poolIds

number[]

pool Ids to fetch

actionFilter
TaskAgentPoolActionFilter

Filter by whether the calling user has use or manage permissions

Returns

Promise<TaskAgentPool[]>

getAgentQueue(number, string, TaskAgentQueueActionFilter)

Get information about an agent queue.

function getAgentQueue(queueId: number, project?: string, actionFilter?: TaskAgentQueueActionFilter): Promise<TaskAgentQueue>

Parameters

queueId

number

The agent queue to get information about

project

string

Project ID or project name

actionFilter
TaskAgentQueueActionFilter

Filter by whether the calling user has use or manage permissions

Returns

Promise<TaskAgentQueue>

getAgentQueues(string, string, TaskAgentQueueActionFilter)

Get a list of agent queues.

function getAgentQueues(project?: string, queueName?: string, actionFilter?: TaskAgentQueueActionFilter): Promise<TaskAgentQueue[]>

Parameters

project

string

Project ID or project name

queueName

string

Filter on the agent queue name

actionFilter
TaskAgentQueueActionFilter

Filter by whether the calling user has use or manage permissions

Returns

Promise<TaskAgentQueue[]>

getAgentQueuesByIds(number[], string, TaskAgentQueueActionFilter)

Get a list of agent queues by their IDs

function getAgentQueuesByIds(queueIds: number[], project?: string, actionFilter?: TaskAgentQueueActionFilter): Promise<TaskAgentQueue[]>

Parameters

queueIds

number[]

A comma-separated list of agent queue IDs to retrieve

project

string

Project ID or project name

actionFilter
TaskAgentQueueActionFilter

Filter by whether the calling user has use or manage permissions

Returns

Promise<TaskAgentQueue[]>

getAgentQueuesByNames(string[], string, TaskAgentQueueActionFilter)

Get a list of agent queues by their names

function getAgentQueuesByNames(queueNames: string[], project?: string, actionFilter?: TaskAgentQueueActionFilter): Promise<TaskAgentQueue[]>

Parameters

queueNames

string[]

A comma-separated list of agent names to retrieve

project

string

Project ID or project name

actionFilter
TaskAgentQueueActionFilter

Filter by whether the calling user has use or manage permissions

Returns

Promise<TaskAgentQueue[]>

getAgentQueuesForPools(number[], string, TaskAgentQueueActionFilter)

Get a list of agent queues by pool ids

function getAgentQueuesForPools(poolIds: number[], project?: string, actionFilter?: TaskAgentQueueActionFilter): Promise<TaskAgentQueue[]>

Parameters

poolIds

number[]

A comma-separated list of pool ids to get the corresponding queues for

project

string

Project ID or project name

actionFilter
TaskAgentQueueActionFilter

Filter by whether the calling user has use or manage permissions

Returns

Promise<TaskAgentQueue[]>

getAgentRequest(number, number, boolean)

function getAgentRequest(poolId: number, requestId: number, includeStatus?: boolean): Promise<TaskAgentJobRequest>

Parameters

poolId

number

requestId

number

includeStatus

boolean

Returns

getAgentRequests(number, number, string)

function getAgentRequests(poolId: number, top: number, continuationToken?: string): Promise<PagedList<TaskAgentJobRequest>>

Parameters

poolId

number

top

number

continuationToken

string

Returns

getAgentRequestsForAgent(number, number, number)

function getAgentRequestsForAgent(poolId: number, agentId: number, completedRequestCount?: number): Promise<TaskAgentJobRequest[]>

Parameters

poolId

number

agentId

number

completedRequestCount

number

Returns

Promise<TaskAgentJobRequest[]>

getAgentRequestsForAgents(number, number[], number)

function getAgentRequestsForAgents(poolId: number, agentIds?: number[], completedRequestCount?: number): Promise<TaskAgentJobRequest[]>

Parameters

poolId

number

agentIds

number[]

completedRequestCount

number

Returns

Promise<TaskAgentJobRequest[]>

getAgentRequestsForDeploymentMachine(string, number, number, number)

function getAgentRequestsForDeploymentMachine(project: string, deploymentGroupId: number, machineId: number, completedRequestCount?: number): Promise<TaskAgentJobRequest[]>

Parameters

project

string

Project ID or project name

deploymentGroupId

number

machineId

number

completedRequestCount

number

Returns

Promise<TaskAgentJobRequest[]>

getAgentRequestsForDeploymentMachines(string, number, number[], number)

function getAgentRequestsForDeploymentMachines(project: string, deploymentGroupId: number, machineIds?: number[], completedRequestCount?: number): Promise<TaskAgentJobRequest[]>

Parameters

project

string

Project ID or project name

deploymentGroupId

number

machineIds

number[]

completedRequestCount

number

Returns

Promise<TaskAgentJobRequest[]>

getAgentRequestsForDeploymentTarget(string, number, number, number)

Get agent requests for a deployment target.

function getAgentRequestsForDeploymentTarget(project: string, deploymentGroupId: number, targetId: number, completedRequestCount?: number): Promise<TaskAgentJobRequest[]>

Parameters

project

string

Project ID or project name

deploymentGroupId

number

ID of the deployment group to which the target belongs.

targetId

number

ID of the deployment target.

completedRequestCount

number

Maximum number of completed requests to return. Default is 50

Returns

Promise<TaskAgentJobRequest[]>

getAgentRequestsForDeploymentTargets(string, number, number[], number, Date, number)

Get agent requests for a list deployment targets.

function getAgentRequestsForDeploymentTargets(project: string, deploymentGroupId: number, targetIds?: number[], ownerId?: number, completedOn?: Date, completedRequestCount?: number): Promise<TaskAgentJobRequest[]>

Parameters

project

string

Project ID or project name

deploymentGroupId

number

ID of the deployment group to which the targets belong.

targetIds

number[]

Comma separated list of IDs of the deployment targets.

ownerId

number

Id of owner of agent job request.

completedOn

Date

Datetime to return request after this time.

completedRequestCount

number

Maximum number of completed requests to return for each target. Default is 50

Returns

Promise<TaskAgentJobRequest[]>

getAgentRequestsForPlan(number, string, string)

function getAgentRequestsForPlan(poolId: number, planId: string, jobId?: string): Promise<TaskAgentJobRequest[]>

Parameters

poolId

number

planId

string

jobId

string

Returns

Promise<TaskAgentJobRequest[]>

getAgentRequestsForQueue(string, number, number, string)

function getAgentRequestsForQueue(project: string, queueId: number, top: number, continuationToken?: string): Promise<PagedList<TaskAgentJobRequest>>

Parameters

project

string

Project ID or project name

queueId

number

top

number

continuationToken

string

Returns

getAgents(number, string, boolean, boolean, boolean, string[], string[])

Get a list of agents.

function getAgents(poolId: number, agentName?: string, includeCapabilities?: boolean, includeAssignedRequest?: boolean, includeLastCompletedRequest?: boolean, propertyFilters?: string[], demands?: string[]): Promise<TaskAgent[]>

Parameters

poolId

number

The agent pool containing the agents

agentName

string

Filter on agent name

includeCapabilities

boolean

Whether to include the agents' capabilities in the response

includeAssignedRequest

boolean

Whether to include details about the agents' current work

includeLastCompletedRequest

boolean

Whether to include details about the agents' most recent completed work

propertyFilters

string[]

Filter which custom properties will be returned

demands

string[]

Filter by demands the agents can satisfy

Returns

Promise<TaskAgent[]>

getAzureManagementGroups()

Returns list of azure subscriptions

function getAzureManagementGroups(): Promise<AzureManagementGroupQueryResult>

Returns

getAzureSubscriptions()

Returns list of azure subscriptions

function getAzureSubscriptions(): Promise<AzureSubscriptionQueryResult>

Returns

getDeploymentGroup(string, number, DeploymentGroupActionFilter, DeploymentGroupExpands)

Get a deployment group by its ID.

function getDeploymentGroup(project: string, deploymentGroupId: number, actionFilter?: DeploymentGroupActionFilter, expand?: DeploymentGroupExpands): Promise<DeploymentGroup>

Parameters

project

string

Project ID or project name

deploymentGroupId

number

ID of the deployment group.

actionFilter
DeploymentGroupActionFilter

Get the deployment group only if this action can be performed on it.

expand
DeploymentGroupExpands

Include these additional details in the returned object.

Returns

Promise<DeploymentGroup>

getDeploymentGroups(string, string, DeploymentGroupActionFilter, DeploymentGroupExpands, string, number, number[])

Get a list of deployment groups by name or IDs.

function getDeploymentGroups(project: string, name?: string, actionFilter?: DeploymentGroupActionFilter, expand?: DeploymentGroupExpands, continuationToken?: string, top?: number, ids?: number[]): Promise<PagedList<DeploymentGroup>>

Parameters

project

string

Project ID or project name

name

string

Name of the deployment group.

actionFilter
DeploymentGroupActionFilter

Get only deployment groups on which this action can be performed.

expand
DeploymentGroupExpands

Include these additional details in the returned objects.

continuationToken

string

Get deployment groups with names greater than this continuationToken lexicographically.

top

number

Maximum number of deployment groups to return. Default is 1000.

ids

number[]

Comma separated list of IDs of the deployment groups.

Returns

getDeploymentGroupsMetrics(string, string, string, number)

Get a list of deployment group metrics.

function getDeploymentGroupsMetrics(project: string, deploymentGroupName?: string, continuationToken?: string, top?: number): Promise<PagedList<DeploymentGroupMetrics>>

Parameters

project

string

Project ID or project name

deploymentGroupName

string

Name of the deployment group.

continuationToken

string

Get metrics for deployment groups with names greater than this continuationToken lexicographically.

top

number

Maximum number of deployment group metrics to return. Default is 50.

Returns

getDeploymentMachine(string, number, number, DeploymentMachineExpands)

function getDeploymentMachine(project: string, deploymentGroupId: number, machineId: number, expand?: DeploymentMachineExpands): Promise<DeploymentMachine>

Parameters

project

string

Project ID or project name

deploymentGroupId

number

machineId

number

Returns

getDeploymentMachineGroup(string, number, MachineGroupActionFilter)

function getDeploymentMachineGroup(project: string, machineGroupId: number, actionFilter?: MachineGroupActionFilter): Promise<DeploymentMachineGroup>

Parameters

project

string

Project ID or project name

machineGroupId

number

Returns

getDeploymentMachineGroupMachines(string, number, string[])

function getDeploymentMachineGroupMachines(project: string, machineGroupId: number, tagFilters?: string[]): Promise<DeploymentMachine[]>

Parameters

project

string

Project ID or project name

machineGroupId

number

tagFilters

string[]

Returns

Promise<DeploymentMachine[]>

getDeploymentMachineGroups(string, string, MachineGroupActionFilter)

function getDeploymentMachineGroups(project: string, machineGroupName?: string, actionFilter?: MachineGroupActionFilter): Promise<DeploymentMachineGroup[]>

Parameters

project

string

Project ID or project name

machineGroupName

string

Returns

getDeploymentMachines(string, number, string[], string, DeploymentMachineExpands)

function getDeploymentMachines(project: string, deploymentGroupId: number, tags?: string[], name?: string, expand?: DeploymentMachineExpands): Promise<DeploymentMachine[]>

Parameters

project

string

Project ID or project name

deploymentGroupId

number

tags

string[]

name

string

Returns

Promise<DeploymentMachine[]>

getDeploymentPoolsSummary(string, DeploymentPoolSummaryExpands, number[])

Get a list of deployment pool summaries.

function getDeploymentPoolsSummary(poolName?: string, expands?: DeploymentPoolSummaryExpands, poolIds?: number[]): Promise<DeploymentPoolSummary[]>

Parameters

poolName

string

Name of the deployment pool.

expands
DeploymentPoolSummaryExpands

Include these additional details in the returned objects.

poolIds

number[]

List of deployment pool ids.

Returns

getDeploymentTarget(string, number, number, DeploymentTargetExpands)

Get a deployment target by its ID in a deployment group

function getDeploymentTarget(project: string, deploymentGroupId: number, targetId: number, expand?: DeploymentTargetExpands): Promise<DeploymentMachine>

Parameters

project

string

Project ID or project name

deploymentGroupId

number

ID of the deployment group to which deployment target belongs.

targetId

number

ID of the deployment target to return.

expand
DeploymentTargetExpands

Include these additional details in the returned objects.

Returns

getDeploymentTargets(string, number, string[], string, boolean, DeploymentTargetExpands, TaskAgentStatusFilter, TaskAgentJobResultFilter, string, number, boolean, string[])

Get a list of deployment targets in a deployment group.

function getDeploymentTargets(project: string, deploymentGroupId: number, tags?: string[], name?: string, partialNameMatch?: boolean, expand?: DeploymentTargetExpands, agentStatus?: TaskAgentStatusFilter, agentJobResult?: TaskAgentJobResultFilter, continuationToken?: string, top?: number, enabled?: boolean, propertyFilters?: string[]): Promise<PagedList<DeploymentMachine>>

Parameters

project

string

Project ID or project name

deploymentGroupId

number

ID of the deployment group.

tags

string[]

Get only the deployment targets that contain all these comma separted list of tags.

name

string

Name pattern of the deployment targets to return.

partialNameMatch

boolean

When set to true, treats name as pattern. Else treats it as absolute match. Default is false.

expand
DeploymentTargetExpands

Include these additional details in the returned objects.

agentStatus
TaskAgentStatusFilter

Get only deployment targets that have this status.

agentJobResult
TaskAgentJobResultFilter

Get only deployment targets that have this last job result.

continuationToken

string

Get deployment targets with names greater than this continuationToken lexicographically.

top

number

Maximum number of deployment targets to return. Default is 1000.

enabled

boolean

Get only deployment targets that are enabled or disabled. Default is 'null' which returns all the targets.

propertyFilters

string[]

Returns

getEnvironmentById(string, number, EnvironmentExpands)

Get an environment by its ID.

function getEnvironmentById(project: string, environmentId: number, expands?: EnvironmentExpands): Promise<EnvironmentInstance>

Parameters

project

string

Project ID or project name

environmentId

number

ID of the environment.

expands
EnvironmentExpands

Include these additional details in the returned objects.

Returns

getEnvironmentDeploymentExecutionRecords(string, number, string, number)

Get environment deployment execution history

function getEnvironmentDeploymentExecutionRecords(project: string, environmentId: number, continuationToken?: string, top?: number): Promise<PagedList<EnvironmentDeploymentExecutionRecord>>

Parameters

project

string

Project ID or project name

environmentId

number

continuationToken

string

top

number

Returns

getEnvironments(string, string, string, number)

Get all environments.

function getEnvironments(project: string, name?: string, continuationToken?: string, top?: number): Promise<PagedList<EnvironmentInstance>>

Parameters

project

string

Project ID or project name

name

string

continuationToken

string

top

number

Returns

getKubernetesResource(string, number, number)

function getKubernetesResource(project: string, environmentId: number, resourceId: number): Promise<KubernetesResource>

Parameters

project

string

Project ID or project name

environmentId

number

resourceId

number

Returns

getMessage(number, string, number)

function getMessage(poolId: number, sessionId: string, lastMessageId?: number): Promise<TaskAgentMessage>

Parameters

poolId

number

sessionId

string

lastMessageId

number

Returns

Promise<TaskAgentMessage>

getPackage(string, string, string)

function getPackage(packageType: string, platform: string, version: string): Promise<PackageMetadata>

Parameters

packageType

string

platform

string

version

string

Returns

Promise<PackageMetadata>

getPackages(string, string, number)

function getPackages(packageType: string, platform?: string, top?: number): Promise<PackageMetadata[]>

Parameters

packageType

string

platform

string

top

number

Returns

Promise<PackageMetadata[]>

getResourceLimits()

function getResourceLimits(): Promise<ResourceLimit[]>

Returns

Promise<ResourceLimit[]>

getResourceUsage(string, boolean, boolean)

function getResourceUsage(parallelismTag?: string, poolIsHosted?: boolean, includeRunningRequests?: boolean): Promise<ResourceUsage>

Parameters

parallelismTag

string

poolIsHosted

boolean

includeRunningRequests

boolean

Returns

Promise<ResourceUsage>

getSecureFile(string, string, boolean, SecureFileActionFilter)

Get a secure file

function getSecureFile(project: string, secureFileId: string, includeDownloadTicket?: boolean, actionFilter?: SecureFileActionFilter): Promise<SecureFile>

Parameters

project

string

Project ID or project name

secureFileId

string

The unique secure file Id

includeDownloadTicket

boolean

If includeDownloadTicket is true and the caller has permissions, a download ticket is included in the response.

actionFilter
SecureFileActionFilter

Returns

Promise<SecureFile>

getSecureFiles(string, string, boolean, SecureFileActionFilter)

Get secure files

function getSecureFiles(project: string, namePattern?: string, includeDownloadTickets?: boolean, actionFilter?: SecureFileActionFilter): Promise<SecureFile[]>

Parameters

project

string

Project ID or project name

namePattern

string

Name of the secure file to match. Can include wildcards to match multiple files.

includeDownloadTickets

boolean

If includeDownloadTickets is true and the caller has permissions, a download ticket for each secure file is included in the response.

actionFilter
SecureFileActionFilter

Filter by secure file permissions for View, Manage or Use action. Defaults to View.

Returns

Promise<SecureFile[]>

getSecureFilesByIds(string, string[], boolean, SecureFileActionFilter)

Get secure files

function getSecureFilesByIds(project: string, secureFileIds: string[], includeDownloadTickets?: boolean, actionFilter?: SecureFileActionFilter): Promise<SecureFile[]>

Parameters

project

string

Project ID or project name

secureFileIds

string[]

A list of secure file Ids

includeDownloadTickets

boolean

If includeDownloadTickets is true and the caller has permissions, a download ticket for each secure file is included in the response.

actionFilter
SecureFileActionFilter

Returns

Promise<SecureFile[]>

getSecureFilesByNames(string, string[], boolean, SecureFileActionFilter)

Get secure files

function getSecureFilesByNames(project: string, secureFileNames: string[], includeDownloadTickets?: boolean, actionFilter?: SecureFileActionFilter): Promise<SecureFile[]>

Parameters

project

string

Project ID or project name

secureFileNames

string[]

A list of secure file Ids

includeDownloadTickets

boolean

If includeDownloadTickets is true and the caller has permissions, a download ticket for each secure file is included in the response.

actionFilter
SecureFileActionFilter

Returns

Promise<SecureFile[]>

getTaskContentZip(string, string, string[], boolean)

function getTaskContentZip(taskId: string, versionString: string, visibility?: string[], scopeLocal?: boolean): Promise<ArrayBuffer>

Parameters

taskId

string

versionString

string

visibility

string[]

scopeLocal

boolean

Returns

Promise<ArrayBuffer>

getTaskDefinition(string, string, string[], boolean)

function getTaskDefinition(taskId: string, versionString: string, visibility?: string[], scopeLocal?: boolean): Promise<TaskDefinition>

Parameters

taskId

string

versionString

string

visibility

string[]

scopeLocal

boolean

Returns

Promise<TaskDefinition>

getTaskDefinitions(string, string[], boolean, boolean)

function getTaskDefinitions(taskId?: string, visibility?: string[], scopeLocal?: boolean, allVersions?: boolean): Promise<TaskDefinition[]>

Parameters

taskId

string

visibility

string[]

scopeLocal

boolean

allVersions

boolean

Returns

Promise<TaskDefinition[]>

getTaskGroup(string, string, string, TaskGroupExpands)

Get task group.

function getTaskGroup(project: string, taskGroupId: string, versionSpec: string, expand?: TaskGroupExpands): Promise<TaskGroup>

Parameters

project

string

Project ID or project name

taskGroupId

string

Id of the task group.

versionSpec

string

version specification of the task group. examples: 1, 1.0.

expand
TaskGroupExpands

The properties that should be expanded. example $expand=Tasks will expand nested task groups.

Returns

Promise<TaskGroup>

getTaskGroupHistory(string, string)

function getTaskGroupHistory(project: string, taskGroupId: string): Promise<TaskGroupRevision[]>

Parameters

project

string

Project ID or project name

taskGroupId

string

Returns

Promise<TaskGroupRevision[]>

getTaskGroupRevision(string, string, number)

function getTaskGroupRevision(project: string, taskGroupId: string, revision: number): Promise<string>

Parameters

project

string

Project ID or project name

taskGroupId

string

revision

number

Returns

Promise<string>

getTaskGroups(string, string, boolean, string, boolean, number, Date, TaskGroupQueryOrder)

List task groups.

function getTaskGroups(project: string, taskGroupId?: string, expanded?: boolean, taskIdFilter?: string, deleted?: boolean, top?: number, continuationToken?: Date, queryOrder?: TaskGroupQueryOrder): Promise<TaskGroup[]>

Parameters

project

string

Project ID or project name

taskGroupId

string

Id of the task group.

expanded

boolean

'true' to recursively expand task groups. Default is 'false'.

taskIdFilter

string

Guid of the taskId to filter.

deleted

boolean

'true'to include deleted task groups. Default is 'false'.

top

number

Number of task groups to get.

continuationToken

Date

Gets the task groups after the continuation token provided.

queryOrder
TaskGroupQueryOrder

Gets the results in the defined order. Default is 'CreatedOnDescending'.

Returns

Promise<TaskGroup[]>

getTaskHubLicenseDetails(string, boolean, boolean)

function getTaskHubLicenseDetails(hubName: string, includeEnterpriseUsersCount?: boolean, includeHostedAgentMinutesCount?: boolean): Promise<TaskHubLicenseDetails>

Parameters

hubName

string

includeEnterpriseUsersCount

boolean

includeHostedAgentMinutesCount

boolean

Returns

getVariableGroup(string, number)

Get a variable group.

function getVariableGroup(project: string, groupId: number): Promise<VariableGroup>

Parameters

project

string

Project ID or project name

groupId

number

Id of the variable group.

Returns

Promise<VariableGroup>

getVariableGroups(string, string, VariableGroupActionFilter, number, number, VariableGroupQueryOrder)

Get variable groups.

function getVariableGroups(project: string, groupName?: string, actionFilter?: VariableGroupActionFilter, top?: number, continuationToken?: number, queryOrder?: VariableGroupQueryOrder): Promise<VariableGroup[]>

Parameters

project

string

Project ID or project name

groupName

string

Name of variable group.

actionFilter
VariableGroupActionFilter

Action filter for the variable group. It specifies the action which can be performed on the variable groups.

top

number

Number of variable groups to get.

continuationToken

number

Gets the variable groups after the continuation token provided.

queryOrder
VariableGroupQueryOrder

Gets the results in the defined order. Default is 'IdDescending'.

Returns

Promise<VariableGroup[]>

getVariableGroupsById(string, number[], boolean)

Get variable groups by ids.

function getVariableGroupsById(project: string, groupIds: number[], loadSecrets?: boolean): Promise<VariableGroup[]>

Parameters

project

string

Project ID or project name

groupIds

number[]

Comma separated list of Ids of variable groups.

loadSecrets

boolean

Flag indicating if the secrets within variable groups should be loaded.

Returns

Promise<VariableGroup[]>

getVirtualMachineGroup(string, number, number)

function getVirtualMachineGroup(project: string, environmentId: number, resourceId: number): Promise<VirtualMachineGroup>

Parameters

project

string

Project ID or project name

environmentId

number

resourceId

number

Returns

getVirtualMachines(string, number, number, string, string, boolean, string[], number)

function getVirtualMachines(project: string, environmentId: number, resourceId: number, continuationToken?: string, name?: string, partialNameMatch?: boolean, tags?: string[], top?: number): Promise<PagedList<VirtualMachine>>

Parameters

project

string

Project ID or project name

environmentId

number

resourceId

number

continuationToken

string

name

string

partialNameMatch

boolean

tags

string[]

top

number

Returns

getVstsAadTenantId()

function getVstsAadTenantId(): Promise<string>

Returns

Promise<string>

getYamlSchema(boolean)

GET the Yaml schema used for Yaml file validation.

function getYamlSchema(validateTaskNames?: boolean): Promise<any>

Parameters

validateTaskNames

boolean

Whether the schema should validate that tasks are actually installed (useful for offline tools where you don't want validation).

Returns

Promise<any>

hasPoolPermissions(number, number)

Checks if current identity has passed permissions on a pool.

function hasPoolPermissions(poolId: number, permissions: number): Promise<boolean>

Parameters

poolId

number

Id of the pool to check

permissions

number

Permissions to check. Multiple permissions might be merged into single value using bitwise OR operator (e.g. AgentPoolPermissions.Manage | AgentPoolPermissions.View)

Returns

Promise<boolean>

publishTaskGroup(PublishTaskGroupMetadata, string, string)

function publishTaskGroup(taskGroupMetadata: PublishTaskGroupMetadata, project: string, parentTaskGroupId: string): Promise<TaskGroup[]>

Parameters

taskGroupMetadata
PublishTaskGroupMetadata
project

string

Project ID or project name

parentTaskGroupId

string

Returns

Promise<TaskGroup[]>

queryEndpoint(TaskDefinitionEndpoint)

Proxy for a GET request defined by an 'endpoint'. The request is authorized using a service connection. The response is filtered using an XPath/Json based selector.

function queryEndpoint(endpoint: TaskDefinitionEndpoint): Promise<string[]>

Parameters

endpoint
TaskDefinitionEndpoint

Describes the URL to fetch.

Returns

Promise<string[]>

querySecureFilesByProperties(string, string, string)

Query secure files using a name pattern and a condition on file properties.

function querySecureFilesByProperties(condition: string, project: string, namePattern?: string): Promise<SecureFile[]>

Parameters

condition

string

The main condition syntax is described here. Use the property('property-name') function to access the value of the specified property of a secure file. It returns null if the property is not set. E.g. and( eq( property('devices'), '2' ), in( property('provisioning profile type'), 'ad hoc', 'development' ) )

project

string

Project ID or project name

namePattern

string

Name of the secure file to match. Can include wildcards to match multiple files.

Returns

Promise<SecureFile[]>

queueAgentPoolMaintenanceJob(TaskAgentPoolMaintenanceJob, number)

function queueAgentPoolMaintenanceJob(job: TaskAgentPoolMaintenanceJob, poolId: number): Promise<TaskAgentPoolMaintenanceJob>

Parameters

poolId

number

Returns

queueAgentRequest(TaskAgentJobRequest, string, number)

function queueAgentRequest(request: TaskAgentJobRequest, project: string, queueId: number): Promise<TaskAgentJobRequest>

Parameters

project

string

Project ID or project name

queueId

number

Returns

queueAgentRequestByPool(TaskAgentJobRequest, number)

function queueAgentRequestByPool(request: TaskAgentJobRequest, poolId: number): Promise<TaskAgentJobRequest>

Parameters

poolId

number

Returns

refreshAgent(number, number)

function refreshAgent(poolId: number, agentId: number): Promise<void>

Parameters

poolId

number

agentId

number

Returns

Promise<void>

refreshAgents(number)

function refreshAgents(poolId: number): Promise<void>

Parameters

poolId

number

Returns

Promise<void>

refreshDeploymentMachines(string, number)

function refreshDeploymentMachines(project: string, deploymentGroupId: number): Promise<void>

Parameters

project

string

Project ID or project name

deploymentGroupId

number

Returns

Promise<void>

refreshDeploymentTargets(string, number)

Upgrade the deployment targets in a deployment group.

function refreshDeploymentTargets(project: string, deploymentGroupId: number): Promise<void>

Parameters

project

string

Project ID or project name

deploymentGroupId

number

ID of the deployment group.

Returns

Promise<void>

replaceAgent(TaskAgent, number, number)

Replace an agent. You probably don't want to call this endpoint directly. Instead, use the agent configuration script to remove and reconfigure an agent from your organization.

function replaceAgent(agent: TaskAgent, poolId: number, agentId: number): Promise<TaskAgent>

Parameters

agent
TaskAgent

Updated details about the replacing agent

poolId

number

The agent pool to use

agentId

number

The agent to replace

Returns

Promise<TaskAgent>

replaceDeploymentMachine(DeploymentMachine, string, number, number)

function replaceDeploymentMachine(machine: DeploymentMachine, project: string, deploymentGroupId: number, machineId: number): Promise<DeploymentMachine>

Parameters

project

string

Project ID or project name

deploymentGroupId

number

machineId

number

Returns

replaceDeploymentTarget(DeploymentMachine, string, number, number)

Replace a deployment target in a deployment group. Generally this is called by agent configuration tool.

function replaceDeploymentTarget(machine: DeploymentMachine, project: string, deploymentGroupId: number, targetId: number): Promise<DeploymentMachine>

Parameters

machine
DeploymentMachine

New deployment target.

project

string

Project ID or project name

deploymentGroupId

number

ID of the deployment group in which deployment target is replaced.

targetId

number

ID of the deployment target to replace.

Returns

sendMessage(TaskAgentMessage, number, number)

function sendMessage(message: TaskAgentMessage, poolId: number, requestId: number): Promise<void>

Parameters

poolId

number

requestId

number

Returns

Promise<void>

setAgentPoolMetadata(any, number)

function setAgentPoolMetadata(agentPoolMetadata: any, poolId: number): Promise<void>

Parameters

agentPoolMetadata

any

poolId

number

Returns

Promise<void>

shareVariableGroup(VariableGroupProjectReference[], number)

Add a variable group.

function shareVariableGroup(variableGroupProjectReferences: VariableGroupProjectReference[], variableGroupId: number): Promise<void>

Parameters

variableGroupProjectReferences

VariableGroupProjectReference[]

variableGroupId

number

Returns

Promise<void>

undeleteTaskGroup(TaskGroup, string)

function undeleteTaskGroup(taskGroup: TaskGroup, project: string): Promise<TaskGroup[]>

Parameters

taskGroup
TaskGroup
project

string

Project ID or project name

Returns

Promise<TaskGroup[]>

updateAgent(TaskAgent, number, number)

Update agent details.

function updateAgent(agent: TaskAgent, poolId: number, agentId: number): Promise<TaskAgent>

Parameters

agent
TaskAgent

Updated details about the agent

poolId

number

The agent pool to use

agentId

number

The agent to update

Returns

Promise<TaskAgent>

updateAgentCloud(TaskAgentCloud, number)

function updateAgentCloud(updatedCloud: TaskAgentCloud, agentCloudId: number): Promise<TaskAgentCloud>

Parameters

updatedCloud
TaskAgentCloud
agentCloudId

number

Returns

Promise<TaskAgentCloud>

updateAgentPool(TaskAgentPool, number)

Update properties on an agent pool

function updateAgentPool(pool: TaskAgentPool, poolId: number): Promise<TaskAgentPool>

Parameters

pool
TaskAgentPool

Updated agent pool details

poolId

number

The agent pool to update

Returns

Promise<TaskAgentPool>

updateAgentPoolMaintenanceDefinition(TaskAgentPoolMaintenanceDefinition, number, number)

function updateAgentPoolMaintenanceDefinition(definition: TaskAgentPoolMaintenanceDefinition, poolId: number, definitionId: number): Promise<TaskAgentPoolMaintenanceDefinition>

Parameters

poolId

number

definitionId

number

Returns

updateAgentPoolMaintenanceJob(TaskAgentPoolMaintenanceJob, number, number)

function updateAgentPoolMaintenanceJob(job: TaskAgentPoolMaintenanceJob, poolId: number, jobId: number): Promise<TaskAgentPoolMaintenanceJob>

Parameters

poolId

number

jobId

number

Returns

updateAgentRequest(TaskAgentJobRequest, number, number, string, TaskAgentRequestUpdateOptions)

function updateAgentRequest(request: TaskAgentJobRequest, poolId: number, requestId: number, lockToken: string, updateOptions?: TaskAgentRequestUpdateOptions): Promise<TaskAgentJobRequest>

Parameters

poolId

number

requestId

number

lockToken

string

Returns

updateAgentUpdateState(number, number, string)

function updateAgentUpdateState(poolId: number, agentId: number, currentState: string): Promise<TaskAgent>

Parameters

poolId

number

agentId

number

currentState

string

Returns

Promise<TaskAgent>

updateAgentUserCapabilities({[key: string]: string}, number, number)

function updateAgentUserCapabilities(userCapabilities: {[key: string]: string}, poolId: number, agentId: number): Promise<TaskAgent>

Parameters

userCapabilities

{[key: string]: string}

poolId

number

agentId

number

Returns

Promise<TaskAgent>

updateDeploymentGroup(DeploymentGroupUpdateParameter, string, number)

Update a deployment group.

function updateDeploymentGroup(deploymentGroup: DeploymentGroupUpdateParameter, project: string, deploymentGroupId: number): Promise<DeploymentGroup>

Parameters

deploymentGroup
DeploymentGroupUpdateParameter

Deployment group to update.

project

string

Project ID or project name

deploymentGroupId

number

ID of the deployment group.

Returns

Promise<DeploymentGroup>

updateDeploymentMachine(DeploymentMachine, string, number, number)

function updateDeploymentMachine(machine: DeploymentMachine, project: string, deploymentGroupId: number, machineId: number): Promise<DeploymentMachine>

Parameters

project

string

Project ID or project name

deploymentGroupId

number

machineId

number

Returns

updateDeploymentMachineGroup(DeploymentMachineGroup, string, number)

function updateDeploymentMachineGroup(machineGroup: DeploymentMachineGroup, project: string, machineGroupId: number): Promise<DeploymentMachineGroup>

Parameters

machineGroup
DeploymentMachineGroup
project

string

Project ID or project name

machineGroupId

number

Returns

updateDeploymentMachineGroupMachines(DeploymentMachine[], string, number)

function updateDeploymentMachineGroupMachines(deploymentMachines: DeploymentMachine[], project: string, machineGroupId: number): Promise<DeploymentMachine[]>

Parameters

deploymentMachines

DeploymentMachine[]

project

string

Project ID or project name

machineGroupId

number

Returns

Promise<DeploymentMachine[]>

updateDeploymentMachines(DeploymentMachine[], string, number)

function updateDeploymentMachines(machines: DeploymentMachine[], project: string, deploymentGroupId: number): Promise<DeploymentMachine[]>

Parameters

machines

DeploymentMachine[]

project

string

Project ID or project name

deploymentGroupId

number

Returns

Promise<DeploymentMachine[]>

updateDeploymentTarget(DeploymentMachine, string, number, number)

Update a deployment target and its agent properties in a deployment group. Generally this is called by agent configuration tool.

function updateDeploymentTarget(machine: DeploymentMachine, project: string, deploymentGroupId: number, targetId: number): Promise<DeploymentMachine>

Parameters

machine
DeploymentMachine

Deployment target to update.

project

string

Project ID or project name

deploymentGroupId

number

ID of the deployment group in which deployment target is updated.

targetId

number

ID of the deployment target to update.

Returns

updateDeploymentTargets(DeploymentTargetUpdateParameter[], string, number)

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

function updateDeploymentTargets(machines: DeploymentTargetUpdateParameter[], project: string, deploymentGroupId: number): Promise<DeploymentMachine[]>

Parameters

machines

DeploymentTargetUpdateParameter[]

Deployment targets with tags to udpdate.

project

string

Project ID or project name

deploymentGroupId

number

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

Returns

Promise<DeploymentMachine[]>

updateEnvironment(EnvironmentUpdateParameter, string, number)

Update the specified environment.

function updateEnvironment(environmentUpdateParameter: EnvironmentUpdateParameter, project: string, environmentId: number): Promise<EnvironmentInstance>

Parameters

environmentUpdateParameter
EnvironmentUpdateParameter

Environment data to update.

project

string

Project ID or project name

environmentId

number

ID of the environment.

Returns

updateSecureFile(SecureFile, string, string)

Update the name or properties of an existing secure file

function updateSecureFile(secureFile: SecureFile, project: string, secureFileId: string): Promise<SecureFile>

Parameters

secureFile
SecureFile

The secure file with updated name and/or properties

project

string

Project ID or project name

secureFileId

string

The unique secure file Id

Returns

Promise<SecureFile>

updateSecureFiles(SecureFile[], string)

Update properties and/or names of a set of secure files. Files are identified by their IDs. Properties provided override the existing one entirely, i.e. do not merge.

function updateSecureFiles(secureFiles: SecureFile[], project: string): Promise<SecureFile[]>

Parameters

secureFiles

SecureFile[]

A list of secure file objects. Only three field must be populated Id, Name, and Properties. The rest of fields in the object are ignored.

project

string

Project ID or project name

Returns

Promise<SecureFile[]>

updateTaskGroup(TaskGroupUpdateParameter, string, string)

Update a task group.

function updateTaskGroup(taskGroup: TaskGroupUpdateParameter, project: string, taskGroupId?: string): Promise<TaskGroup>

Parameters

taskGroup
TaskGroupUpdateParameter

Task group to update.

project

string

Project ID or project name

taskGroupId

string

Id of the task group to update.

Returns

Promise<TaskGroup>

updateTaskGroupProperties(TaskGroupUpdatePropertiesBase, string, string, boolean)

function updateTaskGroupProperties(taskGroupUpdateProperties: TaskGroupUpdatePropertiesBase, project: string, taskGroupId: string, disablePriorVersions?: boolean): Promise<TaskGroup[]>

Parameters

taskGroupUpdateProperties
TaskGroupUpdatePropertiesBase
project

string

Project ID or project name

taskGroupId

string

disablePriorVersions

boolean

Returns

Promise<TaskGroup[]>

updateTaskHubLicenseDetails(TaskHubLicenseDetails, string)

function updateTaskHubLicenseDetails(taskHubLicenseDetails: TaskHubLicenseDetails, hubName: string): Promise<TaskHubLicenseDetails>

Parameters

taskHubLicenseDetails
TaskHubLicenseDetails
hubName

string

Returns

updateVariableGroup(VariableGroupParameters, number)

Update a variable group.

function updateVariableGroup(variableGroupParameters: VariableGroupParameters, groupId: number): Promise<VariableGroup>

Parameters

variableGroupParameters
VariableGroupParameters
groupId

number

Id of the variable group to update.

Returns

Promise<VariableGroup>

updateVirtualMachineGroup(VirtualMachineGroup, string, number)

function updateVirtualMachineGroup(resource: VirtualMachineGroup, project: string, environmentId: number): Promise<VirtualMachineGroup>

Parameters

project

string

Project ID or project name

environmentId

number

Returns

updateVirtualMachines(VirtualMachine[], string, number, number)

function updateVirtualMachines(machines: VirtualMachine[], project: string, environmentId: number, resourceId: number): Promise<VirtualMachine[]>

Parameters

machines

VirtualMachine[]

project

string

Project ID or project name

environmentId

number

resourceId

number

Returns

Promise<VirtualMachine[]>

uploadSecureFile(any, string, string, boolean)

Upload a secure file, include the file stream in the request body

function uploadSecureFile(content: any, project: string, name: string, authorizePipelines?: boolean): Promise<SecureFile>

Parameters

content

any

Content to upload

project

string

Project ID or project name

name

string

Name of the file to upload

authorizePipelines

boolean

If authorizePipelines is true, then the secure file is authorized for use by all pipelines in the project.

Returns

Promise<SecureFile>

validateInputs(InputValidationRequest)

function validateInputs(inputValidationRequest: InputValidationRequest): Promise<InputValidationRequest>

Parameters

inputValidationRequest
InputValidationRequest

Returns