Updated on 2024-01-04 GMT+08:00

Exporting a Graph

Function

This API is used to unbind an EIP.

The database edition 2.3.14 or later supports this function.

URI

POST /v2/{project_id}/graphs/{graph_id}/export-graph

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.

graph_id

Yes

String

Graph ID

Request Parameters

Table 2 Request header parameter

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

It is used to obtain the permission to call APIs. For details about how to obtain the token, see Authentication. The value of X-Subject-Token in the response header is the token.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

graph_export_path

Yes

String

OBS path to which a graph is exported

edge_set_name

Yes

String

Exported edge file name

vertex_set_name

Yes

String

Exported vertex file name

schema_name

Yes

String

Name of the exported metadata file

paginate

No

paginate object

Pagination-related parameters. In memory edition 2.3.11 or later, graphs are exported on multiple pages by default.

Table 4 paginate

Parameter

Mandatory

Type

Description

enable

No

Boolean

Whether to enable pagination. The default value is true. If pagination is not required, set this parameter to false.

NOTE:

This parameter is unavailable for database editions.

row_count_per_file

No

Integer

Maximum number of rows in each file when graphs are exported by page. The default value is 10000000.

num_thread

No

Integer

Number of concurrent threads when graphs are exported by page. The default value is 8.

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

job_id

String

ID of an asynchronous job

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

System prompt code.

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

error_msg

String

System prompt code.

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

Example Request

Export a graph. The OBS path for exporting the graph is demo_movie/, the name of the exported edge file is set_edge.csv, the name of the exported vertex file is set_vertex.csv, and the name of the exported metadata file is set_schema.xml.

POST http://Endpoint/v2/{project_id}/graphs{graph_id}/export-graph

{
  "graph_export_path" : "demo_movie/",
  "edge_set_name" : "set_edge.csv",
  "vertex_set_name" : "set_vertex.csv",
  "schema_name" : "set_schema.xml"
}

Example Response

Status code: 200

Example response for a successful request

{
  "job_id" : "f99f60f1-bba6-4cde-bd1a-ff4bdd1fd500000168232"
}

Status code: 400

Example response for a failed request

{
  "error_msg" : "graph [demo] is not found",
  "error_code" : "GES.8011"
}

Status Code

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 Code

See Error Code.