Updated on 2022-08-09 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.

A maximum of 100 thousand records can be returned for graphs of the 100-billion-edge type.

URI

  • URI format
    GET /ges/v1.0/{project_id}/graphs/{graph_name}/jobs/status?limit={limit}&offset={offset}
  • Parameter description
    Table 1 URI parameter description

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Project ID, which is used for resource isolation. For details, see Obtaining a Project ID.

    offset

    No

    Integer

    Offset of a query. The default value is 0.

    This parameter is not supported for graphs of the 100-billion-edge type.

    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.

    This parameter is not supported for graphs of the 100-billion-edge type.

Request

  • Request example
    GET /ges/v1.0/1/graphs/movie/jobs/status

Response

Table 2 Parameters

Parameter

Mandatory

Type

Description

errorMessage

No

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

No

String

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

result

Yes

String

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

jobs

No

Json

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

Table 3 Job status structure

Parameter

Mandatory

Type

Description

jobId

Yes

String

JobId

request

Yes

Json

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

status

Yes

String

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

  • Response example of a successful request (for 100-billion-edge)
    Http Status Code: 200 
    {
        "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"
                    }
                }
            },
            {
                "jobId": "6258216312399194368daa80df3-e3bd-440d-9764-74f4622a550f",
                "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": "62582163123991943680ed2761f-01f7-4fbf-b867-0a9aae6d9c12",
                "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"
    }
    
    
  • Example response of a failed request (for 100-billion-edge)
    Http Status Code: 400 
     { 
         "errorMessage": "graph : movidde not exist",
        "errorCode": "GES.8000",
        "result": "failed"
    }

Return Value

  • Normal

    200

  • Abnormal
    Table 4 Return code for failed requests

    Return Value

    Description

    400 Bad Request

    Request error.

    401 Unauthorized

    Authentication failed.

    403 Forbidden

    No operation permission.

    404 Not Found

    No resources found.

    500 Internal Server Error

    Internal service error.

    503 Service Unavailable

    Service unavailable.