Updated on 2023-11-27 GMT+08:00

Querying LTS Log Configurations

API Description

This API is used to query LTS log configurations.

Restrictions

This API is available only for audit logs.

URI

  • URI format

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

  • URI example

    https://dds.cn-north-1.myhuaweicloud.com/v3/619d3e78f61b4be68bc5aa0b59edcf7b/instances/logs/lts-configs?offset=0&limit=10

    Table 1 Request parameters

    Parameter

    Mandatory

    Type

    Description

    X-Auth-Token

    Yes

    String

    User token obtained from IAM. For details, see Authentication.

    project_id

    Yes

    String

    Project ID of a tenant in a region. Obtain the project ID by following the instructions in Obtaining a Project ID.

    Table 2 Query parameters

    Name

    Mandatory

    Type

    Description

    offset

    No

    Integer

    Index offset. If offset is set to N, the resource query starts from the N+1 piece of data. The default value is 0, indicating that the query starts from the first piece of data. The value must be a positive integer.

    limit

    No

    Integer

    Number of records to be queried. The value ranges from 0 to 50. If this parameter is not transferred, the log configurations of the first 50 DB instances are queried by default.

Requests

  • Parameter description

    None

  • Example request

    None

Responses

  • Parameter description
    Table 3 Response body parameters

    Parameter

    Type

    Description

    instance_lts_configs

    Array of Table 4 objects

    LTS log configuration and brief information about each instance.

    total_count

    Integer

    Total number of cloud service log configurations that can be queried, which is equal to the total number of DDS instances.

    Table 4 instance_lts_configs

    Parameter

    Type

    Description

    instance

    Table 5 object

    Brief information about an instance.

    lts_configs

    Array of Table lts_configs objects

    LTS log configuration details. If no LTS log stream is configured, no response is returned for this field.

    Table 5 instance

    Parameter

    Type

    Description

    id

    String

    Instance ID.

    name

    String

    Instance name.

    mode

    String

    Instance type, which can be single node, replica set, or cluster.

    Enumerated values:

    • Single
    • Replica
    • Sharding

    datastore

    Table 6 object

    DB engine and version of the DB instance.

    status

    String

    Instance status.

    enterprise_project_id

    String

    ID of the enterprise project to which the instance belongs. For the default enterprise project, the value is 0. For other enterprise projects, see Enterprise Management User Guide.

    actions

    Array of strings

    All actions that are being executed on an instance.

    Table 6 datastore

    Parameter

    Type

    Description

    type

    String

    DB engine. The value is mongodb.

    Enumerated values:

    • mongodb

    version

    String

    Database major version.

    Table 7 lts_configs

    Parameter

    Type

    Description

    log_type

    String

    LTS log type. This parameter cannot be left empty. The options are as follows:

    • audit_log

    Enumerated values:

    • audit_log

    lts_group_id

    String

    LTS log group ID.

    lts_stream_id

    String

    LTS log stream ID.

    enabled

    Boolean

    Indicates whether to upload logs to LTS.

  • Example response
    { 
      "total_count" : 1, 
      "instance_lts_configs" : [ { 
        "instance" : { 
          "id" : "520c58ba00a3497e97ce0b9604874dd6in02", 
          "name" : "dds-1f84", 
          "mode" : "Single", 
          "datastore" : { 
            "type" : "mongodb", 
            "version" : 4.0 
          }, 
          "status" : "normal", 
          "enterprise_project_id" : "0", 
          "actions" : [ "OPS_AUDIT_LOG" ] 
        }, 
        "lts_configs" : [ { 
          "log_type" : "audit_log", 
          "lts_group_id" : "ec6dc499-1a63-4229-a0c2-a2afa8bcfc95", 
          "lts_stream_id" : "cae69d2e-378b-41dd-b3c9-3ca1cd5335bc", 
          "enabled" : true 
        } ] 
      } ] 
    }

Status Code

For details, see Status Code.

Error Code

For details, see Error Code.