작업 그룹 설명을 업데이트하려고한다고 가정 해 보겠습니다.
GET https://dev.azure.com/{organization}/{project}/_apis/distributedtask/taskgroups?api-version=6.0-preview.1
aaabbbcc-abcd-ae12-917d-97f1935b1542
PUT https://dev.azure.com/{organization}/{project}/_apis/distributedtask/taskgroups/aaabbbcc-abcd-ae12-917d-97f1935b1542?api-version=6.0-preview.1
{
"description": "this is the new description",
"id": "aaabbbcc-abcd-ae12-917d-97f1935b1542"
}
그러나 마지막 단계는 작동하지 않습니다. 다음과 같은 오류가 발생합니다.
{
"$id": "1",
"innerException": null,
"message": "Task group aaabbbcc-abcd-ae12-917d-97f1935b1542 not found.",
"typeName": "Microsoft.TeamFoundation.DistributedTask.WebApi.MetaTaskDefinitionNotFoundException, Microsoft.TeamFoundation.DistributedTask.WebApi",
"typeKey": "MetaTaskDefinitionNotFoundException",
"errorCode": 0,
"eventId": 3000
}
내가 도대체 뭘 잘못하고있는 겁니까?
이를 수행하는 가장 좋은 방법은 GET
API 에있는 작업 그룹을 사용하고 설명을 변경 한 다음 JSON으로 변환하고 PUT
API의 모든 개체를 보내는 것 입니다.
예 : PowerShell에서 :
$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $user,"YOUR-PAT")))
$headers = @{Authorization=("Basic {0}" -f $base64AuthInfo)}
$url = "https://dev.azure.com/{organization}/{project}/_apis/distributedtask/taskgroups?api-version=6.0-preview.1"
$taskGroups= Invoke-RestMethod -Method Get -Uri $url -Headers $headers -ContentType 'application/json'
$taskGroups.value[0].description = "test"
$json = $taskGroups.value[0] | ConvertTo-Json -Depth 10
$response = Invoke-RestMethod -Method Put -Uri $url -Headers $headers -ContentType 'application/json' -Body $json
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다