Updated on 2024-04-12 GMT+08:00

Configuring Log Collection Paths

Function

This API is used to configure the log collection paths of a specified ICAgent. This API applies only to configurations of log collection paths on the Log > Path Configuration page of the Application Operations Management (AOM) console.

URI

POST /v3/{project_id}/log-paths

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 Account Tenant 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.

Minimum: 1000

Maximum: 2000

Content-Type

Yes

String

Set this parameter to application/json;charset=utf8.

Minimum: 29

Maximum: 29

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

agent_config_infos

Yes

Array of AgentConfInfo1 objects

ICAgent collection path configuration array.

Table 4 AgentConfInfo1

Parameter

Mandatory

Type

Description

agent_id

Yes

String

The unique ID of ICAgent.

log_paths

Yes

Array of strings

Log collection paths.

Response Parameters

Status code: 400

Table 5 Response body parameters

Parameter

Type

Description

errorCode

String

Status code.

errorMessage

String

Description of the response for calling the API.

Status code: 401

Table 6 Response body parameters

Parameter

Type

Description

errorCode

String

Status code.

errorMessage

String

Description of the response for calling the API.

Status code: 500

Table 7 Response body parameters

Parameter

Type

Description

errorCode

String

Status code.

errorMessage

String

Description of the response for calling the API.

Status code: 503

Table 8 Response body parameters

Parameter

Type

Description

errorCode

String

Status code.

errorMessage

String

Description of the response for calling the API.

Example Requests

POST https://{endpoint}/v3/${project_id}/log-paths

{
  "agent_config_infos" : [ {
    "agent_id" : "c44fd66b-4bf5-4424-8c13-a2bfc927f51d",
    "log_paths" : [ "/log/root.log", "/var/ICAgent" ]
  } ]
}

Example Responses

Status code: 401

The authentication information is incorrect or invalid.

{
  "errorCode" : "SVCSTG.ALS.403.105",
  "errorMessage" : "Project id is invalid."
}

Status Codes

Status Code

Description

200

The request is successful. The log collection path is configured.

400

BadRequest. Invalid request. Modify the request based on the description in error_msg before a retry.

401

The authentication information is incorrect or invalid.

500

Internal server error.

503

ServiceUnavailable. The requested service is unavailable.

Error Codes

See Error Codes.