Help Center/ GeminiDB/ API Reference/ APIs v3 (Recommended)/ Instances/ Querying Big Keys of a GeminiDB Redis Instance
Updated on 2024-08-08 GMT+08:00

Querying Big Keys of a GeminiDB Redis Instance

Function

This API is used to query big keys of a GeminiDB Redis instance.

Constraints

This API supports the following instances:

  • GeminiDB Redis

URI

POST /v3/{project_id}/instances/{instance_id}/big-keys

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID of a tenant in a region. To obtain this value, see Obtaining a Project ID.

instance_id

Yes

String

Instance ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

offset

No

Integer

Index position. If offset is set to N, the resource query starts from the N+1 piece of data.

The value must be no lower than 0. If this parameter is not transferred, offset is set to 0 by default, indicating that the query starts from the first big key.

limit

No

Integer

Maximum records to be queried. The value ranges from 1 to 100. If this parameter is not transferred, the first 100 records are queried by default.

key_types

No

Array of strings

Big key type. It is a character string list and supports six types such as strings, hashes, zsets, sets, lists, and streams.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

keys

Array of Table 5 objects

Queried big keys.

count

Integer

Total big keys.

Table 5 BigKeysInfoResponseBody

Parameter

Type

Description

db_id

Integer

Database where a big key is located.

key_type

String

Type of a big key.

key_name

String

Name of a big key.

key_size

Integer

Length of a big key.

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 500

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Requests

POST https://{endpoint}/v3/instances/91b5c48e11bf4913b35814f28b8f79f2in12/big-keys 
  
 { 
   "key_types" : [ "string", "hash", "zset", "set", "list", "stream" ] 
 }

Example Responses

Status code: 200

Success.

{ 
   "keys" : [ { 
     "db_id" : 0, 
     "key_type" : "String", 
     "key_name" : "a", 
     "key_size" : 12 
   } ], 
   "count" : 1 
 }

Status Codes

For details, see Status Codes.

Error Codes

For details, see Error Codes.