tencent cloud

Feedback

DescribeInstances

Last updated: 2024-03-01 15:01:43

    1. API Description

    Domain name for API request: redis.tencentcloudapi.com.

    This API is used to query the list of Redis instances.

    A maximum of 50 requests can be initiated per second for this API.

    We recommend you to use API Explorer
    Try it
    API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

    2. Input Parameters

    The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

    Parameter Name Required Type Description
    Action Yes String Common Params. The value used for this API: DescribeInstances.
    Version Yes String Common Params. The value used for this API: 2018-04-12.
    Region No String Common Params. This parameter is not required for this API.
    Limit No Integer Number of instances returned per page. Default value: 20. Maximum value: 1000.
    Offset No Integer Pagination offset, which is an integral multiple of Limit. Calculation formula: offset = limit * (page number - 1).
    InstanceId No String ID of a specified instance, such as "crs-xjhsdj****" Log in to the Redis console and copy the instance ID in the instance list.

    OrderBy No String Instance list sorting criteria. The enumerated values are as listed below:
    • projectId: Project ID.
    • createtime: Instance creation time.
    • instancename: Instance name.
    • type: Instance type.
    • curDeadline: Instance expiration time.
    OrderType No Integer Instance sorting order.
    • 1: Descending.
    • 0: Ascending. Default value: 1.
    VpcIds.N No Array of String Array of VPC IDs such as 47525. If this parameter is not passed in or the array is empty, the classic network will be selected by default. This parameter is retained and can be ignored. It is set based on UniqVpcIds parameter format.
    SubnetIds.N No Array of String Array of VPC subnet IDs such as 56854. This parameter is retained and can be ignored. It is set based on UniqSubnetIds parameter format.
    SearchKey No String Keywords for fuzzy query. which can be used to fuzzy query an instance by its ID or name.
    ProjectIds.N No Array of Integer Array of project IDs
    InstanceName No String Instance name
    UniqVpcIds.N No Array of String Array of VPC IDs such as vpc-sad23jfdfk. If this parameter is not passed in or or the array is empty, the classic network will be selected by default.
    UniqSubnetIds.N No Array of String Array of VPC subnet IDs such as subnet-fdj24n34j2
    RegionIds.N No Array of Integer Array of region IDs (disused). The corresponding region can be queried through the common parameter Region.
    Status.N No Array of Integer Instance status.
    • 0: Uninitialized.
    • 1: In the process.
    • 2: Running.
    • -2: Isolated.
    • -3: To be deleted.
    TypeVersion No Integer Instance architecture.
    • 1: Standalone edition.
    • 2: Master-replica edition.
    • 3: Cluster edition.
    EngineName No String Storage engine information. Valid values: Redis-2.8, Redis-4.0, Redis-5.0, Redis-6.0 or CKV.
    AutoRenew.N No Array of Integer Renewal mode. Valid values:
    • 0: Manual renewal
    • 1: Auto-renewal
    • 2: No renewal upon expiration
    BillingMode No String Billing mode. Only pay-as-you-go billing is supported.
    Type No Integer Instance type. Valid values: - 2: Redis 2.8 Memory Edition (Standard Architecture). - 3: CKV 3.2 Memory Edition (Standard Architecture). - 4: CKV 3.2 Memory Edition (Cluster Architecture). - 5: Redis 2.8 Memory Edition (Standalone). - 6: Redis 4.0 Memory Edition (Standard Architecture). - 7: Redis 4.0 Memory Edition (Cluster Architecture). - 8: Redis 5.0 Memory Edition (Standard Architecture). - 9: Redis 5.0 Memory Edition (Cluster Architecture). - 15: Redis 6.2 Memory Edition (Standard Architecture). - 16: Redis 6.2 Memory Edition (Cluster Architecture).
    SearchKeys.N No Array of String Array of the search keywords, which can query the instance by its ID, name, IP address.
    TypeList.N No Array of Integer Internal parameter, which can be ignored.
    MonitorVersion No String Internal parameter, which can be ignored.
    InstanceTags.N No Array of InstanceTagInfo Resources filter by tag key and value. If this parameter is not specified or is an empty array, resources will not be filtered.
    TagKeys.N No Array of String Resources filter by tag key. If this parameter is not specified or is an empty array, resources will not be filtered.
    ProductVersions.N No Array of String Instance product version. If this parameter is not passed in or the array is empty, the instances will not be filtered based this parameter by default.
    • local: Local disk edition.
    • cdc: Dedicated cluster edition.
    InstanceIds.N No Array of String Batch query of the specified instances ID. The number of results returned is based on Limit.
    AzMode No String AZ deployment mode.
    • singleaz: Single-AZ.
    • 1: Multi-AZ.

    3. Output Parameters

    Parameter Name Type Description
    TotalCount Integer Total number of instances
    InstanceSet Array of InstanceSet List of instance details
    RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

    4. Example

    Example1 Sample request

    This example shows you how to query the list of Redis instances

    Input Example

    POST / HTTP/1.1Host: redis.tencentcloudapi.comContent-Type: application/jsonX-TC-Action: DescribeInstances<Common request parameters>{    "Limit": 2,    "Offset": 0,    "OrderBy": "createtime "}
    

    Output Example

    {
        "Response": {
            "InstanceSet": [
                {
                    "Appid": 251223628,
                    "AutoRenewFlag": 0,
                    "BillingMode": 1,
                    "ClientLimit": 10000,
                    "ClientLimitMax": 40000,
                    "ClientLimitMin": 10000,
                    "CloseTime": "0000-00-00 00:00:00",
                    "Createtime": "2023-04-17 11:32:18",
                    "CurrentProxyVersion": "5.8.0",
                    "CurrentRedisVersion": "6.0.0",
                    "DeadlineTime": "2023-05-17 11:32:18",
                    "DiskSize": 0,
                    "DtsStatus": 0,
                    "Engine": "Redis",
                    "InstanceId": "crs-4nmzc0ul",
                    "InstanceName": "Redis_automation_is_awesome",
                    "InstanceNode": [],
                    "InstanceTags": [],
                    "InstanceTitle": "Adding an instance",
                    "MonitorVersion": "5s",
                    "NetLimit": 24,
                    "NoAuth": false,
                    "NodeSet": [
                        {
                            "NodeId": 336948,
                            "NodeType": 0,
                            "ZoneId": 100002,
                            "ZoneName": ""
                        },
                        {
                            "NodeId": 336946,
                            "NodeType": 1,
                            "ZoneId": 100003,
                            "ZoneName": ""
                        },
                        {
                            "NodeId": 336947,
                            "NodeType": 1,
                            "ZoneId": 100004,
                            "ZoneName": ""
                        }
                    ],
                    "OfflineTime": "",
                    "PasswordFree": 0,
                    "PolarisServer": "",
                    "Port": 6379,
                    "PriceId": 1000848,
                    "ProductType": "standalone",
                    "ProjectId": 0,
                    "ProjectName": "Default project",
                    "ReadOnly": 0,
                    "RedisReplicasNum": 2,
                    "RedisShardNum": 1,
                    "RedisShardSize": 4096,
                    "Region": "ap-guangzhou",
                    "RegionId": 1,
                    "RemainBandwidthDuration": "",
                    "Size": 4096,
                    "SizeUsed": 0,
                    "SlaveReadWeight": 0,
                    "Status": 1,
                    "SubStatus": 37,
                    "SubnetId": 2282634,
                    "Tags": [],
                    "Type": 15,
                    "UniqSubnetId": "subnet-1ed4w7to",
                    "UniqVpcId": "vpc-mjwornzj",
                    "UpgradeProxyVersion": "",
                    "UpgradeRedisVersion": "",
                    "Vip6": "",
                    "VpcId": 11133673,
                    "WanAddress": "",
                    "WanIp": "10.0.1.61",
                    "ZoneId": 100002
                },
                {
                    "Appid": 251223628,
                    "AutoRenewFlag": 0,
                    "BillingMode": 1,
                    "ClientLimit": 10000,
                    "ClientLimitMax": 40000,
                    "ClientLimitMin": 10000,
                    "CloseTime": "0000-00-00 00:00:00",
                    "Createtime": "2023-04-17 11:47:02",
                    "CurrentProxyVersion": "5.5.0",
                    "CurrentRedisVersion": "92.0.0",
                    "DeadlineTime": "2023-05-17 11:47:01",
                    "DiskSize": 0,
                    "DtsStatus": 0,
                    "Engine": "Redis",
                    "InstanceId": "crs-46njvft9",
                    "InstanceName": "Redis_automation_is_awesome",
                    "InstanceNode": [],
                    "InstanceTags": [],
                    "InstanceTitle": "Running",
                    "MonitorVersion": "5s",
                    "NetLimit": 24,
                    "NoAuth": false,
                    "NodeSet": [
                        {
                            "NodeId": 336951,
                            "NodeType": 0,
                            "ZoneId": 100002,
                            "ZoneName": ""
                        },
                        {
                            "NodeId": 336949,
                            "NodeType": 1,
                            "ZoneId": 100003,
                            "ZoneName": ""
                        },
                        {
                            "NodeId": 336950,
                            "NodeType": 1,
                            "ZoneId": 100004,
                            "ZoneName": ""
                        }
                    ],
                    "OfflineTime": "",
                    "PasswordFree": 0,
                    "PolarisServer": "",
                    "Port": 6379,
                    "PriceId": 1000848,
                    "ProductType": "standalone",
                    "ProjectId": 0,
                    "ProjectName": "Default project",
                    "ReadOnly": 0,
                    "RedisReplicasNum": 2,
                    "RedisShardNum": 1,
                    "RedisShardSize": 4096,
                    "Region": "ap-guangzhou",
                    "RegionId": 1,
                    "RemainBandwidthDuration": "",
                    "Size": 4096,
                    "SizeUsed": 0,
                    "SlaveReadWeight": 0,
                    "Status": 2,
                    "SubStatus": 19,
                    "SubnetId": 2282634,
                    "Tags": [],
                    "Type": 6,
                    "UniqSubnetId": "subnet-1ed4w7to",
                    "UniqVpcId": "vpc-mjwornzj",
                    "UpgradeProxyVersion": "",
                    "UpgradeRedisVersion": "",
                    "Vip6": "",
                    "VpcId": 11133673,
                    "WanAddress": "",
                    "WanIp": "10.0.1.71",
                    "ZoneId": 100002
                }
            ],
            "RequestId": "3fb5a4d2-680c-45a2-aa88-0213b76d1489",
            "TotalCount": 8
        }
    }
    

    5. Developer Resources

    SDK

    TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

    Command Line Interface

    6. Error Code

    The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

    Error Code Description
    FailedOperation.SystemError Internal system error, which is irrelevant to the business.
    FailedOperation.Unknown Invalid data is entered for weekday.
    InternalError.DbOperationFailed Internal system error with the database operation, which may be update, insert, select, etc.
    InvalidParameter Incorrect parameter.
    InvalidParameter.EmptyParam The parameter is empty.
    InvalidParameter.InvalidParameter Invalid service parameter.
    InvalidParameter.PermissionDenied The API has no CAM permissions.
    UnauthorizedOperation.NoCAMAuthed No CAM permissions.
    UnsupportedOperation The operation is not supported.
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support