Querying Database Proxies
Function
This API is used to query database proxies of a DB instance.
- Before calling an API, you need to understand the API in Authentication.
URI
- Parameter description
Table 1 Parameters Parameter
Mandatory
Description
project_id
Yes
Project ID of a tenant in a region.
To obtain it, refer to Obtaining a Project ID.
instance_id
Yes
Instance ID.
Request
Response
- Normal response
Table 2 Parameters Parameter
Type
Description
proxy_query_info_list
Array of objects
List of database proxies under a DB instance.
For details, see Table 3.
max_proxy_num
Integer
Maximum number of database proxies that can be enabled at the same time.
max_proxy_node_num
Integer
Maximum number of nodes allowed for one database proxy.
support_balance_route_mode_for_favored_version
Boolean
Whether load balancing can be configured when a database proxy is created.
Table 3 proxy_query_info_list field data structure description Parameter
Type
Description
proxy
Object
Database proxy information.
For details, see Table 4.
master_instance
Object
Primary instance information.
For details, see Table 7.
readonly_instances
Array of objects
Read replica information.
For details, see Table 7.
proxy_security_group_check_result
Boolean
Whether the security group allows the database proxy to access the DB instance.
Table 4 proxy field data structure description Parameter
Type
Description
pool_id
String
Database proxy ID.
status
String
Database proxy status. Valid values:
- ENABLING: The database proxy is being enabled.
- DISABLING: The database proxy is being disabled.
- CHANGING_NODE_NUM: The number of nodes is being changed for the database proxy.
- SCALING: The specifications of the database proxy are being changed.
- UPGRADING: The kernel version of the database proxy is being upgraded.
- IPMODIFYING: The read/write splitting address of the database proxy is being changed.
- RESTARTING: The database proxy is being restarted.
- TRANSACTION_SPLITTING: Transaction splitting is being enabled or disabled for the database proxy.
- CONNECTION_POOL_SWITCH_OPERATING: The session connection pool type is being changed for the database proxy.
- PORT_MODIFYING: The port of the database proxy is being changed.
- PROXY_SSL_SWITCHING: The SSL status is being changed for the database proxy.
- ALT_SWITCH_OPERATING: The ALT status is being changed for the database proxy.
- CHANGING_RESOURCES: Resources are being changed for the database proxy.
- NORMAL: The database proxy is running properly.
- ABNORMAL: The database proxy is not running properly.
- FAILED: The database proxy failed to be created.
- FROZEN: The database proxy is frozen.
address
String
Read/write splitting address.
port
Integer
Port number.
delay_threshold_in_seconds
Integer
Delay threshold, in seconds.
cpu
String
vCPUs of the database proxy.
mem
String
Memory size of the database proxy.
node_num
Integer
Number of database proxy nodes.
nodes
Array of objects
List of database proxy nodes.
For details, see Table 5.
mode
String
Database proxy mode. Valid values:
- Cluster
- Ha: primary/standby
flavor_info
Object
Database proxy specifications.
For details, see Table 6.
transaction_split
String
Status of transaction splitting for the database proxy.
- true: enabled
- false: disabled
connection_pool_type
String
Connection pool type.
Valid values:
- CLOSED: The connection pool is closed.
- SESSION: The session-level connection pool is enabled.
pay_mode
String
Billing mode of the database proxy.
Valid values:
- 0: pay-per-use billing
- 1: yearly/monthly billing
name
String
Name of the database proxy.
proxy_mode
String
Read/write mode of the database proxy. Valid values:
- readwrite: readable and writable
- readonly: read-only
dns_name
String
Private domain name for the read/write splitting address of the database proxy. If this parameter is left blank, no private domain name has been requested.
subnet_id
String
ID of the subnet to which the database proxy belongs.
seconds_level_monitor_fun_status
String
Status of Monitoring by Seconds of the database proxy.
Enumerated values:
- off
- on
alt_flag
Boolean
ALT switch status.
force_read_only
Boolean
Whether to forcibly route read requests to read replicas.
route_mode
Integer
Routing policy of the database proxy. Valid values:
- 0: weighted
- 1: load balancing (The primary instance does not process read requests.)
- 2: load balancing (The primary instance processes read requests.)
ssl_option
Boolean
SSL switch status.
support_balance_route_mode
Boolean
Whether load balancing can be enabled for the database proxy.
support_proxy_ssl
Boolean
Whether SSL can be enabled for the database proxy.
support_switch_connection_pool_type
Boolean
Whether the session connection pool type can be changed for the database proxy.
support_transaction_split
Boolean
Whether transaction splitting can be enabled for the database proxy.
Table 5 nodes field data structure description Parameter
Type
Description
id
String
ID of the database proxy node.
status
String
Status of the database proxy node.
Valid values:
- NORMAL: The node is normal.
- ABNORMAL: The node is abnormal.
- CREATING: The node is being created.
- CREATEFAIL: The node failed to be created.
role
String
Role of the database proxy node.
- master: primary node
- slave: standby node
az_code
String
AZ where the database proxy node is located.
frozen_flag
Integer
Whether the database proxy node is frozen.
Valid values:
- 0: unfrozen
- 1: frozen
Table 6 flavor_info field data structure description Parameter
Type
Description
group_type
String
CPU architecture.
Enumerated values:
- X86
- ARM
code
String
Specification code.
Table 7 readonly_instances field data structure description Parameter
Type
Description
id
String
ID of the primary instance or read replica.
status
String
Node status.
name
String
Instance name.
weight
Integer
Read weight of the instance.
available_zones
Array of objects
AZ information.
For details, see Table 8.
- Example normal response
{ "proxy_query_info_list" : [ { "proxy" : { "pool_id" : "e06ecf4dfea8409690c87a9ee6582b0dpo01", "status" : "NORMAL", "address" : "192.168.0.1", "port" : 3306, "delay_threshold_in_seconds" : 30, "cpu" : "2", "mem" : "4", "node_num" : 2, "nodes" : [ { "id" : "3079919890f24fb8ab284571fc409058pn01", "status" : "NORMAL", "role" : "master", "az_code" : "aaa", "frozen_flag" : 0 }, { "id" : "804430ac9068419fa5e49d5ca0684172pn01", "status" : "NORMAL", "role" : "master", "az_code" : "aaa", "frozen_flag" : 0 } ], "mode" : "Cluster", "flavor_info" : { "group_type" : "X86", "code" : "rds.proxy.large.2" }, "transaction_split" : "false", "connection_pool_type" : "CLOSED", "pay_mode" : "0", "name" : "test-hll", "proxy_mode" : "readwrite", "route_mode" : 1, "dns_name" : "", "subnet_id" : "2f75f35c-62ca-43b7-9954-8fd1e6be4641", "ssl_option" : false, "force_read_only" : false, "seconds_level_monitor_fun_status" : "off", "alt_flag" : false, "support_transaction_split" : true, "support_switch_connection_pool_type" : true, "support_balance_route_mode" : true, "support_proxy_ssl" : true }, "master_instance" : { "id" : "920ec36cef814a8b830a5bed50d9a088in01", "status" : "normal", "name" : "rds-2c54", "weight" : 0, "available_zones" : [ { "code" : "aaa", "description" : "az3" } ] }, "readonly_instances" : [ { "id" : "f9462b58982d484fb64fd9880504d863in01", "status" : "abnormal", "name" : "replica-f966", "weight" : 0, "available_zones" : [ { "code" : "aaa", "description" : "az3" } ] } ], "proxy_security_group_check_result" : false } ], "max_proxy_num" : 4, "max_proxy_node_num" : 4, "support_balance_route_mode_for_favored_version" : true }
- Abnormal response
For details, see Abnormal Request Results.
Status Code
- Normal
- Abnormal
For details, see Status Codes.
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.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot