Queries the current session on an ApsaraDB for Redis instance.
Operation description
This operation is applicable only to ApsaraDB for Redis instances.
If you use an SDK to call operations of Database Autonomy Service (DAS), you must set the region ID to cn-shanghai.
This operation cannot be used to query sessions generated in direct connection mode on ApsaraDB for Redis cluster instances.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
hdm:GetRedisAllSession |
get |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ConsoleContext |
string |
No |
The reserved parameter. |
None |
| InstanceId |
string |
Yes |
The database instance ID. |
r-2zemyfd1sh1u2i**** |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| Code |
integer |
The HTTP status code returned. |
200 |
| Message |
string |
The returned message. Note
If the request was successful, Successful is returned. If the request failed, an error message such as an error code is returned. |
Successful |
| Data |
object |
The session data. |
|
| Timestamp |
integer |
The time when the instance sessions were returned. The value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC. |
1660100753556 |
| Total |
integer |
The total number of sessions. |
2 |
| Sessions |
array<object> |
The information about the sessions. |
|
|
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> |
The statistics on the access source. |
|
|
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 |
The request ID. |
40C6E9AF-6C23-5614-AA83-34344CC6**** |
| Success |
boolean |
Indicates whether the request was successful. Valid values:
|
true |
Examples
Success response
JSON format
{
"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
}
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.