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

创建新的 AppMirror 资源

POST /accounts/{account_id}/k8s/v1/appMirrors

指示要创建的 AppMirror API 资源的所需值。

参数

名称 Type Required Description

account_id

string

path

True

包含帐户资源的 ID

  • 示例:{{.Account}}

请求正文

指示要创建的 AppMirror API 资源的所需值。

名称 Type Required Description

type

string

True

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

  • "application/astra-appMirror"

version

string

True

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

  • "1.0"

sourceAppID

string

True

源应用程序的标识符。仅在将 sourceAppID 与 destinationAppID 交换时更新。定义的值为:

  • 符合 Astra 标识符架构

目标集群 ID

string

True

托管目标应用程序的托管群集的标识符。必须在创建时提供,因为它确定将在哪个群集上创建目标应用程序。如果在更新时提供,它必须匹配目标应用程序的群集 ID,因此只能在将 sourceAppID 与 destinationAppID 交换时更改。定义的值为:

  • 符合 Astra 标识符架构

namespaceMapping

数组["namespaceMapping"]

False

创建目标应用程序时要使用的命名空间,对应于源应用程序的命名空间。每个 JSON 对象都包含字段 "clusterID" 和 "namespaces",其中 "clusterID" 值是源或目标集群的 JSON 字符串 ID,"namespaces" 值是 JSON 字符串的 JSON 数组。每个集群必须正好有一个 JSON 对象,命名空间将通过索引关联。如果未提供,源集群的相同命名空间将在目标集群中使用。定义的值为:

  • 最小长度:0

  • 最大长度:2

storageClasses

数组["storageClasses"]

False

创建新的持久卷声明 (PVC) 时要在目标集群上使用的存储类。每个 JSON 对象都包含字段 "clusterID" 和 "storageClassName",其中 "clusterID" 值是源或目标集群的 JSON 字符串 ID,"storageClassName" 是在该集群上创建 PVC 时要使用的存储类。如果未提供或缺少集群的值,则将对该集群使用默认存储类。定义的值为:

  • 最小长度:0

  • 最大长度:2

stateDesired

string

True

关系的期望状态。在创建时,唯一有效的值是 "established"。定义的值为:

  • "established" - 已创建关系。

  • "failedOver" - 应用程序到目标集群的故障转移已完成。

  • "deleted" - 已成功清理并删除此关系。

元数据

"type_astra_metadata_update"

False

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

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

请求示例
{
  "type": "application/astra-appMirror",
  "version": "1.0",
  "sourceAppID": "efd639b6-fc92-4112-8841-0c0ab7890ae0",
  "destinationClusterID": "c5d023a9-4061-4a8a-bfbf-3be11ff06226",
  "stateDesired": "established"
}

响应

Status: 201, Returns the newly created appMirror resource in the JSON response body.
名称 Type Required Description

type

string

True

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

  • "application/astra-appMirror"

version

string

True

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

  • "1.0"

id

string

True

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

  • 符合 UUIDv4 架构

sourceAppID

string

True

源应用程序的标识符。仅在将 sourceAppID 与 destinationAppID 交换时更新。定义的值为:

  • 符合 Astra 标识符架构

sourceClusterID

string

True

托管源应用程序的托管群集的标识符。此字段是只读的,并根据源应用程序的主机群集确定。如果在更新中提供,则它必须与源应用程序的群集 ID 匹配,因此只能在将 sourceAppID 与 destinationAppID 交换时进行更改。定义的值为:

  • 符合 Astra 标识符架构

目标应用程序 ID

string

False

目标应用程序的标识符。无法在创建时提供,因为新的应用程序 ID 将作为关系初始化的一部分生成。只能在将 sourceAppID 与 destinationAppID 交换时更新。定义的值为:

  • 符合 Astra 标识符架构

目标集群 ID

string

True

托管目标应用程序的托管群集的标识符。必须在创建时提供,因为它确定将在哪个群集上创建目标应用程序。如果在更新时提供,它必须匹配目标应用程序的群集 ID,因此只能在将 sourceAppID 与 destinationAppID 交换时更改。定义的值为:

  • 符合 Astra 标识符架构

