Help Center/ GeminiDB/ API Reference/ APIs v3 (Recommended)/ Managing Databases and Accounts/ Performing Operations on a GeminiDB Instance Database
Updated on 2024-08-08 GMT+08:00

Performing Operations on a GeminiDB Instance Database

Function

This function allows you to performing operations on a GeminiDB instance database.

Constraints

This API supports GeminiDB Redis instances.

URI

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

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

action

Yes

String

Operation on the instance:

Flush: Delete data.

db_id

No

Integer

ID of the DB to be cleared. This parameter is valid only when action is set to Flush.

Response Parameters

Status code: 200

Table 4 Response body parameters

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 Requests

  • 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 Responses

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.