Updated on 2022-02-22 GMT+08:00

Exporting Job Execution Results to Files

Function

This API is used to export the execution result (result) of an asynchronous job (jobId) to a file.

The following algorithms are supported:

  • PageRank, PersonalRank, and Pixie
  • Louvain, Label Propagation, and Connected Component
  • K-Core
  • SSSP, Shortest Path (including Time Window Shortest Path), Shortest Path of Vertex Sets, All Shortest Paths, and n Paths
  • Triangle Count, Cluster Coefficient, Degree Correlation, and Closeness
  • Link Prediction
  • Betweenness, edge_betweenness, and od_betweenness

URI

  • URI format
    POST /ges/v1.0/{project_id}/graphs/{graph_name}/jobs/{job_id}/action?action_id=export-result
  • 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.

    graph_name

    Yes

    String

    Graph name

    job_id

    Yes

    String

    ID of the job corresponding to the response

Request

  • Parameter description
    Table 2 Request parameters

    Parameter

    Mandatory

    Type

    Description

    exportPath

    Yes

    String

    Export path

    fileName

    No

    String

    Name of the exported file

    obsParameters

    Yes

    String

    OBS authentication parameters. For details, see Table 3.

    Table 3 obsParameters parameter description

    Parameter

    Mandatory

    Type

    Description

    accessKey

    Yes

    string

    AK value

    secretKey

    Yes

    string

    SK value

  • Request example
    POST /ges/v1.0/{project_id}/graphs/{graph_name}/jobs/{job_id}/action?action_id=export-result
    • Exporting the result to OBS
      {
          "exportPath": "demo_movie/",
          "fileName": "louvain",
          "obsParameters": {
              "accessKey": "xxxx",
              "secretKey": "xxxx"
          }
      }

Response

  • Parameter description
    Table 4 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.

    job_id

    No

    String

    ID of an asynchronous job.

    You can view the job execution status and obtain the return result by querying the job ID. For details, see Querying Job Status on the Service Plane (1.0.0).

  • Response example (successful request)
    HttpStatusCode: 200
    {
        "jobId": "f99f60f1-bba6-4cde-bd1a-ff4bdd1fd500000168232"
    }
  • Response example (failed request)
    HttpStatusCode: 400
    {
        "errorMessage": "graph [demo] is not found",
        "errorCode": "GES.8011"
    }

Return Value

  • Normal

    200

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

Exporting the Result in CSV Format

For example, the content of Louvain.csv is as follows:

# modularity: 0.4269691347613425,
#community_num: 4,
#runtime: 0.003784,
#data_total_size: 34
#community:
1,1
2,1
...