Updated on 2023-06-26 GMT+08:00

Obtaining Job Details

Function

This API is used to obtain job details.

URI

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

Table 1 Path parameters

Parameter

Type

Mandatory

Description

project_id

String

Yes

Tenant's project ID.

job_id

String

Yes

Job ID.

Table 2 Query parameters

Parameter

Type

Mandatory

Description

instance_id

String

No

Component instance ID.

limit

Integer

No

Number of specified records.

offset

Integer

No

Offset.

desc

String

No

Whether query results are displayed in descending order.

Value: true (descending order) or false (ascending order).

Request

None

Response

Table 3 Parameters

Parameter

Type

Description

task_count

Integer

Number of tasks.

job

Object

Job parameters. See Table 4.

tasks

Array<Object>

Task parameters. See Table 5.

Table 4 job parameters

Parameter

Type

Description

CREATED_BY

String

Creator.

EXECUTION_STATUS

String

Execution status.

  • SUBMITTED
  • SCHEDULED
  • RUNNING
  • FAILED
  • SUCCEEDED
  • CANCELLED
  • PARTIALLY_FAILED
  • ROLLBACKING
  • ROLLBACKED
  • UNKNOWN

JOB_DESC

String

Job description.

JOB_ID

String

Job ID.

JOB_NAME

String

Job name.

JOB_TYPE

String

Type.

  • PROVISION
  • DEPROVISION
  • DAILY_OPERATION
  • SYSTEM_INNER
  • UNKNOWN

ORDER_ID

String

Order ID.

PROJECT_ID

String

Tenant's project ID.

SERVICE_INSTANCE_ID

String

Instance ID.

Table 5 task parameters

Parameter

Type

Description

CREATED_AT

String

Creation time.

LAST_HEALTH_CHECK

String

Health check time.

MESSAGES

String

Message.

OWNER_ID

String

Creator ID.

TASK_ID

String

Task ID.

TASK_INDEX

Integer

Task index.

TASK_NAME

String

Task name.

TASK_STATUS

String

Task status.

  • SUBMITTED
  • SCHEDULED
  • RUNNING
  • FAILED
  • SUCCEEDED
  • CANCELLED
  • PARTIALLY_FAILED
  • SKIPPED
  • ROLLBACKING
  • ROLLBACKED
  • UNKNOWN

TASK_TYPE

String

Task type.

  • kube
  • restful
  • sleep
  • echo
  • context
  • sub-job

Example

Example request

None

Example response

{
    "job": {
        "JOB_ID": "JOB474362ef-091d-429f-9b3e-c9246b37dee6", 
        "JOB_NAME": "provision/provMain", 
        "JOB_TYPE": "PROVISION", 
        "SERVICE_INSTANCE_ID": "429a35a0-dee8-4648-86f6-d1f8bc74ba52", 
        "PROJECT_ID": "063a3158b1a34710b36ad208b9497d00", 
        "ORDER_ID": "", 
        "JOB_DESC": "provision/provMain", 
        "EXECUTION_STATUS": "FAILED", 
        "CREATED_BY": "585cc5c16cda4954b28d4eb460f06261"
    }, 
    "tasks": [
        {
            "MESSAGES": "{}", 
            "TASK_ID": "Task-bc64b46c-1688-4787-b7ff-87cb53b346ea", 
            "TASK_TYPE": "echo", 
            "TASK_INDEX": 1, 
            "TASK_NAME": "SEPARATOR_PREPARE_RESOURCES", 
            "TASK_STATUS": "SUCCEEDED", 
            "LAST_HEALTH_CHECK": "2020-02-04T04:01:03.344Z", 
            "CREATED_AT": "2020-02-04T04:01:03.344Z", 
            "OWNER_ID": "cas-mgr-69bb87d7c-wpqwb:30114"
        }, 
        {
            "MESSAGES": "{}", 
            "TASK_ID": "Task-15ec252f-bca0-401e-ae5b-798a639df92e", 
            "TASK_TYPE": "echo", 
            "TASK_INDEX": 4, 
            "TASK_NAME": "SEPARATOR_BUILDING", 
            "TASK_STATUS": "SUCCEEDED", 
            "LAST_HEALTH_CHECK": "2020-02-04T04:01:03.346Z", 
            "CREATED_AT": "2020-02-04T04:01:03.345Z", 
            "OWNER_ID": "cas-mgr-69bb87d7c-wpqwb:30114"
        }, 
        {
            "MESSAGES": "{}", 
            "TASK_ID": "Task-52a5d1ae-2c54-46ec-8134-53e7b6a45fb7", 
            "TASK_TYPE": "restful", 
            "TASK_INDEX": 6, 
            "TASK_NAME": "TN00091", 
            "TASK_STATUS": "SUCCEEDED", 
            "LAST_HEALTH_CHECK": "2020-02-04T04:01:08.924Z", 
            "CREATED_AT": "2020-02-04T04:01:03.346Z", 
            "OWNER_ID": "cas-mgr-69bb87d7c-wpqwb:30114"
        }, 
        {
            "MESSAGES": "{}", 
            "TASK_ID": "Task-a149b585-d31b-4c72-a665-d820efcb0bf9", 
            "TASK_TYPE": "restful", 
            "TASK_INDEX": 7, 
            "TASK_NAME": "TN00094", 
            "TASK_STATUS": "SUCCEEDED", 
            "LAST_HEALTH_CHECK": "2020-02-04T04:01:08.961Z", 
            "CREATED_AT": "2020-02-04T04:01:08.925Z", 
            "OWNER_ID": "cas-mgr-69bb87d7c-wpqwb:30114"
        }, 
        {
            "MESSAGES": "{
  \"Message\" : \"ECC00011\",
  \"Detail\" : \"Building failed.\"
}", 
            "TASK_ID": "Task-a72fe8d8-8cc1-42b5-a097-0cf9e29692a7", 
            "TASK_TYPE": "restful", 
            "TASK_INDEX": 9, 
            "TASK_NAME": "TN00097", 
            "TASK_STATUS": "FAILED", 
            "LAST_HEALTH_CHECK": "2020-02-04T04:01:38.975Z", 
            "CREATED_AT": "2020-02-04T04:01:08.962Z", 
            "OWNER_ID": "cas-mgr-69bb87d7c-wpqwb:30114"
        }
    ], 
    "task_count": 5
}

Status Code

Table 6 Status codes

Status Code

Description

200

OK

400

Bad Request

404

Not Found

500

Internal Server Error

Error Code

Error code must be in the format of SVCSTG.00100.[Error_ID]. Example: SVCSTG.00100400. See Error Codes of Application Management APIs.