Updated on 2025-10-27 GMT+08:00

Creating a Log

Function

This API is used to create a log.

Calling Method

For details, see Calling APIs.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions. For details about the required permissions, see Permissions Policies and Supported Actions.

URI

POST /v1/logtanks

Request Parameters

Table 1 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.

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

logtank

Yes

CreateLogtankOption object

Specifies the request parameters for creating a log.

Table 3 CreateLogtankOption

Parameter

Mandatory

Type

Description

resource_type

Yes

String

Specifies the type of the resource associated with the log.

resource_id

Yes

String

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

log_group_id

Yes

String

Specifies the log group ID.

log_stream_id

Yes

String

Specifies the log stream ID.

Response Parameters

Status code: 201

Table 4 Response body parameters

Parameter

Type

Description

logtank

LogtankDetail object

Specifies the response parameters for a log.

request_id

String

Specifies the request ID.

Table 5 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.

Example Requests

Creating a log for a specified listener

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

{
  "logtank" : {
    "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"
  }
}

Example Responses

Status code: 201

Created.

{
  "logtank" : {
    "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"
  },
  "request_id" : "ac1bf54f-6a23-4074-af77-800648d25bc8"
}

Status Codes

Status Code

Description

201

Created.

Error Codes

See Error Codes.