All Products
Search
Document Center

Database Autonomy Service:GetMongoDBCurrentOp

Last Updated:Jun 10, 2026

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

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tabel berikut menjelaskan otorisasi yang diperlukan untuk memanggil API ini. Anda dapat menentukannya dalam kebijakan Resource Access Management (RAM). Kolom pada tabel dijelaskan sebagai berikut:

  • Action: Aksi yang dapat digunakan dalam elemen Action pada pernyataan kebijakan izin RAM untuk memberikan izin guna melakukan operasi tersebut.

  • API: API yang dapat Anda panggil untuk melakukan aksi tersebut.

  • Access level: Tingkat akses yang telah ditentukan untuk setiap API. Nilai yang valid: create, list, get, update, dan delete.

  • Resource type: Jenis resource yang mendukung otorisasi untuk melakukan aksi tersebut. Ini menunjukkan apakah aksi tersebut mendukung izin tingkat resource. Resource yang ditentukan harus kompatibel dengan aksi tersebut. Jika tidak, kebijakan tersebut tidak akan berlaku.

    • Untuk API dengan izin tingkat resource, jenis resource yang diperlukan ditandai dengan tanda bintang (*). Tentukan Nama Sumber Daya Alibaba Cloud (ARN) yang sesuai dalam elemen Resource pada kebijakan.

    • Untuk API tanpa izin tingkat resource, ditampilkan sebagai All Resources. Gunakan tanda bintang (*) dalam elemen Resource pada kebijakan.

  • Condition key: Kunci kondisi yang didefinisikan oleh layanan. Kunci ini memungkinkan kontrol granular, berlaku baik hanya untuk aksi maupun untuk aksi yang terkait dengan resource tertentu. Selain kunci kondisi spesifik layanan, Alibaba Cloud menyediakan serangkaian common condition keys yang berlaku di semua layanan yang didukung RAM.

  • Dependent action: Aksi dependen yang diperlukan untuk menjalankan aksi tersebut. Untuk menyelesaikan aksi tersebut, pengguna RAM atau role RAM harus memiliki izin untuk melakukan semua aksi dependen.

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 db.currentOp() yang digunakan untuk memfilter Sesi. Untuk informasi lebih lanjut, lihat db.currentOp() pada format Referensi Dokumentasi MongoDB.

{ "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

  • false

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

  • false

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

  • false

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.