Querying the Job Center (1.1.8)

Function

This API is used to query asynchronous job details in the job center on the management plane. Asynchronous jobs include creating, closing, starting, deleting, adding, importing, exporting, and upgrading graphs, as well as adding backups.

URI

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

    Start position of the request. The default value is 0.

    limit

    No

    Integer

    Maximum number of resources displayed on a single page. The default value is 10.

    status

    No

    String

    Job status. Possible values:

    • running
    • waiting
    • success
    • failed

    graph_name

    No

    String

    Associated graph name

    startTime

    No

    String

    Job start date. Currently, only the date is supported. The format is yyyy-MM-dd, for example, 2019-03-27.

    endTime

    No

    String

    Job end date. Currently, only the date is supported. The format is yyyy-MM-dd, for example, 2019-03-27.

Request

  • Request example
    GET https://Endpoint/v1.0/{project_id}/graphs/jobs?offset=0&limit=100

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.

    jobCount

    Yes

    Integer

    Total number of jobs

    jobList

    No

    JsonArray

    Job list. For details, see Table3 Job property list.

  • Response example (successful request)
    Http Status Code: 200
    {  
    "jobCount": 136,
    "jobList": [
     {
          "jobId": "ff80808167bb90340167bc3c7b5b026a",
          "status": "success",
          "jobType": "GraphManagement",
          "jobName": "ImportGraph",
          "relatedGraph": "test1217",
          "beginTime": "2018-12-17T12:55:40",
          "endTime": "2018-12-17T12:56:32",
          "jobDetail": {
            "vertexsetPath": null,
            "edgesetPath": [
              {
                "path": "hkmovie/edge.csv",
                "log": null,
                "cause": null,
                "status": "success"
              }
            ],
            "schemaPath": [
              {
                "path": "hkmovie/schema.xml",
                "log": null,
                "cause": null,
                "status": "success"
              }
            ]
          },
          "jobProgress": 0
        },
        {
          "jobId": "ff80808167bb90340167bc5d0b1d0358",
          "status": "success",
          "jobType": "GraphManagement",
          "jobName": "DeleteGraph",
          "relatedGraph": "test1218",
          "beginTime": "2018-12-17T13:31:14",
          "endTime": "2018-12-17T13:34:48",
          "jobProgress": 0
        }
    ]
    }
  • Response example (failed request)
    Http Status Code: 400
    {
        "errCode": "GES.0001",
        "externalMessage": "Parameter error."
    }

Return Value

  • Normal

    200

  • Abnormal
    Table 3 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.