Taskgroups - List
列出工作組。
GET https://dev.azure.com/{organization}/{project}/_apis/distributedtask/taskgroups/{taskGroupId}?api-version=7.1
GET https://dev.azure.com/{organization}/{project}/_apis/distributedtask/taskgroups/{taskGroupId}?expanded={expanded}&taskIdFilter={taskIdFilter}&deleted={deleted}&$top={$top}&continuationToken={continuationToken}&queryOrder={queryOrder}&api-version=7.1
URI 參數
名稱 | 位於 | 必要 | 類型 | Description |
---|---|---|---|---|
organization
|
path | True |
string |
Azure DevOps 組織的名稱。 |
project
|
path | True |
string |
項目識別碼或項目名稱 |
task
|
path |
string (uuid) |
工作組的標識碼。 |
|
api-version
|
query | True |
string |
要使用的 API 版本。 這應該設定為 『7.1』 以使用此版本的 API。 |
$top
|
query |
integer (int32) |
要取得的工作群組數目。 |
|
continuation
|
query |
string (date-time) |
取得提供接續令牌之後的工作群組。 |
|
deleted
|
query |
boolean |
要包含已刪除的工作組,則為 'true'。 默認值為 『false』。 |
|
expanded
|
query |
boolean |
以遞歸方式展開工作組的 『true』。 默認值為 『false』。 |
|
query
|
query |
取得定義順序的結果。 默認值為 『CreatedOnDescending』。 |
||
task
|
query |
string (uuid) |
要篩選之 taskId 的 Guid。 |
回應
名稱 | 類型 | Description |
---|---|---|
200 OK |
成功作業 |
安全性
oauth2
類型:
oauth2
Flow:
accessCode
授權 URL:
https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
權杖 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
範圍
名稱 | Description |
---|---|
vso.taskgroups_read | 授與讀取工作組的能力 |
範例
List all task groups |
List all versions of a task group |
List all task groups
範例要求
GET https://dev.azure.com/fabrikam/{project}/_apis/distributedtask/taskgroups?api-version=7.1
範例回覆
{
"count": 3,
"value": [
{
"tasks": [
{
"displayName": "PowerShell Script",
"alwaysRun": false,
"continueOnError": false,
"enabled": true,
"timeoutInMinutes": 0,
"inputs": {
"scriptType": "inlineScript",
"inlineScript": "Write-Host \"Hello World\""
},
"task": {
"id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1",
"versionSpec": "1.*",
"definitionType": "task"
}
},
{
"displayName": "PowerShell Script",
"alwaysRun": false,
"continueOnError": false,
"enabled": true,
"timeoutInMinutes": 0,
"inputs": {
"scriptType": "inlineScript",
"inlineScript": "Write-Host \"New task\""
},
"task": {
"id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1",
"versionSpec": "1.*",
"definitionType": "task"
}
}
],
"runsOn": [
"Agent",
"DeploymentGroup"
],
"revision": 2,
"createdBy": {
"id": "4adb1680-0eac-6149-b5ee-fc8b4f6ca227",
"displayName": "Chuck Reinhart",
"uniqueName": "fabfiber@outlook.com"
},
"createdOn": "2017-12-18T08:01:25.24Z",
"modifiedBy": {
"id": "4adb1680-0eac-6149-b5ee-fc8b4f6ca227",
"displayName": "Chuck Reinhart",
"uniqueName": "fabfiber@outlook.com"
},
"modifiedOn": "2017-12-18T08:01:25.893Z",
"comment": "Updated the task group",
"id": "2da4ab36-6fd7-416f-a8ee-5b2a9d3bd61c",
"name": "PowerShell TG1",
"version": {
"major": 1,
"minor": 0,
"patch": 0,
"isTest": false
},
"category": "Deploy",
"definitionType": "metaTask",
"instanceNameFormat": "Task group: TG"
},
{
"tasks": [
{
"displayName": "PowerShell Script",
"alwaysRun": false,
"continueOnError": true,
"enabled": true,
"timeoutInMinutes": 0,
"inputs": {
"scriptType": "inlineScript",
"scriptName": "",
"arguments": "",
"inlineScript": "Write-Host \"Hello World\"",
"workingFolder": "",
"failOnStandardError": "true"
},
"task": {
"id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1",
"versionSpec": "1.*",
"definitionType": "task"
}
},
{
"displayName": "PowerShell Script",
"alwaysRun": false,
"continueOnError": false,
"enabled": true,
"timeoutInMinutes": 0,
"inputs": {
"scriptType": "inlineScript",
"scriptName": "",
"arguments": "",
"inlineScript": "Write-Host \"New task\"",
"workingFolder": "",
"failOnStandardError": "true"
},
"task": {
"id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1",
"versionSpec": "1.*",
"definitionType": "task"
}
}
],
"runsOn": [
"Agent",
"DeploymentGroup"
],
"revision": 4,
"createdBy": {
"id": "4adb1680-0eac-6149-b5ee-fc8b4f6ca227",
"displayName": "Chuck Reinhart",
"uniqueName": "fabfiber@outlook.com"
},
"createdOn": "2017-12-18T08:01:36.74Z",
"modifiedBy": {
"id": "4adb1680-0eac-6149-b5ee-fc8b4f6ca227",
"displayName": "Chuck Reinhart",
"uniqueName": "fabfiber@outlook.com"
},
"modifiedOn": "2017-12-18T08:01:43.787Z",
"comment": "Published preview",
"id": "2da4ab36-6fd7-416f-a8ee-5b2a9d3bd61c",
"name": "PowerShell TG1",
"version": {
"major": 2,
"minor": 0,
"patch": 0,
"isTest": false
},
"iconUrl": "https://cdn.vsassets.io/v/20171217T033454/_content/icon-meta-task.png",
"friendlyName": "PowerShell TG1",
"category": "Deploy",
"definitionType": "metaTask",
"instanceNameFormat": "Task group: PowerShell TG1 "
},
{
"tasks": [
{
"displayName": "PowerShell Script",
"alwaysRun": false,
"continueOnError": false,
"enabled": true,
"timeoutInMinutes": 0,
"inputs": {
"scriptType": "inlineScript",
"scriptName": "",
"arguments": "",
"inlineScript": "Write-Host \"Hello World\"",
"workingFolder": "",
"failOnStandardError": "true"
},
"task": {
"id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1",
"versionSpec": "1.*",
"definitionType": "task"
}
},
{
"displayName": "PowerShell Script",
"alwaysRun": false,
"continueOnError": false,
"enabled": true,
"timeoutInMinutes": 0,
"inputs": {
"scriptType": "inlineScript",
"scriptName": "",
"arguments": "",
"inlineScript": "Write-Host \"New task\"",
"workingFolder": "",
"failOnStandardError": "true"
},
"task": {
"id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1",
"versionSpec": "1.*",
"definitionType": "task"
}
}
],
"runsOn": [
"Agent",
"DeploymentGroup"
],
"revision": 1,
"createdBy": {
"id": "4adb1680-0eac-6149-b5ee-fc8b4f6ca227",
"displayName": "Chuck Reinhart",
"uniqueName": "fabfiber@outlook.com"
},
"createdOn": "2017-12-17T20:15:04.517Z",
"modifiedBy": {
"id": "4adb1680-0eac-6149-b5ee-fc8b4f6ca227",
"displayName": "Chuck Reinhart",
"uniqueName": "fabfiber@outlook.com"
},
"modifiedOn": "2017-12-17T20:15:04.517Z",
"id": "a4bec09c-4360-45cb-8242-78672fc31a53",
"name": "My PowerShell TG2",
"version": {
"major": 1,
"minor": 0,
"patch": 0,
"isTest": false
},
"friendlyName": "My PowerShell TG2",
"category": "Deploy",
"definitionType": "metaTask",
"instanceNameFormat": "Task group: My PowerShell TG2 "
}
]
}
List all versions of a task group
範例要求
GET https://dev.azure.com/fabrikam/{project}/_apis/distributedtask/taskgroups?api-version=7.1
範例回覆
{
"count": 2,
"value": [
{
"tasks": [
{
"displayName": "PowerShell Script",
"alwaysRun": false,
"continueOnError": false,
"enabled": true,
"timeoutInMinutes": 0,
"inputs": {
"scriptType": "inlineScript",
"inlineScript": "Write-Host \"Hello World\""
},
"task": {
"id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1",
"versionSpec": "1.*",
"definitionType": "task"
}
},
{
"displayName": "PowerShell Script",
"alwaysRun": false,
"continueOnError": false,
"enabled": true,
"timeoutInMinutes": 0,
"inputs": {
"scriptType": "inlineScript",
"inlineScript": "Write-Host \"New task\""
},
"task": {
"id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1",
"versionSpec": "1.*",
"definitionType": "task"
}
}
],
"runsOn": [
"Agent",
"DeploymentGroup"
],
"revision": 2,
"createdBy": {
"id": "4adb1680-0eac-6149-b5ee-fc8b4f6ca227",
"displayName": "Chuck Reinhart",
"uniqueName": "fabfiber@outlook.com"
},
"createdOn": "2017-12-18T08:01:25.24Z",
"modifiedBy": {
"id": "4adb1680-0eac-6149-b5ee-fc8b4f6ca227",
"displayName": "Chuck Reinhart",
"uniqueName": "fabfiber@outlook.com"
},
"modifiedOn": "2017-12-18T08:01:25.893Z",
"comment": "Updated the task group",
"id": "2da4ab36-6fd7-416f-a8ee-5b2a9d3bd61c",
"name": "PowerShell TG1",
"version": {
"major": 1,
"minor": 0,
"patch": 0,
"isTest": false
},
"category": "Deploy",
"definitionType": "metaTask",
"instanceNameFormat": "Task group: TG"
},
{
"tasks": [
{
"displayName": "PowerShell Script",
"alwaysRun": false,
"continueOnError": true,
"enabled": true,
"timeoutInMinutes": 0,
"inputs": {
"scriptType": "inlineScript",
"scriptName": "",
"arguments": "",
"inlineScript": "Write-Host \"Hello World\"",
"workingFolder": "",
"failOnStandardError": "true"
},
"task": {
"id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1",
"versionSpec": "1.*",
"definitionType": "task"
}
},
{
"displayName": "PowerShell Script",
"alwaysRun": false,
"continueOnError": false,
"enabled": true,
"timeoutInMinutes": 0,
"inputs": {
"scriptType": "inlineScript",
"scriptName": "",
"arguments": "",
"inlineScript": "Write-Host \"New task\"",
"workingFolder": "",
"failOnStandardError": "true"
},
"task": {
"id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1",
"versionSpec": "1.*",
"definitionType": "task"
}
}
],
"runsOn": [
"Agent",
"DeploymentGroup"
],
"revision": 4,
"createdBy": {
"id": "4adb1680-0eac-6149-b5ee-fc8b4f6ca227",
"displayName": "Chuck Reinhart",
"uniqueName": "fabfiber@outlook.com"
},
"createdOn": "2017-12-18T08:01:36.74Z",
"modifiedBy": {
"id": "4adb1680-0eac-6149-b5ee-fc8b4f6ca227",
"displayName": "Chuck Reinhart",
"uniqueName": "fabfiber@outlook.com"
},
"modifiedOn": "2017-12-18T08:01:43.787Z",
"comment": "Published preview",
"id": "2da4ab36-6fd7-416f-a8ee-5b2a9d3bd61c",
"name": "PowerShell TG1",
"version": {
"major": 2,
"minor": 0,
"patch": 0,
"isTest": false
},
"iconUrl": "https://cdn.vsassets.io/v/20171217T033454/_content/icon-meta-task.png",
"friendlyName": "PowerShell TG1",
"category": "Deploy",
"definitionType": "metaTask",
"instanceNameFormat": "Task group: PowerShell TG1 "
}
]
}
定義
名稱 | Description |
---|---|
Authorization |
|
Data |
|
Demand | |
Identity |
|
JObject |
表示 JSON 物件。 |
JToken |
表示抽象 JSON 令牌。 |
Reference |
表示 REST 參考連結集合的類別。 |
Task |
|
Task |
|
Task |
|
Task |
|
Task |
|
Task |
|
Task |
取得定義順序的結果。 默認值為 『CreatedOnDescending』。 |
Task |
表示工作組中的工作。 |
Task |
|
Task |
|
Task |
|
Task |
工作的參考。 |
Task |
|
Task |
|
Task |
|
Task |
AuthorizationHeader
名稱 | 類型 | Description |
---|---|---|
name |
string |
取得或設定授權標頭的名稱。 |
value |
string |
取得或設定授權標頭的值。 |
DataSourceBinding
名稱 | 類型 | Description |
---|---|---|
callbackContextTemplate |
string |
此數據源支援的分頁格式(ContinuationToken/SkipTop)。 |
callbackRequiredTemplate |
string |
後續需要呼叫? |
dataSourceName |
string |
取得或設定數據源的名稱。 |
endpointId |
string |
取得或設定端點標識碼。 |
endpointUrl |
string |
取得或設定服務端點的 URL。 |
headers |
取得或設定授權標頭。 |
|
initialContextTemplate |
string |
定義查詢參數的初始值 |
parameters |
object |
取得或設定數據源的參數。 |
requestContent |
string |
取得或設定 HTTP 要求本文 |
requestVerb |
string |
取得或設定 HTTP 要求動詞命令 |
resultSelector |
string |
取得或設定結果選取器。 |
resultTemplate |
string |
取得或設定結果範本。 |
target |
string |
取得或設定數據源的目標。 |
Demand
名稱 | 類型 | Description |
---|---|---|
name |
string |
|
value |
string |
IdentityRef
名稱 | 類型 | Description |
---|---|---|
_links |
此欄位包含圖表主旨的相關零或更多有趣連結。 您可以叫用這些連結,以取得此圖表主題的其他關聯性或更詳細的資訊。 |
|
descriptor |
string |
描述元是在系統執行時參考圖表主旨的主要方式。 此欄位會唯一識別帳戶和組織之間的相同圖表主題。 |
directoryAlias |
string |
已淘汰 - 查詢 IdentityRef “_links” 字典中參考的 Graph 使用者,即可擷取 |
displayName |
string |
這是圖形主體的非唯一顯示名稱。 若要變更此欄位,您必須在來源提供者中變更其值。 |
id |
string |
|
imageUrl |
string |
已淘汰 - 可在 IdentityRef “_links” 字典的 “avatar” 專案中取得 |
inactive |
boolean |
已淘汰 - 可藉由查詢 GraphUser “_links” 字典的 “membershipState” 專案中參考的 Graph 成員資格狀態來擷取 |
isAadIdentity |
boolean |
已淘汰 - 可以從描述元的主體類型推斷 (Descriptor.IsAadUserType/Descriptor.IsAadGroupType) |
isContainer |
boolean |
已淘汰 - 可以從描述元的主體類型推斷 (Descriptor.IsGroupType) |
isDeletedInOrigin |
boolean |
|
profileUrl |
string |
已淘汰 - 未在 ToIdentityRef 的大部分預先存在實作中使用 |
uniqueName |
string |
已淘汰 - 請改用 Domain+PrincipalName |
url |
string |
此 URL 是此圖表主體來源資源的完整路由。 |
JObject
表示 JSON 物件。
名稱 | 類型 | Description |
---|---|---|
item |
表示抽象 JSON 令牌。 |
|
type |
string (JTokenType) |
取得這個 JToken 的節點類型。 |
JToken
表示抽象 JSON 令牌。
名稱 | 類型 | Description |
---|---|---|
first |
取得此令牌的第一個子令牌。 |
|
hasValues |
boolean |
取得值,指出這個令牌是否具有子令牌。 |
item |
表示抽象 JSON 令牌。 |
|
last |
取得此令牌的最後一個子令牌。 |
|
next |
取得這個節點的下一個同層級令牌。 |
|
parent |
string (JContainer) |
取得或設定父代。 |
path |
string |
取得 JSON 令牌的路徑。 |
previous |
取得這個節點的上一個同層級令牌。 |
|
root |
取得這個 JToken 的根 JToken。 |
|
type |
string (JTokenType) |
取得這個 JToken 的節點類型。 |
ReferenceLinks
表示 REST 參考連結集合的類別。
名稱 | 類型 | Description |
---|---|---|
links |
object |
連結的只讀檢視。 因為參考連結是只讀的,所以我們只想要將其公開為只讀。 |
TaskCommandMode
值 | Description |
---|---|
any | |
restricted |
TaskCommandRestrictions
名稱 | 類型 | Description |
---|---|---|
mode |
TaskDefinitionReference
名稱 | 類型 | Description |
---|---|---|
definitionType |
string |
取得或設定定義類型。 值可以是 'task' 或 'metaTask'。 |
id |
string (uuid) |
取得或設定工作的唯一標識符。 |
versionSpec |
string |
取得或設定工作的版本規格。 |
TaskExecution
名稱 | 類型 | Description |
---|---|---|
execTask |
要執行的公用程式工作。 指定這表示此工作定義只是呼叫另一個工作的中繼工作。 這對於呼叫 powershell 和命令行等公用程式工作的工作很有用 |
|
platformInstructions |
object |
如果工作要執行程式代碼,則這會提供類型/文稿等...依平台的資訊。 例如,它看起來可能像這樣。 net45: { typeName: “Microsoft.TeamFoundation.Automation.Tasks.PowerShellTask”, assemblyName: “Microsoft.TeamFoundation.Automation.Tasks.PowerShell.dll” } net20: { typeName: “Microsoft.TeamFoundation.Automation.Tasks.PowerShellTask”, assemblyName: “Microsoft.TeamFoundation.Automation.Tasks.PowerShell.dll” } java: { jar: “powershelltask.tasks.automation.teamfoundation.microsoft.com”, } node: { script: “powershellhost.js”, } } |
TaskGroup
名稱 | 類型 | Description |
---|---|---|
agentExecution | ||
author |
string |
|
category |
string |
|
comment |
string |
取得或設定批注。 |
contentsUploaded |
boolean |
|
contributionIdentifier |
string |
|
contributionVersion |
string |
|
createdBy |
取得或設定建立的身分識別。 |
|
createdOn |
string (date-time) |
取得或設定建立日期。 |
dataSourceBindings | ||
definitionType |
string |
|
deleted |
boolean |
取得或設定為 'true',表示為已刪除,否則為 'false'。 |
demands |
Demand[] |
|
deprecated |
boolean |
|
description |
string |
|
disabled |
boolean |
|
execution |
<string, JObject> |
|
friendlyName |
string |
|
groups | ||
helpMarkDown |
string |
|
helpUrl |
string |
|
hostType |
string |
|
iconUrl |
string |
|
id |
string (uuid) |
|
inputs | ||
instanceNameFormat |
string |
|
minimumAgentVersion |
string |
|
modifiedBy |
取得或設定已修改的身分識別。 |
|
modifiedOn |
string (date-time) |
取得或設定修改日期。 |
name |
string |
|
outputVariables | ||
owner |
string |
取得或設定擁有者。 |
packageLocation |
string |
|
packageType |
string |
|
parentDefinitionId |
string (uuid) |
取得或設定父工作組標識碼。這會在建立草稿工作組時使用。 |
postJobExecution |
<string, JObject> |
|
preJobExecution |
<string, JObject> |
|
preview |
boolean |
|
releaseNotes |
string |
|
restrictions | ||
revision |
integer (int32) |
取得或設定修訂。 |
runsOn |
string[] |
|
satisfies |
string[] |
|
serverOwned |
boolean |
|
showEnvironmentVariables |
boolean |
|
sourceDefinitions | ||
sourceLocation |
string |
|
tasks |
取得或設定工作。 |
|
version | ||
visibility |
string[] |
TaskGroupDefinition
名稱 | 類型 | Description |
---|---|---|
displayName |
string |
|
isExpanded |
boolean |
|
name |
string |
|
tags |
string[] |
|
visibleRule |
string |
TaskGroupQueryOrder
取得定義順序的結果。 默認值為 『CreatedOnDescending』。
值 | Description |
---|---|
createdOnAscending |
依建立的遞增順序。 |
createdOnDescending |
依 createdon 遞減排序。 |
TaskGroupStep
表示工作組中的工作。
名稱 | 類型 | Description |
---|---|---|
alwaysRun |
boolean |
取得或設定為 『true』 以一律執行工作,否則為 『false』。 |
condition |
string |
取得或設定工作的條件。 |
continueOnError |
boolean |
取得或設定為 『true』 以在錯誤時繼續,否則為 『false』。 |
displayName |
string |
取得或設定顯示名稱。 |
enabled |
boolean |
取得或設定為已啟用或未啟用工作。 |
environment |
object |
取得環境變數的字典。 |
inputs |
object |
取得或設定輸入的字典。 |
retryCountOnTaskFailure |
integer (int32) |
取得或設定重試次數上限 |
task |
取得或設定工作的參考。 |
|
timeoutInMinutes |
integer (int32) |
取得或設定工作在伺服器取消之前,允許在代理程式上執行的最大時間,以分鐘為單位。 零值表示無限逾時。 |
TaskInputDefinition
名稱 | 類型 | Description |
---|---|---|
aliases |
string[] |
|
defaultValue |
string |
|
groupName |
string |
|
helpMarkDown |
string |
|
label |
string |
|
name |
string |
|
options |
object |
|
properties |
object |
|
required |
boolean |
|
type |
string |
|
validation | ||
visibleRule |
string |
TaskInputValidation
名稱 | 類型 | Description |
---|---|---|
expression |
string |
條件表達式 |
message |
string |
說明使用者如何在驗證失敗時更正的訊息 |
TaskOutputVariable
名稱 | 類型 | Description |
---|---|---|
description |
string |
|
name |
string |
TaskReference
工作的參考。
名稱 | 類型 | Description |
---|---|---|
id |
string (uuid) |
工作定義的識別碼。 對應至 task.json 檔案的標識碼值。 |
inputs |
object |
工作定義特有的輸入字典。 對應至檔案 task.json 的輸入值。 |
name |
string |
工作定義的名稱。 對應至 task.json 檔案的名稱值。 |
version |
string |
工作定義的版本。 對應至 task.json 檔案的版本值。 |
TaskRestrictions
名稱 | 類型 | Description |
---|---|---|
commands | ||
settableVariables |
TaskSourceDefinition
名稱 | 類型 | Description |
---|---|---|
authKey |
string |
|
endpoint |
string |
|
keySelector |
string |
|
selector |
string |
|
target |
string |
TaskVariableRestrictions
名稱 | 類型 | Description |
---|---|---|
allowed |
string[] |
TaskVersion
名稱 | 類型 | Description |
---|---|---|
isTest |
boolean |
|
major |
integer (int32) |
|
minor |
integer (int32) |
|
patch |
integer (int32) |