Help Center> GeminiDB> API Reference> APIs v3 (Recommended)> Logs> Querying LTS Log Configurations
Updated on 2023-12-25 GMT+08:00

Querying LTS Log Configurations

Function

This API is used to query the LTS configuration of instances.

Constraints

  • This function supports only slow query logs and audit logs of GeminiDB Redis instances.

URI

GET https://{Endpoint}/v3/{project_id}/instances/logs/lts-configs

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. To obtain this value, see Obtaining a Project ID.

Table 2 Query parameters

Parameter

Mandatory

Type

Description

offset

No

Integer

Index offset. The query starts from the next piece of data indexed by this parameter. The offset value must be a positive integer. The default value is 0, indicating that the query starts from the first piece of data.

limit

No

Integer

Maximum returned records. The value must be an integer ranging from 1 to 100. If this parameter is not transferred, information of 100 instances is queried by default.

instance_id

No

String

Instance ID used for exact search.

instance_name

No

String

Instance name used for fuzzy search.

enterprise_project_id

No

String

Enterprise project ID for exact search.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

X-Language

No

String

Language.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

total_count

Integer

Total instance records.

instance_lts_configs

Array of objects

LTS log configurations of the instance. For details, see Table 5.

Table 5 InstanceLogConfig

Parameter

Type

Description

instance

object

Instance information. For details, see Table 6.

lts_configs

Array of objects

LTS log configuration details. If the LTS log stream is not configured, this parameter is not returned. For details, see Table 8.

Table 6 LogInstanceInfo

Parameter

Type

Description

id

String

Instance ID.

name

String

Instance name.

status

String

Instance status. The value can be:

  • normal, indicating that the instance is running normally.
  • abnormal, indicating that the instance is abnormal.
  • creating, indicating that the instance is being created.
  • frozen, indicating that the instance is frozen.
  • data_disk_full, indicating that the instance disk is full.
  • createfail, indicating that the instance failed to be created.
  • enlargefail, indicating that nodes failed to be added to the instance.

mode

String

Instance type. The value can be:

  • Cluster, indicating that the instance is aGeminiDB Redis replica set instance.

datastore

object

Database information. For details, see Table 7.

actions

Array of strings

Operation that is executed on the instance.

enterprise_project_id

String

Enterprise project ID.

supported_log_types

Array of strings

Supported log type. The value can be:

slow_log, indicating that the log is a slow query log.

audit_log, indicating that the log is an audit log.

Table 7 InstancesDatastoreResult

Parameter

Type

Description

type

String

DB API.

version

String

DB version number.

Table 8 InstanceLogConfigDetail

Parameter

Type

Description

log_type

String

Log type. The value can be:

  • slow_log, indicating that the log is a slow query log.
  • audit_log, indicating that the log is an audit log.

lts_group_id

String

ID of the LTS log group. If enabled is set to false, this parameter indicates the ID of the latest associated LTS log group.

lts_stream_id

String

ID of the LTS log stream. If enabled is set to false, this parameter indicates the ID of the latest associated LTS log stream.

enabled

Boolean

Whether LTS log stream is enabled.

  • true: enabled
  • false: disabled

Example Requests

GET https://{Endpoint}/v3/0549b4a43100d4f32f51c01c2fe4acdb/instances/logs/lts-configs?limit=10&offset=0&instance_id=362b42f769ff45d884e1866f8ee00bb4in12&instance_name=c316&enterprise_project_id=0

Example Responses

Status code: 200

Success

{ 
  "total_count" : 1, 
  "instance_lts_configs" : [ { 
    "instance" : { 
      "id" : "362b42f769ff45d884e1866f8ee00bb4in12", 
      "name" : "nosql-c316", 
      "mode" : "RedisCluster", 
      "datastore" : { 
        "version" : "5.0", 
        "type" : "redis" 
      }, 
      "status" : "normal", 
      "actions" : [ "GROWING" ], 
      "enterprise_project_id" : "0", 
      "supported_log_types" : [ "slow_log", "audit_log" ]
    }, 
    "lts_configs" : [ { 
      "log_type" : "slow_log", 
      "lts_group_id" : "65442dd4-b8de-4e9f-8a80-b60aa0698354", 
      "lts_stream_id" : "5992dd29-fd11-4228-a852-5f6e578789c5", 
      "enabled" : true 
    } ] 
  } ] 
}

Status Codes

For details, see Status Codes.

Error Codes

For details, see Error Codes.