Updated on 2024-12-03 GMT+08:00

Querying the Job Status

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 each job.

URI

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

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.

Response Parameters

Table 2 Response body parameters

Parameter

Type

Description

errorMessage

String

System prompt.

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

errorCode

String

System prompt.

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

status

String

Job status when the query is successful. The options are:

  • pending
  • running
  • success
  • failed

This parameter is left blank when the query fails.

data

Object

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

Table 3 data parameter description

Parameter

Type

Description

vertices

List

Vertex-associated algorithm result

edges

List

Edge-associated algorithm result

outputs

Object

Other results

data_return_size

Integer

Number of records returned after a query

data_offset

Integer

Result offset of a query

data_total_size

Integer

Total amount of result data generated by asynchronous jobs

Example Request

Query the execution status of a job. The query offset is 0, and the maximum number of returned results is 2.

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 Using Service Plane APIs.

Example Response

Status code: 200

Example response for a 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"
}       

Status code: 400

Example response for a failed request
Http Status Code: 400
{
"errorMessage":"graph [demo] is not found",
"errorCode":"GES.8402"
}

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.