Updated on 2024-02-27 GMT+08:00

Querying Proxy Instances

Function

This API is used to query proxy instances. Before calling this API:

URI

GET /v3/{project_id}/instances/{instance_id}/proxies

Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID of a tenant in a region.

To obtain this value, see Obtaining a Project ID.

instance_id

Yes

String

Instance ID, which is compliant with the UUID format.

Table 2 Query parameters

Parameter

Mandatory

Type

Description

offset

No

Integer

Index offset. If offset is set to N, the resource query starts from the N+1 piece of data. The value is 0 by default, indicating that the query starts from the first piece of data. The value cannot be a negative number.

limit

No

Integer

Number of records to be queried. The default value is 10. The value must be a positive integer. The minimum value is 1 and the maximum value is 100.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

If the following response body is returned for calling the API used to obtain a user token, the request is successful.

After the request is processed, the value of X-Subject-Token in the message header is the token value.

X-Language

No

String

Request language type. The default value is en-us.

Value:

  • en-us
  • zh-cn

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

proxy_list

Array of MysqlShowProxyResponseV3 objects

Proxy instances.

Table 5 MysqlShowProxyResponseV3

Parameter

Type

Description

proxy

MysqlProxyV3 object

Proxy instance information.

master_node

MysqlProxyNodeV3 object

Primary node information.

readonly_nodes

Array of MysqlProxyNodeV3 objects

Read replica information.

Table 6 MysqlProxyV3

Parameter

Type

Description

pool_id

String

Proxy instance ID.

status

String

Operating status of the proxy instance.

Value:

  • ACTIVE: The proxy instance is normal.
  • FAILED: The proxy instance fails to be created.
  • DELETED: The proxy instance is deleted.
  • ABNORMAL: The proxy instance is abnormal.
  • ENABLING PROXY: The proxy instance is being created.
  • DISABLING PROXY: The proxy instance is being deleted.
  • ADDING PROXY NODE: Nodes are being added to the proxy instance.
  • DELETING READ REPLICAS FROM PROXY: Read replicas are being removed from the proxy instance.
  • ADDING READ REPLICAS TO PROXY: Read replicas are being added to the proxy instance.
  • CHANGING WEIGHTS: The weights of read replicas for the proxy instance are being changed.

address

String

Read/write splitting address.

port

Integer

Read/write splitting port.

pool_status

String

Proxy instance status.

Value:

  • ACTIVE: The proxy instance is normal.
  • ABNORMAL: The proxy instance is abnormal.
  • FAILED: The proxy instance failed.
  • DELETED: The proxy instance has been deleted.

delay_threshold_in_seconds

Integer

Delay threshold in seconds.

elb_vip

String

Virtual IP address in ELB mode.

eip

String

EIP information.

vcpus

String

Number of vCPUs of the proxy instance.

ram

String

Memory size of the proxy instance.

node_num

Integer

Proxy instance nodes.

mode

String

Primary/standby proxy. The value is Cluster.

nodes

Array of MysqlProxyNodes objects

Proxy node information.

flavor_ref

String

Proxy instance specifications.

name

String

Proxy instance name.

transaction_split

String

Whether the proxy transaction splitting is enabled.

Value:

  • ON: Transaction splitting is enabled.
  • OFF: Transaction splitting is disabled.

connection_pool_type

String

Connection pool type.

Value:

  • CLOSED: The connection pool is not used.
  • SESSION: The session-level connection pool is used.

switch_connection_pool_type_enabled

Boolean

Whether the proxy version supports session-level connection pool.

Value:

  • true: supported
  • false: not supported

route_mode

Integer

Routing policy of the proxy instance.

Value:

  • 0 (default value): weighted
  • 1: load balancing (The primary node does not process read requests.)
  • 2: load balancing (The primary node processes read requests.)

balance_route_mode_enabled

Boolean

Whether the database proxy version supports load balancing.

Value:

  • true: supported
  • false: not supported

consistence_mode

String

Consistency mode. The default value is empty. In this case, the value of session_consistence is used.