namespaceMapping

数组["namespaceMapping"]

False

创建目标应用程序时要使用的命名空间,对应于源应用程序的命名空间。每个 JSON 对象都包含字段 "clusterID" 和 "namespaces",其中 "clusterID" 值是源或目标集群的 JSON 字符串 ID,"namespaces" 值是 JSON 字符串的 JSON 数组。每个集群必须正好有一个 JSON 对象,命名空间将通过索引关联。如果未提供,源集群的相同命名空间将在目标集群中使用。定义的值为:

  • 最小长度:0

  • 最大长度:2

storageClasses

数组["storageClasses"]

False

创建新的持久卷声明 (PVC) 时要在目标集群上使用的存储类。每个 JSON 对象都包含字段 "clusterID" 和 "storageClassName",其中 "clusterID" 值是源或目标集群的 JSON 字符串 ID,"storageClassName" 是在该集群上创建 PVC 时要使用的存储类。如果未提供或缺少集群的值,则将对该集群使用默认存储类。定义的值为:

  • 最小长度:0

  • 最大长度:2

状态

string

True

关系的状态。定义的值为:

  • "establishing" - 正在创建关系。

  • "established" - 已创建关系。

  • "failingOver" - 正在将应用程序故障转移到目标群集。

  • "failedOver" - 应用程序到目标集群的故障转移已完成。

  • "deleting" - 正在清理由关系创建的资源。

  • "deleted" - 已清理并删除此关系。

stateTransitions

数组["type_astra_stateTransition"]

False

允许的状态转换。此资源可以进行以下状态转换:

  • "正在建立": "已建立", "正在删除"

  • "established": "failingOver", "deleting"

  • "failingOver": "failedOver", "正在删除"

  • "failedOver": "正在建立", "正在删除"

  • "deleting": "已删除"

  • "已删除":

stateDesired

string

True

关系的期望状态。在创建时,唯一有效的值是 "established"。定义的值为:

  • "established" - 已创建关系。

  • "failedOver" - 应用程序到目标集群的故障转移已完成。

  • "deleted" - 已成功清理并删除此关系。

stateAllowed

数组[string]

False

可以在给定状态下请求的状态。可以在每个定义的状态下请求以下状态:

  • "establishing":"已建立","已删除"

  • "established": "failedOver", "deleted"

  • “failingOver”: “failedOver”, “deleted”

  • "failedOver": "已建立", "已删除"

  • "deleting": "已删除"

  • "deleted": "deleted"

stateDetails

数组["type_astra_stateDetail"]

True

有关当前状态的其他详细信息,包括为什么达到当前状态。如果没有可用的详细信息,此数组将为空。定义的值为:

  • 最小项目数:0

transferState

string

False

当前或最近快照传输的状态。定义的值为:

  • "transferring" - 创建了一个新的快照,现在正在复制到目标集群。此状态还包括先前尝试失败且正在持续重试的传输。

  • "idle" - 当前没有正在执行的传输。

transferStateTransitions

数组["type_astra_stateTransition"]

False

从给定定义状态允许的状态转换。此资源可以进行以下状态转换:

  • “传输中”: “空闲”

  • “空闲”: “传输中”

transferStateDetails

数组["type_astra_stateDetail"]

False

有关当前状态的其他详细信息,包括为什么达到当前状态。如果没有可用的详细信息,此数组将为空。定义的值为:

  • 最小项目数:0

healthState

string

True

资源的运行状况。定义的值为:

  • "不确定" - 无法确定资源的健康状况(例如,由于缺乏连接)

  • "normal" - 资源没有已知问题,可以根据接口规范提供服务

  • "warning" - 资源存在已知问题,但不会阻止其根据接口规范提供服务

  • "critical" - 资源存在已知问题,无法根据接口规范提供服务

healthStateTransitions

数组["type_astra_stateTransition"]

True

