Updated on 2025-09-16 GMT+08:00

Performing Operations on GeminiDB Instances

Function

This API is used to perform operations on GeminiDB instances.

Constraints

This API supports GeminiDB Redis instances.

URI

PUT /v3/{project_id}/instances/{instance_id}/databases

Table 1 URI 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 parameter

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

action

Yes

String

Operation on the instance:

Flush: Delete data.

db_id

No

Integer

ID of a database to be cleared. This parameter is valid only when action is set to Flush.

Response Parameters

Status code: 200

Table 4 Response body parameter

Parameter

Type

Description

job_id

String

Task ID

Status code: 400

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Error code

error_msg

String

Error message

Status code: 500

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code

error_msg

String

Error message

Example Request

  • Clearing data in a specified database
    PUT https://{endpoint}/v3/0549b4a43100d4f32f51c01c2fe4acdb/instances/e73893ef73754465a8bd2e0857bbf13ein12/databases 
     { 
       "action" : "flush", 
       "db_id" : 1 
     }
  • Clearing all data
    PUT https://{endpoint}/v3/0549b4a43100d4f32f51c01c2fe4acdb/instances/e73893ef73754465a8bd2e0857bbf13ein12/databases 
     { 
       "action" : "flush" 
     }

Example Response

Status code: 200

Accepted.

{ 
  "job_id" : "04efe8e2-9255-44ae-a98b-d87cae411890" 
}

Status Codes

For details, see Status Codes.

Error Codes

For details, see Error Codes.