Updated on 2022-02-21 GMT+08:00

Obtaining Job Progress

Function

This API is used to query the job progress.

URI

GET /v2/{project_id}/instances/{instance_id}/assets/jobs/{job_id}

Table 1 Path parameters

Parameter

Mandatory

Type

Description

instance_id

Yes

String

Instance ID.

Minimum: 0

Maximum: 64

project_id

Yes

String

Project ID.

Minimum: 0

Maximum: 64

job_id

Yes

String

Job ID.

Minimum: 0

Maximum: 64

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token, which can be obtained by calling the IAM API (value of X-Subject-Token in the response header).

Minimum: 1

Maximum: 100000

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

id

String

Job ID.

Minimum: 1

Maximum: 128

type

String

Job type.

status

String

Job status.

  • Running: The job is being executed.

  • Success: The job is successfully executed. For an export job, you can use archive_id to download the asset package.

  • Failed: The job fails to be executed. You can view the cause of the error in the reason field.

  • Finished: The job is completed. For an export job, if the asset package is downloaded within the validity period, the job status changes from Success to Finished. In this case, the archive_id field is not returned.

reasons

Array of AssetJobReason objects

Cause of a job failure.

progress_percent

Float

Job progress percentage.

Minimum: 0

Maximum: 1

archive_id

String

ID of the asset package to download when the job is exported.

Minimum: 1

Maximum: 128

begin_time

Number

Start time of the job.

Minimum: 1

Maximum: 128

end_time

Number

End time of the job.

Minimum: 1

Maximum: 128

Table 4 AssetJobReason

Parameter

Type

Description

resource_type

String

Resource type.

resource_name

String

Resource name.

Minimum: 1

Maximum: 64

error_code

String

Error code.

Minimum: 1

Maximum: 64

error_msg

String

Error message.

Minimum: 1

Maximum: 64

Status code: 403

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

Minimum: 1

Maximum: 128

error_msg

String

Error message.

Minimum: 1

Maximum: 128

error_details

String

Error information.

Minimum: 1

Maximum: 128

request_id

String

Request ID.

Minimum: 1

Maximum: 128

Example Requests

None

Example Responses

Status code: 200

OK

{
  "id" : "ff8080814dbd65d7014dbe0d84db0013",
  "type" : "exportAsset",
  "status" : "Running",
  "reason" : [ {
    "resource_type" : "application",
    "resource_name" : "myApp",
    "error_code" : "ROMA.00000101",
    "error_msg" : "some error details here"
  } ],
  "progress_percent" : 0.35,
  "archive_id" : "string",
  "begin_time" : "2019-12-06T06:49:04Z",
  "end_time" : "2019-12-06T06:50:04Z"
}

Status code: 403

Forbidden

{
  "error_code" : "ROMA.00000101",
  "error_msg" : "error summary",
  "error_details" : "some error details here",
  "request_id" : "13760c1fe8655e61209b75665e9bef43"
}

Status Codes

Status Code

Description

200

OK

403

Forbidden

Error Codes

See Error Codes.