通过使用浏览器开发工具并单击 ADO 中的删除按钮,我设法了解如何使用 Azure DevOps Rest API 删除环境资源。
你可以发送:
DELETE <azure-dev-ops-base-url>/<organization>/_apis/distributedtask/environments/{environment-id}/providers/kubernetes/{resource-id}?api-version=6.0-preview.1
要查找 environment-id 和 resource-id 使用:
GET: <azure-dev-ops-base-url>/<organization>/_apis/distributedtask/environments?api-version=6.0-preview.1
GET: <azure-dev-ops-base-url>/<organization>/_apis/distributedtask/environments/{environment-id}?expands=resourceReferences&api-version=6.0-preview.1