Help Center/ Relational Database Service/ API Reference/ API v3 (Recommended)/ Querying the Storage Type of a Database
Updated on 2024-08-28 GMT+08:00

Querying the Storage Type of a Database

Function

This API is used to query the storage type of a specified DB engine version.

  • Before calling an API, you need to understand the API in Authentication.

URI

  • URI format

    GET /v3/{project_id}/storage-type/{database_name}?version_name={version_name}&ha_mode={ha_mode}

  • Parameter description
    Table 1 Parameter description

    Name

    Mandatory

    Description

    project_id

    Yes

    Project ID of a tenant in a region.

    For details about how to obtain the project ID, see Obtaining a Project ID.

    database_name

    Yes

    Specifies the DB engine name. Its value can be any of the following and is case-insensitive:

    • MySQL
    • PostgreSQL
    • SQLServer

    version_name

    Yes

    Specifies the database version. For details about how to obtain the database version, see section Querying Version Information About a DB Engine.

    ha_mode

    No

    Specifies the HA mode. The value options are as follows:

    • single
    • ha
    • replica

Request

  • Request parameters

    None

  • URI example

    GET https://{endpoint}/v3/0483b6b16e954cb88930a360d2c4e663/storage-type/mysql?version_name=5.7&ha_mode=ha

Response

  • Normal response
    Table 2 Parameter description

    Name

    Type

    Description

    storage_type

    Array of objects

    Indicates the DB instance specifications information list.

    For details, see Table 3.

    dsspool_info

    Array of objects

    Indicates the dsspool specifications information list.

    For details, see Table 4.

    NOTE:

    Only Dedicated Cloud (DeC) users are supported.

    Table 3 storage_type field data structure description

    Name

    Type

    Description

    name

    String

    Indicates the storage type. Its value can be any of the following:

    • ULTRAHIGH: ultra-high I/O storage.
    • LOCALSSD: local SSD storage.
    • CLOUDSSD: cloud SSD storage. This storage type is supported only with general-purpose and dedicated DB instances.
    • ESSD: extreme SSD storage. This storage type is supported only with dedicated DB instances.

    az_status

    Map<String, String>

    Indicates the specification status in an AZ. Its value can be any of the following:

    • normal: indicates that the specifications in the AZ are available.
    • unsupported: indicates that the specifications are not supported by the AZ.
    • sellout: indicates that the specifications in the AZ are sold out.

    support_compute_group_type

    List<String>

    Indicates the performance specifications. Its value can be any of the following:

    • normal: general-enhanced
    • normal2: general-enhanced II
    • armFlavors: Kunpeng general-enhanced
    • dedicicateNormal: exclusive x86
    • armLocalssd: standard Kunpeng
    • normalLocalssd: standard x86
    • general: general-purpose
    • dedicated:
      • For the MySQL DB engine: dedicated
      • For PostgreSQL and SQL Server DB engines: dedicated, which is only supported for cloud SSDs
    • rapid:
      • For the MySQL DB engine: dedicated (offline)
      • For PostgreSQL and SQL Server DB engines: dedicated, which is only supported for extreme SSDs
    • bigmem: large-memory
    Table 4 dsspool_info field data structure description

    Name

    Type

    Description

    az_name

    String

    Indicates the name of the AZ where dsspool is located.

    free_capacity_gb

    String

    Indicates the available capacity of dsspool.

    dsspool_volume_type

    String

    Indicates the dsspool volume type.

    dsspool_id

    String

    Indicates the dsspool ID.

    dsspool_status

    String

    Indicates the dsspool status. Its value can be any of the following:

    • available
    • deploying
    • enlarging
    • frozen
    • sellout
  • Example normal response
    {
    	"storage_type": [{
    			"name": "COMMON",
    			"az_status": {
    				"az1": "normal",
    				"az2": "normal"
    			},
                            "support_compute_group_type": [
                                    "normal",
                                    "normal2",
                                    "armFlavors"
                            ]
    		},
    		{
    			"name": "ULTRAHIGH",
    			"az_status": {
    				"az1": "normal",
    				"az2": "normal"
    			},
                            "support_compute_group_type": [
                                    "normal",
                                    "normal2",
                                    "armFlavors"
                            ]
    		}
    	],
            "dsspool_info": []
    }

    DeC user query response example

    {
    	"storage_type": [
    		{
    			"name": "COMMON",
    			"az_status": {
    				"az1xahz": "normal",
    				"az3xahz": "normal"
    			},
                            "support_compute_group_type": [
                                    "normal",
                                    "normal2"
                            ]
    		},
    		{
    			"name": "ULTRAHIGH",
    			"az_status": {
    				"az1xahz": "normal",
    				"az3xahz": "normal"
    			},
                            "support_compute_group_type": [
                                    "normal",
                                    "normal2"
                            ]
    		}
    	],
    	"dsspool_info": [
    		{
    			"az_name": "az1xahz",
    			"free_capacity_gb": "8656",
    			"dsspool_volume_type": "ULTRAHIGH",
    			"dsspool_id": "f5f84ed7-6f19-4bd4-99d7-b450ad6cc4dd",
    			"dsspool_status": "available"
    		}
    	]
    }
  • Abnormal response

    For details, see Abnormal Request Results.

Status Code

Error Code

For details, see Error Codes.