Value:

  • session: session consistency
  • global: global consistency
  • eventual: eventual consistency

subnet_id

String

ID of the subnet to which the proxy instance belongs.

ssl_option

String

Whether to enable SSL.

Value:

  • true: SSL is enabled.
  • false: SSL is disabled.

new_node_auto_add_status

String

Whether new nodes are automatically associate with proxy instances.

Value:

  • ON: New nodes are automatically associate with proxy instances.
  • OFF: New nodes are not automatically associate with proxy instances.

new_node_weight

Integer

Read weight of the new node.

Table 7 MysqlProxyNodes

Parameter

Type

Description

id

String

Proxy node ID.

status

String

Proxy node status.

Value:

  • ACTIVE: The node is available.
  • ABNORMAL: The node is abnormal.
  • FAILED: The node fails.
  • DELETED: The node has been deleted.

name

String

Proxy node name.

role

String

Proxy node name.

Value:

  • master: primary node
  • slave: read replica

az_code

String

AZ.

frozen_flag

Integer

Whether the proxy node is frozen.

Value:

  • 0: unfrozen
  • 1: frozen
  • 2: deleted after being frozen
Table 8 MysqlProxyNodeV3

Parameter

Type

Description

id

String

Node ID.

instance_id

String

Instance ID.

status

String

Node status.

name

String

Node name.

weight

Integer

Read weight of the node.

availability_zone

Array of MysqlProxyAvailable objects

AZ information.

Table 9 MysqlProxyAvailable

Parameter

Type

Description

code

String

AZ code.

description

String

AZ description.

Status code: 400

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 500

Table 11 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Request

Querying proxy instances

GET https://{endpoint}/v3/054e292c9880d4992f02c0196d3ea468/instances/096c0fc43e804757b59946b80dc27f8bin07/proxies?offset=0&limit=10

Example Response

Status code: 200

Success.

{
  "proxy_list" : [ {
    "proxy" : {
      "pool_id" : "2e7cf21d14794bafab623a334efd9ad8po01",
      "status" : "ACTIVE",
      "address" : "192.168.125.69",
      "port" : 3306,
      "pool_status" : "ACTIVE",
      "delay_threshold_in_seconds" : 30,
      "elb_vip" : "192.168.125.60",
      "eip" : "192.168.125.50",
      "vcpus" : 4,
      "ram" : 8,
      "node_num" : 2,
      "mode" : "Cluster",
      "nodes" : [ {
        "id" : "db53a238a02240c49365e72e284a4890pn01",
        "name" : "PROXY-2e7cf21d14794bafab623a334efd9ad8po01_0",
        "role" : "master",
        "az_code" : "az1xahz",
        "status" : "ACTIVE",
        "frozen_flag" : 0
      } ],
      "name" : "proxy-name",
    
      "connection_pool_type" : "SESSION", 
      "switch_connection_pool_type_enabled" : true ,
      "subnet_id" : "6991d82d-9166-4aff-a1fa-d2a8748b7084"
    },
    "master_node" : {
      "id" : "c01a5645eb2c4fb6a9373542f5366e50no07",
      "instance_id" : "7a871d6d494e4327ad2e326afb591108in07",
      "status" : "ACTIVE",
      "name" : "taurus_mysql80_x86-ondemand-2-1U4G_1_202103070251274842281_node01",
      "weight" : 0,
      "availability_zone" : [{
        "code" : "az1",
        "description": "AZ1"
      }]
    },
    "readonly_nodes" : {
      "id" : "d23535333138462880bfa1838fdfced2no07",
      "instance_id" : "7a871d6d494e4327ad2e326afb591108in07",
      "status" : "ACTIVE",
      "name" : "taurus_mysql80_x86-ondemand-2-1U4G_1_202103070251274842281_node02",
      "weight" : 100,
      "availability_zone" : [{
        "code" : "az1",
        "description": "AZ1"
      }]
    }
  } ]
}

Status Code

For details, see Status Codes.

Error Code

For details, see Error Codes.