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

Querying Physical Sessions

Function

This API is used to obtain physical sessions of a DDM instance.

Constraints

None

URI

  • URL format

    GET /v3/{project_id}/instances/{instance_id}/physical-processes?offset={offset}&limit={limit}

  • Parameter description
    Table 1 Parameter description

    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

    ID of the associated RDS DB instance.

    offset

    No

    Integer

    Which page the server starts returning items. The default value is 0.

    The value is an integer greater than or equal to 0.

    limit

    No

    Integer

    Number of records displayed on each page. The default value is 10.

    Value range: 1 to 128.

    keyword

    No

    String

    Keyword filtered by the session result. It is a fuzzy match field and can contain a maximum of 255 characters.

Request

Table 2 Parameter description

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

You can obtain the token by calling the IAM API used to obtain a user token.

Example Request

This API is used to obtain physical sessions of a DDM instance.

GET https://{endpoint}/v3/{project_id}/instances/{instance_id}/physical-processes?offset=0&limit=10

Response

  • Normal response
    Table 3 Response body parameters

    Parameter

    Type

    Description

    total_count

    Integer

    Total records.

    physical_processes

    Array of Table 4 objects

    Physical session list of a DDM instance.

    Table 4 PhysicalProcessInfo

    Parameter

    Type

    Description

    id

    String

    Physical session ID.

    user

    String

    Current user.

    host

    String

    IP address and port number.

    db

    String

    Database name.

    command

    String

    Connection status. Generally, the value can be sleep, query, or connect.

    time

    Boolean

    Duration of a connection, in seconds.

    state

    Boolean

    Status of the SQL statement being executed.

    info

    Integer

    SQL statement that is being executed.

    trx_executed_time

    Integer

    Duration of a transaction, in seconds.

  • Normal response example
    {
      "physical_processes": [
        {
          "id": 1973,
          "user": "DDMRW1613058863",
          "hots": "172.16.241.84:58908",
          "db": "ddm_db_test_0001",
          "state": "",
          "command": "Sleep",
          "info": null,
          "time": 13977,
          "trx_executed_time": 0
        }
      ],
      "total_count": 1
    }
  • Abnormal response

    For details, see Abnormal Request Results.

Status Code

Error Codes

For details, see Error Codes.