Updated on 2023-11-23 GMT+08:00

Querying Details of a Batch Job

Function

This API is used to query details of a batch job.

URI

GET /v2/{project_id}/productmgr/jobs/{job_id}

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.

job_id

Yes

String

Batch job ID.

Request

Table 2 Parameters in the request header

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. The token can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

ief-instance-id

No

String

Platinum edition instance ID. This parameter is left blank for a professional edition instance.

Content-Type

Yes

String

Message body type (format). The default value is application/json.

Response

Status code: 200

Table 3 Parameters in the response body

Parameter

Type

Description

job_id

String

Batch job ID.

job_name

String

Batch job name.

job_type

String

Batch job type, including node_upgrade (node upgrade), deployment_deploy (application deployment), and deployment_upgrade (application upgrade).

description

String

Description

created_at

Integer

Creation time.

status

String

Execution status.

task_total_count

Integer

Total number of tasks.

task_failed_count

Integer

Number of successfully tasks.

task_success_count

Integer

Number of failed tasks.

target_type

String

Batch job target type, including node (edge node), node_group (edge node group), and deployment (edge application).

task_data

String

Batch job content. This parameter is mandatory only for batch application deployment and upgrade. The value is the deployment parameter in the request body of the API for creating a deployment compiled in the JSON format. The value should be converted into a string.

tasks

Array of Task objects

Details of job tasks.

targets

Array of Target objects

Batch job target details.

status_last_updated_at

Integer

Time when the status was updated.

Table 4 Task

Parameter

Type

Description

task_id

String

Task ID.

task_name

String

Task name.

status

String

Task status.

reason

String

Task failure cause.

created_at

Integer

Creation time.

target_id

String

Batch job target ID.

extension_info

Array of Extension objects

Basic information about the batch job target.

Table 5 Target

Parameter

Type

Description

extension_info

Array of Extension objects

Basic information about the batch job target.

target_id

String

Batch job target ID.

Table 6 Extension

Parameter

Type

Description

key

String

Attribute name. The value can be node_name.

value

String

Attribute value.

Example Request

None

Example Response

Status code: 200

Query succeeded.

{
  "job_name" : "aaa",
  "job_id" : "66273c66-f72e-4607-8769-3663d255fb83",
  "job_type" : "deployment_deploy",
  "target_type" : "node",
  "description" : "",
  "targets" : [ {
    "target_id" : "72eb5df1-295b-41f6-baed-d1a56728b0e0",
    "extension_info" : [ {
      "key" : "node_name",
      "value" : "test1"
    } ]
  }, {
    "target_id" : "b1c0e722-ee98-4ae3-9224-881224cb32c9",
    "extension_info" : [ {
      "key" : "node_name",
      "value" : "test2"
    } ]
  } ],
  "task_data" : "{\"deployment\":{\"replicas\":1,\"template\":{\"configs\":{\"host_network\":false,\"restart_policy\":\"Always\",\"host_pid\":false},\"containers\":[{\"name\":\"container-06fefd36\",\"version\":\"latest\",\"image_url\":\"sample:latest\",\"envs\":[],\"volumes\":[],\"resources\":{\"limits\":{\"cpu\":\"0.25\",\"memory\":\"512\"},\"requests\":{\"cpu\":\"0.25\",\"memory\":\"512\"}},\"privileged\":false,\"ports\":[]}]}},\"source\":\"userdefined\",\"name_prex\":\"aaa\",\"tags\":[],\"description\":\"\"}",
  "status" : "Successful",
  "created_at" : 1667218308,
  "status_last_updated_at" : 1667218329,
  "tasks" : [ {
    "task_name" : "aaa-c530d",
    "task_id" : "382cca3e-88e6-4a7c-bf23-b637a99761f9",
    "target_id" : "72eb5df1-295b-41f6-baed-d1a56728b0e0",
    "status" : "Successful",
    "created_at" : 1667218324,
    "reason" : "",
    "extension_info" : [ {
      "key" : "deployment_id",
      "value" : "9bdefd92-c724-41f4-b07a-4b1061e096d6"
    } ]
  }, {
    "task_name" : "aaa-ce854",
    "task_id" : "ac04605b-c286-4f23-97e0-fe08366c36f5",
    "target_id" : "b1c0e722-ee98-4ae3-9224-881224cb32c9",
    "status" : "Successful",
    "created_at" : 1667218325,
    "reason" : "",
    "extension_info" : [ {
      "key" : "deployment_id",
      "value" : "4b4c7b0c-7ee8-4a7e-b79e-9291b7fd365d"
    } ]
  } ],
  "task_total_count" : 2,
  "task_failed_count" : 2,
  "task_success_count" : 0
}

Status Codes

Status Code

Description

200

Query succeeded.

Error Codes

For details, see Error Codes.