建立新的 AppMirror 資源
POST /accounts/{account_id}/k8s/v1/appMirrors
指示要建立的 AppMirror API 資源的所需值。
參數
| Name | 類型 | 在 | 必要 | 說明 |
|---|---|---|---|---|
account_id |
字串 |
路徑 |
True |
包含帳戶資源的 ID
|
請求本文
指示要建立的 AppMirror API 資源的所需值。
| Name | 類型 | 必要 | 說明 |
|---|---|---|---|
類型 |
字串 |
True |
資源的媒體類型。定義的值為:
|
版本 |
字串 |
True |
資源版本。定義的值為:
|
來源應用程式 ID |
字串 |
True |
來源應用程式的識別碼。僅在將 sourceAppID 與 destinationAppID 互換時更新。定義的值為:
|
目的地叢集 ID |
字串 |
True |
用於託管目標應用程式的受管叢集識別碼。建立時必須提供,因為它決定了目標應用程式將在哪個叢集上建立。如果在更新時提供,則它必須與目標應用程式的叢集 ID 相符,因此只有在 sourceAppID 與 destinationAppID 互換時才會變更。定義的值為:
|
namespaceMapping |
錯誤 |
建立目標應用程式時要使用的命名空間,與來源應用程式的命名空間相對應。每個 JSON 物件包含「clusterID」和「namespaces」欄位,其中「clusterID」的值是來源叢集或目標叢集的 JSON 字串 ID,「namespaces」的值是 JSON 字串陣列。每個叢集必須只有一個 JSON 物件,命名空間將透過索引關聯。如果未提供,則目標叢集將使用與來源叢集相同的命名空間。定義的值為:
|
|
storageClasses |
陣列["storageClasses"] |
錯誤 |
建立新的持久性磁碟區宣告(PVC)時,目標叢集上要使用的儲存類別。每個 JSON 物件包含欄位 "clusterID" 和 "storageClassName",其中 "clusterID" 的值是來源叢集或目標叢集的 JSON 字串 ID,"storageClassName" 是在該叢集上建立 PVC 時要使用的儲存類別。如果未提供或某個叢集缺少該值,則將使用該叢集的預設儲存類別。定義的值為:
|
stateDesired |
字串 |
True |
關係的理想狀態。建立時,唯一有效值為 "established"。定義的值為:
|
中繼資料 |
錯誤 |
與資源相關聯的用戶端和服務指定中繼資料。定義的值為:
|
範例請求
{
"type": "application/astra-appMirror",
"version": "1.1",
"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.
| Name | 類型 | 必要 | 說明 |
|---|---|---|---|
類型 |
字串 |
True |
資源的媒體類型。定義的值為:
|
版本 |
字串 |
True |
資源版本。定義的值為:
|
ID |
字串 |
True |
資源的全域唯一識別碼。定義的值為:
|
來源應用程式 ID |
字串 |
True |
來源應用程式的識別碼。僅在將 sourceAppID 與 destinationAppID 互換時更新。定義的值為:
|
sourceClusterID |
字串 |
True |
託管來源應用程式的受管叢集識別碼。此欄位為唯讀,根據來源應用程式的主機叢集決定。如果在更新中提供,則必須與來源應用程式的叢集 ID 相符,因此只有在將 sourceAppID 與 destinationAppID 互換時才能變更。定義的值為:
|
目的地應用程式 ID |
字串 |
錯誤 |
目標應用程式的識別碼。建立時無法提供此識別碼,因為關係初始化過程中會產生一個新的應用程式 ID。只有在來源應用程式 ID 與目標應用程式 ID 互換時才能更新此識別碼。定義的值為:
|
目的地叢集 ID |
字串 |
True |
用於託管目標應用程式的受管叢集識別碼。建立時必須提供,因為它決定了目標應用程式將在哪個叢集上建立。如果在更新時提供,則它必須與目標應用程式的叢集 ID 相符,因此只有在 sourceAppID 與 destinationAppID 互換時才會變更。定義的值為:
|
namespaceMapping |
錯誤 |
建立目標應用程式時要使用的命名空間,與來源應用程式的命名空間相對應。每個 JSON 物件包含「clusterID」和「namespaces」欄位,其中「clusterID」的值是來源叢集或目標叢集的 JSON 字串 ID,「namespaces」的值是 JSON 字串陣列。每個叢集必須只有一個 JSON 物件,命名空間將透過索引關聯。如果未提供,則目標叢集將使用與來源叢集相同的命名空間。定義的值為:
|
|
storageClasses |
陣列["storageClasses"] |
錯誤 |
建立新的持久性磁碟區宣告(PVC)時,目標叢集上要使用的儲存類別。每個 JSON 物件包含欄位 "clusterID" 和 "storageClassName",其中 "clusterID" 的值是來源叢集或目標叢集的 JSON 字串 ID,"storageClassName" 是在該叢集上建立 PVC 時要使用的儲存類別。如果未提供或某個叢集缺少該值,則將使用該叢集的預設儲存類別。定義的值為:
|
狀態 |
字串 |
True |
關係的狀態。定義的值為:
|
stateTransitions |
錯誤 |
允許的狀態轉換。此資源可能的狀態轉換如下:
|
|
stateDesired |
字串 |
True |
關係的理想狀態。建立時,唯一有效值為 "established"。定義的值為:
|
stateAllowed |
陣列[string] |
錯誤 |
在給定狀態下可以請求的狀態。在每個已定義的狀態下,可以請求以下狀態:
|
stateDetails |
True |
關於目前狀態的其他詳細資訊,包括達到目前狀態的原因。如果沒有可用的詳細資料,此陣列將為空白。定義的值為:
|
|
transferState |
字串 |
錯誤 |
目前或最近一次 Snapshot 傳輸的狀態。定義的值為:
|
transferStateTransitions |
錯誤 |
從給定的已定義狀態允許的狀態轉換。此資源可能的狀態轉換如下:
|
|
transferStateDetails |
錯誤 |
有關目前狀態的其他詳細資料,包括達到目前狀態的原因。如果沒有可用的詳細資料,此陣列將為空白。定義的值為:
|
|
healthState |
字串 |
True |
資源的健全狀態。定義的值為:
|
healthStateTransitions |
True |
從給定的已定義狀態允許的狀態轉換。此資源可能的狀態轉換如下:
|
|
healthStateDetails |
True |
有關目前狀態的其他詳細資料,包括達到目前狀態的原因。如果沒有可用的詳細資料,此陣列將為空白。定義的值為:
|
|
中繼資料 |
True |
與資源相關聯的用戶端和服務指定中繼資料。定義的值為:
|
範例回應
{
"type": "application/astra-appMirror",
"version": "1.1",
"id": "512c8dac-b7d4-5be9-836e-ee672965866a",
"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
| Name | 類型 | 必要 | 說明 |
|---|---|---|---|
類型 |
字串 |
True |
|
標題 |
字串 |
True |
|
詳細資料 |
字串 |
True |
|
狀態 |
字串 |
True |
|
correlationID |
字串 |
錯誤 |
範例回應
{
"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
| Name | 類型 | 必要 | 說明 |
|---|---|---|---|
類型 |
字串 |
True |
|
標題 |
字串 |
True |
|
詳細資料 |
字串 |
True |
|
狀態 |
字串 |
True |
|
correlationID |
字串 |
錯誤 |
|
invalidFields |
陣列["invalidFields"] |
錯誤 |
無效請求本文欄位清單 |
範例回應
{
"type": "https://astra.netapp.io/problems/5",
"title": "Invalid query parameters",
"detail": "The supplied query parameters are invalid.",
"status": "400"
}
回應
Status: 409, Conflict
| Name | 類型 | 必要 | 說明 |
|---|---|---|---|
類型 |
字串 |
True |
|
標題 |
字串 |
True |
|
詳細資料 |
字串 |
True |
|
狀態 |
字串 |
True |
|
correlationID |
字串 |
錯誤 |
範例回應
{
"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
| Name | 類型 | 必要 | 說明 |
|---|---|---|---|
類型 |
字串 |
True |
|
標題 |
字串 |
True |
|
詳細資料 |
字串 |
True |
|
狀態 |
字串 |
True |
|
correlationID |
字串 |
錯誤 |
範例回應
{
"type": "https://astra.netapp.io/problems/11",
"title": "Operation not permitted",
"detail": "The requested operation isn't permitted.",
"status": "403"
}
錯誤
Status: 404, Not found
| Name | 類型 | 必要 | 說明 |
|---|---|---|---|
類型 |
字串 |
True |
|
標題 |
字串 |
True |
|
詳細資料 |
字串 |
True |
|
狀態 |
字串 |
True |
|
correlationID |
字串 |
錯誤 |
範例錯誤回應
{
"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
| Name | 類型 | 必要 | 說明 |
|---|---|---|---|
clusterID |
字串 |
錯誤 |
指定命名空間的叢集識別碼。定義的值為:
|
命名空間 |
陣列[string] |
錯誤 |
叢集上要使用的命名空間清單。透過索引與其他叢集命名空間清單關聯。定義的值為:
|
角色 |
字串 |
錯誤 |
此命名空間定義的初始角色。除使用同叢集複寫組態外,此參數為選用參數。定義的值為:
|
storageClasses
| Name | 類型 | 必要 | 說明 |
|---|---|---|---|
clusterID |
字串 |
錯誤 |
指定儲存類別的叢集識別碼。定義的值為:
|
storageClassName |
字串 |
錯誤 |
在「clusterID」指定的叢集上建立 PVC 時要使用的儲存類別名稱。定義的值為:
|
角色 |
字串 |
錯誤 |
此儲存類別定義的初始角色。除使用同叢集複寫組態外,此參數為選用參數。定義的值為:
|
type_astra_label
| Name | 類型 | 必要 | 說明 |
|---|---|---|---|
姓名 |
字串 |
True |
|
值 |
字串 |
True |
type_astra_metadata_update
與資源相關聯的用戶端和服務指定中繼資料。定義的值為:
-
符合 Astra Metadata Schema。如果在建立時未指定、則會建立沒有標籤的中繼資料物件。如果在更新時未指定,元資料物件的標籤、creationTimestamp 和 createdBy 將保持不變。
| Name | 類型 | 必要 | 說明 |
|---|---|---|---|
標籤 |
錯誤 |
||
建立時間戳記 |
字串 |
錯誤 |
|
修改時間戳記 |
字串 |
錯誤 |
|
建立者 |
字串 |
錯誤 |
|
modifiedBy |
字串 |
錯誤 |
type_astra_stateTransition
| Name | 類型 | 必要 | 說明 |
|---|---|---|---|
從 |
字串 |
True |
|
到 |
陣列[string] |
True |
additionalDetails
type_astra_stateDetail
| Name | 類型 | 必要 | 說明 |
|---|---|---|---|
類型 |
字串 |
True |
|
標題 |
字串 |
True |
|
詳細資料 |
字串 |
True |
|
additionalDetails |
錯誤 |
invalidParams
| Name | 類型 | 必要 | 說明 |
|---|---|---|---|
姓名 |
字串 |
True |
無效查詢參數的名稱 |
原因 |
字串 |
True |
查詢參數無效的原因 |
invalidFields
| Name | 類型 | 必要 | 說明 |
|---|---|---|---|
姓名 |
字串 |
True |
無效請求內文欄位的名稱 |
原因 |
字串 |
True |
請求本文欄位無效的原因 |