Updated on 2024-01-04 GMT+08:00

Querying the Job List

Function

After the ID of an asynchronous job is returned, if the job ID at the service layer is lost and cannot be obtained through the API, a new API is provided to query all asynchronous jobs stored in the engine. The job ID, job status, and original request of each job are returned.

URI

GET /ges/v1.0/{project_id}/graphs/{graph_name}/jobs/status?limit={limit}&offset={offset}
Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain the project ID, see Obtaining a Project ID.

offset

No

Integer

Offset of a query. The default value is 0.

job_id

Yes

String

ID of the job corresponding to the response

limit

No

Integer

Maximum number of records that can be queried. The default value is 100000.

Request Parameters

For details, see the URI parameters.

Response Parameters

Table 2 Response body parameters

Parameter

Type

Description

errorMessage

String

System prompt.

  • If execution succeeds, this parameter may be left blank.
  • If execution fails, this parameter is used to display the error message.

errorCode

String

System prompt code.

  • If execution succeeds, this parameter may be left blank.
  • If execution fails, this parameter is used to display the error code.

result

String

Query result. If the query is successful, the value is success. If the query fails, the value is failed.

jobs

Object

Job status list stored in the system. If execution succeeds, this parameter is contained in the response. Table 3 describes the structure of a single jobs field.

Table 3 Job status structure

Parameter

Type

Description

jobId

String

Job name.

request

Object

Request content, including the command, URL, and body.

status

String

Job status. The value can be pending, running, or complete.

Example Request

Query the job list and return the job ID and status of each job.

GET /ges/v1.0/{project_id}/graphs/movie/jobs/status?limit=2&offset=0

Example Response

Status code: 200

Example response for a successful request

{
    "jobs": [
        {
            "jobId": "62582163123991943683d0f9aa3-f701-48be-a662-360e6a0455da",
            "status": "complete",
            "request": {
                "command": "import_graph",
                "url": "/ges/v1.0/10001/graphs/moviejx/action?action_id=import-graph",
                "body": {
                    "edgesetPath": "file:///root/ges-install/auDatas/ranking_edge-sp.csv",
                    "vertexsetPath": "file:///root/ges-install/auDatas/movies_vertex_new.csv",
                    "schemaPath": "file:///root/ges-install/auDatas/schema_aikv.xml.bak"
                }
            }
        },
        {
            "jobId": "62582163123991943683fe74caf-f4d3-48b3-b3ee-66daaedcd2ca",
            "status": "complete",
            "request": {
                "command": "import_graph",
                "url": "/ges/v1.0/10001/graphs/moviejx/action?action_id=import-graph",
                "body": {
                    "edgesetPath": "file:///root/ges-install/auDatas/ranking_edge-sp.csv",
                    "vertexsetPath": "file:///root/ges-install/auDatas/movies_vertex_new.csv",
                    "schemaPath": "file:///root/ges-install/auDatas/schema_aikv.xml.bak"
                }
            }
        }
    ],
    "result": "success"
}

Status code: 400

Example response for a failed request

Http Status Code: 400 
 { 
     "errorMessage": "graph : movidde not exist",
    "errorCode": "GES.8000",
    "result": "failed"
}

Status Codes

Return Value

Description

400 Bad Request

Request error.

401 Unauthorized

Authorization failed.

403 Forbidden

No operation permissions.

404 Not Found

No resources found.

500 Internal Server Error

Internal server error.

503 Service Unavailable

Service unavailable.

Error Codes

See Error Codes.