Skip to main content
Astra Automation
简体中文版经机器翻译而成,仅供参考。如与英语版出现任何冲突,应以英语版为准。

列出所有任务

GET /accounts/{account_id}/core/v1/tasks

返回集合中所有匹配资源的 JSON 数组。如果在请求中指定了单个字段,则项目 JSON 数组将包含按指定顺序为每个匹配资源请求的字段。

参数

名称 Type Required Description

account_id

string

path

True

包含帐户资源的 ID

  • 示例:{{.Account}}

包括

string

查询

False

指示列出集合时应返回哪些字段。

URL 示例:"include=id"、"include=id,name"

OpenAPI 示例:"id"

limit

string

查询

False

指示列出集合时要返回的最大资源数。

URL 示例:"limit=2"

OpenAPI 示例:"2"

筛选器

string

查询

False

指示在列出集合时应匹配哪些字段以返回资源。

支持的运算符有:

  • eq - 相等

  • lt/gt - 小于/大于

  • lte/gte - 小于或等于/大于或等于

URL 示例:"filter=field%20eq%20%27value%27"

OpenAPI 示例:"field eq 'value'"

响应

Status: 200, Returns a JSON array of all matching resources in the collection. If individual fields are specified in the request, the items JSON array will contain the fields requested for each matching resource in the order specified.
名称 Type Required Description

个项

数组[任意一个:"task_1.1_get_response_body",数组[]]

True

元数据

"type_astra_metadata_list"

True

响应示例
{
  "type": "application/astra-tasks",
  "version": "1.1",
  "items": [
    {
      "type": "application/astra-task",
      "version": "1.0",
      "id": "ae1e6561-9e22-406c-8a5a-762f4604da00",
      "name": "astra.backup.prep",
      "summary": "Backup preparation",
      "description": "Task to prepare for the application backup",
      "service": "nautilus",
      "parentTaskID": "9cc8c321-6af1-406c-8158-2c6582c247f8",
      "userID": "abda967f-cd2c-4237-908e-99266648c553",
      "resourceID": "626a0978-d55f-4841-8b7c-dc0c0f592c6f",
      "resourceURI": "/accounts/fdaa655c-15ab-4d34-aa61-1e9098e67be0/k8s/v1/apps/7c8bef49-697e-4fb4-810c-675cef4cf6c9/appSnaps/5cb608f9-571b-492e-a520-5bfb900a9b9c",
      "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/5cb608f9-571b-492e-a520-5bfb900a9b9c",
        "/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/5cb608f9-571b-492e-a520-5bfb900a9b9c"
      ],
      "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",
      "metadata": {
        "labels": [],
        "creationTimestamp": "2020-08-06T12:24:52.256624Z",
        "modificationTimestamp": "2020-08-06T12:24:52.256624Z",
        "createdBy": "00000000-0000-0000-0000-000000000000"
      }
    },
    {
      "type": "application/astra-task",
      "version": "1.0",
      "id": "bc1e6561-9e22-406c-8a5a-762f4604da00",
      "name": "astra.backup",
      "summary": "Backup",
      "description": "Task to take a Backup for an application",
      "service": "nautilus",
      "userID": "abda967f-cd2c-4237-908e-99266648c553",
      "resourceID": "736a0978-d55f-4841-8b7c-dc0c0f592c6f",
      "resourceURI": "/accounts/fdaa655c-15ab-4d34-aa61-1e9098e67be0/k8s/v1/apps/7c8bef49-697e-4fb4-810c-675cef4cf6c9/appBackups/736a0978-d55f-4841-8b7c-dc0c0f592c6f",
      "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/appBackups/736a0978-d55f-4841-8b7c-dc0c0f592c6f",
        "/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/appBackups/736a0978-d55f-4841-8b7c-dc0c0f592c6f"
      ],
      "state": "completed",
      "stateTransitions": [
        {
          "from": "running",
          "to": [
            "paused",
            "cancelled"
          ]
        },
        {
          "from": "paused",
          "to": [
            "running",
            "cancelled"
          ]
        }
      ],
      "stateDetails": [],
      "orderHint": 0,
      "percentDone": 100,
      "startTime": "2020-08-06T12:24:52.256624Z",
      "endTime": "2020-08-06T12:26:52.256624Z",
      "metadata": {
        "labels": [],
        "creationTimestamp": "2020-08-06T12:24:52.256624Z",
        "modificationTimestamp": "2020-08-06T12:24:52.256624Z",
        "createdBy": "00000000-0000-0000-0000-000000000000"
      }
    }
  ],
  "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/2",
  "title": "Collection not found",
  "detail": "The collection 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

