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

Querying the Log Collection Path

Function

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

URI

GET /v2/{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

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

id

No

String

The ICAgent of which the log collection paths you want to query. When querying the paths of multiple ICAgents, separate the ICAgent IDs with commas (,).

Default value: Obtain the log collection paths of all ICAgents.

Minimum length: 0 characters.

Maximum length: 35,999 characters.

Minimum: 0

Maximum: 35999

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token obtained from IAM.

Default value: None.

Minimum length: 1000 characters.

Maximum length: 2000 characters.

Minimum: 1000

Maximum: 2000

Content-Type

Yes

String

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

Default value: None.

Minimum length: 29 characters.

Maximum length: 29 characters.

Minimum: 29

Maximum: 29

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

errorCode

String

Status code.

errorMessage

String

Description of the response for calling the API.

result

Array of AgentConfInfo objects

ICAgent collection path information array.

Table 5 AgentConfInfo

Parameter

Type

Description

agent_id

String

The unique ID of ICAgent.

Minimum length: 36 characters.

Maximum length: 36 characters.

Minimum: 36

Maximum: 36

log_paths

Array of strings

List of log collection paths.

Minimum length: 0 characters.

Maximum length: 20 characters.

Minimum: 0

Maximum: 20

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

errorCode

String

Status code.

errorMessage

String

Description of the response for calling the API.

Status code: 401

Table 7 Response body parameters

Parameter

Type

Description

errorCode

String

Status code.

errorMessage

String

Description of the response for calling the API.

Status code: 500

Table 8 Response body parameters

Parameter

Type

Description

errorCode

String

Status code.

errorMessage

String

Description of the response for calling the API.

Status code: 503

Table 9 Response body parameters

Parameter

Type

Description

errorCode

String

Status code.

errorMessage

String

Description of the response for calling the API.

Example Requests

GET https://{endpoint}/v2/${project_id}/log-paths?id=86072d0f-1580-4bbe-a467-66cf61767f80,79e86731- b22b-4207-ae1b-8de882ea3711

Example Responses

Status code: 200

The request is successful. Log collection paths obtained.

{
  "errorCode": "SVCSTG.ALS.200.200",
  "errorMessage": "Query agent info success."
  "result": [
    {
      "agent_id": "c44fd66b-4bf5-4424-8c13-a2bfc927f51c",
      "log_paths": [
        "/log/trace.log"
      ]
    },
    {
      "agent_id": "c44fd66b-4bf5-4424-8c13-a2bfc927f51d",
      "log_paths": [
        "/log/trace.log"
      ]
    }
  ]
}

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. Log collection paths obtained.

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.