Help Center/ Log Tank Service/ API Reference/ APIs/ Cloud Log Structuring/ Querying the Brief List of Structuring Templates
Updated on 2024-05-17 GMT+08:00

Querying the Brief List of Structuring Templates

Function

This API is used to query the brief list of structuring templates.

Calling Method

For details, see Calling APIs.

URI

GET /v3/{project_id}/lts/struct/customtemplate/list

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain a project ID, see Obtaining the Project ID, Account ID, Log Group ID, and Log Stream ID.

Minimum: 32

Maximum: 32

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token obtained from IAM. For details about how to obtain a user token, see Obtaining a User Token.

Minimum: 1000

Maximum: 2000

Content-Type

Yes

String

Set this parameter to application/json;charset=UTF-8.

Minimum: 30

Maximum: 30

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

results

Array of BriefStructTemplateModel objects

Brief list of structuring templates.

Table 4 BriefStructTemplateModel

Parameter

Type

Description

create_time

Long

Template creation/update time.

Minimum: 0

Maximum: 20000000000000

id

String

Template ID.

Minimum: 36

Maximum: 36

template_name

String

Template name.

Minimum: 1

Maximum: 64

template_type

String

Structuring type. Currently, regular expression, JSON, delimiters, and Nginx are supported.

Enumeration values:

  • regex

  • json

  • split

  • nginx

project_id

String

Project ID. For details about how to obtain a project ID, see Obtaining the Account ID, Project ID, Log Group ID, and Log Stream ID.

Minimum: 32

Maximum: 32

Status code: 500

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

Minimum: 8

Maximum: 8

error_msg

String

Error message.

Enumeration values:

  • Internal Server Error

Example Requests

Obtaining the Brief List of Structuring Templates of the Current Tenant

GET https://{endpoint}/v3/{project_id}/lts/struct/customtemplate/list

/v3/{project_id}/lts/struct/customtemplate/list

Example Responses

Status code: 200

The request is successful.

{
  "results" : [ {
    "create_time" : 1632897983441,
    "id" : "47629e46-287d-478c-8888-xxxxxxxxxxxx",
    "template_name" : "jsonTemplate",
    "template_type" : "json",
    "project_id" : "2a473356cca5487f8373be89xxxxxxxx"
  } ]
}

Status code: 500

The server has received the request but encountered an internal error.

{
  "error_code" : "LTS.2017",
  "error_msg" : "Find struct template failed."
}

Status Codes

Status Code

Description

200

The request is successful.

500

The server has received the request but encountered an internal error.

Error Codes

See Error Codes.