Updated on 2023-03-15 GMT+08:00

Querying the Job List

Function

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

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 a Project ID and Name.

cluster_id

Yes

String

ID of the cluster you want to query.

Request Parameters

None

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

clusterLogRecord

Array of clusterLogRecord objects

Cluster log entity object.

Table 3 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.