Updated on 2025-01-14 GMT+08:00

Querying a DCS instance

Function

This API is used to query the details about a specified DCS instance.

Calling Method

For details, see Calling APIs.

URI

GET /v2/{project_id}/instances/{instance_id}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

instance_id

Yes

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.

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.

Request Parameters

None

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

vpc_name

String

Parameter description:

VPC name.

Value range:

N/A.

charging_mode

Integer

Parameter description:

Billing mode.

Value range:

  • 0: pay-per-use

  • 1: yearly/monthly

vpc_id

String

Parameter description:

ID of the VPC where the DCS Redis instance is located.

Value range:

N/A.

user_name

String

Parameter description:

Username of the instance.

Value range:

N/A.

created_at

String

Parameter description:

Creation completion time, for example, 2017-03-31T12:24:46.297Z

Value range:

N/A.

description

String

Parameter description:

Instance description.

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.

security_group_name

String

Parameter description:

Name of the tenant security group.

Value range:

N/A.

max_memory

Integer

Parameter description:

Total memory size in MB.

Value range:

N/A.

used_memory

Integer

Parameter description:

Used memory size in MB.

Value range:

N/A.

capacity

Integer

Parameter description:

DCS instance memory, 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.

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:

DCS instance engine.

Value range:

N/A.

no_password_access

String

Parameter description:

Indicates whether password-protected access is enabled for the instance.

Value range:

  • true: no

  • false: yes

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.

instance_backup_policy

InstanceBackupPolicy object

Parameter description:

Backup policy. This parameter is available for master/standby, read/write splitting, and cluster instances.

Value range:

N/A.

az_codes

Array of strings

Parameter description:

AZ where the instance is located. The AZ code is returned.

Value range:

N/A.

available_zones

Array of strings

Parameter description:

ID of the AZ where the instance is in. The AZ ID is returned.

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.

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.

name

String

Parameter description:

Instance name.

Value range:

N/A.

spec_code

String

Parameter description:

Product flavor code.

Value range:

N/A.

subnet_id

String

Parameter description:

ID of the subnet bound to a DCS Redis instance.

Value range:

N/A.

subnet_name

String

Parameter description:

Subnet name.

Value range:

N/A.

subnet_cidr

String

Parameter description:

Subnet CIDR block.

Value range:

N/A.

engine_version

String

Parameter description:

Engine version.

Value range:

The engine version of a DCS Redis instance can be:

  • 3.0

  • 4.0

  • 5.0

  • 6.0

If the cache engine is Memcached, this parameter is blank.

order_id

String

Parameter description:

Order ID.

Value range:

N/A.

status

String

Parameter description:

DCS instance status.

Value range:

For details, see DCS Instance Statuses.

domain_name

String

Parameter description:

Domain name of an instance.

Value range:

N/A.

readonly_domain_name

String

Parameter description:

Read-only domain name of an instance. This parameter is available only for master/standby instances.

Value range:

N/A.

enable_publicip

Boolean

Parameter description:

Whether public access is enabled for a DCS Redis 3.0 instance.

Value range:

  • true: enable

  • false: disable

publicip_id

String

Parameter description:

ID of the EIP bound to a DCS Redis instance.

The value of this parameter is null if public access is disabled.

Value range:

N/A.

publicip_address

String

Parameter description:

EIP bound to the DCS Redis instance.

The value of this parameter is null if public network access is disabled.

Value range:

N/A.

enable_ssl

Boolean

Parameter description:

Whether SSL is supported when enabling public access to a DCS Redis instance.

Value range:

  • true: enable

  • false: disable

service_upgrade

Boolean

Parameter description:

Whether an upgrade task has been created for an instance.

Value range:

  • true: yes

  • false: no

service_task_id

String

Parameter description:

ID of an upgrade task.

  • This parameter is valid when service_upgrade is set to true.

  • This parameter is blank when service_upgrade is set to false.

Value range:

N/A.

enterprise_project_id

String

Parameter description:

Enterprise project ID.

Value range:

N/A.

backend_addrs

String

Parameter description:

Backend address of a cluster instance.

Value range:

N/A.

features

Features object

Parameter description:

Features supported by the instance.

Value range:

N/A.

domain_name_info

DomainNameInfo object

Parameter description:

Information about instance domain name update and public domain name resolution.

Value range:

N/A.

transparent_client_ip_enable

Boolean

Parameter description:

Whether client IP pass-through is enabled.

Value range:

N/A.

sub_status

String

Parameter description:

Instance sub-status.

Value range:

N/A.

tags

Array of ResourceTag objects

Parameter description:

Instance tag key and value.

Value range:

N/A.

cpu_type

String

Parameter description:

