You can call the ListClasses operation to query the instance types that are available to specific ApsaraDB RDS instances.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ListClasses

The operation that you want to perform. Set the value to ListClasses.

CommodityCode String Yes bards

The commodity code of the instances.

Valid values on the China site (aliyun.com):

  • bards: The instances are pay-as-you-go primary instances.
  • rds: The instances are subscription primary instances.
  • rords: The instances are pay-as-you-go read-only instances.
  • rds_rordspre_public_cn: The instances are subscription read-only instances.

Valid values on the International site (alibabacloud.com):

  • bards_intl: The instances are pay-as-you-go primary instances.
  • rds_intl: The instances are subscription primary instances.
  • rords_intl: The instances are pay-as-you-go read-only instances.
  • rds_rordspre_public_intl: The instances are subscription read-only instances.
OrderType String Yes BUY

The type of order that you want to query. Valid values:

  • BUY: specifies to query orders that are used to purchase instances.
  • UPGRADE: specifies to query orders that are used to change the specifications of instances.
  • RENEW: specifies to query orders that are used to renew instances.
  • CONVERT: specifies to query orders that are used to change the billing methods of instances.
ClientToken String No ETnLKlblzczshOTUbOCzxxxxxxx

The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can only contain ASCII characters and cannot exceed 64 characters in length.

DBInstanceId String No rm-uf6wjk5xxxxxxx

The ID of the primary instance. You can call the DescribeDBInstances operation to query the IDs of instances.

Note If you use the CommodityCode parameter to query the instance types that are available to read-only instances, you must specify the DBInstanceId parameter.
RegionId String No cn-hangzhou

The ID of the region that is supported by the instances. You can call the DescribeRegions operation to query the most recent region list.

Note If you are using an Alibaba Cloud account on the International site (alibabacloud.com), you must specify the RegionId parameter.

Response parameters

Parameter Type Example Description
Items Array of ClassList

An array that consists of the instance types that are available.

ClassCode String mysql.n1.micro.1

The instance type that is available. For more information, see Primary ApsaraDB RDS instance types and Read-only ApsaraDB RDS instance types.

ClassGroup String General-purpose

The instance family to which the instance type belongs. For more information, see Instance families.

Cpu String 1

The number of cores that are supported by the instance type. Unit: number.

MaxConnections String 2000

The maximum number of connections that are supported by the instance type. Unit: number.

MaxIOMBPS String 1024Mbps

The maximum I/O bandwidth that is supported by the instance type. Unit: Mbit/s.

MaxIOPS String 10000

The maximum input/output operations per second (IOPS) that is supported by the instance type. Unit: times/s.

MemoryClass String 1 GB (RDS Basic Edition)

The memory capacity that is supported by the instance type. Unit: GB.

ReferencePrice String 2500

The fee that you must pay for the instance type.

  • Unit on the China site (aliyun.com): cent (CNY).
  • Unit on the International site (alibabacloud.com): cent (USD).
Note
  • If you set the CommodityCode parameter to a value that indicates the pay-as-you-go billing method, the ReferencePrice parameter specifies the hourly fee that you must pay.
  • If you set the CommodityCode parameter to a value that indicates the subscription billing method, the ReferencePrice parameter specifies the monthly fee that you must pay.
RegionId String cn-hangzhou

The ID of the region to which the instance type is available.

RequestId String CF8D35BF-263D-4F7B-883A-1163B79A9EC6

The ID of the request.

Examples

Sample requests

http(s)://rds.aliyuncs.com/?Action=ListClasses
&CommodityCode=bards
&OrderType=BUY
&<Common request parameters>

Sample success responses

XML format

<ListClassesResponse>
  <RequestId>CF8D35BF-263D-4F7B-883A-1163B79A9EC6</RequestId>
  <Items>
        <MaxIOMBPS>1024Mbps</MaxIOMBPS>
        <ClassCode>mysql.n2.medium.1</ClassCode>
        <MaxConnections>4000</MaxConnections>
        <ClassGroup>General-purpose</ClassGroup>
        <Cpu>2 </Cpu>
        <MemoryClass>4 GB (RDS Basic Edition)</MemoryClass>
        <ReferencePrice>32.6</ReferencePrice>
        <MaxIOPS>10000</MaxIOPS>
  </Items>
  <Items>
        <MaxIOMBPS>1024Mbps</MaxIOMBPS>
        <ClassCode>mysql.n1.micro.1</ClassCode>
        <MaxConnections>2000</MaxConnections>
        <ClassGroup>General-purpose</ClassGroup>
        <Cpu>1 </Cpu>
        <MemoryClass>1 GB (RDS Basic Edition)</MemoryClass>
        <ReferencePrice>5.2</ReferencePrice>
        <MaxIOPS>10000</MaxIOPS>
  </Items>
</ListClassesResponse>

JSON format

{
  "RequestId": "CF8D35BF-263D-4F7B-883A-1163B79A9EC6",
  "Items": [
    {
      "MaxIOMBPS": "1024Mbps",
      "ClassCode": "mysql.n2.medium.1",
      "MaxConnections": "4000",
      "ClassGroup": "General-purpose",
      "Cpu": "2 ",
      "MemoryClass": "4 GB (RDS Basic Edition)",
      "ReferencePrice": "32.6",
      "MaxIOPS": "10000"
    },
    {
      "MaxIOMBPS": "1024Mbps",
      "ClassCode": "mysql.n1.micro.1",
      "MaxConnections": "2000",
      "ClassGroup": "General-purpose",
      "Cpu": "1 ",
      "MemoryClass": "1 GB (RDS Basic Edition)",
      "ReferencePrice": "5.2",
      "MaxIOPS": "10000"
    }
  ]
}

Error codes

HTTP status code Error code Error message Description
404 GetCommodity.Failed Get commodity failed. The error message returned because the instance types cannot be obtained.
404 InvalidDBInstanceName.NotFound Invalid DBInstanceId NotFound. The error message returned because the value that you specified for the DBInstanceId parameter cannot be found. Enter a valid value and try again.
400 InvalidSecurityIPList.Malformed The specified parameter "SecurityIPList" is not valid. The error message returned because the value that you specified for the SecurityIPList parameter is invalid.
400 InvalidSecurityIPList.Duplicate The Security IP address is not in the available range or occupied. The error message returned because the IP address that you specified is in use or is not within the valid range.
403 Forbidden.Authentication The operation is forbidden by Aliyun Realname Authentication System. The error message returned because this operation is prohibited by the real-name verification system of Alibaba Cloud.
400 InvalidCommodityCode.Malformed The commodity code is invalid. The error message returned because the commodity code that you specified is invalid.

For a list of error codes, visit the API Error Center.