Last Update: 9/26/2016

TaskAgentHttpClient2_1

This API is in private preview and subject to change.

Module path: TFS/DistributedTask/TaskAgentRestClient

Initialization sample

  import RestClient = require("TFS/DistributedTask/TaskAgentRestClient");

  // Get an instance of the client
  var client = RestClient.getClient();

  // Call a method on the client
  // e.g. client.getResource(...).then(...);

Methods

addAgent()

Syntax

 IPromise<Contracts.TaskAgent> addAgent(agent, poolId)

Parameters

Returns

addAgentPool()

Syntax

 IPromise<Contracts.TaskAgentPool> addAgentPool(pool)

Parameters

Returns

addAgentQueue()

Syntax

 IPromise<Contracts.TaskAgentQueue> addAgentQueue(queue)

Parameters

Returns

createAgentSession()

Syntax

 IPromise<Contracts.TaskAgentSession> createAgentSession(session, poolId)

Parameters

Returns

createServiceEndpoint()

Syntax

 IPromise<Contracts.ServiceEndpoint> createServiceEndpoint(endpoint, scopeIdentifier, endpointId)

Parameters

Returns

deleteAgent()

Syntax

 IPromise<void> deleteAgent(poolId, agentId)

Parameters

  • poolId: number.
  • agentId: number.

Returns

deleteAgentPool()

Syntax

 IPromise<void> deleteAgentPool(poolId)

Parameters

  • poolId: number.

Returns

deleteAgentQueue()

Syntax

 IPromise<void> deleteAgentQueue(queueId)

Parameters

  • queueId: number.

Returns

deleteAgentRequest()

Syntax

 IPromise<void> deleteAgentRequest(poolId, requestId, lockToken)

Parameters

  • poolId: number.
  • requestId: number.
  • lockToken: string.

Returns

deleteAgentSession()

Syntax

 IPromise<void> deleteAgentSession(poolId, sessionId)

Parameters

  • poolId: number.
  • sessionId: string.

Returns

deleteMessage()

Syntax

 IPromise<void> deleteMessage(poolId, messageId, sessionId)

Parameters

  • poolId: number.
  • messageId: number.
  • sessionId: string.

Returns

deleteServiceEndpoint()

Syntax

 IPromise<void> deleteServiceEndpoint(scopeIdentifier, endpointId)

Parameters

  • scopeIdentifier: string. The project GUID to scope the request
  • endpointId: string.

Returns

deleteTaskDefinition()

Syntax

 IPromise<void> deleteTaskDefinition(taskId)

Parameters

  • taskId: string.

Returns

getAgent()

Syntax

 IPromise<Contracts.TaskAgent> getAgent(poolId, agentId, includeCapabilities, includeAssignedRequest, propertyFilters)

Parameters

  • poolId: number.
  • agentId: number.
  • includeCapabilities: boolean. Optional.
  • includeAssignedRequest: boolean. Optional.
  • propertyFilters: string[]. Optional.

Returns

getAgentPool()

Syntax

 IPromise<Contracts.TaskAgentPool> getAgentPool(poolId, properties)

Parameters

  • poolId: number.
  • properties: string[]. Optional.

Returns

getAgentPoolRoles()

Syntax

 IPromise<VSS_Common_Contracts.IdentityRef[]> getAgentPoolRoles(poolId)

Parameters

  • poolId: number. Optional.

Returns

getAgentPools()

Syntax

 IPromise<Contracts.TaskAgentPool[]> getAgentPools(poolName, properties)

Parameters

  • poolName: string. Optional.
  • properties: string[]. Optional.

Returns

getAgentQueue()

Syntax

 IPromise<Contracts.TaskAgentQueue> getAgentQueue(queueId, actionFilter)

Parameters

Returns

getAgentQueueRoles()

Syntax

 IPromise<VSS_Common_Contracts.IdentityRef[]> getAgentQueueRoles(queueId)

Parameters

  • queueId: number. Optional.

Returns

getAgentQueues()

Syntax

 IPromise<Contracts.TaskAgentQueue[]> getAgentQueues(queueName, actionFilter)

Parameters

Returns

getAgentRequest()

Syntax

 IPromise<Contracts.TaskAgentJobRequest> getAgentRequest(poolId, requestId)

Parameters

  • poolId: number.
  • requestId: number.

Returns

getAgentRequestsForAgent()

Syntax

 IPromise<Contracts.TaskAgentJobRequest[]> getAgentRequestsForAgent(poolId, agentId, completedRequestCount)

Parameters

  • poolId: number.
  • agentId: number.
  • completedRequestCount: number. Optional.

Returns

getAgentRequestsForAgents()

Syntax

 IPromise<Contracts.TaskAgentJobRequest[]> getAgentRequestsForAgents(poolId, agentIds, completedRequestCount)

Parameters

  • poolId: number.
  • agentIds: number[].
  • completedRequestCount: number. Optional.

Returns

getAgentRequestsForPlan()

Syntax

 IPromise<Contracts.TaskAgentJobRequest[]> getAgentRequestsForPlan(poolId, planId, jobId)

