Help Center/ Log Tank Service/ API Reference/ APIs/ Log Collection Beyond Free Quota/ Enabling Log Collection Beyond Free Quota
Updated on 2024-12-20 GMT+08:00

Enabling Log Collection Beyond Free Quota

Function

This API is used to configure log collection to continue when the free quota runs out.

Calling Method

For details, see Calling APIs.

URI

POST /v2/{project_id}/collection/enable

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: 403

Table 3 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 500

Table 4 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Requests

Enabling log collection beyond free quota

POST https://{endpoint}/v2/{project_id}/collection/enable

/v2/{project_id}/collection/enable

Example Responses

Status code: 403

Forbidden. The request has been rejected. The server has received the request and understood it, but refuses to respond to it. The client should not repeat the request without modifications.

{
  "error_code" : "LTS.0001",
  "error_msg" : "Invalid projectId"
}

Status code: 500

Failed to change the setting of log collection beyond the free quota.

{
  "error_code" : "LTS.0210",
  "error_msg" : "Update continue Collection Status error."
}

Status Codes

Status Code

Description

200

The request is successful.

403

Forbidden. The request has been rejected. The server has received the request and understood it, but refuses to respond to it. The client should not repeat the request without modifications.

500

Failed to change the setting of log collection beyond the free quota.

503

ServiceUnavailable. The requested service is unavailable.

Error Codes

See Error Codes.