Querying All DCS Instances
Function
This API is used to query DCS instances of a tenant, and allows you to specify query criteria.
Calling Method
For details, see Calling APIs.
URI
GET /v2/{project_id}/instances
Parameter | Mandatory | Type | Description |
|---|---|---|---|
project_id | Yes | String | Parameter description: Project ID. For details, see Obtaining a Project ID. Constraints: N/A. Value range: N/A. Default value: N/A. |
Parameter | Mandatory | Type | Description |
|---|---|---|---|
instance_id | No | String | Parameter description: Instance ID, which can be viewed on the instance details page on the DCS console. Constraints: N/A. Value range: N/A. Default value: N/A. |
include_failure | No | String | Parameter description: Indicates whether to return the number of instances that fail to be created. Constraints: N/A. Value range:
Default value: false |
include_delete | No | String | Parameter description: Whether to return the number of instances that have been deleted. Constraints: N/A. Value range:
Default value: false |
name | No | String | Parameter description: Instance name. Constraints: N/A. Value range: N/A. Default value: N/A. |
offset | No | Integer | Parameter description: Offset where the query starts Constraints: N/A. Value range: ≥ 0 Default value: 0 |
limit | No | Integer | Parameter description: Number of records displayed on each page. Constraints: N/A. Value range: 1–1000 Default value: 10 |
status | No | String | Parameter description: Instance status. Constraints: N/A. Value range: For details, see DCS Instance Statuses. Default value: N/A. |
name_equal | No | String | Parameter description: Exact query by instance name. Constraints: N/A Value range: N/A Default value: N/A |
tags | No | String | Parameter description: Query by instance tag key-value pair. {key} indicates the tag key, and {value} indicates the tag value. Constraints: To query instances with multiple tag keys and values, separate key-value pairs with commas (,). Value range: N/A. Default value: N/A. |
ip | No | String | Parameter description: IP address of a DCS instance, for example, 192.168.7.146 It can be viewed on the instance details page on the DCS console. Constraints: N/A. Value range: N/A. Default value: N/A. |
capacity | No | String | Parameter description: DCS instance memory, in GB. Constraints: N/A. Value range: N/A. Default value: N/A. |
Request Parameters
None
Response Parameters
Status code: 200
Parameter | Type | Description |
|---|---|---|
instance_num | Integer | Parameter description: Number of instances. Value range: N/A. |
instances | Array of InstanceListInfo objects | Parameter description: Instance details array. Value range: N/A. |
Parameter | Type | Description |
|---|---|---|
publicip_id | String | Parameter description: ID of the EIP bound to a DCS Redis instance. This parameter is reserved. The value is null. Value range: N/A. |
vpc_name | String | Parameter description: VPC name. Value range: N/A. |
charging_mode | Integer | Parameter description: Billing mode. Value range: 0: pay-per-use |
vpc_id | String | Parameter description: ID of the VPC where the DCS Redis instance is located. Value range: N/A. |
subnet_id | String | Parameter description: ID of the subnet bound to a DCS Redis instance. Value range: N/A. |
security_group_id | String | Parameter description: ID of the security group bound to the DCS Redis instance. Value range: N/A. |
created_at | String | Parameter description: Instance creation time. For example, 2017-03-31T12:24:46.297Z. Value range: N/A. |
updated_at | String | Parameter description: Instance update time. Format: 2017-03-31T19:24:46.297Z. Value range: N/A. |
enable_ssl | Boolean | Parameter description: This parameter is reserved. Value range: N/A |
max_memory | Integer | Parameter description: Total memory of an instance, in MB. Value range: N/A. |
used_memory | Integer | Parameter description: Used memory of an instance, in MB. Value range: N/A. |
publicip_address | String | Parameter description: EIP bound to the DCS Redis instance. This parameter is reserved. The value is null. Value range: N/A. |
capacity | Integer | Parameter description: Cache size of the instance, in GB. Value range: N/A. |
capacity_minor | String | Parameter description: Memory of a DCS instance whose size is less than 1 GB, in GB. Value range: N/A. |
order_id | String | Parameter description: Order ID. The value is null when a pay-per-use instance is created. Value range: N/A. |
maintain_begin | String | Parameter description: UTC time when the maintenance time window starts. The format is HH:mm:ss. Value range: N/A. |
maintain_end | String | Parameter description: UTC time when the maintenance time window ends. The format is HH:mm:ss. Value range: N/A. |
engine | String | Parameter description: Cache engine. Value range: Redis |
engine_version | String | Parameter description: Cache version. Value range: The engine version of a DCS Redis instance can be:
|
service_upgrade | Boolean | Parameter description: Whether an upgrade task has been created for an instance. Value range:
|
no_password_access | String | Parameter description: Indicates whether password-protected access is enabled for the instance. Value range:
|
service_task_id | String | Parameter description: ID of an upgrade task.
Value range: N/A. |
ip | String | Parameter description: IP address of the DCS instance. For a cluster instance, multiple IP addresses are returned and separated by commas (,). For example, 192.168.0.1, 192.168.0.2. Value range: N/A. |
access_user | String | Parameter description: Username for accessing a password-protected DCS instance. Value range: N/A. |
instance_id | String | Parameter description: Instance ID. Value range: N/A. |
enable_publicip | Boolean | Parameter description: Value range: |
port | Integer | Parameter description: Port of a DCS instance. Value range: N/A. |
user_id | String | Parameter description: ID of the user to which the instance belongs. Value range: N/A. |
user_name | String | Parameter description: Username of the instance. Value range: N/A. |
domain_name | String | Parameter description: Domain name of a instance. Value range: N/A. |
readonly_domain_name | String | Parameter description: Read-only domain name of the instance. This parameter is available only for master/standby instances. Value range: N/A. |
name | String | Parameter description: Instance name. Value range: N/A. |
spec_code | String | Parameter description: Product flavor code. Value range: N/A. |
status | String | Parameter description: Instance status. Value range: For details, see DCS Instance Statuses. |
tags | Array of ResourceTags objects | Parameter description: Instance tag key and value. Value range: N/A. |
enterprise_project_id | String | Parameter description: Enterprise project ID. Value range: N/A. |
description | String | Parameter description: Instance description. Value range: N/A. |
cpu_type | String | Parameter description: CPU type of the instance. Value range:
|
az_codes | Array of strings | Parameter description: AZs where there are available resources. Value range: N/A. |
features | Features object | Parameter description: Features supported by the instance. Value range: N/A. |
sub_status | String | Parameter description: Instance sub-status. Value range: N/A. |
Parameter | Type | Description |
|---|---|---|
key | String | Parameter description: Tag key. Value range: N/A |
value | String | Parameter description: Tag value. Value range: N/A |
Parameter | Type | Description |
|---|---|---|
support_acl | Boolean | Parameter description: Whether ACL is supported. Value range:
|
support_transparent_client_ip | Boolean | Parameter description: Whether client IP pass-through is enabled. Value range:
|
support_ssl | Boolean | Parameter description: Whether SSL is supported. Value range:
|
support_audit_log | Boolean | Parameter description: Whether audit logs are supported. Value range:
|
Status code: 400
Parameter | Type | Description |
|---|---|---|
error_msg | String | Parameter description: Error message. Value range: N/A. |
error_code | String | Parameter description: Error code. Value range: For details, see Error Codes. |
error_ext_msg | String | Parameter description: Extended error information. This parameter is not used currently and is set to null. Value range: N/A. |
Status code: 401
Parameter | Type | Description |
|---|---|---|
error_msg | String | Parameter description: Error message. Value range: N/A. |
error_code | String | Parameter description: Error code. Value range: For details, see Error Codes. |
error_ext_msg | String | Parameter description: Extended error information. This parameter is not used currently and is set to null. Value range: N/A. |
Status code: 403
Parameter | Type | Description |
|---|---|---|
error_msg | String | Parameter description: Error message. Value range: N/A. |
error_code | String | Parameter description: Error code. Value range: For details, see Error Codes. |
error_ext_msg | String | Parameter description: Extended error information. This parameter is not used currently and is set to null. Value range: N/A. |
Status code: 404
Parameter | Type | Description |
|---|---|---|
error_msg | String | Parameter description: Error message. Value range: N/A. |
error_code | String | Parameter description: Error code. Value range: For details, see Error Codes. |
error_ext_msg | String | Parameter description: Extended error information. This parameter is not used currently and is set to null. Value range: N/A. |
Status code: 500
Parameter | Type | Description |
|---|---|---|
error_msg | String | Parameter description: Error message. Value range: N/A. |
error_code | String | Parameter description: Error code. Value range: For details, see Error Codes. |
error_ext_msg | String | Parameter description: Extended error information. This parameter is not used currently and is set to null. Value range: N/A. |
Example Requests
GET https://{dcs_endpoint}/v2/{project_id}/instances?offset=0&limit=10&name={name}&status={status}&id={id}&include_failure=true&include_delete=true&name_equal=false Example Responses
Status code: 200
All instances are listed successfully.
{
"instance_num" : 1,
"instances" : [ {
"publicip_id" : { },
"vpc_name" : "dcs-beta",
"charging_mode" : 0,
"vpc_id" : "5e37b3be-950a-48e1-b498-65b63d336481",
"subnet_id" : "a4112635-3ec0-471c-95c3-5cf49b9533af",
"user_name" : "clouduser",
"created_at" : "2022-08-29T09:00:34.335Z",
"updated_at" : "2022-08-29T09:00:34.335Z",
"enable_ssl" : false,
"max_memory" : 128,
"publicip_address" : null,
"capacity" : 0,
"order_id" : null,
"maintain_begin" : "18:00:00",
"engine" : "Redis",
"maintain_end" : "19:00:00",
"capacity_minor" : ".125",
"service_upgrade" : false,
"no_password_access" : true,
"service_task_id" : "",
"ip" : "192.168.0.195",
"used_memory" : 2,
"access_user" : null,
"instance_id" : "c830053e-d5a3-4bc0-b6d6-ca37d1ea9dd5",
"enable_publicip" : false,
"port" : 6379,
"user_id" : "d53977d1adfb49c5b025ba7d33a13fd7",
"domain_name" : "redis-c830053e-d5a3-4bc0-b6d6-ca37d1ea9dd5.dcs.**cloud.com",
"name" : "dcs-lpvo0829",
"spec_code" : "redis.ha.xu1.tiny.r2.128",
"engine_version" : "5.0",
"status" : "RUNNING",
"security_group_id" : "securityGroupId",
"enterprise_project_id" : 0,
"tags" : [ {
"key" : 1,
"value" : "DCS"
} ],
"az_codes" : [ "region01", "region02" ],
"description" : "Instance description.",
"cpu_type" : "x86_64",
"features" : {
"support_acl" : true,
"support_transparent_client_ip" : true,
"support_ssl" : false,
"support_audit_log" : false
},
"sub_status" : "normal"
} ]
} Status code: 400
Invalid request.
{
"error_code" : "DCS.4800",
"error_msg" : "Invalid offset in the request."
} Status Codes
Status Code | Description |
|---|---|
200 | All instances are listed successfully. |
400 | Invalid request. |
401 | Invalid authentication information. |
403 | The request is rejected. |
404 | The requested resource is not found. |
500 | Internal service error. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.