从给定定义状态允许的状态转换。此资源可以进行以下状态转换:

  • "不确定": "正常", "警告", "严重"

  • "normal": "不确定", "警告", "严重"

  • "warning": "不确定", "正常", "严重"

  • "critical": "indeterminate", "normal", "warning"

healthStateDetails

数组["type_astra_stateDetail"]

True

有关当前状态的其他详细信息,包括为什么达到当前状态。如果没有可用的详细信息,此数组将为空。定义的值为:

  • 最小项目数:0

元数据

"type_astra_metadata_update"

True

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

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

响应示例
{
  "type": "application/astra-appMirror",
  "version": "1.0",
  "id": "c5fbadd4-5d9e-5942-bb7f-f5386b6b6253",
  "sourceAppID": "efd639b6-fc92-4112-8841-0c0ab7890ae0",
  "sourceClusterID": "5789e026-c2e2-41e9-ab00-9766bcfa8951",
  "destinationAppID": "cd7b6d91-fc19-4983-a754-9a7bb4d80a7b",
  "destinationClusterID": "c5d023a9-4061-4a8a-bfbf-3be11ff06226",
  "state": "establishing",
  "stateTransitions": [
    {
      "from": "establishing",
      "to": [
        "established",
        "deleting"
      ]
    },
    {
      "from": "established",
      "to": [
        "failingOver",
        "deleting"
      ]
    },
    {
      "from": "failingOver",
      "to": [
        "failedOver",
        "deleting"
      ]
    },
    {
      "from": "failedOver",
      "to": [
        "establishing",
        "deleting"
      ]
    },
    {
      "from": "deleting",
      "to": [
        "deleted"
      ]
    }
  ],
  "stateDesired": "established",
  "stateAllowed": [
    "deleted"
  ],
  "stateDetails": [
    {
      "type": "https://astra.netapp.io/stateDetails/3",
      "title": "AppMirror is being established",
      "detail": "The AppMirror relationship is in the process of being established."
    }
  ],
  "healthState": "warning",
  "healthStateTransitions": [
    {
      "from": "indeterminate",
      "to": [
        "normal",
        "warning",
        "critical"
      ]
    },
    {
      "from": "normal",
      "to": [
        "indeterminate",
        "warning",
        "critical"
      ]
    },
    {
      "from": "warning",
      "to": [
        "indeterminate",
        "normal",
        "critical"
      ]
    },
    {
      "from": "critical",
      "to": [
        "indeterminate",
        "normal",
        "warning"
      ]
    }
  ],
  "healthStateDetails": [
    {
      "type": "https://astra.netapp.io/stateDetails/4",
      "title": "AppMirror not yet established",
      "detail": "The relationship is in the process of being established, so it's not protecting the app data yet."
    }
  ],
  "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

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

响应示例
{
  "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: 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"
}

定义

查看定义

namespaceMapping

名称 Type Required Description

clusterID

string

False

为其指定了命名空间的集群的标识符。定义的值为:

  • 符合 Astra 标识符架构

命名空间

数组[string]

False

要在集群上使用的命名空间列表。按索引与其他集群命名空间列表相关联。定义的值为:

  • 最小长度:1

  • 最大长度:63

  • 符合 DNS 1123 标签架构

storageClasses

名称 Type Required Description

clusterID

string

False

为其指定了存储类的集群的标识符。定义的值为:

  • 符合 Astra 标识符架构

storageClassName

string

False

在"clusterID"中指定的集群上创建 PVC 时要使用的存储类的名称。定义的值为:

  • 最小长度:1

  • 最大长度:255

类型 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

type_astra_stateTransition

名称 Type Required Description

string

True

to

数组[string]

True

type_astra_stateDetail

名称 Type Required Description

type

string

True

标题

string

True

详细信息

string

True

invalidParams

名称 Type Required Description

name

string

True

无效查询参数的名称

原因

string

True

查询参数无效的原因

invalidFields

名称 Type Required Description

name

string

True

无效请求正文字段的名称

原因

string

True

请求正文字段无效的原因