Mengkueri sesi saat ini dari instans Database Apsara untuk MongoDB (MongoDB).
Deskripsi operasi
-
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.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
hdm:GetMongoDBCurrentOp |
*全部资源
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceId |
string |
Yes |
ID Instans. |
dds-uf6079bda570**** |
| NodeId |
string |
No |
ID node. Catatan
Jika Anda tidak menentukan ID node, sesi node primer dikueri secara default. |
23302531 |
| Role |
string |
No |
Parameter cadangan. Anda tidak perlu menentukan parameter ini. |
None |
| FilterDoc |
string |
No |
Perintah |
{ "active" : true } |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| Code |
integer |
The response code. |
200 |
| Message |
string |
The returned message. Catatan
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. Catatan
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 |
Untuk informasi lebih lanjut, lihat format data yang dikembalikan dengan menjalankan perintah currentOp dari MongoDB.
Contoh
Respons sukses
JSONformat
{
"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
}
Kode kesalahan
|
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. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.