All Products
Search
Document Center

Database Autonomy Service:GetRedisAllSession

Last Updated:Mar 22, 2024

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.
Note This operation cannot be used to query sessions generated in direct connection mode on ApsaraDB for Redis cluster instances.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
hdm:GetRedisAllSessionRead
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ConsoleContextstringNo

The reserved parameter.

None
InstanceIdstringYes

The database instance ID.

r-2zemyfd1sh1u2i****

Response parameters

ParameterTypeDescriptionExample
object
Codelong

The HTTP status code returned.

200
Messagestring

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
Dataobject

The session data.

Timestamplong

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
Totallong

The total number of sessions.

2
Sessionsobject []

The information about the sessions.

Sublong

The number of subscribed channels.

0
Psublong

The number of subscriptions that match the pattern.

0
Idlelong

The duration during which the session is in the idle state. Unit: seconds.

8
Flagsstring

The client flag. Valid values:

  • A: The connection needs to be closed at the earliest opportunity.
  • b: The client is waiting for blocked events.
  • c: The connection is closed after all replies are written.
  • d: The monitored keys have been modified, and the EXEC command is about to fail.
  • i: The client is waiting for VM I/O operations. This value is no longer used.
  • M: The client is the primary node.
  • N: No special flags are configured.
  • O: The client is in monitor mode.
  • r: The client is a cluster node in read-only mode.
  • S: The client is a replica node in normal mode.
  • u: The client is not blocked.
  • U: The client is connected by using UNIX domain sockets.
  • x: The client is executing a transaction.
N
Olllong

The number of objects contained in the output list.

0
QbufFreelong

The remaining size of the input buffer. Unit: bytes.

0
Multilong

The number of commands in MULTI or EXEC.

-1
Omemlong

The size of the output buffer. Unit: bytes.

0
Qbuflong

The size of the input buffer. Unit: bytes.

0
Namestring

The name of the client.

test
Obllong

The size of the fixed output buffer. Unit: bytes.

0
Clientstring

The IP address of the client.

172.16.XX.XX
Cmdstring

The command that was last run.

PING
Idlong

The client ID.

9080586
Addrstring

The IP address and port number of the client.

172.16.XX.XX:53458
NodeIdstring

The node ID.

r-2zemyfd1sh1u2i****-proxy-14#1679****
Agestring

The connection duration of the session. Unit: seconds.

12
Dblong

The ID of the database that the client is using.

0
Eventsstring

The file descriptor event. Valid values:

  • r: Client sockets are readable in the event loop.
  • w: Client sockets are writable in the event loop.
r
Fdlong

The file descriptor that is used by sockets.

73
ClientDescstring

The alias of the client.

prod ip
SourceStatsobject []

The statistics on the access source.

Keystring

The access source.

172.16.XX.XX
Countstring

The total number of sessions from the access source.

1
Idsarray

The client IDs.

long

The client ID.

9080586
RequestIdstring

The request ID.

40C6E9AF-6C23-5614-AA83-34344CC6****
Successboolean

Indicates whether the request was successful. Valid values:

  • true
  • false
true

Examples

Sample success responses

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
}

Error codes

HTTP status codeError codeError message
400InvalidParamsThe request parameters are invalid.
403NoPermissionYou are not authorized to do this action.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history