Updated on 2025-12-02 GMT+08:00

Killing Sessions of an Instance Node

Description

This API is used to kill sessions of an instance node.

Constraints

  • This function is available for DB instances of Community Edition 3.4 or later.
  • Inactive sessions cannot be terminated.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependencies

    dds:instance:deleteSession

    write

    -

    -

    dds:instance:session

    -

URI

  • URI format

    POST /v3/{project_id}/nodes/{node_id}/session

  • URI example

    https://dds.ap-southeast-1.myhuaweicloud.com/v3/619d3e78f61b4be68bc5aa0b59edcf7b/nodes/520c58ba00a3497e97ce0b9604874dd6no02/session

Table 1 Request Parameters

Parameter

Type

IN

Mandatory

Description

X-Auth-Token

string

header

Yes

Definition

User token obtained from IAM. For details, see Authentication.

Constraints

N/A

Range

N/A

Default Value

N/A

project_id

string

path

Yes

Definition

Project ID of a tenant in a region. Obtain the project ID by following the instructions in Obtaining a Project ID.

Constraints

N/A

Range

N/A

Default Value

N/A

node_id

string

path

Yes

Definition

Node ID.

Constraints

  • For a cluster instance, you can select any mongos, shard, or config node.
  • Select the primary or secondary node in a replica set instance.

Range

N/A

Default Value

N/A

Request

  • Parameter description
    Table 2 Request body parameters

    Parameter

    Type

    Mandatory

    Description

    sessions

    Array of strings

    Yes

    Definition

    The IDs of sessions to be terminated.

    Constraints

    N/A

    Range

    For details, see the session ID returned in Table 4.

    Default Value

    N/A

Response

{}

Example Request

POST https://{endpoint}/v3/619d3e78f61b4be68bc5aa0b59edcf7b/nodes/520c58ba00a3497e97ce0b9604874dd6no02/session
{    
 "sessions" : [ "34631", "34703" ]  
}

Example Response

None

SDK

Click Document Database Service DDS SDK to download the SDK or view the SDK document. To learn how to install and authenticate an SDK, read the Usage section.

Status Code

For more information, see Status Code.

Error Code

For more information, see Error Code.