You can call this operation to query the network information of an ApsaraDB for Redis instance.

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 DescribeDBInstanceNetInfo

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

InstanceId String Yes r-bp1xxxxxxxxxxxxx

The ID of the instance.

RegionId String No cn-hangzhou

The ID of the region where the instance is deployed.

Response parameters

Parameter Type Example Description
InstanceNetworkType String CLASSIC

The network type of the instance. Valid values:

  • CLASSIC
  • VPC
NetInfoItems Array

The network information.

InstanceNetInfo
ConnectionString String r-bp1xxxxxxxxxxxxx.redis.rds.aliyuncs.com

The endpoint of the instance.

DBInstanceNetType String 1

The network type of the instance. Valid values:

  • 0: public network.
  • 1: classic network.
  • 2: Virtual Private Cloud (VPC).
ExpiredTime String 5183779

The expiration time of the classic network address of an ApsaraDB for Redis instance. Unit: seconds.

IPAddress String xxx.xxx.xxx.201

The IP address of the instance.

IPType String Inner

The network type of the IP address. Valid values:

  • Public: public network.
  • Inner: classic network.
  • Private: VPC.
Port String 6379

The port number of the instance.

Upgradeable String 0

The remaining validity period of the endpoint of the classic network. Unit: seconds. A value of 0 indicates that the endpoint never expires.

VPCId String vpc-bp1cxxxxxxxxxxxxxxxxx

The ID of the VPC where the instance is deployed.

VPCInstanceId String r-bp1xxxxxxxxxxxxx

The ID of the instance. It is returned only when the value of the DBInstanceNetType parameter is 2 (indicating VPC).

VSwitchId String vsw-4gxxxxxxxxxxxxxxxxxxx

The ID of the VSwitch.

RequestId String FC77D4E1-2A7C-4F0B-A4CC-CE0B9C314B9B

The ID of the request.

Examples

Sample requests

https://r-kvstore.aliyuncs.com/
?Action=DescribeDBInstanceNetInfo
&InstanceId=r-bp1xxxxxxxxxxxxx
&<Common request parameters>

Sample success responses

XML format

<DescribeDBInstanceNetInfoResponse>
      <RequestId>FC77D4E1-2A7C-4F0B-A4CC-CE0B9C314B9B</RequestId>
      <InstanceNetworkType>VPC</InstanceNetworkType>
      <NetInfoItems>
            <InstanceNetInfo>
                  <DBInstanceNetType>2</DBInstanceNetType>
                  <Port>6379</Port>
                     <ConnectionString>r-bp1xxxxxxxxxxxxx.redis.rds.aliyuncs.com</ConnectionString>
                  <VPCInstanceId>r-bp1xxxxxxxxxxxxx</VPCInstanceId>
                  <VPCId>vpc-bp1xxxxxxxxxxxxx</VPCId>
                  <IPAddress>xxx.xxx.xxx.161</IPAddress>
                  <IPType>Private</IPType>
                  <Upgradeable>0</Upgradeable>
                  <DirectConnection>0</DirectConnection>
            </InstanceNetInfo>
            <InstanceNetInfo>
                  <DBInstanceNetType>2</DBInstanceNetType>
                  <Port>6379</Port>
                  <ConnectionString>r-bp1xxxxxxxxxxxxx.redis.rds.aliyuncs.com</ConnectionString>
                  <VPCInstanceId>r-bp1xxxxxxxxxxxxx-direct</VPCInstanceId>
                  <VPCId>vpc-bp1xxxxxxxxxxxxx</VPCId>
                  <IPAddress>xxx.xxx.xxx.168</IPAddress>
                  <IPType>Private</IPType>
                  <Upgradeable>0</Upgradeable>
                  <DirectConnection>1</DirectConnection>
            </InstanceNetInfo>
      </NetInfoItems>
</DescribeDBInstanceNetInfoResponse>

JSON format

{
    "RequestId": "FC77D4E1-2A7C-4F0B-A4CC-CE0B9C314B9B",
    "InstanceNetworkType": "VPC",
    "NetInfoItems": {
        "InstanceNetInfo": [
            {
                "DBInstanceNetType": "2",
                "Port": "6379",
                "ConnectionString": "r-bp1xxxxxxxxxxxxx.redis.rds.aliyuncs.com",
                "VPCInstanceId": "r-bp1xxxxxxxxxxxxx",
                "VPCId": "vpc-bp1xxxxxxxxxxxxx",
                "IPAddress": "xxx.xxx.xxx.161",
                "IPType": "Private",
                "Upgradeable": "0",
                "DirectConnection": 0
            },
            {
                "DBInstanceNetType": "2",
                "Port": "6379",
                "ConnectionString": "r-bp1xxxxxxxxxxxxx.redis.rds.aliyuncs.com",
                "VPCInstanceId": "r-bp1xxxxxxxxxxxxx-direct",
                "VPCId": "vpc-bp1xxxxxxxxxxxxx",
                "IPAddress": "xxx.xxx.xxx.168",
                "IPType": "Private",
                "Upgradeable": "0",
                "DirectConnection": 1
            }
        ]
    }
}

Error codes

HttpCode Error code Error message Description
400 InvalidStartTime.Malformed The Specified parameter StartTime is not valid. The error message returned because the format of the beginning time is invalid. The time must be in GMT. Example: 2011-06-11T16:00Z.
400 InvalidEndTime.Malformed The Specified parameter EndTime is not valid. The error message returned because the format of the end time is invalid. The time must be in GMT. Example: 2011-06-11T16:00Z.

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