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

检索设置

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

返回 JSON 响应正文中存储的 Setting API 资源。

参数

名称 Type Required Description

account_id

string

path

True

包含帐户资源的 ID

  • 示例:{{.Account}}

setting_id

string

path

True

要列出的设置集合的 ID

响应

Status: 200, Returns the stored Setting API resource in the JSON 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": "application/astra-setting",
  "version": "1.1",
  "id": "ea510866-47d3-5130-8468-563df4cd6a28",
  "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": "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

invalidParams

名称 Type Required Description

name

string

True

无效查询参数的名称

原因

string

True

查询参数无效的原因