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
- The following queries are supported:
URI
POST /ges/v1.0/{project_id}/graphs/{graph_name}/jobs/{job_id}/action?action_id=export-result
Parameter | Mandatory | Type | Description |
---|---|---|---|
project_id | Yes | String | Project ID. For details about how to obtain the project ID, see Obtaining a Project ID. |
graph_name | Yes | String | Graph name |
job_id | Yes | String | ID of the job corresponding to the response |
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. |
Parameter | Mandatory | Type | Description |
---|---|---|---|
accessKey | Yes | string | AK value |
secretKey | Yes | string | SK value |
Response Parameters
Parameter | Type | Description |
---|---|---|
errorMessage | String | System prompt.
|
errorCode | String | System prompt code.
|
jobId | 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). |
Example Request
Export the execution results of an asynchronous job to an OBS file. The export path is demo_movie/, and the exported file name is louvain. After the export, the original job is deleted.
POST /ges/v1.0/{project_id}/graphs/{graph_name}/jobs/{job_id}/action?action_id=export-result{"exportPath": "demo_movie/","fileName": "louvain","obsParameters": {"accessKey": "xxxx","secretKey": "xxxx"}}
Example Response
Status code: 200
Example response (successful request)
HttpStatusCode: 200{"jobId": "f99f60f1-bba6-4cde-bd1a-ff4bdd1fd500000168232"}
Status code: 400
Example response for a failed request
HttpStatusCode: 400{"errorMessage": "graph [demo] is not found","errorCode": "GES.8011"}
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.
Exporting the Result in CSV File
- The following is an example of the algorithm execution result, for example, content of Louvain.csv:# modularity: 0.4269691347613425,#community_num: 4,#runtime: 0.003784,#data_total_size: 34#community:1,12,1...
- The following is an example Cypher query result:
- Example 1
Query statement:
match (n:user)-[r]->(m:movie) return id(n),n.Name, n.Occupation, n.Age,r.Score,m.TitleResult:
#data_total_size:1209#data_return_size:1209#data_offset:0#records:Vivian, artist, 25-34, 5, Lethal WeaponVivian, Artist, 25-34, 4, Raising ArizonaMercedes, K-12 student, Under 18, 3, Lethal WeaponMercedes, K-12 student, Under 18, 3, The Rock... - Example 2
Query statement:
match (n)-->(m) where id(n)='Vivian' return labels(m),count(*)Result:
#data_total_size:2#data_return_size:2#data_offset:0#records:user,5movie,2
- Example 1
- Function
- URI
- Request Parameters
- Response Parameters
- Example Request
- Example Response
- Status Codes
- Error Codes
- Exporting the Result in CSV File