Querying All DCS Instances of a Tenant¶
Function¶
This API is used to query DCS instances of a tenant, and allows you to specify query criteria.
URI¶
GET /v1.0/{project_id}/instances?start={start}&limit={limit}&name={name}&status={status}&id={id}&include_failure={include_failure}&ip={ip}&tags={key}={value}
Table 1 describes the parameters.
Parameter | Type | Mandatory | Description |
---|---|---|---|
project_id | String | Yes | Project ID. For details on how to obtain the value of this parameter, see Obtaining a Project ID. |
start | Integer | No | Start number for querying DCS instances. It cannot be lower than 1. By default, the start number is 1. |
limit | Integer | No | Number of DCS instances displayed on each page. Minimum value: 1 Maximum value: 2000 If this parameter is left unspecified, a maximum of 1000 DCS instances are displayed on each page. |
name | String | No | DCS instance name. |
id | String | No | Instance ID. |
status | String | No | DCS instance status. For details about status, see DCS Instance Statuses. |
ip | String | No | IP address for connecting to the DCS instance |
include_failure | String | No | An indicator of whether the number of DCS instances that failed to be created will be returned to the API caller. Options:
|
tags | Array of Objects | No | Query based on the instance tag key and value. {key} indicates the tag key, and {value} indicates the tag value. To query instances with multiple tag keys and values, separate key-value pairs with commas (,). |
Example
GET https://{dcs_endpoint}/v1.0/bd6b78e2ff9e4e47bc260803ddcc7a21/instances?start=1&limit=10&name=&status=&id=&include_failure=true
Request¶
Request parameters
None
Example request
None
Response¶
Response parameters
Table 2 describes the response parameters.
Parameter | Type | Description |
---|---|---|
instances | Array | Array of DCS instance details. |
instance_num | Integer | Number of DCS instances. |
Parameter | Type | Description |
---|---|---|
name | String | DCS instance name. |
engine | String | Cache engine. |
capacity | Integer | Cache capacity. Unit: GB. |
ip | String | IP address for connecting to 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. |
domainName | String | Domain name of the instance. |
port | Integer | Port number of the cache node. |
status | String | Cache instance status. For details about status, see DCS Instance Statuses. |
max_memory | Integer | Overall memory size. Unit: MB. |
used_memory | Integer | Size of the used memory. Unit: MB. |
instance_id | String | DCS instance ID. |
resource_spec_code | String | Resource specifications. For example:
|
engine_version | String | Cache engine version. |
internal_version | String | Internal DCS version. |
charging_mode | Integer | Billing mode. 0: pay-per-use. |
capacity_minor | String | Small-scale cache capacity. Unit: GB. |
vpc_id | String | VPC ID. |
vpc_name | String | VPC name. |
created_at | String | Time at which the DCS instance is created. For example, 2017-03-31T12:24:46.297Z. |
error_code | String | Error code returned when the DCS instance fails to be created or is abnormal. For details about error codes, see Error Codes. |
user_id | String | User ID. |
user_name | String | Username. |
maintain_begin | String | Time at which the maintenance time window starts. Format: hh:mm:ss. |
maintain_end | String | Time at which the maintenance time window ends. Format: hh:mm:ss. |
no_password_access | String | An indicator of whether a DCS instance can be accessed in password-free mode.
|
access_user | String | Username used for accessing a DCS instance with password authentication. |
enable_publicip | Boolean | An indicator of whether public access is enabled for a DCS Redis instance.
|
publicip_address | String | Elastic IP address bound to a DCS Redis instance. The parameter value is null if public access is disabled. |
publicip_id | String | ID of the elastic IP address bound to a DCS Redis instance. The parameter value is null if public access is disabled. |
enable_ssl | Boolean | An indicator of whether to enable SSL for public access to a DCS Redis instance.
|
service_upgrade | Boolean | An indicator of whether an upgrade task has been created for a DCS instance.
|
service_task_id | String | Upgrade task ID.
|
security_group_id | String | Security group name. |
tags | Array of Objects | Instance tag key and value. |
spec_code | String | Product specification code. |
domain_name | String | Domain name of the instance. |
readonlyDomainName | String | Read-only domain name. |
readonly_domain_name | String | Read-only domain name. |
freeze_scene | String | Scenario where the instance is frozen. |
update_at | String | Update time. For example, 2017-03-31T12:24:46.297Z. |
subnet_id | String | Subnet ID. |
Example response
{"instances":[
{
"max_memory":2048,
"used_memory":1,
"instance_id":"add1eee3-eaad-4975-a8d7-8cf853460e3d",
"name":"lboka-single-4",
"resource_spec_code":"redis.single.xu1.large.2",
"spec_code":"redis.single.xu1.large.2",
"engine":"Redis",
"engine_version":"4.0",
"internal_version":null,
"charging_mode":0,
"capacity":2,
"capacity_minor":null,
"vpc_id":"9d3938d4-d622-48f3-ab62-23f8ff8b7830",
"vpc_name":null,
"ip":"192.168.1.91",
"domainName":"redis-add1eee3-eaad-4975-a8d7-8cf853460e3d.dcs.com",
"domain_name":"redis-add1eee3-eaad-4975-a8d7-8cf853460e3d.dcs.com",
"readonlyDomainName":null,
"readonly_domain_name":null,
"port":6379,
"status":"RUNNING",
"freeze_scene":null,
"created_at":"2021-04-18T13:36:44.144Z",
"update_at":"2021-04-18T13:37:10.575Z",
"error_code":null,
"user_id":"e96cb82994ef49648c2bfad79455b0ef",
"user_name":"lboka",
"maintain_begin":"02:00:00",
"maintain_end":"06:00:00",
"no_password_access":"false",
"access_user":null,
"enable_publicip":false,
"publicip_id":null,
"publicip_address":null,
"enable_ssl":false,
"service_upgrade":false,
"service_task_id":"",
"security_group_id":null,
"tags":null,
"subnet_id":"fd47ed9c-78a9-44c5-a712-06d251381e04"},
],
"instance_num":1
}
Status Code¶
Table 4 describes the status code of successful operations. For details about other status codes, see Table 1.
Status Code | Description |
---|---|
200 | All DCS instances of the tenant queried successfully. |