Queries the current sessions of an ApsaraDB for MongoDB (MongoDB) instance.
Operation description
This operation is applicable only to MongoDB instances.
If you use an Alibaba Cloud SDK or Database Autonomy Service (DAS) SDK to call this operation, we recommend that you use the latest version of the SDK.
If you use an SDK to call API operations of DAS, you must set the region to cn-shanghai.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
hdm:GetMongoDBCurrentOp |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceId |
string |
Yes |
The instance ID. |
dds-uf6079bda570**** |
| NodeId |
string |
No |
The node ID. Note
If you do not specify a node ID, the sessions of the primary node are queried by default. |
23302531 |
| Role |
string |
No |
A reserved parameter. You do not need to specify the parameter. |
None |
| FilterDoc |
string |
No |
The |
{ "active" : true } |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| Code |
integer |
The response code. |
200 |
| Message |
string |
The returned message. Note
If the request was successful, Successful is returned. Otherwise, an error message such as an error code is returned. |
Successful |
| Data |
object |
The details of the sessions. |
|
| Timestamp |
integer |
The time when the database sessions were returned. The value is in the UNIX timestamp format. Unit: milliseconds. |
1692029584428 |
| SessionList |
array<object> |
The sessions. |
|
|
object |
|||
| OpId |
string |
The operation ID. |
14508 |
| Active |
boolean |
Indicates whether the operation is active. Valid values:
|
true |
| Command |
string |
The document that contains the complete command object associated with the operation. |
"command" : { "find" : "items", "filter" : { "sku" : 1403978 }, ... "$db" : "test" } |
| Op |
string |
The type of the operation. |
update |
| SecsRunning |
integer |
The duration of the operation. Unit: seconds. |
5 |
| PlanSummary |
string |
The description of the execution plan. |
None |
| Host |
string |
The host. |
a79****.cloud.et15:3328 |
| Client |
string |
The IP address of the client. |
219.143.XX.XX:52324 |
| Desc |
string |
The description of the connection. |
conn1013858 |
| Ns |
string |
The namespace. |
admin.cmd |
| ConnectionId |
integer |
The connection ID. |
66378736 |
| Driver |
string |
The driver for MongoDB. |
mongo-java-driver|legacy@3.11.2 |
| OsType |
string |
The type of the operating system. |
Linux |
| OsName |
string |
The name of the operating system. |
Linux |
| OsArch |
string |
The architecture of the operating system. |
AMD64 |
| Platform |
string |
The platform. |
Java/Alibaba/1.8.0_152-b5 |
| KillPending |
boolean |
Indicates whether the operation is marked as terminated.
|
true |
| Shard |
string |
The ID of the data shard. Note
This parameter is returned for sharded cluster instances. |
d-bp1689995b78**** |
| SessionStat |
object |
The statistics on the sessions. |
|
| ActiveCount |
integer |
The number of active sessions. |
0 |
| TotalCount |
integer |
The total number of sessions. |
11 |
| LongestSecsRunning |
integer |
The longest duration of a session. Unit: seconds. |
0 |
| ClientStats |
object |
The statistics on the IP addresses of the clients. |
|
|
object |
The details of the IP addresses of the clients. |
||
| ActiveCount |
integer |
The number of clients whose IP addresses are active. |
0 |
| TotalCount |
integer |
The total number of IP addresses of clients. |
11 |
| DbStats |
object |
The statistics on the namespaces. |
|
|
object |
The details of the namespaces. |
||
| ActiveCount |
integer |
The number of active namespaces. |
0 |
| TotalCount |
integer |
The total number of namespaces. |
11 |
| RequestId |
string |
The request ID. |
FC6C0929-29E1-59FD-8DFE-70D9D41E**** |
| Success |
boolean |
Indicates whether the request was successful. Valid values:
|
true |
For more information, see the data returned by running the currentOp command of MongoDB.
Examples
Success response
JSON format
{
"Code": 200,
"Message": "Successful",
"Data": {
"Timestamp": 1692029584428,
"SessionList": [
{
"OpId": "14508",
"Active": true,
"Command": "\"command\" : {\n \"find\" : \"items\",\n \"filter\" : {\n \"sku\" : 1403978\n },\n ...\n \"$db\" : \"test\"\n}",
"Op": "update",
"SecsRunning": 5,
"PlanSummary": "None",
"Host": "a79****.cloud.et15:3328",
"Client": "219.143.XX.XX:52324",
"Desc": "conn1013858",
"Ns": "admin.cmd",
"ConnectionId": 66378736,
"Driver": "mongo-java-driver|legacy@3.11.2",
"OsType": "Linux",
"OsName": "Linux",
"OsArch": "AMD64",
"Platform": "Java/Alibaba/1.8.0_152-b5",
"KillPending": true,
"Shard": "d-bp1689995b78****"
}
],
"SessionStat": {
"ActiveCount": 0,
"TotalCount": 11,
"LongestSecsRunning": 0,
"ClientStats": {
"key": {
"ActiveCount": 0,
"TotalCount": 11
}
},
"DbStats": {
"key": {
"ActiveCount": 0,
"TotalCount": 11
}
}
}
},
"RequestId": "FC6C0929-29E1-59FD-8DFE-70D9D41E****",
"Success": true
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParams | The request parameters are invalid. | |
| 403 | NoPermission | You are not authorized to do this action. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.