• Cloud Container Engine

cce
  1. Help Center
  2. Cloud Container Engine
  3. API Reference 2.0
  4. API
  5. Cluster Management
  6. Obtaining the Progress of a Specified Job

Obtaining the Progress of a Specified Job

Function

This API is used to query the progress of a specified job.

URI

GET /api/v3/projects/{project_id}/jobs/{job_id}

Table 1 describes the parameters of the API.

Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Project ID.

job_id

Yes

Job ID.

Request

N/A

Response

Response parameters:

Table 2 describes the response parameters.

Table 2 Response parameters

Parameter

Type

Description

kind

String

API type. The value is fixed to Job.

apiVersion

String

API version. The value is fixed to v3.

metadata

Table 3

Node metadata.

spec

Table 4

Node parameters.

status

Table 5

Node status.

Table 3 Data structure of the metadata field

Parameter

Type

Description

uid

String

Job ID.

creationTimestamp

String

Job creation time.

updateTimestamp

String

Job update time.

Table 4 Data structure of the spec field

Parameter

Type

Description

type

String

Job type.

clusterUID

String

ID of the cluster where the job runs.

resourceID

String

ID of the IaaS resource on which a job is executed.

resourceName

String

Name of the IaaS resource on which a job is executed.

extendParam

String

Extended parameter.

subJobs

Table 2

List of sub-jobs.

Table 5 Data structure of the status field

Parameter

Type

Description

phase

String

Job status. The value can be RUNNING, SUCCESS, FAILED, or INIT.

Example response:

{
    "kind": "Job",
    "apiVersion": "v3",
    "metadata": {
        "uid": "397eb2b9-261a-11e9-bcf7-0255ac110e1e",
        "creationTimestamp": "2019-02-01 12:09:28.712099 +0000 UTC",
        "updateTimestamp": "2019-02-01 12:10:20.649724 +0000 UTC"
    },
    "spec": {
        "type": "ScaleDownCluster",
        "clusterUID": "41932beb-2615-11e9-bfc6-0255ac110d10",
        "resourceName": "robotcluster",
        "subJobs": [
            {
                "kind": "Job",
                "apiVersion": "v3",
                "metadata": {
                    "uid": "397f0c5b-261a-11e9-bcf7-0255ac110e1e",
                    "creationTimestamp": "2019-02-01 12:09:28.716537 +0000 UTC",
                    "updateTimestamp": "2019-02-01 12:10:20.476998 +0000 UTC"
                },
                "spec": {
                    "type": "DeleteNodeVM",
                    "clusterUID": "41932beb-2615-11e9-bfc6-0255ac110d10",
                    "resourceID": "c89fb5dc-2617-11e9-bcf7-0255ac110e1e",
                    "extendParam": {
                        "jobuid": "2c90b2c168756f340168a8f6c01247cb",
                        "serverID": "16f056be-0214-48db-a781-e85a56e8f14f"
                    }
                },
                "status": {
                    "phase": "Success"
                }
            }
        ]
    },
    "status": {
        "phase": "Success"
    }
}

Status Code

Table 6 describes the status code of the API.

Table 6 Status code

Status Code

Description

200

The progress of the specified job is successfully obtained.

For details about error status codes, see Status Codes.