You can call DescribeInstances to query information of one or more ApsaraDB for Redis 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 No DescribeInstances

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

RegionId String No cn-hangzhou

The ID of the region.

InstanceIds String No r-bp1xxxxxxxxxxxxx

The IDs of the instances to query. Set this parameter if you want to query information of specified ApsaraDB for Redis instances. Separate multiple IDs with a comma (,). If the parameter is not specified, all instances under the account are queried.

InstanceStatus String No Normal

The status of the instance. Valid values:

  • Normal
  • Creating
  • Changing
  • Inactive
  • Flushing
  • Released
  • Transforming
  • Unavailable
  • Error
  • Migrating
  • BackupRecovering
  • MinorVersionUpgrading
  • NetworkModifying
  • SSLModifying
  • MajorVersionUpgrading (You can still access the instance when the major version is being upgraded.)
ChargeType String No PostPaid

The payment type. Valid values:

  • PrePaid: subscription.
  • PostPaid: pay-as-you-go.
NetworkType String No CLASSIC

The type of the network. Valid values:

  • CLASSIC
  • VPC
EngineVersion String No 4.0

The engine version. Valid values:

  • 2.8
  • 4.0
  • 5.0
InstanceClass String No redis.master.small.default

The instance type. For more information, see Instance types.

VpcId String No vpc-bp1cxxxxxxxxxxxxxxxxx

The ID of the VPC.

VSwitchId String No vsw-sdrxxxxxxxxxxxxxxxxxx

The ID of the VSwitch.

PageNumber Integer No 1

The number of the page to return. Pages start from page 1. Default value: 1.

PageSize Integer No 10

The number of lines to return on each page. Maximum value: 50. Default value: 10.

InstanceType String No ApsaraDB for Redis

The engine type. Valid values:

  • Redis
  • Memcache
SearchKey String No apitest

The name of the instance.

ArchitectureType String No standard

The type of the architecture. Valid values:

  • cluster: the cluster edition.
  • standard: the standard master- replica edition.
  • SplitRW: the read/write-splitting edition.
  • NULL: all editions. This is the default value.
Expired String No False

The expiration status of the instance. Valid values:

  • True: the instance has expired.
  • False: the instance has not expired.
ZoneId String No cn-hongkong-b

The ID of the zone.

Tag.N.Key String No {“key1”:”value1”,“key2”:”value2”}

The tag key of the instance that is corresponding to the tag value. You can query instances based on the tag. You can specify up to five tags in a single request. The value of the parameter is in the {"key1":"value1","key2":"value2"...} format.

Tag.N.Value String No {“key1”:”value1”,“key2”:”value2”}

The tag value of the instance that is corresponding to the tag key.

ResourceGroupId String No rg-resourcegroupid1

The ID of the resource group.

Response parameters

Parameter Type Example Description
TotalCount Integer 1

The total number of instances that were queried.

PageNumber Integer 1

The page number of the returned page.

PageSize Integer 30

The number of lines that were returned on each page.

Instances Array

The information of the instances that were queried.

KVStoreInstance
ArchitectureType String cluster

The architecture of the instance. Valid values:

  • cluster: the cluster edition.
  • standard: the standard master-replica edition.
  • SplitRW: the read/write splitting edition.
  • NULL: all editions. This is the default value.
Bandwidth Long 96

The bandwidth of the instance. Unit: MB/s.

Capacity Long 4096

The storage capacity of the instance. Unit: MB.

ChargeType String PostPaid

The billing method. Valid values:

  • PrePaid: subscription.
  • PostPaid: pay-as-you-go.
