Updated on 2025-07-11 GMT+08:00

Querying the Resource Task List

Function

This API is used to query the resource task list.

Calling Method

For details, see Calling APIs.

URI

GET /v5/{project_id}/p2c-vpn-gateways/jobs

Table 1 Parameter description

Parameter

Type

Mandatory

Description

project_id

String

Yes

Specifies a project ID. You can obtain the project ID by referring to Obtaining the Project ID.

Table 2 Parameter in a query request

Parameter

Type

Mandatory

Description

resource_id

String

No

Specifies a resource ID.

Request

  • Request parameters

    None

  • Example request
    1. Query all resource tasks.
      GET https://{Endpoint}/v5/{project_id}/p2c-vpn-gateways/jobs
    2. Query resource tasks based on a specified resource ID.
      GET https://{Endpoint}/v5/{project_id}/p2c-vpn-gateways/jobs?resource_id={resource_id}

Response

  • Response parameters

    Returned status code 200: successful query

    Table 3 Parameters in the response body

    Parameter

    Type

    Description

    jobs

    Array of Job objects

    Specifies task information.

    request_id

    String

    Specifies a request ID.

    Table 4 Job

    Parameter

    Type

    Description

    id

    String

    • Specifies a task ID.
    • The value is a UUID containing 36 characters.

    resource_id

    String

    • Specifies a VPN gateway resource ID.
    • The value is a UUID containing 36 characters.

    job_type

    String

    • Specifies a task type.
    • The value can be upgrade or rollback.

    status

    String

    • Specifies the status of the VPN gateway.
    • Value range:

      upgrading: The upgrade is in progress.

      pending_upgrade_confirm: The upgrade is to be committed.

      success: The upgrade is successful.

      rolling_back: The rollback is in progress.

      rollback_success: The rollback is successful.

      fail: The upgrade fails.

    created_at

    String

    • Specifies the creation time.
    • The UTC time format is yyyy-MM-ddTHH:mm:ss.SSSZ.

    finished_at

    String

    • Specifies the end time.
    • The UTC time format is yyyy-MM-ddTHH:mm:ss.SSSZ.

    error_message

    String

    • Indicates error information.

    sub_jobs

    Array of SubJob objects

    • Specifies the subtask list.
    Table 5 SubJob

    Parameter

    Type

    Description

    id

    String

    • Specifies a task ID.
    • The value is a UUID containing 36 characters.

    job_type

    String

    • Specifies a task type.
    • Value range:
      • prepare_resource
      • upgrade_worker_1
      • upgrade_worker_2

    status

    String

    • Specifies the task status.
    • Value range:
      • init: initializing
      • upgrading: The upgrade is in progress.
      • success: The upgrade is successful.
      • fail: The upgrade fails.

    created_at

    String

    • Specifies the creation time.
    • The UTC time format is yyyy-MM-ddTHH:mm:ss.SSSZ.

    finished_at

    String

    • Specifies the end time.
    • The UTC time format is yyyy-MM-ddTHH:mm:ss.SSSZ.

    error_message

    String

    • Indicates error information.
  • Example response
    {
        "request_id": "8dfd314d50caab38ccc40e4df2213eda",
        "jobs": [
            {
                "id": "e3be04c3-0b62-45d8-b1dc-f4785c96412e",
                "resource_id": "b3eb2b86-2a6d-41f2-835f-879021764b84",
                "job_type": "upgrade",
                "status": "success",
                "created_at": "2025-06-04T03:29:01.855Z",
                "finished_at": "2025-06-04T03:29:33.085Z",
                "sub_jobs": [
                   {
                        "id": "80c103ab-61b9-4e74-8e47-fd78ac6177eb",
                        "job_type": "prepare_resource",
                        "status": "success",
                        "created_at": "2025-06-04T11:28:01.926+08:00",
                        "finished_at": "2025-06-04T11:29:03.993+08:00",
                        "error_message": ""
                    },
                    {
                        "id": "b035cd1c-b9f4-4b05-b9af-b8fcf75eae6a",
                        "job_type": "upgrade_worker_1",
                        "status": "success",
                        "created_at": "2025-06-04T11:29:01.926+08:00",
                        "finished_at": "2025-06-04T11:29:14.993+08:00",
                        "error_message": ""
                    },
                    {
                        "id": "db3dabe1-60a0-45ff-91b7-735aff90a3dd",
                        "job_type": "upgrade_worker_2",
                        "status": "success",
                        "created_at": "2025-06-04T11:29:01.931+08:00",
                        "finished_at": "2025-06-04T11:29:33.037+08:00",
                        "error_message": ""
                    }
                ]
            }
    }

Status Codes

For details, see Status Codes.