"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

task_1.1_get_response_body

名称 Type Required Description

type

string

True

资源的媒体类型。定义的值为:

  • "application/astra-task"

version

string

True

资源的版本。定义的值为:

  • "1.0"

  • "1.1"

id

string

True

资源的全局唯一标识符。定义的值为:

  • 符合 UUIDv4 架构

name

string

True

包含任务的点符号 (.) 层次结构名称的 JSON 字符串。定义的值是:

  • 最小长度:3

  • 最大长度:127

  • 定义的正则表达式为:"^[a-z])(\.([a-z])+$"

摘要

string

True

包含任务的短格式摘要的 JSON 字符串。定义的值是:

  • 最小长度:3

  • 最大长度:63

description

string

True

包含任务说明的 JSON 字符串。已定义的值为:

  • 最小长度:1

  • 最大长度:511

service

string

False

包含管理任务的服务的名称的 JSON 字符串。定义的值是:

  • 最小长度:1

  • 最大长度:31

parentTaskID

string

False

包含任务的父任务的全局唯一标识符的 JSON 字符串。定义的值是:

  • 符合 Astra 标识符架构

用户 ID

string

False

包含与任务关联的用户 ID 的 JSON 字符串。仅包含与用户启动的操作相关联的任务。定义的值为:

  • 符合 Astra 标识符架构

resourceID

string

True

包含与任务关联的资源的全局唯一标识符的 JSON 字符串。定义的值是:

  • 符合 Astra 标识符架构

资源 URI

string

True

包含与任务关联的 URI 的 JSON 字符串。定义的值为:

  • 最小长度:3

  • 最大长度:4095

resourceCollectionURI

数组[string]

True

JSON 字符串的 JSON 数组,每个数组指示与任务关联的资源的完全扩展的访问 URL。定义的值为:

  • 最小长度:3

  • 最大长度:4095

状态

string

True

包含指示任务操作状态的值的 JSON 字符串。定义的值为:

  • "notStarted" - 任务尚未开始执行。

  • "running" - 任务正在运行。

  • "completed" - 任务已完成。

  • "pausing" - 请求暂停任务。

  • "paused" - 任务已暂停。

  • "cancelling" - 任务被请求取消。

  • "cancelled" - 任务已取消。

  • "failed" - 任务失败。

  • 最小长度:1

  • 最大长度:31

stateTransitions

数组["type_astra_stateTransition"]

True

JSON 对象的 JSON 数组,每个表示从给定定义状态的允许状态转换集。每个 JSON 对象都包含"from"和"to"字段,其中"from"值是状态的名称,"to"值是允许的目标状态数组。

  • 最小长度:1

  • 最大长度:31 例如:"stateTransitions" : [ { "from": "running", "to": ["paused", "cancelled"] }, { "from": "paused", "to": ["running", "cancelled"] }, ]

stateDetails

数组["type_astra_stateDetail"]

True

列出有关当前"状态"的其他详细信息的 JSON 对象的 JSON 数组。此字段指示何时存在阻止实际状态与所需状态匹配的条件或错误。如果没有可用的详细信息,此数组将为空。

  • 最小项目数:0

orderHint

数字

False

表示子任务顺序的 JSON 编号。客户端可以使用此字段将子任务从最小到最大排序。

percentDone

数字

False

包含正在运行的任务的完成百分比的 JSON 编号。任务完成后,设置为"100"。

startTime

string

False

包含指示任务何时启动的时间戳的 JSON 字符串。已定义的值为:

  • 符合 ISO-8601 日期时间方案

endTime

string

False

包含指示任务何时结束的时间戳的 JSON 字符串。定义的值为:

  • 符合 ISO-8601 日期时间方案

cancelTime

string

False

包含指示任务何时被取消的时间戳的 JSON 字符串。定义的值为:

  • 符合 ISO-8601 日期时间方案

元数据

"type_astra_metadata"

True

与资源关联的客户端和服务指定的元数据。定义的值为:

  • 符合 Astra 元数据架构

type_astra_metadata_list

名称 Type Required Description

继续

string

False

count

数字

False

labels

数组["类型 Astra 标签"]

False

creationTimestamp

string

False

modificationTimestamp

string

False

已创建

string

False

modifiedBy

string

False

invalidParams

名称 Type Required Description

name

string

True

无效查询参数的名称

原因

string

True

查询参数无效的原因