Config String {\"maxmemory-policy\":\"volatile-lfu\",\"EvictionPolicy\":\"volatile-lru\",\"hash-max-ziplist-entries\":512,\"zset-max-ziplist-entries\":128,\"zset-max-ziplist-value\":64,\"set-max-intset-entries\":512,\"hash-max-ziplist-value\":64,\"#no_loose_disabled-commands\":\"flushall,flushdb\",\"lazyfree-lazy-eviction\":\"yes\"}

The parameter configuration of the instance. For more information, see Set parameters.

ConnectionDomain String r-bp1xxxxxxxxxxxxx.redis.rds.aliyuncs.com

The internal connection address of the instance.

ConnectionMode String Standard

The connection mode of the instance. Valid values:

  • Standard: the standard connection mode.
  • Safe: the database proxy mode.
Connections Long 20,000

The maximum number of connections supported by the instance.

CreateTime String 2018-11-07T08:49:00Z

The time when the instance was created.

DestroyTime String 2019-04-28T10:03:01Z

The time when the instance was destroyed.

End time String 2019-06-13T16:00:00Z

The expiration time of the subscription instance.

EngineVersion String 4.0

The engine version of the instance. Valid values:

  • 2.8
  • 4.0
  • 5.0
HasRenewChangeOrder String false

Indicates whether there was an order of renewal with configuration change that had not taken effect. Valid values:

  • true
  • false
InstanceClass String redis.logic.sharding.2g.2db.0rodb.4proxy.default

The type of the instance.

InstanceId String r-bp1xxxxxxxxxxxxx

The ID of the instance.

InstanceName String apitest

The name of the instance.

InstanceStatus String Normal

The state of the instance.

InstanceType String ApsaraDB for Redis

The engine type of the instance.

IsRds Boolean true

Indicates whether the instance is managed by Relational Database Service (RDS). Valid values:

  • true
  • false
NetworkType String CLASSIC

The network type of the instance.

  • CLASSIC
  • VPC
NodeType String double

The node type of the instance.

PackageType String standard

The type of the package. Valid values:

  • standard
  • customized
Port Long 6379

The service port of the instance.

PrivateIp String xxx.xxx.xxx.222

The internal IP address of the instance.

QPS Long 100000

The queries per second (QPS) supported by the instance.

RegionId String cn-hongkong

The ID of the region.

ReplacateId String grr-bp1xxxxxxxxxxxxx

The logical ID of the replica instance.

SearchKey String apitest

The keyword used in the fuzzy search based on the ID or description of the instance.

Tags Array

The list of tags and the details of each tag.

Tag
Key String key1

The tag key.

Value String value1

The tag value.

UserName String r-bp1xxxxxxxxxxxxx

The username used for connecting to the instance.

VSwitchId String vsw-bp1xxxxxxxxxxxxxxxxxx

The ID of the VSwitch.

VpcId String vpc-bp1xxxxxxxxxxxxxxxxxx

The ID of the VPC.

ZoneId String cn-hongkong-b

The ID of the zone.

RequestId String 1E83311F-0EE4-4922-A3BF-730B312BED56

The ID of the request.

Examples

Sample request

https://r-kvstore.aliyuncs.com/
?Action=DescribeInstances
&RegionId=cn-hangzhou
&<Common request parameter>

Sample success responses

XML format

<DescribeInstancesResponse>
      <PageNumber>1</PageNumber>
      <TotalCount>1</TotalCount>
      <PageSize>30</PageSize>
      <RequestId>1E83311F-0EE4-4922-A3BF-730B312BED56</RequestId>
      <Instances>
            <KVStoreInstance>
                  <Config>{"maxmemory-policy":"volatile-lfu","EvictionPolicy":"volatile-lru","hash-max-ziplist-entries":512,"zset-max-ziplist-entries":128,"zset-max-ziplist-value":64,"set-max-intset-entries":512,"hash-max-ziplist-value":64,"#no_loose_disabled-commands":"flushall,flushdb","lazyfree-lazy-eviction":"yes"}</Config>
                  <HasRenewChangeOrder>false</HasRenewChangeOrder>
                  <InstanceId>r-bp1xxxxxxxxxxxxx</InstanceId>
                  <UserName>r-bp1xxxxxxxxxxxxx</UserName>
                  <ZoneId>cn-hangzhou-e</ZoneId>
                  <ArchitectureType>cluster</ArchitectureType>
                  <PrivateIp>xxx.xxx.xxx.224</PrivateIp>
                  <VSwitchId>vsw-bp1xxxxxxxxxxxxxxxxxx</VSwitchId>
                  <VpcId>vpc-bp1xxxxxxxxxxxxxxxxxx</VpcId>
                  <NetworkType>VPC</NetworkType>
                  <PackageType>standard</PackageType>
                  <QPS>200000</QPS>
                  <IsRds>true</IsRds>
                  <EngineVersion>4.0</EngineVersion>
                  <ConnectionDomain>r-bp1xxxxxxxxxxxxx.redis.rds.aliyuncs.com</ConnectionDomain>
                  <InstanceName>apitest</InstanceName>
                  <ReplacateId>grr-bp1xxxxxxxxxxxxx</ReplacateId>
                  <Bandwidth>96</Bandwidth>
                  <ChargeType>PostPaid</ChargeType>
                  <InstanceType>Redis</InstanceType>
                  <Tags></Tags>
                  <InstanceStatus>Normal</InstanceStatus>
                  <Port>6379</Port>
                  <InstanceClass>redis.logic.sharding.2g.2db.0rodb.4proxy.default</InstanceClass>
                  <NodeType>double</NodeType>
                  <RegionId>cn-hangzhou</RegionId>
                  <CreateTime>2018-11-07T08:49:00Z</CreateTime>
                  <Capacity>4096</Capacity>
                  <Connections>20000</Connections>
            </KVStoreInstance>
      </Instances>
</DescribeInstancesResponse>

JSON format

{
    "PageNumber": 1,
    "TotalCount": 1,
    "PageSize": 30,
    "RequestId": "1E83311F-0EE4-4922-A3BF-730B312BED56",
    "Instances": {
        "KVStoreInstance": [
            {
                "Config": "{\"maxmemory-policy\":\"volatile-lfu\",\"EvictionPolicy\":\"volatile-lru\",\"hash-max-ziplist-entries\":512,\"zset-max-ziplist-entries\":128,\"zset-max-ziplist-value\":64,\"set-max-intset-entries\":512,\"hash-max-ziplist-value\":64,\"#no_loose_disabled-commands\":\"flushall,flushdb\",\"lazyfree-lazy-eviction\":\"yes\"}",
                "HasRenewChangeOrder": false,
                "InstanceId": "r-bp1xxxxxxxxxxxxx",
                "UserName": "r-bp1xxxxxxxxxxxxx",
                "ZoneId": "cn-hangzhou-e",
                "ArchitectureType": "cluster",
                "PrivateIp": "xxx.xxx.xxx.224",
                "VSwitchId": "vsw-bp1xxxxxxxxxxxxxxxxxx",
                "VpcId": "vpc-bp1xxxxxxxxxxxxxxxxxx",
                "NetworkType": "VPC",
                "PackageType": "standard",
                "QPS": 200000,
                "IsRds": true,
                "EngineVersion": "4.0",
                "ConnectionDomain": "r-bp1xxxxxxxxxxxxx.redis.rds.aliyuncs.com",
                "InstanceName": "apitest",
                "ReplacateId": "grr-bp1xxxxxxxxxxxxx",
                "Bandwidth": 96,
                "ChargeType": "PostPaid",
                "InstanceType": "Redis",
                "Tags": {
                    "Tag":[]
                },
                "InstanceStatus": "Normal",
                "Port": 6379,
                "InstanceClass": "redis.logic.sharding.2g.2db.0rodb.4proxy.default",
                "NodeType": "double",
                "RegionId": "cn-hangzhou",
                "CreateTime": "2018-11-07T08:49:00Z",
                "Capacity": 4096,
                "Connections": 20000
            }
        ]
    }
}

Error codes

HTTP status code Error code Error message Description
400 InvalidInstanceIds.Malformed The Specified parameter "InstanceIds" is not valid. The error message returned because the verification of instance IDs failed.

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