Querying Details of DB Instances in Batches
Function
This API is used to query details of DB instances in batches. Before calling this API:
- Learn how to authorize and authenticate it.
- Obtain the required region and endpoint.
URI
GET /v3.1/{project_id}/instances/details
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Definition: Project ID of a tenant in a region. To obtain this value, see Obtaining a Project ID. Constraints: N/A Range: The value contains 32 characters. Only letters and digits are allowed. Default value: N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
instance_ids |
Yes |
String |
Definition: List of instance IDs. Constraints: The list can contain a maximum of 20 instance IDs. Range: An instance ID can contain 36 characters with a suffix of in07. Only letters and digits are allowed. Default value: N/A |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
Definition: User token. To obtain this value, call the IAM API for obtaining a user token. The value of X-Subject-Token in the response header is the token value. Constraints: N/A Range: N/A Default value: N/A |
|
X-Language |
No |
String |
Definition: Request language type. Constraints: N/A Range: Default value: en-us |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
instances |
Array of MysqlInstanceInfoDetailUnifyStatus objects |
Definition: Instance details. |
|
Parameter |
Type |
Description |
|---|---|---|
|
id |
String |
Definition: Instance ID. Range: The value can contain 36 characters with a suffix of in07. Only letters and digits are allowed. |
|
name |
String |
Definition: Instance name. Range: N/A |
|
project_id |
String |
Definition: Project ID of a tenant in a region. Range: N/A |
|
status |
String |
Definition: Instance status. Range: |
|
port |
String |
Definition: Database port. Range: N/A |
|
alias |
String |
Definition: Instance description. Range: N/A |
|
type |
String |
Definition: Instance type. Range: Cluster |
|
charge_info |
MysqlInstanceChargeInfo object |
Definition: Billing information. |
|
node_count |
Integer |
Definition: Number of nodes. Range: N/A |
|
datastore |
Definition: Database information. |
|
|
backup_used_space |
Double |
Definition: Used backup space, in GB. Range: N/A |
|
created |
String |
Definition: Creation time in the "yyyy-mm-ddThh:mm:ssZ" format. T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset. For example, if the time zone offset is one hour, the value of Z is +0100. Range: N/A |
|
updated |
String |
Definition: Update time in the "yyyy-mm-ddThh:mm:ssZ" format. T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset. For example, if the time zone offset is one hour, the value of Z is +0100. Range: N/A |
|
private_write_ips |
Array of strings |
Definition: Private IP addresses for write of instances. Range: N/A |
|
public_ips |
String |
Definition: EIPs. Range: N/A |
|
db_user_name |
String |
Definition: Default username. Range: N/A |
|
vpc_id |
String |
Definition: VPC ID. Range: N/A |
|
subnet_id |
String |
Definition: Network ID of the subnet. Range: N/A |
|
security_group_id |
String |
Definition: Security group ID. Range: N/A |
|
configuration_id |
String |
Definition: ID of the parameter template used for creating an instance or ID of the latest parameter template that is applied to an instance. Range: N/A |
|
backup_strategy |
MysqlBackupStrategy object |
Definition: Automated backup policy. Constraints: N/A |
|
nodes |
Array of MysqlInstanceNodeInfo objects |
Definition: Node information. |
|
enterprise_project_id |
String |
Definition: Enterprise project ID. Range: N/A |
|
time_zone |
String |
Definition: Time zone. Range: N/A |
|
az_mode |
String |
Definition: AZ type. Range: |
|
master_az_code |
String |
Definition: Primary AZ. Range: N/A |
|
maintenance_window |
String |
Definition: Maintenance window in the UTC format. Range: N/A |
|
tags |
Array of MysqlTags objects |
Definition: Instance tags. Range: N/A |
|
proxies |
Array of MysqlProxyInfo objects |
Definition: Proxy information. |
|
Parameter |
Type |
Description |
|---|---|---|
|
charge_mode |
String |
Definition: Billing mode. Range: |
|
order_id |
String |
Definition: Order ID. This parameter is only returned for yearly/monthly instances. Range: N/A |
|
Parameter |
Type |
Description |
|---|---|---|
|
type |
String |
Definition: DB engine. Range: gaussdb-mysql |
|
version |
String |
Definition: DB version. Range: N/A |
|
Parameter |
Type |
Description |
|---|---|---|
|
start_time |
String |
Definition: Automated backup start time. An automated backup will be triggered within one hour after the time specified by this parameter. Constraints: N/A Range: The value cannot be empty. It must be a valid value in the "hh:mm-HH:MM" format. The current time is the UTC time. Default value: N/A |
|
keep_days |
String |
Definition: Retention period of automated backups. Constraints: The value must be a positive integer. Range: 1–732 Default value: N/A |
|
Parameter |
Type |
Description |
|---|---|---|
|
id |
String |
Definition: Instance ID, which is compliant with the UUID format. Range: The value can contain 36 characters with a suffix of in07. Only letters and digits are allowed. |
|
name |
String |
Definition: Node name. Range: N/A |
|
type |
String |
Definition: Node type. Range: |
|
status |
String |
Definition: Node status. Range: N/A |
|
port |
Integer |
Definition: Database port. Range: N/A |
|
private_read_ips |
Array of strings |
Definition: Private IP addresses for read of nodes. Range: N/A |
|
volume |
MysqlInstanceNodeVolumeInfo object |
Definition: Storage disk information. Range: N/A |
|
az_code |
String |
Definition: AZ. Range: N/A |
|
region_code |
String |
Definition: Region where an instance is deployed. Range: N/A |
|
created |
String |
Definition: Creation time in the "yyyy-mm-ddThh:mm:ssZ" format. T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset. For example, if the time zone offset is one hour, the value of Z is +0100. Range: N/A |
|
updated |
String |
Definition: Update time. The format is the same as that of the created field. Range: N/A |
|
flavor_id |
String |
Definition: Specification ID. Range: N/A |
|
flavor_ref |
String |
Definition: Specification code. Range: N/A |
|
max_connections |
String |
Definition: Maximum number of connections. Range: N/A |
|
vcpus |
String |
Definition: Number of vCPUs. Range: N/A |
|
ram |
String |
Definition: Memory size, in GB. Range: N/A |
|
need_restart |
Boolean |
Definition: Whether to reboot the instance for the parameter modifications to take effect. Range: N/A |
|
priority |
Integer |
Definition: Failover priority. Range: –1 or 1–16 |
|
Parameter |
Type |
Description |
|---|---|---|
|
type |
String |
Definition: Disk type. Range: N/A |
|
used |
String |
Definition: Used disk size, in GB. Range: N/A |
|
size |
Long |
Definition: Storage space of a yearly/monthly instance, in GB. Range: N/A |
|
Parameter |
Type |
Description |
|---|---|---|
|
key |
String |
Definition: Tag key. Constraints: It cannot be an empty string, a space, or left blank. Range: The value contains a maximum of 36 Unicode characters. Only uppercase letters, lowercase letters, digits, hyphens (-), and underscores (_) are allowed. Default value: N/A |
|
value |
String |
Definition: Tag value. Constraints: It can be an empty string. Range: The value contains a maximum of 43 Unicode characters. Only uppercase letters, lowercase letters, digits, hyphens (-), and underscores (_) are allowed. Default value: N/A |
|
Parameter |
Type |
Description |
|---|---|---|
|
pool_id |
String |
Definition: Proxy instance ID. Range: N/A |
|
name |
String |
Definition: Proxy instance name. Range: N/A |
|
address |
String |
Definition: Proxy address. Range: N/A |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code. |
|
error_msg |
String |
Error message. |
Status code: 500
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code. |
|
error_msg |
String |
Error message. |
Example Request
Querying details of DB instances in batches
GET https://{endpoint}/v3.1/97b026aa9cc4417888c14c84a1ad9860/instances/details?instance_ids=11684a0e59e94bceba7880d58cfb07b5in07
Example Response
Status code: 200
Success.
{
"instances" : [ {
"id" : "11684a0e59e94bceba7880d58cfb07b5in07",
"name" : "gaussdb-mysql-instance01",
"alias" : "",
"status" : "normal",
"project_id" : "3cedfc54-b105-4652-a4e0-847b11576628",
"enterprise_project_id" : 0,
"type" : "Cluster",
"charge_info" : {
"charge_mode" : "postPaid",
"order_id" : ""
},
"node_count" : 2,
"datastore" : {
"type" : "gaussdb-mysql",
"version" : "8.0",
},
"created" : "2022-07-14T16:26:58+0800",
"updated" : "2022-07-18T14:20:33+0800",
"public_ips" : "10.*.*.*",
"private_write_ips" : [ "192.*.*.*" ],
"db_user_name" : "root",
"port" : 3306,
"vpc_id" : "3cedfc54-b105-4652-a4e0-847b11576b58",
"subnet_id" : "c1cfa53c-65d3-431e-8552-326bf310c7ad",
"security_group_id" : "fc577a1a-f202-424a-977f-24faec3fdd55",
"backup_strategy" : {
"start_time" : "19:00-20:00",
"keep_days" : 7
},
"nodes" : [ {
"id" : "799a0f2fa49a4151bf9f7063c1fbba36no07",
"name" : "gauss-d616-lb07_node01",
"type" : "master",
"status" : "normal",
"port" : 3306,
"private_read_ips" : [ "192.*.*.*" ],
"volume" : {
"type" : "POOL",
"used" : 0.07
},
"az_code" : "az1xahz",
"region_code" : "region-1",
"flavor_id" : "3169caaf-6c2f-41d5-aadd-c8fc3d83597e",
"flavor_ref" : "gaussdb.mysql.xlarge.arm.4",
"max_connections" : 1500,
"vcpus" : 1,
"ram" : 4,
"need_restart" : false,
"priority" : 1,
"created" : "2022-07-14T16:26:58+0800",
"updated" : "2022-07-18T09:24:18+0800"
}, {
"id" : "799a0f2fa49a4151bf9f7063c1fbba35no07",
"name" : "gauss-d616-lb07_node02",
"type" : "slave",
"status" : "normal",
"port" : 3306,
"private_read_ips" : [ "192.*.*.*" ],
"volume" : {
"type" : "POOL",
"used" : 0.07
},
"az_code" : "az1",
"region_code" : "region-1",
"flavor_id" : "3169caaf-6c2f-41d5-aadd-c8fc3d83597e",
"flavor_ref" : "gaussdb.mysql.xlarge.arm.4",
"max_connections" : 1500,
"vcpus" : 1,
"ram" : 4,
"need_restart" : false,
"priority" : 1,
"created" : "2022-07-14T16:26:58+0800",
"updated" : "2022-07-18T09:36:18+0800"
} ],
"time_zone" : "UTC+08:00",
"backup_used_space" : 0.24,
"az_mode" : "single",
"master_az_code" : "az1",
"maintenance_window" : "18:00-22:00",
"tags" : [ ],
"configuration_id" : "53570e0de54e40c5a15f331aa5sd2176pr07",
"dedicated_resource_id" : "",
"proxies" : [ {
"pool_id" : "dab1cfc5150c4d1ca0e8c6596bfc0d8cpo01",
"address" : "192.*.*.*",
"name" : "proxy-name"
} ]
} ]
}
Status Code
|
Status Code |
Description |
|---|---|
|
200 |
Success. |
|
400 |
Client error. |
|
500 |
Server error. |
Error Code
For details, see Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.