Parameters

  • poolId: number.
  • planId: string.
  • jobId: string. Optional.

Returns

getAgents()

Syntax

 IPromise<Contracts.TaskAgent[]> getAgents(poolId, agentName, includeCapabilities, includeAssignedRequest, propertyFilters, demands)

Parameters

  • poolId: number.
  • agentName: string. Optional.
  • includeCapabilities: boolean. Optional.
  • includeAssignedRequest: boolean. Optional.
  • propertyFilters: string[]. Optional.
  • demands: string[]. Optional.

Returns

getMessage()

Syntax

 IPromise<Contracts.TaskAgentMessage> getMessage(poolId, sessionId, lastMessageId)

Parameters

  • poolId: number.
  • sessionId: string.
  • lastMessageId: number. Optional.

Returns

getPackage()

This method can return packages/{packageType} -- package stream OR TaskPackageMetadata if requested for json

Syntax

 IPromise<Contracts.TaskPackageMetadata> getPackage(packageType)

Parameters

  • packageType: string.

Returns

getPackages()

Syntax

 IPromise<Contracts.TaskPackageMetadata[]> getPackages()

Parameters

Returns

getPackageZip()

This method can return packages/{packageType} -- package stream OR TaskPackageMetadata if requested for json

Syntax

 IPromise<ArrayBuffer> getPackageZip(packageType)

Parameters

  • packageType: string.

Returns

getServiceEndpointDetails()

Syntax

 IPromise<Contracts.ServiceEndpoint> getServiceEndpointDetails(scopeIdentifier, endpointId)

Parameters

  • scopeIdentifier: string. The project GUID to scope the request
  • endpointId: string.

Returns

getServiceEndpoints()

Syntax

 IPromise<Contracts.ServiceEndpoint[]> getServiceEndpoints(scopeIdentifier, type, authSchemes, endpointIds)

Parameters

  • scopeIdentifier: string. The project GUID to scope the request
  • type: string. Optional.
  • authSchemes: string[]. Optional.
  • endpointIds: string[]. Optional.

Returns

getServiceEndpointTypes()

Syntax

 IPromise<Contracts.ServiceEndpointType[]> getServiceEndpointTypes(scopeIdentifier, type, scheme)

Parameters

  • scopeIdentifier: string. The project GUID to scope the request
  • type: string. Optional.
  • scheme: string. Optional.

Returns

getTaskContentZip()

Syntax

 IPromise<ArrayBuffer> getTaskContentZip(taskId, versionString, visibility, scopeLocal)

Parameters

  • taskId: string.
  • versionString: string.
  • visibility: string[]. Optional.
  • scopeLocal: boolean. Optional.

Returns

getTaskDefinition()

Syntax

 IPromise<Contracts.TaskDefinition> getTaskDefinition(taskId, versionString, visibility, scopeLocal)

Parameters

  • taskId: string.
  • versionString: string.
  • visibility: string[]. Optional.
  • scopeLocal: boolean. Optional.

Returns

getTaskDefinitions()

Syntax

 IPromise<Contracts.TaskDefinition[]> getTaskDefinitions(taskId, visibility, scopeLocal)

Parameters

  • taskId: string. Optional.
  • visibility: string[]. Optional.
  • scopeLocal: boolean. Optional.

Returns

queryEndpoint()

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.

Syntax

 IPromise<string[]> queryEndpoint(endpoint)

Parameters

Returns

queryServiceEndpoint()

Syntax

 IPromise<string[]> queryServiceEndpoint(binding, scopeIdentifier)

Parameters

  • binding: Contracts.DataSourceBinding. Describes the data source to fetch.
  • scopeIdentifier: string. The project GUID to scope the request

Returns

queueAgentRequest()

Syntax

 IPromise<Contracts.TaskAgentJobRequest> queueAgentRequest(request, poolId)

Parameters

Returns

refreshAgent()

Syntax

 IPromise<void> refreshAgent(poolId, agentId)

Parameters

  • poolId: number.
  • agentId: number.

Returns

refreshAgents()

Syntax

 IPromise<void> refreshAgents(poolId)

Parameters

  • poolId: number.

Returns

replaceAgent()

Syntax

 IPromise<Contracts.TaskAgent> replaceAgent(agent, poolId, agentId)

Parameters

Returns

sendMessage()

Syntax

 IPromise<void> sendMessage(message, poolId, requestId)

Parameters

Returns

updateAgent()

Syntax

 IPromise<Contracts.TaskAgent> updateAgent(agent, poolId, agentId)

Parameters

Returns

updateAgentPool()

Syntax

 IPromise<Contracts.TaskAgentPool> updateAgentPool(pool, poolId)

Parameters

Returns

updateAgentRequest()

Syntax

 IPromise<Contracts.TaskAgentJobRequest> updateAgentRequest(request, poolId, requestId, lockToken)

Parameters

Returns

updateAgentUserCapabilities()

Syntax

 IPromise<Contracts.TaskAgent> updateAgentUserCapabilities(userCapabilities, poolId, agentId)

Parameters

  • userCapabilities: {[key: string]: string}.
  • poolId: number.
  • agentId: number.

Returns