Incrementally Importing Data to Graphs (1.0.5)

Function

This API is used to import data to graphs incrementally.

To prevent failures in restoring the imported graph data during system restarting, do not delete the data stored on OBS when the graph is in use.

URL

  • URI format
    POST  /v1.0/{project_id}/graphs/{graph_id}/action?action_id=import-graph
  • 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_id

    Yes

    String

    Graph ID

Request

  • Request example
    POST http://Endpoint/v1.0/{project_id}/graphs/{graph_id}/action?action_id=import-graph
    {
      "edgesetPath": "testbucket/demo_movie/edges/",
      "edgesetFormat": "csv",
      "vertexsetPath": "testbucket/demo_movie/vertices/",
      "vertexsetFormat": "csv",
      "schemaPath": "testbucket/demo_movie/incremental_data_schema.xml",
      "logDir": "testbucket/importlogdir",
      "parallelEdge": "override"
    }
  • Parameter description
    Table 2 Request body parameter description

    Parameter

    Mandatory

    Type

    Description

    edgesetPath

    Yes

    String

    Edge file directory or name

    edgesetFormat

    No

    String

    Format of the edge data set. Currently, only the CSV format is supported.

    The CSV format is used by default.

    vertexsetPath

    No

    String

    Vertex file directory or name

    vertexsetFormat

    No

    String

    Format of the vertex data set. Currently, only the CSV format is supported.

    The CSV format is used by default.

    schemaPath

    Yes

    String

    OBS path of the metadata file of the new data

    logDir

    No

    String

    Directory for storing logs of imported graphs. This directory stores the data that fails to be imported during graph creation and detailed error causes.

    parallelEdge

    No

    String

    Processing mode of repetitive edges. The value can be allow, ignore, or override. The default value is allow.

    • allow indicates that repetitive edges are allowed.
    • ignore indicates that subsequent repetitive edges are ignored.
    • override indicates that the previous repetitive edges are overwritten.
    • For details about the value validity of the edgesetPath, vertexsetPath, schemaPath, and logDir character strings, see the OBS Object Name Restrictions.

Response

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

    NOTE:

    You can view the job execution status and obtain the return result by querying the job ID. For details, see Job Management APIs.

  • Response example (successful request)
    Http Status Code: 200
    {
    "jobId": "b4f2e9a0-0439-4edd-a3ad-199bb523b613"
    }
  • Response example (failed request)
    Http Status Code: 400
    {
    "errorMessage": "parameter format error",
    "errorCode": "GES.8013"
    }

Return Value

  • Normal

    200

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