Consulta a sessão atual em uma instância do ApsaraDB for Redis.
Descrição da operação
-
Esta operação é aplicável apenas a instâncias do ApsaraDB for Redis.
-
Se você usar um SDK para chamar operações do Database Autonomy Service (DAS), deverá definir o ID da região como cn-shanghai.
Esta operação não pode ser usada para consultar sessões geradas no modo de conexão direta em instâncias de cluster do ApsaraDB for Redis.
Experimente agora
Testar
Autorização RAM
|
Ação |
Nível de acesso |
Tipo de recurso |
Chave de condição |
Ação dependente |
|
hdm:GetRedisAllSession |
get |
*All Resource
|
Nenhuma | Nenhuma |
Parâmetros da solicitação
|
Parâmetro |
Tipo |
Obrigatório |
Descrição |
Exemplo |
| ConsoleContext |
string |
Não |
O parâmetro reservado. |
None |
| InstanceId |
string |
Sim |
O ID da instância de banco de dados. |
r-2zemyfd1sh1u2i**** |
Elementos de resposta
|
Elemento |
Tipo |
Descrição |
Exemplo |
|
object |
Os parâmetros de resposta. |
||
| Code |
integer |
O código de status HTTP retornado. |
200 |
| Message |
string |
A mensagem retornada. Nota
Se a solicitação for bem-sucedida, Successful será retornado. Se a solicitação falhar, uma mensagem de erro, como um código de erro, será retornada. |
Successful |
| Data |
object |
Os dados da sessão. |
|
| Timestamp |
integer |
A hora em que as sessões da instância foram retornadas. O valor é um carimbo de data e hora UNIX que representa o número de milissegundos decorridos desde 1º de janeiro de 1970, 00:00:00 UTC. |
1660100753556 |
| Total |
integer |
O número total de sessões. |
2 |
| Sessions |
array<object> |
As informações sobre as sessões. |
|
|
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> |
As estatísticas sobre a origem de acesso. |
|
|
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 |
O ID da solicitação. |
40C6E9AF-6C23-5614-AA83-34344CC6**** |
| Success |
boolean |
Indica se a solicitação foi bem-sucedida. Valores válidos:
|
true |
Exemplos
Resposta de sucesso
JSON formato
{
"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
}
Códigos de erro
|
Código de status HTTP |
Código de erro |
Mensagem de erro |
Descrição |
|---|---|---|---|
| 400 | InvalidParams | The request parameters are invalid. | |
| 403 | NoPermission | You are not authorized to do this action. |
Consulte Códigos de Erro para uma lista completa.
Notas de versão
Consulte Notas de Versão para uma lista completa.