Querying Details of a DB Instance¶
Function¶
This API is used to query the details of a specified DB instance. Before calling this API:
Learn how to authorize and authenticate it.
Obtain the required region and endpoint.
URI¶
URI format
GET https://{endpoint}/mysql/v3/{project_id}/instances/{instance_id}
Example
Parameter description
¶ Name
Type
Mandatory
Description
project_id
String
Yes
Project ID of a tenant in a region.
To obtain this value, see Obtaining a Project ID.
instance_id
String
Yes
DB instance ID.
Request Parameters¶
Parameter | Mandatory | Type | Description |
---|---|---|---|
X-Auth-Token | Yes | String | User token. |
X-Language | No | String | Language. |
Content-Type | Yes | String | MIME type of the request body. You are advised to use the default value application/json. For APIs used to upload objects or images, the value can vary depending on the flow type. |
Response Parameters¶
Status code: 201
Parameter | Type | Description |
---|---|---|
instance | MysqlInstanceInfoDetail object | Instance information. |
Parameter | Type | Description |
---|---|---|
id | String | DB instance ID. |
name | String | DB instance name. |
project_id | String | Project ID of a tenant in a region. |
status | String | DB instance status. Valid value: If the value is BUILD, the DB instance is being created. If the value is ACTIVE, the DB instance is normal. If the value is FAILED, the DB instance is abnormal. If the value is FROZEN, the DB instance is frozen. If the value is MODIFYING, the DB instance is being scaled up. If the value is REBOOTING, the DB instance is being rebooted. If the value is RESTORING, the DB instance is being restored. If the value is MODIFYING INSTANCE TYPE, the DB instance is changing from primary to standby. If the value is SWITCHOVER, the primary/standby switchover is being performed. If the value is MIGRATING, the DB instance is being migrated. If the value is BACKING UP, the DB instance is being backed up. If the value is MODIFYING DATABASE PORT, the database port is being changed. If the value is STORAGE FULL, the instance storage space is full. |
port | String | Database port. |
type | String | Instance type. The value is Cluster. |
node_count | Integer | Number of nodes. |
datastore | MysqlDatastore object | Database information. |
backup_used_space | Double | Used backup space in GB. |
created | String | 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. The value is empty unless the instance creation is complete. |
updated | String | Update time. The format is the same as that of the created field. The value is empty unless the instance creation is complete. |
private_write_ips | Array of strings | Private IP address for write. |
public_ips | String | Public IP address of the instance. |
db_user_name | String | Default username. |
vpc_id | String | VPC ID. |
subnet_id | String | Network ID of the subnet. |
security_group_id | String | Security group ID. |
configuration_id | String | ID of the parameter template used for creating an instance or ID of the latest parameter template that is applied to an instance. |
backup_strategy | MysqlBackupStrategy object | Backup policy. |
nodes | Array of MysqlInstanceNodeInfo objects | Node information. |
enterprise_project_id | String | Enterprise project ID. |
time_zone | String | Time zone. |
az_mode | String | AZ type. It can be single or multi. |
master_az_code | String | Primary AZ. |
maintenance_window | String | Maintenance window in the UTC format. |
tags | Array of MysqlTags objects | Tags for managing instances. |
dedicated_resource_id | String | Dedicated resource pool ID. This parameter is returned only when the instance belongs to a dedicated resource pool. |
Parameter | Type | Description |
---|---|---|
type | String | DB engine. Currently, only gaussdb-mysql is supported. |
version | String | DB version. |
kernel_version | String | Database kernel version. |
Parameter | Type | Description |
---|---|---|
type | String | Disk type. |
used | String | Used disk size in GB. |
Parameter | Type | Description |
---|---|---|
start_time | String | Automated backup start time. The automated backup will be triggered within one hour after the time specified by this parameter. |
keep_days | String | Backup retention days. |
Parameter | Type | Description |
---|---|---|
id | String | DB instance ID. |
name | String | Node name. |
type | String | Node type, which can be master or slave. |
status | String | Node status. |
port | Integer | Database port. |
private_read_ips | Array of strings | Private IP address for read of the node. |
volume | Table 6 object | Storage disk information. |
az_code | String | AZ. |
region_code | String | Region where the instance is located. |
created | String | DB instance creation time. |
updated | String | Update time. |
flavor_ref | String | Specification code. |
max_connections | String | Maximum number of connections. |
vcpus | String | Number of vCPUs. |
ram | String | Memory size in GB. |
need_restart | Boolean | Whether to reboot the instance for the parameter modifications to take effect. |
priotiry | Integer | Failover priority. |
Parameter | Type | Description |
---|---|---|
key | String | Tag key. The value can contain a maximum of 36 Unicode characters. The value cannot be an empty string, a space, or left blank. Only uppercase letters, lowercase letters, digits, hyphens (-), and underscores (_) are allowed. |
value | String | Tag value. It contains a maximum of 43 Unicode characters. The value can be an empty string. Only uppercase letters, lowercase letters, digits, periods (.), hyphens (-), and underscores (_) are allowed. |
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 a DB instance
GET https://gaussdb-mysql.eu-de.otc.t-systems.com/mysql/v3/97b026aa9cc4417888c14c84a1ad9860/instances/d2cda7b97a39488e8b30e3cea4066204in07
Example Response¶
Note
The values of region_code and az_code are used as examples.
Status code: 201
Success.
{
"instance": {
"id": "d2cda7b97a39488e8b30e3cea4066204in07",
"name": "gauss-d616-lb07",
"status": "FAILED",
"project_id": "053f533ead80d5102f0cc012e8d468a4",
"enterprise_project_id": "0",
"type": "Cluster",
"charge_info": {
"charge_mode": "postPaid",
"order_id": ""
},
"node_count": 2,
"datastore": {
"type": "GaussDB(for MySQL)",
"version": "8.0"
},
"created": "2020-07-21T09:13:56+0200",
"updated": "2020-07-21T09:27:54+0200",
"public_ips": "",
"private_write_ips": [
"192.168.0.235"
],
"db_user_name": "root",
"port": "3306",
"vpc_id": "f7ee62e2-9705-4523-ba49-a85ea1a1fa87",
"subnet_id": "140af7bf-a9da-4dcf-8837-34199fd6d186",
"security_group_id": "c7f69884-fe2b-4630-8114-70a11499d902",
"backup_strategy": {
"start_time": "00:00-00:00",
"keep_days": "0"
},
"nodes": [
{
"id": "799a0f2fa49a4151bf9f7063c1fbba36no07",
"name": "gauss-d616-lb07_node01",
"type": "master",
"status": "FAILED",
"port": 3306,
"private_read_ips": [
"192.168.0.163"
],
"volume": {
"type": "POOL",
"used": "0.0"
},
"az_code": "cn-cmcc1a-01",
"region_code": "cn-cmcc1",
"flavor_id": "3169caaf-6c2f-41d5-aadd-c8fc3d83597e",
"flavor_ref": "gaussdb.mysql.4xlarge.arm.8",
"max_connections": null,
"vcpus": "16",
"ram": "128",
"need_restart": false,
"priority": 1
},
{
"id": "816459d771c444db9fa4c1d5c173cb1cno07",
"name": "gauss-d616-lb07_node02",
"type": "slave",
"status": "FAILED",
"port": 3306,
"private_read_ips": [
"192.168.0.160"
],
"volume": {
"type": "POOL",
"used": "0.0"
},
"az_code": "cn-cmcc1a-01",
"region_code": "cn-cmcc1",
"flavor_id": "3169caaf-6c2f-41d5-aadd-c8fc3d83597e",
"flavor_ref": "gaussdb.mysql.4xlarge.arm.8",
"max_connections": null,
"vcpus": "16",
"ram": "128",
"need_restart": false,
"priority": 1
}
],
"time_zone": "UTC+08:00",
"backup_used_space": 0,
"az_mode": "single",
"master_az_code": "cn-cmcc1a-01",
"maintenance_window": "18:00-22:00"
}
}
Status Code¶
For details, see Status Codes.
Error Code¶
For details, see Error Codes.