Updated on 2024-09-11 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

Explanation:

Project ID of a tenant in a region.

To obtain this value, see Obtaining a Project ID.

Constraints:

None

Value range:

The value can contain 32 characters. Only letters and digits are allowed.

Default value:

None

instance_id

Yes

String

Explanation:

Instance ID, which uniquely identifies an instance.

Constraints:

None

Value range:

The value can contain 36 characters with a suffix of in07. Only letters and digits are allowed.

Default value:

None

Table 2 Query parameters

Parameter

Mandatory

Type

Description

offset

No

Integer

Explanation:

Index offset. The query starts from the next piece of data indexed by this parameter.

Constraints:

The value must be an integer and cannot be a negative number.

Value range:

≥0

Default value:

0

limit

No

Integer

Explanation:

Number of records to be queried.

Constraints:

The value must be an integer and cannot be a negative number.

Value range:

1–100

Default value:

100

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Explanation:

User token.

It can be obtained by calling the IAM API used to obtain a user token.

The value of X-Subject-Token in the response header is the token value.

Constraints:

None

Value range:

None

Default value:

None

X-Language

No

String

Explanation:

Request language type.

Constraints:

None

Value range:

  • en-us
  • zh-cn

Default value:

en-us

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

proxy_list

Array of MysqlShowProxyResponseV3 objects

Explanation:

Proxy instances.

Table 5 MysqlShowProxyResponseV3

Parameter

Type

Description

proxy

MysqlProxyV3 object

Explanation:

Proxy instance information.

master_node

MysqlProxyNodeV3 object

Explanation:

Primary node information.

readonly_nodes

Array of MysqlProxyNodeV3 objects

Explanation:

Read replica information.

Table 6 MysqlProxyV3

Parameter

Type

Description

pool_id

String

Explanation:

Proxy instance ID.

Value range:

The value can contain 36 characters with a suffix of po01. Only letters and digits are allowed.

status

String

Explanation:

Status of a proxy instance.

Value range:

  • ACTIVE: The proxy instance is normal.
  • FAILED: The proxy instance failed 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

Explanation:

Proxy IP address.

Value range:

None

port

Integer

Explanation:

Port of a proxy instance.

Value range:

None

pool_status

String

Explanation:

Status of a proxy instance.

Value range:

  • ACTIVE: The proxy instance is normal.
  • ABNORMAL: The proxy instance is abnormal.
  • FAILED: The proxy instance failed to be created.
  • DELETED: The proxy instance is deleted.

delay_threshold_in_seconds

Integer

Explanation:

Delay threshold in seconds.

Value range:

None

elb_vip

String

Explanation:

Virtual IP address in ELB mode.

Value range:

None

eip

String

Explanation:

EIP.

Value range:

None

vcpus

String

Explanation:

vCPUs of a proxy instance.

Value range:

None

ram

String

Explanation:

Memory size of a proxy instance.

Value range:

None

node_num

Integer

Explanation:

Number of proxy instance nodes.

Value range:

None

mode

String

Explanation:

Proxy instance in primary/standby mode.

Value range:

Cluster

nodes

Array of MysqlProxyNodes objects

Explanation:

Database proxy nodes.

flavor_ref

String

Explanation:

Proxy instance specifications.

Value range:

None

name

String

Explanation:

Proxy instance name.

Value range:

None

transaction_split

String

Explanation:

Status of transaction splitting for the proxy instance.

Value range:

  • true: enabled
  • false: disabled

connection_pool_type

String

Explanation:

Connection pool type.

Value range:

  • CLOSED: The connection pool is closed.
  • SESSION: The session-level connection pool is enabled.

switch_connection_pool_type_enabled

Boolean

Explanation:

Whether the proxy instance version supports session-level connection pool.

Value range:

  • true: supported
  • false: not supported

route_mode

Integer

Explanation:

Routing policy of the proxy instance.

Value range:

  • 0: 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

Explanation:

Whether the proxy instance version supports load balancing.

Value range:

  • true: supported
  • false: not supported

consistence_mode

String

Explanation:

Consistency level. The parameter is left blank by default.

Value range:

  • session: session consistency (Only this value can be used when session_consistence is true.)
  • global: global consistency (This value can be used when session_consistence is false.)
  • eventual: eventual consistency (This value can be used when session_consistence is false.)

subnet_id

String

Explanation:

ID of the subnet that the proxy instance belongs to.

Value range:

None

ssl_option

String

Explanation:

Whether to enable SSL.

Value range:

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

new_node_auto_add_status

String

Explanation:

Whether new nodes are automatically associated with proxy instances.

Value range:

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

new_node_weight

Integer

Explanation:

Read weight of a new node.

Value range:

1–1000

Table 7 MysqlProxyNodes

Parameter

Type

Description

id

String

Explanation:

Proxy node ID.

status

String

Explanation:

Status of the proxy instance node.

Value range:

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

name

String

Explanation:

Name of the proxy instance node.

Value range:

None

role

String

Explanation:

Role of the proxy instance node.

Value range:

  • master: primary node
  • slave: read replica

az_code

String

Description

AZ.

Value range:

None

frozen_flag

Integer

Explanation:

Whether the proxy instance node is frozen.

Value range:

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

Parameter

Type

Description

id

String

Explanation:

ID of the proxy instance node.

Value range:

The value can contain 36 characters with a suffix of no07. Only letters and digits are allowed.

instance_id

String

Explanation:

Instance ID, which uniquely identifies an instance.

Value range:

The value can contain 36 characters with a suffix of in07. Only letters and digits are allowed.

status

String

Explanation:

Node status.

Value range:

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

name

String

Explanation:

Node name.

Value range:

None

weight

Integer

Explanation:

Read weight of the node.

Value range:

1–1000

availability_zone

Array of MysqlProxyAvailable objects

Explanation:

AZ information.

Table 9 MysqlProxyAvailable

Parameter

Type

Description

code

String

Explanation:

AZ code.

Value range:

None

description

String

Explanation:

AZ description.

Value range:

None

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.