CPU type of the instance.

Value range:

  • x86_64: x86-based

  • aarch64: Arm-based

enterprise_project_name

String

Parameter description:

Enterprise project name.

Value range:

N/A.

update_at

String

Parameter description:

Update time, for example, 2022-07-06T09:32:16.502Z

Value range:

N/A.

product_type

String

Parameter description:

Instance type.

Value range:

  • generic: basic edition

  • enterprise: enterprise edition

storage_type

String

Parameter description:

Storage type.

Value range:

Memory storage.

launched_at

String

Parameter description:

Start time, for example, 2022-07-06T09:32:16.502Z

Value range:

N/A.

cache_mode

String

Parameter description:

DCS instance type.

Value range:

  • single: single-node

  • ha: master/standby

  • cluster: Redis Cluster

  • proxy: Proxy Cluster

  • ha_rw_split: read/write splitting

support_slow_log_flag

String

Parameter description:

Whether slow query logs are supported.

Value range:

  • true: yes

  • false: no

db_number

Integer

Parameter description:

Number of databases.

Value range:

N/A.

replica_count

Integer

Parameter description:

Number of replicas.

Value range:

N/A.

sharding_count

Integer

Parameter description:

Number of shards in a cluster instance.

Value range:

N/A.

bandwidth_info

BandwidthInfo object

Parameter description:

Bandwidth information.

Value range:

N/A.

cloud_service_type_code

String

Parameter description:

Cloud service type code.

Value range:

N/A.

cloud_resource_type_code

String

Parameter description:

Cloud resource type code.

Value range:

N/A.

inquery_spec_code

String

Parameter description:

Specification code in the operations system.

Value range:

N/A.

Table 3 InstanceBackupPolicy

Parameter

Type

Description

backup_policy_id

String

Parameter description:

Backup policy ID.

Value range:

N/A.

created_at

String

Parameter description:

Creation time, in the format of 2022-04-11T09:45:24.790Z.

Value range:

N/A.

updated_at

String

Parameter description:

Update time, in the format of 2022-04-12T02:22:03.269Z.

Value range:

N/A.

policy

BackupPolicyResp object

Parameter description:

Backup policy.

Value range:

N/A.

tenant_id

String

Parameter description:

Tenant ID.

Value range:

N/A.

Table 4 BackupPolicyResp

Parameter

Type

Description

backup_type

String

Parameter description:

Backup type.

Value range:

  • auto: automatic backup

  • manual: manual backup

save_days

Integer

Parameter description:

Retention period, in days. The automatic backup policy is retained when automatic backup is switched to manual backup.

Value range:

1–7

periodical_backup_plan

BackupPlan object

Parameter description:

Backup plan. The automatic backup policy is retained when automatic backup is switched to manual backup.

Value range:

N/A.

Table 5 BackupPlan

Parameter

Type

Description

timezone_offset

String

Parameter description:

Time zone of the backup. This parameter is no longer used.

Value range:

N/A.

backup_at

Array of integers

Parameter description:

Day on which the backup starts every week. The automatic backup policy is retained when automatic backup is switched to manual backup.

Value range:

17: Monday to Sunday

period_type

String

Parameter description:

Interval at which backup is performed, which supports only weekly currently. The automatic backup policy is retained when automatic backup is switched to manual backup.

Value range:

N/A.

begin_at

String

Parameter description:

UTC time when the backup starts. For example, 00:00–01:00 indicates that the backup starts at 00:00 (UTC time). The value must be on the hour. The backup interval is 1 hour. The automatic backup policy is retained when automatic backup is switched to manual backup.

Value range:

N/A.

Table 6 Features

Parameter

Type

Description

support_acl

Boolean

Parameter description:

Whether ACL is supported.

Value range:

  • true: Yes

  • false: No

support_transparent_client_ip

Boolean

Parameter description:

Whether client IP pass-through is enabled.

Value range:

  • true: Yes

  • false: No

support_ssl

Boolean

Parameter description:

Whether SSL is supported.

Value range:

  • true: Yes

  • false: No

support_audit_log

Boolean

Parameter description:

Whether audit logs are supported.

Value range:

  • true: Yes

  • false: No

Table 7 DomainNameInfo

Parameter

Type

Description

support_public_resolve

Boolean

Parameter description:

Whether to enable public domain name resolution.

Value range:

  • true: yes

  • false: no

is_latest_rules

Boolean

Parameter description:

Whether the current domain name is the latest.

Value range:

  • true: Yes

  • false: No

zone_name

String

Parameter description:

Region suffix of the domain name.

Value range:

N/A.

history_domain_names

Array of DomainNameEntity objects

Parameter description:

Historical domain name information.

Value range:

N/A.

Table 8 DomainNameEntity

Parameter

Type

Description

domain_name

String

Parameter description:

Historical domain names of the instance.

Value range:

N/A.

is_readonly

Boolean

Parameter description:

Whether the domain name is read-only.

Value range:

  • true: Yes

  • false: No

Table 9 ResourceTag

Parameter

Type

Description

key

String

Parameter description:

Tag key.

  • Cannot be left blank.

  • Must be unique for each resource.

  • Can contain a maximum of 36 characters.

  • Must be unique and cannot be empty.

Value range:

N/A.

value

String

Parameter description:

Tag value.

  • This parameter is mandatory when action is set to create and is optional when action is set to delete.

  • It can contain a maximum of 43 characters.

Value range:

N/A.

Table 10 BandwidthInfo

Parameter

Type

Description

begin_time

Long

Parameter description:

Start time of temporary increase.

Value range:

N/A.

end_time

Long

Parameter description:

End time of temporary increase.

Value range:

N/A.

current_time

Long

Parameter description:

Current time.

Value range:

N/A.

bandwidth

Integer

Parameter description:

Current bandwidth, in Mbit/s.

Value range:

N/A.

next_expand_time

Long

Parameter description:

Next increase time.

Value range:

N/A.

expand_count

Integer

Parameter description:

Number of increases.

Value range:

N/A.

expand_effect_time

Long

Parameter description:

Interval between temporary increases.

Value range:

N/A.

expand_interval_time

Long

Parameter description:

Time to the next increase.

Value range:

N/A.

max_expand_count

Integer

Parameter description:

Maximum number of increases.

Value range:

N/A.

task_running

Boolean

Parameter description:

Whether the task is running.

Value range:

N/A.

Example Requests

GET https://{dcs_endpoint}/v2/{project_id}/instances/{instance_id}

Example Responses

Status code: 200

The specified instance is queried successfully.

{
  "publicip_id" : null,
  "vpc_name" : "dcs-beta",
  "charging_mode" : 0,
  "enterprise_project_name" : "default",
  "vpc_id" : "5e37b3be-950a-48e1-b498-65b63d336481",
  "user_name" : "clouduser",
  "created_at" : "2022-08-29T08:53:47.319Z",
  "description" : null,
  "cache_mode" : "ha",
  "security_group_id" : "securityGroupId",
  "enable_ssl" : false,
  "max_memory" : 128,
  "publicip_address" : null,
  "capacity" : 0,
  "maintain_begin" : "18:00:00",
  "engine" : "Redis",
  "maintain_end" : "19:00:00",
  "capacity_minor" : ".125",
  "service_upgrade" : false,
  "subnet_name" : "dcs-beta",
  "no_password_access" : "true",
  "service_task_id" : null,
  "ip" : "192.168.0.251",
  "subnet_cidr" : "192.168.0.0/24",
  "used_memory" : 2,
  "security_group_name" : "securityGroupId",
  "instance_backup_policy" : null,
  "az_codes" : [ "xx-xxxxx-xx" ],
  "available_zones" : [ "d539378ec1314c85b76fefa3f7071458" ],
  "access_user" : null,
  "enterprise_project_id" : "0",
  "instance_id" : "a4c545cd-10b2-4efc-b0ab-a9b554ca0621",
  "enable_publicip" : false,
  "port" : 6379,
  "user_id" : "d53977d1adfb49c5b025ba7d33a13fd7",
  "domain_name" : "redis-a4c545cd-10b2-4efc-b0ab-a9b554ca0621.dcs.example.com",
  "name" : "dcs-billing",
  "spec_code" : "redis.ha.xu1.tiny.r2.128",
  "subnet_id" : "a4112635-3ec0-471c-95c3-5cf49b9533af",
  "engine_version" : "5.0",
  "order_id" : null,
  "status" : "RUNNING",
  "features" : {
    "support_acl" : true,
    "support_transparent_client_ip" : true,
    "support_ssl" : false,
    "support_audit_log" : false
  },
  "domain_name_info" : {
    "support_public_resolve" : true,
    "is_latest_rules" : true,
    "zone_name" : "dcs.example.com",
    "history_domain_names" : null
  },
  "transparent_client_ip_enable" : true,
  "sub_status" : "normal",
  "cpu_type" : "x86_64",
  "cloud_service_type_code" : "hws.service.type.dcs",
  "cloud_resource_type_code" : "hws.resource.type.dcs3",
  "inquery_spec_code" : "redis.ha.xu1.tiny.r2.128"
}

Status Codes

Status Code

Description

200

The specified instance is queried successfully.

400

Invalid request.

500

Internal service error.

Error Codes

See Error Codes.