From 5eeaba6a479cb6402ff5222fcb29e205215fd5c7 Mon Sep 17 00:00:00 2001 From: zhangwh807 Date: Wed, 16 Oct 2024 09:55:41 +0800 Subject: [PATCH] Update the RESTful API documentation and Official Website (#703) --- README.md | 2 +- README_CN.md | 2 +- docs/en-US/source/15.contacts.md | 2 +- .../source/7.client-tools/7.restful-api.md | 295 +++--------------- docs/zh-CN/source/15.contacts.md | 2 +- .../source/7.client-tools/7.restful-api.md | 292 +++-------------- 6 files changed, 75 insertions(+), 520 deletions(-) diff --git a/README.md b/README.md index 123a8222fc..323b483760 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ NOTICE: If you want to contribute code, you should sign a [cla doc](https://cla- ## 6. Contact -Official Website: [www.tugraph.org](https://www.tugraph.org) +Official Website: [tugraph.tech](https://tugraph.tech) Slack (For developer quick communication): [TuGraph.slack](https://join.slack.com/t/tugraph/shared_invite/zt-1hha8nuli-bqdkwn~w4zH1vlk0QvqIfg) diff --git a/README_CN.md b/README_CN.md index 01f8773323..3cc5348bb0 100644 --- a/README_CN.md +++ b/README_CN.md @@ -97,7 +97,7 @@ $ make package ## 5. 联系我们 -官网: [www.tugraph.org](https://www.tugraph.org) +官网: [tugraph.tech](https://tugraph.tech) Slack (在线开发沟通): [TuGraph.slack](https://join.slack.com/t/tugraph/shared_invite/zt-1hha8nuli-bqdkwn~w4zH1vlk0QvqIfg) diff --git a/docs/en-US/source/15.contacts.md b/docs/en-US/source/15.contacts.md index fb28a5f1aa..edde354f9a 100644 --- a/docs/en-US/source/15.contacts.md +++ b/docs/en-US/source/15.contacts.md @@ -2,7 +2,7 @@ If you have any feedback or suggestions for the product, You are welcome to join the discussion or make suggestions through the following contact methods. -Official website: [www.tugraph.org](https://www.tugraph.org) +Official website: [tugraph.tech](https://tugraph.tech) Github Issue: [Issue](https://github.com/TuGraph-db/tugraph-db/issues) diff --git a/docs/en-US/source/7.client-tools/7.restful-api.md b/docs/en-US/source/7.client-tools/7.restful-api.md index b5679e97fd..fed821e48b 100644 --- a/docs/en-US/source/7.client-tools/7.restful-api.md +++ b/docs/en-US/source/7.client-tools/7.restful-api.md @@ -29,23 +29,24 @@ The user sends the login request to the server with the user name and password. - **METHOD**: POST - **REQUEST**: -| body parameter | parameter description | parameter type | necessary | -| ------- |-----------------------|-------|------------| -| userName | name of the user | string | yes | -| password | password of the user | string | yes | +| body parameter | parameter description | parameter type | necessary | +|----------------|-----------------------|-------|------------| +| user | name of the user | string | yes | +| password | password of the user | string | yes | - **RESPONSE**: -If successful, the success field in the returned response message will be set to 00 and the token will be included in data + If successful, the success field in the returned response message will be set to 00 and the token will be included in data -| body parameter | parameter description | parameter type | necessary | -| ------- |-------|--------|------| -| authorization | token | string | yes | -| default_password | whether the password is the default password | bool | yes | +| body parameter | parameter description | parameter type | +|------------------|------------------|----------------| +| jwt | token | string | +| is_admin | Whether the user is an admin | bool | +| default_password | Whether it is the default password | bool | **Example request.** ``` - {"userName" : "test", "password" : "123456"} + {"user" : "admin", "password" : "73@TuGraph"} ``` #### 2.2.2. User Logout @@ -54,10 +55,18 @@ When a user logs out, the authenticated token is deleted. and the user needs to - **URI**: /logout - **METHOD**: POST - **REQUEST**: -The http request header carries the token returned by login interface, and the body has no parameters + The http request header carries the token returned by login interface. The specific string to be filled is `Bearer ${jwt}`, where `${jwt}` is the "jwt" returned from the login interface,and the body has no parameters + +| header parameter | parameter description | parameter type | +|------------------|-----------------------|------------| +| Authorization | Bearer ${jwt} | string | - **RESPONSE**: -If successful, the success field in the returned response message will be set to 00, and data is empty + If successful, the success field in the returned response message will be set to 00, and data is + +| body parameter | parameter description | parameter type | +|------------------|--------------------|----------------| +| is_admin | Whether the user is an admin | bool | #### 2.2.3. Refresh Token If the delivered token becomes invalid, you need to invoke this interface for re-authentication. The token is valid within one hour after the first login and needs to be refreshed @@ -65,14 +74,19 @@ If the delivered token becomes invalid, you need to invoke this interface for re - **URI**: /refresh - **METHOD**: POST - **REQUEST**: -The http request header carries the token returned by login interface, and the body has no parameters + The http request header carries the token returned by login interface. The specific string to be filled is `Bearer ${jwt}`, where `${jwt}` is the "jwt" returned from the login interface,and the body has no parameters + +| header parameter | parameter description | parameter type | +|------------------|-----------------------|------------| +| Authorization | Bearer ${jwt} | string | - **RESPONSE**: -If successful, the success field in the returned response message will be set to 00, and the token will be included in data + If successful, the success field in the returned response message will be set to 00, and the token will be included in data -| body parameter | parameter description | parameter type | necessary | -| ------- |------|----------------|------------| -| authorization | token | string | yes | +| body parameter | parameter description | parameter type | +|----------------|------|----------------| +| jwt | token | string | +| is_admin | Whether the user is an admin | bool | #### 2.2.4. Call Cypher User manipulation of data and models in tugraph requires calling the cypher interface and is initiated through the standard cypher query language @@ -81,13 +95,17 @@ User manipulation of data and models in tugraph requires calling the cypher inte - **METHOD**: POST - **REQUEST**: +| header parameter | parameter description | parameter type | +|------------------|-----------------------|------------| +| Authorization | Bearer ${jwt} | string | + | body parameter | parameter description | parameter type | necessary | | ------- |------------------|---------|-----------| | graph | the name of the subgraph to be queried | string | yes | | script | query statement | string | yes | - **RESPONSE**: -If successful, the success field in the returned response message will be set to 00, and the query results will be included in data + If successful, the success field in the returned response message will be set to 00, and the query results will be included in data | body parameter | parameter description | parameter type | necessary | | ------- |------|----------------|------------| @@ -97,245 +115,4 @@ If successful, the success field in the returned response message will be set to ``` {"script" : "Match (n) return n", "graph" : "default"} -``` - -#### 2.2.5. Upload File -This interface is used to upload local files to the TuGraph machine. You can upload text/binary files, large files, and small files. For large files, the client must split the files, and each file fragment must not be larger than 1MB. Parameters Begin-Pos and Size correspond to the offset and fragment size of this fragment in the complete file. The parameter must be placed in the header of the http request, and the request body contains only the file fragment content. The request header of this interface contains more than token parameters - -- **URI**: /upload_file -- **METHOD**: POST -- **REQUEST**: - -| header parameter | parameter description | parameter type | necessary | -|------------------|--------------------------------------|---------|-------| -| File-Name | the name of the file | string | yes | -| Begin-Pos | Offset of the start position of the current file fragment within the file | string | yes | -| Size | the current file fragment size | string | yes | - -- **RESPONSE**: -If successful, the success field in the returned response message will be set to 00 - -#### 2.2.6. Check File -this interface is used to check the correctness of uploaded files. If the check succeeds, the system returns a success message when the same file is uploaded again - -- **URI**: /check_file -- **METHOD**: POST -- **REQUEST**: - -| body parameter | parameter description | parameter type | necessary | -| ------- |-----------------------------|----------------|-----------| -| fileName | the name of the file | string | yes | -| checkSum | the checksum of the file | string | yes when flag set to "1" | -| fileSize | the size of the file | string | yes when flag set to "2" | -| flag | If flag is "1", check md5. If flag is "2",check file size | string | yes | - -- **RESPONSE**: -If successful, the success field in the returned response message will be set to 00 - -| body parameter | parameter description | parameter type | necessary | -| ------- |------|------|------| -| pass | true on success, false otherwise | bool | yes | - -**Example request.** - -``` -{"fileName" : "test.csv", "checkSum" : "$MD5", "flag" : “1”} -``` - -#### 2.2.7. Delete Cached File -The admin user can delete all the files uploaded by anyone. Other users can delete their own files. You can delete a file with a specified name, a file uploaded by a specified user, or all files - -- **URI**: /clear_cache -- **METHOD**: POST -- **REQUEST**: - -| body parameter | parameter description | parameter type | necessary | -| ------- |-----------------------|--------|--------| -| fileName | the name of the file | string | yes when flag set to "0" | -| userName | the name of the user | string | yes when flag set to "1" | -| flag | When flag is set to 0, the file specified by fileName is deleted; when flag is set to 1, all files uploaded by userName are deleted; when flag is set to 2, all files are deleted | string | yes | - -- **RESPONSE**: -If successful, the success field in the returned response message will be set to 00 - -**Example request.** - -``` -{"fileName" : "test.csv", "userName" : "test", "flag" : “1”} -``` - -#### 2.2.8. Import Schema -This interface can create a schema model based on the schema information specified by description parameter. For details about the schema format, refer to data-import.md - -- **URI**: /import_schema -- **METHOD**: POST -- **REQUEST**: - -| body parameter | parameter description | parameter type | necessary | -| ------- |-----------------------|----------------|-----------| -| graph | name of the subgraph | string | yes | -| description | schema infomation | json string | yes | - -- **RESPONSE**: - If successful, the success field in the returned response message will be set to 00 - -**Example request.** - -``` -{ - "graph": "test_graph", - "description": { - "schema": [{ - "label": "Person", - "type": "VERTEX", - "primary": "name", - "properties": [{ - "name": "name", - "type": "STRING" - }, { - "name": "birthyear", - "type": "INT16", - "optional": true - }, { - "name": "phone", - "type": "INT16", - "unique": true, - "index": true - }] - }, { - "label": "City", - "type": "VERTEX", - "primary": "name", - "properties": [{ - "name": "name", - "type": "STRING" - }] - }, { - "label": "Film", - "type": "VERTEX", - "primary": "title", - "properties": [{ - "name": "title", - "type": "STRING" - }] - }, { - "label": "HAS_CHILD", - "type": "EDGE" - }, { - "label": "MARRIED", - "type": "EDGE" - }, { - "label": "BORN_IN", - "type": "EDGE", - "properties": [{ - "name": "weight", - "type": "FLOAT", - "optional": true - }] - }, { - "label": "DIRECTED", - "type": "EDGE" - }, { - "label": "WROTE_MUSIC_FOR", - "type": "EDGE" - }, { - "label": "ACTED_IN", - "type": "EDGE", - "properties": [{ - "name": "charactername", - "type": "STRING" - }] - }, { - "label": "PLAY_IN", - "type": "EDGE", - "properties": [{ - "name": "role", - "type": "STRING", - "optional": true - }], - "constraints": [ - ["Person", "Film"] - ] - }] - } -} -``` - -#### 2.2.9. Import Data -This interface allows users to specify uploaded and verified files as data files and import them to the subgraph specified by the graph parameter. The import process is asynchronous, and the server returns a task id after receiving the import request - -- **URI**: /import_data -- **METHOD**: POST -- **REQUEST**: - -| body parameter | parameter description | parameter type | necessary | -| ------- |---------------------------|--------|-----| -| graph | name of the subgraph | string | yes | -| schema | schema infomation | json string | yes | -| delimiter | column delimiter | string | yes | -| continueOnError | Whether to skip the error and continue when an error occurs | boolean | no | -| skipPackages | number of packets skipped | string | no | -| taskId | used to restart the failed task | string | no | -| flag | If flag is set to 1, the data file is deleted after the import is successful | string | no | -| other | other parameter | string | no | - -- **RESPONSE**: - If successful, the success field in the returned response message will be set to 00 - -| body parameter | parameter description | parameter type | necessary | -| ------- |---------------------------------------|--------|------------| -| taskId | task id is used to find a import task | string | yes | - -**Example request.** - -``` -{ - "graph": "default", //导入的子图名称 - "delimiter": ",", //数据分隔符 - "continueOnError": true, //遇到错误时是否跳过错误数据并继续导入 - "skipPackages": “0”, //跳过的包个数 - "flag" : "1", - "schema": { - "files": [{ - "DST_ID": "Film", //终点label类型 - "SRC_ID": "Person", //起点label类型 - "columns": [ //数据格式说明 - "SRC_ID", //起点id - "DST_ID", //终点id - "SKIP", //表示跳过此列数据 - "charactername" //属性名称 - ], - "format": "CSV", //数据文件格式类型,支持csv和json - "path": "acted_in.csv", //数据文件名称 - "header": 0, //数据从第几行开始 - "label": "ACTED_IN" //边的类型 - }] - } -} -``` - -#### 2.2.10. Import Progress Query -This interface is used to query the execution progress of a import task - -- **URI**: /import_progress -- **METHOD**: POST -- **REQUEST**: - -| body parameter | parameter description | parameter type | necessary | -| ------- |-------------------------------------------|---------|----| -| taskId | task id returned by import_data interface | string | 是 | - -- **RESPONSE**: - If successful, the success field in the returned response message will be set to 00 - -| body parameter | parameter description | parameter type | necessary | -| ------- |--------------------------------------|----------------|-----------| -| success | whether import is successful | boolean | yes | -| reason | reason of the import failure | string | yes if success is false | -| progress | import progress at the current time | string | yes | - -**Example request.** - -``` -{"taskId" : "$taskId"} ``` \ No newline at end of file diff --git a/docs/zh-CN/source/15.contacts.md b/docs/zh-CN/source/15.contacts.md index e003ef4098..787d8c1e49 100644 --- a/docs/zh-CN/source/15.contacts.md +++ b/docs/zh-CN/source/15.contacts.md @@ -2,7 +2,7 @@ 您有任何对产品的意见和建议,欢迎通过以下联系方式加入讨论,或提出建议。 -官网: [www.tugraph.org](https://www.tugraph.org) +官网: [tugraph.tech](https://tugraph.tech) Github Issue (错误反馈、功能讨论) [Issue](https://github.com/TuGraph-db/tugraph-db/issues) diff --git a/docs/zh-CN/source/7.client-tools/7.restful-api.md b/docs/zh-CN/source/7.client-tools/7.restful-api.md index beb44d41aa..e8f090a1c8 100644 --- a/docs/zh-CN/source/7.client-tools/7.restful-api.md +++ b/docs/zh-CN/source/7.client-tools/7.restful-api.md @@ -29,23 +29,24 @@ TuGraph HTTP Server 接收json格式的请求,经过鉴权后开始提取请 - **METHOD**: POST - **REQUEST**: -| body参数 | 参数说明 | 参数类型 | 是否必填 | -| ------- |------|-------|------------| -| userName | 用户名 | 字符串类型 | 是 | -| password | 用户密码 | 字符串类型 | 是 | +| body参数 | 参数说明 | 参数类型 | 是否必填 | +| ------ |------|-------|------------| +| user | 用户名 | 字符串类型 | 是 | +| password | 用户密码 | 字符串类型 | 是 | - **RESPONSE**: -如果成功,返回的响应信息中success为00,data中包含令牌 + 如果成功,返回的响应信息中success为00,data中包含令牌 -| body参数 | 参数说明 | 参数类型 | 是否必填 | -| ------- |------|-------|------------| -| authorization | 令牌 | 字符串类型 | 是 | -| default_password | 默认密码 | 布尔类型 | 是 | +| body参数 | 参数说明 | 参数类型 | +|------------------|--------------------|------------| +| jwt | 令牌 | 字符串类型 | +| is_admin | 是否是admin用户 | 布尔类型 | +| default_password | 默认密码 | 布尔类型 | **Example request.** ``` - {"userName" : "test", "password" : "123456"} + {"user" : "admin", "password" : "73@TuGraph"} ``` #### 2.2.2. 用户登出 @@ -53,11 +54,19 @@ TuGraph HTTP Server 接收json格式的请求,经过鉴权后开始提取请 - **URI**: /logout - **METHOD**: POST -- **REQUEST**: - http request header中携带调用login接口时返回的token,body中没有参数 + - **REQUEST**: + http request header中携带调用login接口时返回的token,具体填写的字符串是`Bearer ${jwt}`,`${jwt}`就是login接口返回的jwt,body中没有参数 + +| header参数 | 参数说明 | 参数类型 | +|------------------|---------------|------------| +| Authorization | Bearer ${jwt} | 字符串类型 | - **RESPONSE**: -如果成功,返回的响应信息中success为00,data为空 + 如果成功,返回的响应信息中success为00,data中包含 + +| body参数 | 参数说明 | 参数类型 | +|------------------|--------------------|------------| +| is_admin | 是否是admin用户 | 布尔类型 | #### 2.2.3. 身份刷新 已下发的token失效后,需要调用本接口重新认证。后端验证token合法性。token在初次登录后,1小时内有效,过期需要刷新 @@ -65,14 +74,19 @@ TuGraph HTTP Server 接收json格式的请求,经过鉴权后开始提取请 - **URI**: /refresh - **METHOD**: POST - **REQUEST**: - http request header中携带调用login接口时返回的token,body中没有参数 + http request header中携带调用login接口返回的token,具体填写的字符串是`Bearer ${jwt}`,`${jwt}`就是login接口返回的jwt,body中没有参数 + +| header参数 | 参数说明 | 参数类型 | +|------------------|---------------|------------| +| Authorization | Bearer ${jwt} | 字符串类型 | - **RESPONSE**: 如果成功,返回的响应信息中success为00,data中包含令牌 -| body参数 | 参数说明 | 参数类型 | 是否必填 | -| ------- |------|-------|------------| -| authorization | 令牌 | 字符串类型 | 是 | +| body参数 | 参数说明 | 参数类型 | +|------------------|--------------------|------------| +| jwt | 令牌 | 字符串类型 | +| is_admin | 是否是admin用户 | 布尔类型 | #### 2.2.4. 调用cypher 用户对TuGraph的增删改查请求需要调用cypher接口,并通过标准的cypher查询语言发起 @@ -81,6 +95,10 @@ TuGraph HTTP Server 接收json格式的请求,经过鉴权后开始提取请 - **METHOD**: POST - **REQUEST**: +| header参数 | 参数说明 | 参数类型 | +|------------------|---------------|------------| +| Authorization | Bearer ${jwt} | 字符串类型 | + | body参数 | 参数说明 | 参数类型 | 是否必填 | | ------- |----------|-------|------------| | graph | 查询的子图名称 | 字符串类型 | 是 | @@ -97,244 +115,4 @@ TuGraph HTTP Server 接收json格式的请求,经过鉴权后开始提取请 ``` {"script" : "Match (n) return n", "graph" : "default"} -``` - -#### 2.2.5. 上传文件 -接口用于将本地文件上传至TuGraph所在机器。可以上传文本文件,二进制文件,可以上传大文件,也可以上传小文件,对于大文件,客户端在上传时应该对文件做切分,每个文件分片不大于1MB,参数Begin-Pos和Size对应本次分片在完整文件中的偏移量与分片大小。参数需要放在http请求的报文头,请求内容对应文件分片内容。本接口请求头不止有token参数 - -- **URI**: /upload_file -- **METHOD**: POST -- **REQUEST**: - -| header参数 | 参数说明 | 参数类型 | 是否必填 | -| ------- |-------------|------------------|------------| -| File-Name | 文件名称 | 字符串类型 | 是 | -| Begin-Pos | 开始位置在文件内的偏移 | 可以转成size_t类型的字符串 | 是 | -| Size | 本次请求文件分片大小 | 可以转成size_t类型的字符串 | 是 | - -- **RESPONSE**: - 如果成功,返回的响应信息中success为00 - -#### 2.2.6. 检查文件 -本接口用于检查已上传文件正确性,如果成功通过检查,再次上传同一文件时,直接返回成功 - -- **URI**: /check_file -- **METHOD**: POST -- **REQUEST**: - -| body参数 | 参数说明 | 参数类型 | 是否必填 | -| ------- |----------------|---------------|-------------| -| fileName | 文件名称 | 字符串类型 | 是 | -| checkSum | 文件对应md5值 | 可以转成int类型的字符串 | flag为"1"时必填 | -| fileSize | 文件长度(以字节计算) | 可以转成int类型的字符串 | flag为"2"时必填 | -| flag | 标记位,flag为1时校验md5。flag为2时校验文件长度 | 可以转成int类型的字符串 | 是 | - -- **RESPONSE**: - 如果成功,返回的响应信息中success为00 - -| body参数 | 参数说明 | 参数类型 | 是否必填 | -| ------- |------|--------|------------| -| pass | 检查成功为true,否则为false | bool类型 | 是 | - -**Example request.** - -``` -{"fileName" : "test.csv", "checkSum" : "$MD5", "flag" : “1”} -``` - -#### 2.2.7. 清理缓存文件 -admin用户可以删除所有用户上传的文件,其他用户可以删除自己的上传的文件,可以删除指定名称的文件,指定用户上传的文件,也可以删除所有文件 - -- **URI**: /clear_cache -- **METHOD**: POST -- **REQUEST**: - -| body参数 | 参数说明 | 参数类型 | 是否必填 | -| ------- |-------------|---------------|-------------| -| fileName | 文件名称 | 字符串类型 | flag为"0"时必填 | -| userName | 用户名称 | 字符串类型 | flag为"1"时必填 | -| flag | 标记位,flag为0时删除fileName指定文件, flag为1时删除userName指定用户已经上传的所有文件,flag为2时删除所有用户上传的文件 | 可以转成int类型的字符串 | 是 | - -- **RESPONSE**: - 如果成功,返回中success为00 - -**Example request.** - -``` -{"fileName" : "test.csv", "userName" : "test", "flag" : “1”} -``` - -#### 2.2.8. 导入schema -本接口可以根据用户指定的schema信息创建schema模型,schema的详细格式信息请参考data-import.md - -- **URI**: /import_schema -- **METHOD**: POST -- **REQUEST**: - -| body参数 | 参数说明 | 参数类型 | 是否必填 | -| ------- |------------|---------------|-------------| -| graph | 子图名称 | 字符串 | 是 | -| description | schema描述信息 | json字符串 | 是 | - -- **RESPONSE**: - 如果成功,返回中success为00 - -**Example request.** - -``` -{ - "graph": "test_graph", - "description": { - "schema": [{ - "label": "Person", - "type": "VERTEX", - "primary": "name", - "properties": [{ - "name": "name", - "type": "STRING" - }, { - "name": "birthyear", - "type": "INT16", - "optional": true - }, { - "name": "phone", - "type": "INT16", - "unique": true, - "index": true - }] - }, { - "label": "City", - "type": "VERTEX", - "primary": "name", - "properties": [{ - "name": "name", - "type": "STRING" - }] - }, { - "label": "Film", - "type": "VERTEX", - "primary": "title", - "properties": [{ - "name": "title", - "type": "STRING" - }] - }, { - "label": "HAS_CHILD", - "type": "EDGE" - }, { - "label": "MARRIED", - "type": "EDGE" - }, { - "label": "BORN_IN", - "type": "EDGE", - "properties": [{ - "name": "weight", - "type": "FLOAT", - "optional": true - }] - }, { - "label": "DIRECTED", - "type": "EDGE" - }, { - "label": "WROTE_MUSIC_FOR", - "type": "EDGE" - }, { - "label": "ACTED_IN", - "type": "EDGE", - "properties": [{ - "name": "charactername", - "type": "STRING" - }] - }, { - "label": "PLAY_IN", - "type": "EDGE", - "properties": [{ - "name": "role", - "type": "STRING", - "optional": true - }], - "constraints": [ - ["Person", "Film"] - ] - }] - } -} -``` - -#### 2.2.9. 导入数据 -本接口允许用户指定已经通过上传,校验的文件作为数据文件,按照schema参数描述的配置信息,导入到graph参数指定的子图中。导入过程是异步的,server在接收到导入请求后,返回一个任务id - -- **URI**: /import_data -- **METHOD**: POST -- **REQUEST**: - -| body参数 | 参数说明 | 参数类型 | 是否必填 | -| ------- |-------|---------|----| -| graph | 子图名称 | 字符串类型 | 是 | -| schema | 导入schema描述 | json字符串 | 是 | -| delimiter | 分隔符 | 字符串类型 | 是 | -| continueOnError | 单行数据出错是否跳过错误并继续 | boolean类型 | 否 | -| skipPackages | 跳过的包个数 | 可以转成int类型的字符串 | 否 | -| taskId | 任务id,用于重启出错的任务 | 字符串类型 | 否 | -| flag | 标记位,flag为1时导入成功将删除数据文件 | 可以转成int类型的字符串 | 否 | -| other | 其他参数 | 可以转成int类型的字符串 | 否 | - -- **RESPONSE**: - 如果成功,返回的响应信息中success为00 - -| body参数 | 参数说明 | 参数类型 | 是否必填 | -| ------- |------|--------|------------| -| taskId | 任务编号 | 字符串类型 | 是 | - -**Example request.** - -``` -{ - "graph": "default", //导入的子图名称 - "delimiter": ",", //数据分隔符 - "continueOnError": true, //遇到错误时是否跳过错误数据并继续导入 - "skipPackages": “0”, //跳过的包个数 - "flag" : "1", - "schema": { - "files": [{ - "DST_ID": "Film", //终点label类型 - "SRC_ID": "Person", //起点label类型 - "columns": [ //数据格式说明 - "SRC_ID", //起点id - "DST_ID", //终点id - "SKIP", //表示跳过此列数据 - "charactername" //属性名称 - ], - "format": "CSV", //数据文件格式类型,支持csv和json - "path": "acted_in.csv", //数据文件名称 - "header": 0, //数据从第几行开始 - "label": "ACTED_IN" //边的类型 - }] - } -} -``` - -#### 2.2.10. 导入进度查询 -本接口用于查询导入任务的执行进度 - -- **URI**: /import_progress -- **METHOD**: POST -- **REQUEST**: - -| body参数 | 参数说明 | 参数类型 | 是否必填 | -| ------- |----------------------|---------|----| -| taskId | import_data接口返回的任务id | 字符串类型 | 是 | -- **RESPONSE**: - 如果成功,返回的响应信息中success为00 - -| body参数 | 参数说明 | 参数类型 | 是否必填 | -| ------- |---------|------------------|---------| -| success | 是否成功导入 | boolean类型 | 是 | -| reason | 导入失败原因 | 字符串类型 | success为false时必填 | -| progress | 当前导入进度 | 可以转成double类型的字符串 | 是 | - -**Example request.** - -``` -{"taskId" : "$taskId"} ``` \ No newline at end of file