Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: luhuayi <luhuayi@huawei.com> Co-committed-by: luhuayi <luhuayi@huawei.com>
26 KiB
Querying Flavors by Snapshot ID
Function
This API is used to query flavors based on the snapshot ID. You can query the flavor of a snapshot or the flavor to which a snapshot can be restored.
Calling Method
For details, see Calling APIs.
URI
GET /v2/{project_id}/snapshots/{snapshot_id}/flavors
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
project_id |
Yes |
String |
Definition Project ID. Constraints N/A Range N/A Default Value N/A |
snapshot_id |
Yes |
String |
Definition Snapshot ID. Constraints N/A Range N/A Default Value N/A |
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
type |
No |
String |
Definition Flavor type. Constraints N/A Range snapshot: Only the flavor used by the snapshot is queried. restore: Flavor used by the snapshot and flavors that the snapshot can be restored to are queried. Default Value snapshot |
az_code |
No |
String |
Definition AZ that the snapshot can be restored to. Once the target AZ is selected, you can restore the snapshot to the flavors in the target AZ. When restoring a 3-AZ cluster, you need to specify three AZ codes separated by commas (,). Constraints N/A Range N/A Default Value AZ of the original cluster where the snapshot is located. |
fine_grained_restore |
No |
Boolean |
Definition Whether fine-grained backup restoration is used to filter available flavors during restoration. Constraints N/A Range true|false Default Value false |
Request Parameters
None
Response Parameters
Status code: 200
Parameter |
Type |
Description |
|---|---|---|
flavors |
Array of ProductUnitResp objects |
Definition Response to the snapshot flavor information. Range N/A |
count |
Integer |
Definition Total number of snapshot flavors. Range A positive integer greater than or equal to 0 |
Parameter |
Type |
Description |
|---|---|---|
id |
String |
Definition Flavor ID. Range N/A |
code |
String |
Definition Flavor code. Range N/A |
default_capacity |
String |
Definition Default capacity of the flavor. Range N/A |
classify |
String |
Definition Flavor type. Range N/A |
scenario |
String |
Definition Flavor application scenario. Range N/A |
version |
String |
Definition Flavor version information. Range v1.0: first-generation flavor v2.0: second-generation flavor. |
status |
String |
Definition Flavor status. Range N/A |
attribute |
Array of ProductExtendResp objects |
Definition Extended information. Range N/A |
duplicate |
Integer |
Definition Number of copies used by the flavor. Range N/A |
default_node |
Integer |
Definition Default number of nodes. Range N/A |
min_node |
Integer |
Definition Minimum number of nodes. Range N/A |
max_node |
Integer |
Definition Maximum number of nodes. Range N/A |
product_version_list |
Array of ProductVersionResp objects |
Definition Version information. Range N/A |
flavor_id |
String |
Definition Bottom-layer flavor ID. Different from the id field, this field is not used. Range N/A |
flavor_code |
String |
Definition Bottom-layer flavor code. Range N/A |
volume_num |
Integer |
Definition Number of disks supported by the flavor. Range N/A |
volume_used |
ProductVolumeUsedResp object |
Definition Disk usage of the cluster when a snapshot is created. Range N/A |
Parameter |
Type |
Description |
|---|---|---|
code |
String |
Definition Code of the extended information of the cluster flavor. Range N/A |
value |
String |
Definition Value of the extended information of the cluster flavor. Range N/A |
Parameter |
Type |
Description |
|---|---|---|
min_cn |
Integer |
Definition Minimum number of CNs supported by the flavor in this version. Range N/A |
max_cn |
Integer |
Definition Maximum number of CNs supported by the flavor in this version. Range N/A |
version_type |
String |
Definition Version type supported by the flavor. Range 1: stable version 0: latest version |
datastore_version |
String |
Definition Version number supported by the flavor. Range N/A |
Parameter |
Type |
Description |
|---|---|---|
volume_type |
String |
Definition Storage type used by a node. Range HIGH: SAS disk ULTRAHIGH: SSD cloud disk COMMON: SATA disk LOCAL_DISK: local disk |
volume_num |
Integer |
Definition Number of disks used by a node. Range N/A |
capacity |
Integer |
Definition Available storage of a single node in the cluster. Range N/A |
volume_size |
Integer |
Definition Physical storage of a single data disk on a cluster node. Range N/A |
Example Requests
Query flavors by snapshot ID.
GET https://{Endpoint}/v2/05f2cff45100d5112f4bc00b794ea08e/snapshots/46921d1d-3d15-4a6f-8834-520c108c03da/flavors?type=snapshot
Example Responses
Status code: 200
Query succeeded.
{
"flavors" : [ {
"id" : "908c1620-4cd8-3803-9082-2b29fc966917",
"code" : "dws2.km1.xlarge",
"classify" : "dws",
"scenario" : "non-production",
"version" : "v1.0",
"status" : "enable",
"attribute" : [ {
"code" : "maxQueue",
"value" : ""
}, {
"code" : "cpuNum",
"value" : "4"
}, {
"code" : "memSize",
"value" : "32"
}, {
"code" : "ioGbSec",
"value" : ""
}, {
"code" : "diskType",
"value" : "SSD"
}, {
"code" : "localDisk",
"value" : "N"
} ],
"duplicate" : 2,
"default_node" : 3,
"min_node" : 3,
"max_node" : 32,
"default_capacity" : "200",
"product_version_list" : [ {
"min_cn" : 2,
"max_cn" : 20,
"version_type" : "1",
"datastore_version" : "9.1.0.215"
} ],
"flavor_id" : "e7fe0f10-5ec7-45f5-8558-c8b50ad88b34",
"flavor_code" : "rc6.xlarge.4",
"volume_num" : 2,
"volume_used" : {
"volume_type" : "SATA",
"volume_num" : 2,
"capacity" : 200,
"volume_size" : 200
}
} ],
"count" : 1
}
Status Codes
Status Code |
Description |
|---|---|
200 |
Query succeeded. |
400 |
Request error. |
401 |
Authentication failed. |
403 |
You do not have required permissions. |
500 |
Internal server error. |
503 |
Service unavailable. |