Help Center/ Enterprise Switch/ API Reference/ Enterprise Switch/ Querying the Job Execution Status
Updated on 2025-12-04 GMT+08:00

Querying the Job Execution Status

Function

This API is used to query the information about jobs of a specified resource. COMPLETED indicates that the job has been successfully completed. RUNNING indicates that the job is being executed. FAILED indicates that the job fails to be executed.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the following required identity policy-based permissions. For details about the required permissions, see Permissions Policies and Supported Actions.

Action

Access Level

Resource Type (*: required)

Condition Key

Alias

Dependencies

esw:job:listResourceRelatedJobs

List

-

-

-

-

URI

GET /v3/{project_id}/l2cg/resources/{resource_id}/jobs

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

  • Definition: ID of the project to which the enterprise switch belongs.

  • Constraints: N/A

  • Range: N/A

  • Default value: N/A

resource_id

Yes

String

  • Definition: Unique ID of the enterprise switch.

  • Constraints: The value is in the UUID format with hyphens (-).

  • Range: N/A

  • Default value: N/A

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

limit

No

Integer

  • Definition: Number of records returned on each page.

  • Constraints: limit must be used together with marker. For details, see the description of marker.

  • Value range: 0 to 2^31 – 1

  • Default value: 2000

marker

No

String

  • Definition: A resource ID for pagination query, indicating that the query starts from the next record of the specified resource ID.

  • Constraints: marker must be used together with limit.

    • If parameters marker and limit are not specified, all resource records on the first page will be returned.

    • If marker is not specified and limit is set to 10, the first 10 resource records will be returned.

    • If marker is set to the resource ID of the tenth record and limit is set to 10, the 11th to 20th resource records will be returned.

    • If marker is set to the resource ID of the tenth record and limit is not specified, the 11th to 2000th resource records will be returned (the default value of limit is 2000).

  • Range: N/A

  • Default value: N/A

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

jobs

Array of Job objects

  • Definition: Response body for querying the jobs.

  • Constraints: N/A

  • Range: N/A

  • Default value: N/A

page_info

PageInfo object

  • Definition: Pagination information.

  • Constraints: N/A

  • Range: N/A

  • Default value: N/A

request_id

String

  • Definition: Unique request ID.

  • Constraints: The value is in the UUID format.

  • Range: N/A

  • Default value: N/A

Table 4 Job

Parameter

Type

Description

id

String

  • Definition: Unique job ID.

  • Constraints: The value is in the UUID format with hyphens (-).

  • Range: N/A

  • Default value: N/A

name

String

  • Definition: Name of the current job.

  • Constraints: N/A

  • Range: N/A

  • Default value: N/A

status

String

  • Definition: Job status.

  • Constraints: N/A

  • Range:

    • RUNNING

    • FAILED

    • COMPLETED

  • Default value: N/A

begin_time

String

  • Definition: Time when the job was started.

  • Constraints: The value is a UTC time in the format of yyyy-MM-ddTHH:mm:ss.

  • Range: N/A

  • Default value: N/A

end_time

String

  • Definition: Time when the job was completed.

  • Constraints:

    • The value is a UTC time in the format of yyyy-MM-ddTHH:mm:ss.

    • This parameter is displayed only when the job status is FAILED or COMPLETED.

  • Range: N/A

  • Default value: N/A

process

String

  • Definition: Current job progress, displayed as a percentage.

  • Constraints: This parameter is displayed only when the job status is RUNNING.

  • Range: N/A

  • Default value: N/A

fail_reason

String

  • Definition: The reason why the job fails.

  • Constraints: This parameter is displayed only when the job status is FAILED.

  • Range: N/A

  • Default value: N/A

resource_id

String

  • Definition: ID of the resource associated with the job.

  • Constraints: N/A

  • Range: N/A

  • Default value: N/A

resource_name

String

  • Definition: Name of the resource associated with the job.

  • Constraints: N/A

  • Range: N/A

  • Default value: N/A

resource_type

String

  • Definition: Type of the resource associated with the job.

  • Constraints: N/A

  • Range:

    • instance: enterprise switch

  • Default value: N/A

project_id

String

  • Definition: ID of the project to which the enterprise switch belongs.

  • Constraints: N/A

  • Range: N/A

  • Default value: N/A

Table 5 PageInfo

Parameter

Type

Description

next_marker

String

  • Definition: The last record on the current page. The parameter next_marker does not exist on the last page.

  • Constraints: N/A

  • Range: N/A

  • Default value: N/A

previous_marker

String

  • Definition: ID of the resource from which the pagination query starts. If the parameter is left blank, only resources on the first page are queried.

  • Constraints: N/A

  • Range: N/A

  • Default value: N/A

current_count

Integer

  • Definition: Total number of records on the current page.

  • Constraints: N/A

  • Range: N/A

  • Default value: N/A

Example Requests

GET https://{{endpoint}}/v3/88104fcc62a640bfa0a0bf687607621c/l2cg/resources/3bbe7af1-1355-4e41-9fee-721bd80de2ab/jobs

Example Responses

Status code: 200

The GET operation is successful. For more status codes, see Status Codes.

{
  "request_id" : "f8ef8704d8eb6a13988a01f4e37307fc",
  "jobs" : [ {
    "name" : "DeleteHAInstance",
    "id" : "25578d6b-7394-48fd-b647-3308c476cb6d",
    "status" : "COMPLETED",
    "resource_id" : "3bbe7af1-1355-4e41-9fee-721bd80de2ab",
    "resource_name" : "esw-fee1",
    "resource_type" : "instance",
    "project_id" : "88104fcc62a640bfa0a0bf687607621c",
    "begin_time" : "2025-10-22T03:25:41",
    "end_time" : "2025-10-22T03:25:43"
  }, {
    "name" : "CreateHAInstance",
    "id" : "71c1c3fc-c2ab-4d78-8964-b38b270dcde8",
    "status" : "FAILED",
    "resource_id" : "3bbe7af1-1355-4e41-9fee-721bd80de2ab",
    "resource_name" : "esw-fee1",
    "resource_type" : "instance",
    "project_id" : "88104fcc62a640bfa0a0bf687607621c",
    "begin_time" : "2025-10-22T03:23:13",
    "end_time" : "2025-10-22T03:25:01",
    "fail_reason" : "WaitCreateServerJobTask Failed"
  } ],
  "page_info" : {
    "previous_marker" : "25578d6b-7394-48fd-b647-3308c476cb6d",
    "current_count" : 2
  }
}

Status Codes

Status Code

Description

200

The GET operation is successful. For more status codes, see Status Codes.

Error Codes

See Error Codes.