Updated on 2024-10-16 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

Mandatory

Type

Description

project_id

Yes

String

Tenant's project ID. See Obtaining a Project ID.

job_id

Yes

String

Deployment job ID, which is job_id in the response parameter in Creating an Application Component Instance.

Table 2 Query parameters

Parameter

Mandatory

Type

Description

instance_id

No

String

Component instance ID. See Obtaining All Component Instances.

limit

No

Integer

Number of specified records.

offset

No

Integer

Offset.

desc

No

String

Whether query results are displayed in descending order.

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

Request

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

Message body type (format). Default value: application/json;charset=utf8.

X-Auth-Token

Yes

String

API calling can be authenticated using a token or AK/SK. If you use a token, this parameter is mandatory and must be set to the token. For details about how to obtain a token, see Obtaining a User Token.

Response

Table 4 Response parameters

Parameter

Type

Description

task_count

Integer

Number of tasks.

job

Object

Job parameters. See Table 5.

tasks

Array<Object>

Task parameters. See Table 6.

Table 5 job

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 6 task

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: Kubernetes task
  • restful: RESTful HTTP request task
  • sleep: sleep waiting task
  • echo: output task
  • context
  • sub-job

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

Status Code

Description

200

OK

400

Bad Request

404

Not Found

500

Internal Server Error

Error Code

The error code format is SVCSTG.00100.[Error_ID], for example, SVCSTG.00100400. For details, see ServiceStage Error Codes.