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

列出所有设置

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

返回集合中所有匹配资源的 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'"

count

string

查询

False

指示是否应在元数据对象中返回资源总数。

URL 示例:"count=true"

OpenAPI 示例:"true"

订单

string

查询

False

指示列出集合时资源的排序顺序。

URL 示例:"orderBy=name","orderBy=name%20desc"

OpenAPI 示例:"name desc"

跳过

string

查询

False

指示列出集合时要跳过的资源数。

URL 示例:"skip=1"

OpenAPI 示例:"1"

响应

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

个项

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

True

元数据

"type_astra_metadata_list"

True

响应示例
{
  "type": "application/astra-settings",
  "version": "1.1",
  "items": [
    {
      "type": "application/astra-setting",
      "version": "1.0",
      "id": "5da0a2ed-c51d-4d91-8b98-ed3aa8a88cc5",
      "name": "astra.account.smtp",
      "currentConfig": {
        "credential": "",
        "isEnabled": "false",
        "port": 587,
        "relayServer": "smtp.sendgrid.net"
      },
      "configSchema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "astra.account.smtp",
        "type": "object",
        "properties": {
          "credential": {
            "type": "string",
            "description": "The credential ID for SMTP authentication."
          },
          "isEnabled": {
            "type": "string",
            "description": "This property determines if this setting is enabled or not."
          },
          "port": {
            "type": "integer",
            "description": "The SMTP port. For an unencrypted or a TLS connection, use port 25, 2525, or 587."
          },
          "relayServer": {
            "type": "string",
            "description": "This setting is sometimes referred to as the external SMTP server or the SMTP relay."
          }
        },
        "additionalProperties": false,
        "required": [
          "relayServer",
          "port",
          "isEnabled"
        ]
      },
      "state": "valid",
      "stateUnready": [],
      "metadata": {
        "labels": [],
        "creationTimestamp": "2021-06-04T20:14:52Z",
        "modificationTimestamp": "2021-06-04T20:14:52Z",
        "createdBy": "c9550bbb-e70b-4578-8504-07397f875bcb",
        "modifiedBy": "65e1571b-1b46-4f05-95b0-7d7f5a93da6a"
      }
    }
  ],
  "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: 503, Service unavailable
名称 Type Required Description

type

string

True

标题

string

True

详细信息

string

True

状态

string

True

correlationID

string

False

响应示例
{
  "type": "https://astra.netapp.io/problems/41",
  "title": "Service not ready",
  "detail": "Currently, the service can't respond to this request.",
  "status": "503"
}

错误

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_json

包含构成此设置的当前配置的键和值的 JSON 对象。此对象的内容必须符合 configSchema 字段中包含的 JSON Schema。默认值由 configmap 提供。用户更改默认值后,它们将不会被覆盖。

type_json

JSON 对象包含组成此设置的请求配置的键和值。此对象的内容必须符合 configSchema 字段中包含的 JSON 架构。该对象在指定之前不存在。指定后,这将触发功能服务通知相应服务请求可以应用所需配置。然后,相应的服务可以执行验证并将所需配置应用于当前配置。

属性

类型_json_schema

包含此资源中 config 属性的 JSON 架构的 JSON 对象。必须符合 JSON Schema Draft 7。如果资源中存在配置值,则必须根据所示的 configSchema 进行验证。作为一种常见的约定,建议在适当的时候配置具有"isEnabled"字段。"isEnabled"字段包含一个值,该值指示设置是打开("true")还是关闭("false")。

名称 Type Required Description

$schema

string

True

type

string

True

属性

"属性"

True

additionalProperties

布尔值

True

必填

数组[string]

True

类型 Astra 标签

名称 Type Required Description

name

string

True

value

string

True

type_astra_metadata_update

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

  • 符合 Astra 元数据架构如果在更新时未指定,则元数据对象的标签、creationTimestamp 和 createdBy 将不加修改地保留。

名称 Type Required Description

labels

数组["类型 Astra 标签"]

False

creationTimestamp

string

False

modificationTimestamp

string

False

已创建

string

False

modifiedBy

string

False

setting_1.1_get_response_body

名称 Type Required Description

type

string

True

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

  • "application/astra-setting"

version

string

True

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

  • "1.0"

  • "1.1"

id

string

True

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

  • 符合 UUIDv4 架构

name

string

True

包含设置名称的 JSON 字符串,采用分层点表示法(.)。定义的值为:

  • 最小长度:1

  • 最大长度:63

  • 此字符串经过内部验证,以防止 XSS、Unicode、目录遍历和 SQL 注入攻击。此值由运行时加载的 configmap 指定,用户无法更新。

currentConfig

"type_json"

True

包含构成此设置的当前配置的键和值的 JSON 对象。此对象的内容必须符合 configSchema 字段中包含的 JSON Schema。默认值由 configmap 提供。用户更改默认值后,它们将不会被覆盖。

desiredConfig

"type_json"

False

JSON 对象包含组成此设置的请求配置的键和值。此对象的内容必须符合 configSchema 字段中包含的 JSON 架构。该对象在指定之前不存在。指定后,这将触发功能服务通知相应服务请求可以应用所需配置。然后,相应的服务可以执行验证并将所需配置应用于当前配置。

configSchema

"类型_json_schema"

True

包含此资源中 config 属性的 JSON 架构的 JSON 对象。必须符合 JSON Schema Draft 7。如果资源中存在配置值,则必须根据所示的 configSchema 进行验证。作为一种常见的约定,建议在适当的时候配置具有"isEnabled"字段。"isEnabled"字段包含一个值,该值指示设置是打开("true")还是关闭("false")。

状态

string

True

包含指示应用程序操作状态的值的 JSON 字符串。定义的值为:

  • "valid" - 当前配置与所需配置匹配。

  • "pending" - 正在应用所需的配置。

  • "error" - 无法应用所需的配置。

stateUnready

数组[string]

True

JSON 字符串的 JSON 数组,每个字符串指示未成功应用设置的原因。定义的值为:

  • 最小长度:1

  • 最大长度:127

元数据

"type_astra_metadata_update"

True

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

  • 符合 Astra 元数据架构如果在更新时未指定,则元数据对象的标签、creationTimestamp 和 createdBy 将不加修改地保留。

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

查询参数无效的原因