Mengkueri log yang sedang berjalan dari instans MongoDB.
Deskripsi operasi
-
API ini untuk instans dengan tipe spesifikasi berikut: disk lokal tujuan umum, disk lokal khusus, dan disk cloud.
-
API ini dibatasi hingga 30 panggilan per menit. Melebihi batas ini akan memicu pembatasan kecepatan, jadi hindari panggilan dengan frekuensi tinggi. Untuk operasi dengan frekuensi tinggi, gunakan Logstore. Untuk informasi lebih lanjut, lihat Mengelola Logstore.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
dds:DescribeRunningLogRecords |
get |
*dbinstance
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| DBInstanceId |
string |
Yes |
ID instans. Catatan
Jika parameter ini disetel ke ID instans cluster sharded, Anda juga harus menentukan parameter NodeId. |
dds-bpxxxxxxxx |
| NodeId |
string |
No |
ID node mongos atau shard dalam instans cluster sharded. Catatan
Parameter ini hanya tersedia ketika parameter DBInstanceId disetel ke ID instans cluster sharded. |
d-bpxxxxxxxx |
| StartTime |
string |
Yes |
Awal rentang waktu yang akan dikueri. Tentukan waktu dalam format yyyy-MM-ddTHH:mmZ. Waktu harus dalam UTC. |
2019-01-01T12:10Z |
| EndTime |
string |
Yes |
Akhir rentang waktu yang akan dikueri. Waktu akhir harus lebih lambat dari waktu mulai. Tentukan waktu dalam format yyyy-MM-ddTHH:mmZ. Waktu harus dalam UTC. Catatan
Waktu akhir dapat hingga 24 jam lebih lambat dari waktu mulai. Jika tidak, panggilan gagal. |
2019-01-01T13:10Z |
| DBName |
string |
No |
Nama database. |
mongodbtest |
| RoleType |
string |
No |
Peran node. Nilai yang valid:
Catatan
Jika parameter NodeId disetel ke ID node mongos, parameter RoleType hanya dapat disetel ke primary. |
primary |
| PageSize |
integer |
No |
Jumlah entri per halaman. Nilai yang valid: 30 hingga 100. |
30 |
| PageNumber |
integer |
No |
Nomor halaman. Nilainya harus berupa bilangan bulat yang lebih besar dari 0. Nilai default: 1. |
1 |
| OrderType |
string |
No |
Urutan pengurutan log yang sedang berjalan. Nilai yang valid:
|
asc |
| ResourceGroupId |
string |
No |
ID grup sumber daya. |
sg-bpxxxxxxxxxxxxxxxxxx |
| RoleId |
string |
No |
ID peran node. Anda dapat memanggil operasi DescribeReplicaSetRole untuk mengkueri ID peran. |
651xxxxx |
| QueryKeywords |
string |
No |
Kata kunci untuk kueri. Anda dapat menentukan hingga 10 kata kunci. Pisahkan beberapa kata kunci dengan spasi. |
test test2 |
| LogicalOperator |
string |
No |
Operator logis untuk kueri berbasis kata kunci. Nilai default: |
and |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
|||
| TotalRecordCount |
integer |
Jumlah total catatan. |
2 |
| PageRecordCount |
integer |
Jumlah catatan per halaman. |
30 |
| RequestId |
string |
ID permintaan. |
45D2B592-DEBA-4347-BBF3-47FF6C97DBBC |
| PageNumber |
integer |
Nomor halaman. |
1 |
| Items |
object |
||
| LogRecords |
array<object> |
Daftar catatan log yang sedang berjalan. |
|
|
object |
|||
| ConnInfo |
string |
The connection information of the log entry. |
conn18xxxxxx |
| CreateTime |
string |
The time when the log entry was generated. The time is in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC. |
2019-02-26T12:09:34Z |
| Category |
string |
The category of the log entry. |
NETWORK |
| Content |
string |
The content of the log entry. |
end connection 11.xxx.xxx.xx:3xxxx (0 connections now open)\n |
| Engine |
string |
Mesin database. |
MongoDB |
Contoh
Respons sukses
JSONformat
{
"TotalRecordCount": 2,
"PageRecordCount": 30,
"RequestId": "45D2B592-DEBA-4347-BBF3-47FF6C97DBBC",
"PageNumber": 1,
"Items": {
"LogRecords": [
{
"ConnInfo": "conn18xxxxxx",
"CreateTime": "2019-02-26T12:09:34Z",
"Category": "NETWORK",
"Content": " end connection 11.xxx.xxx.xx:3xxxx (0 connections now open)\\n"
}
]
},
"Engine": "MongoDB"
}
Kode kesalahan
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParameterCombination | The end time must be greater than the start time | |
| 400 | InvalidStartTime.Malformed | The Specified parameter StartTime is not valid. | |
| 400 | InvalidEndTime.Malformed | The Specified parameter EndTime is not valid. | |
| 403 | LogApiFrequencyExceeded | Exceeding the allowed frequency of log api. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.