Updated on 2025-12-25 GMT+08:00

Exporting a Graph (1.0.5)

Function

This API is used to export a graph.

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

Definition

Project ID. For details about how to obtain a project ID, see Obtaining a Project ID.

Constraints

N/A

Range

The value can contain up to 64 characters. Only letters and digits are allowed.

Default Value

N/A

graph_id

Yes

String

Definition

Graph ID.

Constraints

N/A

Range

N/A

Default Value

N/A

Request Parameters

Table 2 Request header parameter

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

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

Constraints

N/A

Range

N/A

Default Value

N/A

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

graph_export_path

Yes

String

Definition

OBS path where a graph is exported.

Constraints

N/A

Range

N/A

Default Value

N/A

edge_set_name

Yes

String

Definition

Name of the folder where the edges are exported.

Constraints

N/A

Range

N/A

Default Value

N/A

vertex_set_name

Yes

String

Definition

Name of the folder where the vertices are exported.

Constraints

N/A

Range

N/A

Default Value

N/A

schema_name

Yes

String

Definition

Name of the metadata file to export.

Constraints

N/A

Range

N/A

Default Value

N/A

paginate

No

paginate object

Definition

Pagination-related settings. Starting from version 2.3.11 of the memory edition, exporting graphs defaults to paginated export.

Constraints

N/A

Range

N/A

Default Value

N/A

Table 4 paginate

Parameter

Mandatory

Type

Description

enable

No

Boolean

Definition

Whether to enable pagination.

Constraints

This parameter is unavailable for the database edition.

Range

  • true: enabled.
  • false: disabled.

Default Value

true

row_count_per_file

No

Integer

Definition

Maximum number of rows per file when exporting by page.

Constraints

N/A

Range

N/A

Default Value

10000000

num_thread

No

Integer

Definition

Number of concurrent threads when exporting by page.

Constraints

N/A

Range

N/A

Default Value

8

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

job_id

String

Definition

ID of an asynchronous job.

Range

N/A

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Definition

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.

Range

N/A

error_msg

String

Definition

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.

Range

N/A

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, the name of the exported vertex file is set_vertex, and the name of the exported metadata file is set_schema.xml.

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

{
  "graph_export_path" : "demo_movie/",
  "edge_set_name" : "set_edge",
  "vertex_set_name" : "set_vertex",
  "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": "The export path cannot be empty.",
    "error_code": "GES.7243"
}

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.