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

Querying Logical Sessions

Function

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

Constraints

None

URI

  • URL format

    GET /v3/{project_id}/instances/{instance_id}/logical-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

    DDM instance ID.

    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 logical sessions of a DDM instance.

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

Response

  • Normal response
    Table 3 Response body parameters

    Parameter

    Type

    Description

    total_count

    Integer

    Total records.

    logical_processes

    Array of Table 4 objects

    Logical session list of a DDM instance.

    Table 4 logicalProcessesInfo

    Parameter

    Type

    Description

    id

    String

    Logical 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.

  • Normal response example
    {
      "logical_processes": [
        {
          "id": "4564224",
          "user": "drdsagent",
          "host": "127.0.0.1:54486",
          "db": "None",
          "command": "Query",
          "time": "0",
          "state": "starting",
          "info": "show processlist"
        }
      ],
      "total_count": 1
    }
  • Abnormal response

    For details, see Abnormal Request Results.

Status Code

Error Codes

For details, see Error Codes.