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

修改设置

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

将整个存储资源替换为提供的 JSON 请求正文,同时保留不可由用户修改的键值。

参数

名称 Type Required Description

account_id

string

path

True

包含帐户资源的 ID

  • 示例:{{.Account}}

setting_id

string

path

True

要列出的设置集合的 ID

请求正文

将整个存储资源替换为提供的 JSON 请求正文,同时保留不可由用户修改的键值。

名称 Type Required Description

type

string

True

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

  • "application/astra-setting"

version

string

True

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

  • "1.0"

  • "1.1"

id

string

False

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

  • 符合 UUIDv4 架构

name

string

False

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

  • 最小长度:1

  • 最大长度:63

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

currentConfig

"type_json"

False

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

desiredConfig

"type_json"

False

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

configSchema

"类型_json_schema"

False

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

状态

string

False

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

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

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

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

stateUnready

数组[string]

False

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

  • 最小长度:1

  • 最大长度:127

元数据

"type_astra_metadata_update"

False

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

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

请求示例
{
  "type": "application/astra-setting",
  "version": "1.1",
  "desiredConfig": {
    "credential": "e3d2ea77-398e-49be-85fd-ec66d9426a06",
    "port": 587,
    "relayServer": "smtp.sendgrid.net",
    "isEnabled": "true"
  }
}

响应

Status: 204, Indicates if the setting resource was updated.

响应

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

invalidFields

数组["invalidFields"]

False

无效请求正文字段列表

响应示例
{
  "type": "https://astra.netapp.io/problems/5",
  "title": "Invalid query parameters",
  "detail": "The supplied query parameters are invalid.",
  "status": "400"
}

响应

Status: 409, Conflict
名称 Type Required Description

type

string

True

标题

string

True

详细信息

string

True

状态

string

True

correlationID

string

False

invalidFields

数组["invalidFields"]

False

无效请求正文字段列表

响应示例
{
  "type": "https://astra.netapp.io/problems/10",
  "title": "JSON resource conflict",
  "detail": "The request body JSON contains a field that conflicts with an idempotent value.",
  "status": "409"
}

响应

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

查询参数无效的原因

invalidFields

名称 Type Required Description

name

string

True

无效请求正文字段的名称

原因

string

True

请求正文字段无效的原因