Updated on 2024-11-11 GMT+08:00

Querying Logs

Function

This API is used to query logs.

Calling Method

For details, see Calling APIs.

URI

GET /v1/logtanks

Table 1 Query Parameters

Parameter

Mandatory

Type

Description

limit

No

Integer

Specifies the number of resources on each page. If this parameter is not specified, the default value is 500.

marker

No

String

Specifies the ID of the resource from which pagination query starts, that is, the ID of the last resource on the previous page. If the parameter is not specified, only resources on the first page are queried.

This parameter must be used together with limit.

id

No

String

Specifies the resource ID.

status

No

String

Specifies the resource status. The value can be one of the following:

  • ACTIVE: The resource is running.

  • PENDING: The status is to be determined.

  • ERROR: Failed to create the resource.

  • DELETING: The resource is being deleted.

resource_ids

No

Array of strings

Specifies the resource IDs.

resource_type

No

String

Specifies the type of the resource associated with the log.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Specifies the user token. The token can be obtained by calling the IAM API. The value of X-Subject-Token in the response header is the user token.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

logtanks

Array of LogtankDetail objects

Specifies the response parameters for a log.

page_info

PageInfo object

Specifies the pagination query information.

request_id

String

Specifies the request ID.

Table 4 LogtankDetail

Parameter

Type

Description

id

String

Specifies the log ID.

domain_id

String

Specifies the tenant ID.

project_id

String

Specifies the project ID.

resource_type

String

Specifies the type of the resource associated with the log.

resource_id

String

Specifies the ID of the resource for which LTS is enabled.

log_group_id

String

Specifies the log group ID.

log_stream_id

String

Specifies the log stream ID.

status

String

Specifies the provisioning status. The value can be one of the following:

  • ACTIVE: The resource is running.

  • PENDING: The status is to be determined.

  • ERROR: Failed to create the resource.

  • DELETING: The resource is being deleted.

created_at

String

Specifies the time when the log was created.

updated_at

String

Specifies the time when the log was updated.

Table 5 PageInfo

Parameter

Type

Description

next_marker

String

Specifies the marker of the next page. If this parameter is left empty, the resource is on the last page.

current_count

Integer

Specifies the number of resources on the current list.

Example Requests

Querying logs

GET https://{ga_endpoint}/v1/logtanks

Example Responses

Status code: 200

Operation succeeded.

{
  "logtanks" : [ {
    "id" : "ac1bf54f-6a23-4074-af77-800648d25bc8",
    "domain_id" : "99a3fff0d03c428eac3678da6a7d0f24",
    "project_id" : "644056c6947343d498427218e271b545",
    "resource_type" : "LISTENER",
    "resource_id" : "78d425da-4d5f-422f-b13b-40aa3f49bc55",
    "log_group_id" : "0b43cca4-a11a-4444-8ac5-2feee53a48ab",
    "log_stream_id" : "43afe287-2a2d-4bf2-a67d-8a027b9ed80c",
    "status" : "ACTIVE",
    "created_at" : "2019-01-08T01:21:37Z",
    "updated_at" : "2019-01-08T01:21:37Z"
  } ],
  "page_info" : {
    "next_marker" : "09e86f09-03fc-440e-8132-03f3e149e979",
    "current_count" : 10
  },
  "request_id" : "string"
}

Status Codes

Status Code

Description

200

Operation succeeded.

Error Codes

See Error Codes.