Updated on 2024-10-17 GMT+08:00

Querying the Job List

Function

This API is used to query the job list in the logs of a cluster.

Debugging

You can debug this API through automatic authentication in API Explorer.

URI

GET /v1.0/{project_id}/clusters/{cluster_id}/logs/records

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain the project ID and name, see Obtaining the Project ID and Name.

cluster_id

Yes

String

ID of the cluster you want to query.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

start

No

Integer

The start value of the query. The default value is 1, indicating that the query starts from the first task.

limit

No

Integer

Number of task to be queried. The default value is 10, indicating that the information about 10 tasks is queried at a time.

status

No

String

Specifies the status of the log task to be queried. If this parameter is not set, all log tasks of the cluster are queried.

FAIL: failed tasks

NOT_FAIL: ongoing or successful tasks

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

clusterLogRecord

Array of clusterLogRecord objects

Cluster log entity object.

Table 4 clusterLogRecord

Parameter

Type

Description

id

String

Log task ID, which is generated based on the system UUID.

clusterId

String

Cluster ID.

createAt

String

Creation time. Format: Unix timestamp.

logPath

String

Storage path of backed up logs in the OBS bucket.

status

String

Task status

  • RUNNING: The line is being backed up.

  • SUCCESS: The backup succeeded.

  • FAIL: The backup failed.

finishedAt

Long

End time. If the creation has not been completed, the end time is null. Format: Unix timestamp.

jobTypes

String

Task type.

  • Manual: Manual backup.

  • Auto: Automatic backup.

failedMsg

String

Error information. If the task did not fail, the value of this parameter is null.

jobId

String

Task ID.

Example Requests

None

Example Responses

Status code: 200

Request succeeded.

{
  "clusterLogRecord" : [ {
    "id" : "d455a541-597e-4846-a6be-baad0ea361b1",
    "clusterId" : "4213d908-f5dc-4633-8401-cfd7175fca0c",
    "createAt" : 1656042837000,
    "logPath" : "css-backup-1610678043608/css/log",
    "status" : "RUNNING",
    "finishedAt" : null,
    "jobTypes" : "Manual",
    "failedMsg" : null,
    "jobId" : "2c9080df7c171342017c5e0884f8011c"
  } ]
}

Status Codes

Status Code

Description

200

Request succeeded.

400

Invalid request.

Modify the request before retry.

409

The request could not be completed due to a conflict with the current state of the resource.

The resource that the client attempts to create already exists, or the update request fails to be processed because of a conflict.

412

The server did not meet one of the preconditions contained in the request.

Error Codes

See Error Codes.