检索任务
GET /accounts/{account_id}/core/v1/tasks/{task_id}
返回 JSON 响应正文中存储的 Task API 资源。
参数
| 名称 | Type | 在 | Required | Description |
|---|---|---|---|---|
account_id |
string |
path |
True |
包含帐户资源的 ID
|
task_id |
string |
path |
True |
要列出的任务集合的 ID |
响应
Status: 200, Returns the stored Task API resource in the JSON response body.
| 名称 | Type | Required | Description |
|---|---|---|---|
type |
string |
True |
资源的媒体类型。定义的值为:
|
version |
string |
True |
资源的版本。定义的值为:
|
id |
string |
True |
资源的全局唯一标识符。定义的值为:
|
name |
string |
True |
包含任务的点符号 (.) 层次结构名称的 JSON 字符串。定义的值是:
|
摘要 |
string |
True |
包含任务的短格式摘要的 JSON 字符串。定义的值是:
|
description |
string |
True |
包含任务说明的 JSON 字符串。已定义的值为:
|
service |
string |
False |
包含管理任务的服务的名称的 JSON 字符串。定义的值是:
|
parentTaskID |
string |
False |
包含任务的父任务的全局唯一标识符的 JSON 字符串。定义的值是:
|
用户 ID |
string |
False |
包含与任务关联的用户 ID 的 JSON 字符串。仅包含与用户启动的操作相关联的任务。定义的值为:
|
resourceID |
string |
True |
包含与任务关联的资源的全局唯一标识符的 JSON 字符串。定义的值是:
|
资源 URI |
string |
True |
包含与任务关联的 URI 的 JSON 字符串。定义的值为:
|
resourceCollectionURI |
数组[string] |
True |
JSON 字符串的 JSON 数组,每个数组指示与任务关联的资源的完全扩展的访问 URL。定义的值为:
|
状态 |
string |
True |
包含指示任务操作状态的值的 JSON 字符串。定义的值为:
|
stateTransitions |
True |
JSON 对象的 JSON 数组,每个表示从给定定义状态的允许状态转换集。每个 JSON 对象都包含"from"和"to"字段,其中"from"值是状态的名称,"to"值是允许的目标状态数组。
|
|
stateDetails |
True |
列出有关当前"状态"的其他详细信息的 JSON 对象的 JSON 数组。此字段指示何时存在阻止实际状态与所需状态匹配的条件或错误。如果没有可用的详细信息,此数组将为空。
|
|
orderHint |
数字 |
False |
表示子任务顺序的 JSON 编号。客户端可以使用此字段将子任务从最小到最大排序。 |
percentDone |
数字 |
False |
包含正在运行的任务的完成百分比的 JSON 编号。任务完成后,设置为"100"。 |
startTime |
string |
False |
包含指示任务何时启动的时间戳的 JSON 字符串。已定义的值为:
|
endTime |
string |
False |
包含指示任务何时结束的时间戳的 JSON 字符串。定义的值为:
|
cancelTime |
string |
False |
包含指示任务何时被取消的时间戳的 JSON 字符串。定义的值为:
|
元数据 |
True |
与资源关联的客户端和服务指定的元数据。定义的值为:
|
响应示例
{
"type": "application/astra-task",
"version": "1.1",
"id": "26e8e8ef-5549-5928-98dd-2c3d43a608e8",
"name": "astra.backup.prep",
"summary": "Backup preparation",
"description": "Task to prepare for the application backup",
"service": "nautilus",
"userID": "abda967f-cd2c-4237-908e-99266648c553",
"parentTaskID": "9cc8c321-6af1-406c-8158-2c6582c247f8",
"resourceID": "626a0978-d55f-4841-8b7c-dc0c0f592c6f",
"resourceURI": "/accounts/fdaa655c-15ab-4d34-aa61-1e9098e67be0/k8s/v1/apps/7c8bef49-697e-4fb4-810c-675cef4cf6c9/appSnaps/2b6dafc3-2172-4431-a482-6306b2703130",
"resourceCollectionURI": [
"/accounts/fdaa655c-15ab-4d34-aa61-1e9098e67be0/topology/v1/clouds/0df3f1a0-7203-4c12-aabf-a7bee6302671/clusters/dfd9de2d-6f0b-437b-a737-c8f7f176cd14/namespaces/f8b58091-4b9c-4c64-9b40-018dbaf7c5de/apps/f670bf11-8850-44bd-b330-815af6186a06/appSnaps/2b6dafc3-2172-4431-a482-6306b2703130",
"/accounts/fdaa655c-15ab-4d34-aa61-1e9098e67be0/topology/v1/clouds/0df3f1a0-7203-4c12-aabf-a7bee6302671/clusters/dfd9de2d-6f0b-437b-a737-c8f7f176cd14/namespaces/923708f8-0435-45b5-8c00-fbdef3ffaf25/apps/f670bf11-8850-44bd-b330-815af6186a06/appSnaps/2b6dafc3-2172-4431-a482-6306b2703130"
],
"state": "running",
"stateTransitions": [
{
"from": "running",
"to": [
"paused",
"cancelled"
]
},
{
"from": "paused",
"to": [
"running",
"cancelled"
]
}
],
"stateDetails": [],
"orderHint": 0,
"percentDone": 20.25,
"startTime": "2020-08-06T12:24:52.256624Z",
"endTime": "2020-08-06T12:26:52.256624Z",
"metadata": {
"labels": [],
"creationTimestamp": "2022-10-06T20:58:16.305662Z",
"modificationTimestamp": "2022-10-06T20:58:16.305662Z",
"createdBy": "8f84cf09-8036-51e4-b579-bd30cb07b269"
}
}
响应
Status: 401, Unauthorized
| 名称 | Type | Required | Description |
|---|---|---|---|
type |
string |
True |
|
标题 |
string |
True |
|
详细信息 |
string |
True |
|
状态 |
string |
True |
|
correlationID |
string |
False |
响应示例
{
"type": "https://astra.netapp.io/problems/3",
"title": "Missing bearer token",
"detail": "The request is missing the required bearer token.",
"status": "401"
}
响应
Status: 400, Bad request
| 名称 | Type | Required | Description |
|---|---|---|---|
type |
string |
True |
|
标题 |
string |
True |
|
详细信息 |
string |
True |
|
状态 |
string |
True |
|
correlationID |
string |
False |
|
invalidParams |
数组["invalidParams"] |
False |
无效查询参数列表 |
响应示例
{
"type": "https://astra.netapp.io/problems/5",
"title": "Invalid query parameters",
"detail": "The supplied query parameters are invalid.",
"status": "400"
}
响应
Status: 403, Forbidden
| 名称 | Type | Required | Description |
|---|---|---|---|
type |
string |
True |
|
标题 |
string |
True |
|
详细信息 |
string |
True |
|
状态 |
string |
True |
|
correlationID |
string |
False |
响应示例
{
"type": "https://astra.netapp.io/problems/11",
"title": "Operation not permitted",
"detail": "The requested operation isn't permitted.",
"status": "403"
}
错误
Status: 404, Not found
| 名称 | Type | Required | Description |
|---|---|---|---|
type |
string |
True |
|
标题 |
string |
True |
|
详细信息 |
string |
True |
|
状态 |
string |
True |
|
correlationID |
string |
False |
错误响应示例
{
"type": "https://astra.netapp.io/problems/1",
"title": "Resource not found",
"detail": "The resource specified in the request URI wasn't found.",
"status": "404"
}
定义
查看定义
type_astra_stateTransition
| 名称 | Type | Required | Description |
|---|---|---|---|
自 |
string |
True |
|
to |
数组[string] |
True |
additionalDetails
type_astra_stateDetail
| 名称 | Type | Required | Description |
|---|---|---|---|
type |
string |
True |
|
标题 |
string |
True |
|
详细信息 |
string |
True |
|
additionalDetails |
False |
类型 Astra 标签
| 名称 | Type | Required | Description |
|---|---|---|---|
name |
string |
True |
|
value |
string |
True |
type_astra_metadata
与资源关联的客户端和服务指定的元数据。定义的值为:
-
符合 Astra 元数据架构
| 名称 | Type | Required | Description |
|---|---|---|---|
labels |
数组["类型 Astra 标签"] |
True |
|
creationTimestamp |
string |
True |
|
modificationTimestamp |
string |
True |
|
已创建 |
string |
True |
|
modifiedBy |
string |
False |
invalidParams
| 名称 | Type | Required | Description |
|---|---|---|---|
name |
string |
True |
无效查询参数的名称 |
原因 |
string |
True |
查询参数无效的原因 |