Updated on 2022-08-09 GMT+08:00

Querying Job Status on the Service Plane

Function

This API is used to query the execution status of a job. After asynchronous APIs such as those for querying vertices and edges or executing algorithms are used, job IDs are returned. You can use the job ID to query the execution status of a job.

URI

  • URI format
    GET /ges/v1.0/{project_id}/graphs/{graph_name}/jobs/{job_id}/status?offset=offset&limit=limit
  • 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.

    job_id

    Yes

    String

    Job ID

    offset

    No

    Integer

    Offset of a query. The default value is 0.

    limit

    No

    Integer

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

Request

  • Request example
    GET http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/jobs/{job_id}/status?offset=0&limit=2

    SERVER_URL: Address for accessing a graph. For details about its value, see Constraints of Using Service Plane APIs.

Response

  • Parameter description
    Table 2 Parameter description

    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.

    status

    No

    String

    Returned job status after the query is successful. Possible values:

    • pending
    • running
    • success
    • failed

    This parameter is left blank when the query fails.

    data

    No

    Json

    Algorithm execution result. This parameter is left blank when the query fails.

  • Parameter description
    Table 3 data parameter description

    Parameter

    Mandatory

    Type

    Description

    vertices

    No

    List

    Vertex-associated algorithm result

    edges

    No

    List

    Edge-associated algorithm result

    outputs

    No

    Json

    Other results

    data_return_size

    No

    Integer

    Number of records returned after a query

    data_offset

    No

    Integer

    Result offset of a query

    data_total_size

    No

    Integer

    Total amount of result data generated by asynchronous jobs

  • Response example (successful request)
    Http Status Code: 200
    {
        "data": {
            "outputs": {
                "data_return_size": 2,
                "vertices": [
                    {
                        "id": "Sarah",
                        "label": "user",
                        "properties": {
                            "Occupation": [
                                "other or not specified"
                            ],
                            "Name": [
                                "Sarah"
                            ],
                            "Zip-code": [
                                "55105"
                            ],
                            "Gender": [
                                "F"
                            ],
                            "Age": [
                                "18-24"
                            ]
                        }
                    },
                    {
                        "id": "Sidney",
                        "label": "user",
                        "properties": {
                            "Occupation": [
                                "writer"
                            ],
                            "Name": [
                                "Sidney"
                            ],
                            "Zip-code": [
                                "85296"
                            ],
                            "Gender": [
                                "M"
                            ],
                            "Age": [
                                "18-24"
                            ]
                        }
                    }
                ],
                "data_offset": 0,
                "data_total_size": 19
             }
        },
        "status": "success"
    }       
  • Response example (failed request)
    Http Status Code: 400
    {
      "errorMessage": "can not find job, jobId is  9440a7ebXXXXXXXXXXXXXXXXXXXX2d079a67001679122",
      "errorCode": "GES.8301"
    }

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

    The requested resource was not found.

    500 Internal Server Error

    Internal service error.

    503 Service Unavailable

    Service unavailable.