Mengkueri sesi saat ini pada instans ApsaraDB for Redis.
Deskripsi operasi
-
Operasi ini hanya berlaku untuk instans ApsaraDB for Redis.
-
Jika Anda menggunakan SDK untuk memanggil operasi Database Autonomy Service (DAS), Anda harus menetapkan ID region ke cn-shanghai.
Operasi ini tidak dapat digunakan untuk mengkueri sesi yang dihasilkan dalam mode koneksi langsung pada instans klaster ApsaraDB for Redis.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
hdm:GetRedisAllSession |
get |
*全部资源
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| ConsoleContext |
string |
No |
Parameter cadangan. |
None |
| InstanceId |
string |
Yes |
ID instans database. |
r-2zemyfd1sh1u2i**** |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
Parameter respons. |
||
| Code |
integer |
Kode status HTTP yang dikembalikan. |
200 |
| Message |
string |
Pesan yang dikembalikan. Catatan
Jika permintaan berhasil, Successful akan dikembalikan. Jika permintaan gagal, pesan kesalahan seperti kode kesalahan akan dikembalikan. |
Successful |
| Data |
object |
Data sesi. |
|
| Timestamp |
integer |
Waktu saat sesi instans dikembalikan. Nilainya berupa stempel waktu UNIX yang merepresentasikan jumlah milidetik yang telah berlalu sejak 1 Januari 1970, 00:00:00 UTC. |
1660100753556 |
| Total |
integer |
Jumlah total sesi. |
2 |
| Sessions |
array<object> |
Informasi tentang sesi. |
|
|
object |
|||
| Sub |
integer |
The number of subscribed channels. |
0 |
| Psub |
integer |
The number of subscriptions that match the pattern. |
0 |
| Idle |
integer |
The duration during which the session is in the idle state. Unit: seconds. |
8 |
| Flags |
string |
The client flag. Valid values:
|
N |
| Oll |
integer |
The number of objects contained in the output list. |
0 |
| QbufFree |
integer |
The remaining size of the input buffer. Unit: bytes. |
0 |
| Multi |
integer |
The number of commands in |
-1 |
| Omem |
integer |
The size of the output buffer. Unit: bytes. |
0 |
| Qbuf |
integer |
The size of the input buffer. Unit: bytes. |
0 |
| Name |
string |
The name of the client. |
test |
| Obl |
integer |
The size of the fixed output buffer. Unit: bytes. |
0 |
| Client |
string |
The IP address of the client. |
172.16.XX.XX |
| Cmd |
string |
The command that was last run. |
PING |
| Id |
integer |
The client ID. |
9080586 |
| Addr |
string |
The IP address and port number of the client. |
172.16.XX.XX:53458 |
| NodeId |
string |
The node ID. |
r-2zemyfd1sh1u2i****-proxy-14#1679**** |
| Age |
string |
The connection duration of the session. Unit: seconds. |
12 |
| Db |
integer |
The ID of the database that the client is using. |
0 |
| Events |
string |
The file descriptor event. Valid values:
|
r |
| Fd |
integer |
The file descriptor that is used by sockets. |
73 |
| ClientDesc |
string |
The alias of the client. |
prod ip |
| SourceStats |
array<object> |
Statistik tentang sumber akses. |
|
|
object |
|||
| Key |
string |
The access source. |
172.16.XX.XX |
| Count |
string |
The total number of sessions from the access source. |
1 |
| Ids |
array |
The client IDs. |
|
|
integer |
The client ID. |
9080586 |
|
| RequestId |
string |
ID permintaan. |
40C6E9AF-6C23-5614-AA83-34344CC6**** |
| Success |
boolean |
Menunjukkan apakah permintaan berhasil. Nilai yang valid:
|
true |
Contoh
Respons sukses
JSONformat
{
"Code": 200,
"Message": "Successful",
"Data": {
"Timestamp": 1660100753556,
"Total": 2,
"Sessions": [
{
"Sub": 0,
"Psub": 0,
"Idle": 8,
"Flags": "N",
"Oll": 0,
"QbufFree": 0,
"Multi": -1,
"Omem": 0,
"Qbuf": 0,
"Name": "test",
"Obl": 0,
"Client": "172.16.XX.XX",
"Cmd": "PING",
"Id": 9080586,
"Addr": "172.16.XX.XX:53458",
"NodeId": "r-2zemyfd1sh1u2i****-proxy-14#1679****",
"Age": "12",
"Db": 0,
"Events": "r",
"Fd": 73,
"ClientDesc": "prod ip"
}
],
"SourceStats": [
{
"Key": "172.16.XX.XX",
"Count": "1",
"Ids": [
9080586
]
}
]
},
"RequestId": "40C6E9AF-6C23-5614-AA83-34344CC6****",
"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.