Querying Logs
Function
This API is used to query code check logs. Pagination query is supported. The backend filters sensitive information. Therefore, the number of returned lines is less than the number of queried lines.
Calling Method
For details, see Calling APIs.
Authorization Information
Each account root user has all the permissions required to call all APIs, but IAM users must be assigned the following required identity policy-based permissions. For details about the required permissions, see Permissions Policies and Supported Actions.
|
Action |
Access Level |
Resource Type (*: required) |
Condition Key |
Alias |
Dependencies |
|---|---|---|---|---|---|
|
codeartscheck:task:get |
Read |
task * |
- |
- |
- |
|
- |
codeartscheck:ProjectId |
URI
GET /v1/console-log
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
job_id |
Yes |
String |
Definition: ID of one or more subtasks contained in an execution. Constraints: N/A Value range: 32-character subtask ID. Default value: N/A |
|
start_offset |
No |
Long |
Definition: Start range of logs to be queried. Constraints: When the API is called for the first time, the value 0 should be passed. For subsequent calls, the value of result.startOffset returned by the API should be passed. Value range: 0-9223372036854775807 |
|
end_offset |
No |
Long |
Definition: End range of logs to be queried. Constraints: When the API is called for the first time, the value 0 should be passed. For subsequent calls, the value of result.endOffset returned by the API should be passed. Value range: 0-9223372036854775807 |
|
size |
No |
Integer |
Definition: The number of log lines retrieved in a single query is based on the raw log entries. However, the returned result is filtered, so the number of lines may be less than the specified size. Constraints: N/A Value range: 0–1000 |
|
sort |
No |
String |
Definition: Query sequence. Constraints: N/A Value range: |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
Definition : User token. Obtain one by calling the IAM API Obtaining a User Token. The value of X-Subject-Token in the response header is a token. Constraints: N/A Value range: 1–100,000 characters. Default value: N/A |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
ShowLogResponse |
String |
Querying logs |
|
Parameter |
Type |
Description |
|---|---|---|
|
result |
ShowLogResponseResult object |
Definition: Log information. Value range: N/A |
|
error |
MainError object |
Definition: Error message. Value range: N/A |
|
status |
String |
Definition: API response status. Value range: |
|
Parameter |
Type |
Description |
|---|---|---|
|
hasMore |
Boolean |
Definition: Flag of the ascending query. This parameter is valid only for the ascending query. Value range: |
|
startOffset |
Long |
Definition: Start range of logs to be queried next time, which also functions as the flag of the descending query. Value range: 0 to 9223372036854775807. When the query is in descending order, the value 0 indicates that there are no more logs, and a value other than 0 indicates that there are more logs. |
|
endOffset |
Long |
Definition: End range of logs to be queried next time. Value range: 0 to 9223372036854775807 |
|
log |
String |
Definition: Log content. Value range: N/A |
|
location |
String |
Definition: No service meaning. Value range: Jenkins. |
|
override |
Boolean |
Definition: No service meaning. Value range: false, true |
|
Parameter |
Type |
Description |
|---|---|---|
|
code |
String |
Definition: Error code. Value range: N/A |
|
reason |
String |
Definition: Error message. Value range: N/A |
|
message |
String |
Definition: Error message. Value range: N/A |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Definition: Error code. Value range: N/A |
|
error_msg |
String |
Definition: Error message. Value range: N/A |
Status code: 401
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Definition: Error code. Value range: N/A |
|
error_msg |
String |
Definition: Error message. Value range: N/A |
Example Requests
GET https://{endpoint}/v1/console-log?size=300&sort=DESC&start_offset=0&end_offset=0&job_id=a777ff00d3cf4d369d87066806aexxxx
Example Responses
Status code: 200
Querying logs
{
"result" : {
"hasMore" : false,
"startOffset" : 88961,
"endOffset" : 176422,
"log" : "[2025/09/23 14:10:07.623 GMT+08:00] [INFO] [CHECK_PARALLEL:analyze] : main-INFO org.pf4j.AbstractPluginManager.startPlugin(AbstractPluginManager.java:407) - Start plugin 'CmetricsPlugin@1.0.0'\n",
"location" : "jenkins",
"override" : true
},
"error" : { },
"status" : "success"
}
Status code: 400
Bad Request
{
"error_code" : "CC.xxxxxxxx.400",
"error_msg" : "Verify request parameter failed. Check whether the request parameters are correct."
}
Status code: 401
Unauthorized
{
"error_code" : "CC.00000003",
"error_msg" : "Authentication information expired."
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Querying logs |
|
400 |
Bad Request |
|
401 |
Unauthorized |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot