From 1ec16639d179065eb38e90ab8b53f9de7745d746 Mon Sep 17 00:00:00 2001 From: vsian Date: Mon, 14 Oct 2024 16:13:21 +0800 Subject: [PATCH 1/7] add docs --- docs/references/http_api_reference.mdx | 234 +++++++++++++++++++++++++ 1 file changed, 234 insertions(+) diff --git a/docs/references/http_api_reference.mdx b/docs/references/http_api_reference.mdx index 64f027d2bc..8007241364 100644 --- a/docs/references/http_api_reference.mdx +++ b/docs/references/http_api_reference.mdx @@ -3112,6 +3112,240 @@ The response includes a JSON object like the following: --- +## Show memory + +**GET** `/instance/memory` + +Shows memory usage information in the instance. + +### Request + +- Method: GET +- URL: `/instance/memory` +- Headers: `accept: application/json` + +#### Request example + +```shell +curl --request GET \ + --url http://localhost:23821/instance/memory \ + --header 'accept: application/json' +``` + +### Response + +#### Status code 200 + +The response includes a JSON object like the following: + +```shell +{ + "error_code":0, + "memory_allocation":"Not activate", + "memory_objects":"Not activate" +} +``` + +- `"error_code"`: `integer` + `0`: The operation succeeds. + +--- + +## Show memory object + +**GET** `/instance/memory/objects` + +... + +### Request + +- Method: GET +- URL: `/instance/memory/objects` +- Headers: `accept: application/json` + +#### Request example + +```shell +curl --request GET \ + --url http://localhost:23821/instance/memory/objects \ + --header 'accept: application/json' +``` + +### Response + +#### Status code 200 + +The response includes a JSON object like the following: + +```shell +{ + "error_code":0, +} +``` + +- `"error_code"`: `integer` + `0`: The operation succeeds. + +--- + +## Show memory allocation + +**GET** `/instance/memory/allocation` + +... + +### Request + +- Method: GET +- URL: `/instance/memory/allocation` +- Headers: `accept: application/json` + +#### Request example + +```shell +curl --request GET \ + --url http://localhost:23821/instance/memory/allocation \ + --header 'accept: application/json' +``` + +### Response + +#### Status code 200 + +The response includes a JSON object like the following: + +```shell +{ + "error_code":0, +} +``` + +- `"error_code"`: `integer` + `0`: The operation succeeds. + +--- + +## Global Checkpoint + +Makes database to perform a full checkpoint. + +**POST** `/admin/node/current` + +Sets role for a node. + +### Request + +- Method: POST +- URL: `/admin/node/current` +- Headers: + - `accept: application/json` + - `content-type: application/json` + +#### Request example + +```shell +curl --request POST \ + --url http://localhost:23822/instance/flush\ + --header 'accept: application/json' \ +``` + +### Response + +#### Status code 200 + +The response includes a JSON object like the following: + +```shell +{ + "error_code":0, +} +``` + +- `"error_code"`: `integer` + `0`: The operation succeeds. + +--- + +## Compact Table + +Makes database to perform compaction on a table. + +**POST** `/admin/node/current` + +Sets role for a node. + +### Request + +- Method: POST +- URL: `/admin/node/current` +- Headers: + - `accept: application/json` + - `content-type: application/json` + +#### Request example + +```shell +curl --request POST \ + --url http://localhost:23820/instance/table/compact \ + --header 'accept: application/json' \ + --header 'content-type: application/json' \ + --data ' + { + "db_name" : "default_db", + "table_name" : "my_table", + } ' +``` + +#### Request parameters + +- `db_name`: Required (*Body parameter*) +- `table_name`: Required (*Body parameter*) +`db_name` and `table_name` specifies the table to perform compaction. + +### Response + + + + + +The response includes a JSON object like the following: + +```shell +{ + "error_code": 0 +} +``` + +- `"error_code"`: `integer` + `0`: The operation succeeds. + + + + +A `500` HTTP status code indicates an error condition. The response includes a JSON object like the following: + +```shell +{ + "error_code":3022, + "error_message":"Table id_timep doesn't exist@src/planner/query_binder.cpp:423" +} +``` + +- `"error_code"`: `integer` + A non-zero value indicates a specific error condition. +- `"error_message"`: `string` + When `error_code` is non-zero, `"error_message"` provides additional details about the error. + + + + +--- + ## Admin set node role **POST** `/admin/node/current` From 48ce7ee450a4092f0c2682bff56cca9a37ee3877 Mon Sep 17 00:00:00 2001 From: vsian Date: Mon, 14 Oct 2024 16:17:07 +0800 Subject: [PATCH 2/7] minor fix --- docs/references/http_api_reference.mdx | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/docs/references/http_api_reference.mdx b/docs/references/http_api_reference.mdx index 8007241364..c28531fb0a 100644 --- a/docs/references/http_api_reference.mdx +++ b/docs/references/http_api_reference.mdx @@ -3229,14 +3229,12 @@ The response includes a JSON object like the following: Makes database to perform a full checkpoint. -**POST** `/admin/node/current` - -Sets role for a node. +**POST** `/instance/flush` ### Request - Method: POST -- URL: `/admin/node/current` +- URL: `/instance/flush` - Headers: - `accept: application/json` - `content-type: application/json` @@ -3268,16 +3266,14 @@ The response includes a JSON object like the following: ## Compact Table -Makes database to perform compaction on a table. - -**POST** `/admin/node/current` +**POST** `/instance/table/compact` -Sets role for a node. +Makes database to perform compaction on a table. ### Request - Method: POST -- URL: `/admin/node/current` +- URL: `/instance/table/compact` - Headers: - `accept: application/json` - `content-type: application/json` From 4b1694d0a4d8da1f4fc3ff7b160f2474a4eff8a2 Mon Sep 17 00:00:00 2001 From: vsian Date: Mon, 14 Oct 2024 16:18:25 +0800 Subject: [PATCH 3/7] minor fix --- docs/references/http_api_reference.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/references/http_api_reference.mdx b/docs/references/http_api_reference.mdx index c28531fb0a..e97cc315f7 100644 --- a/docs/references/http_api_reference.mdx +++ b/docs/references/http_api_reference.mdx @@ -3227,10 +3227,10 @@ The response includes a JSON object like the following: ## Global Checkpoint -Makes database to perform a full checkpoint. - **POST** `/instance/flush` +Makes database to perform a full checkpoint. + ### Request - Method: POST From 5c1052a0dd4e4b57fdd38a2810a1581b50bed65f Mon Sep 17 00:00:00 2001 From: vsian Date: Mon, 14 Oct 2024 17:07:20 +0800 Subject: [PATCH 4/7] Update docs/references/http_api_reference.mdx Co-authored-by: writinwaters <93570324+writinwaters@users.noreply.github.com> --- docs/references/http_api_reference.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/references/http_api_reference.mdx b/docs/references/http_api_reference.mdx index e97cc315f7..fe70fcbdc8 100644 --- a/docs/references/http_api_reference.mdx +++ b/docs/references/http_api_reference.mdx @@ -3268,7 +3268,7 @@ The response includes a JSON object like the following: **POST** `/instance/table/compact` -Makes database to perform compaction on a table. +Performs a compaction operation on a specified table. ### Request From a9e560a61c562185b2fd2882f4582b225ad6ff4e Mon Sep 17 00:00:00 2001 From: vsian Date: Mon, 14 Oct 2024 17:07:45 +0800 Subject: [PATCH 5/7] Update docs/references/http_api_reference.mdx Co-authored-by: writinwaters <93570324+writinwaters@users.noreply.github.com> --- docs/references/http_api_reference.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/references/http_api_reference.mdx b/docs/references/http_api_reference.mdx index fe70fcbdc8..1d01c9300f 100644 --- a/docs/references/http_api_reference.mdx +++ b/docs/references/http_api_reference.mdx @@ -3229,7 +3229,7 @@ The response includes a JSON object like the following: **POST** `/instance/flush` -Makes database to perform a full checkpoint. +Performs a full checkpoint on the instance. ### Request From 9ee73c98b26c604f742c0bcc20d0c0594f11ec5c Mon Sep 17 00:00:00 2001 From: vsian Date: Mon, 14 Oct 2024 17:12:19 +0800 Subject: [PATCH 6/7] resolve conversations --- docs/references/http_api_reference.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/references/http_api_reference.mdx b/docs/references/http_api_reference.mdx index 1d01c9300f..f78b18f653 100644 --- a/docs/references/http_api_reference.mdx +++ b/docs/references/http_api_reference.mdx @@ -3116,7 +3116,7 @@ The response includes a JSON object like the following: **GET** `/instance/memory` -Shows memory usage information in the instance. +Shows the memory usage information of the instance. ### Request @@ -3155,7 +3155,7 @@ The response includes a JSON object like the following: **GET** `/instance/memory/objects` -... +Shows the memory object usage information of the instance. ### Request @@ -3192,7 +3192,7 @@ The response includes a JSON object like the following: **GET** `/instance/memory/allocation` -... +Shows the memory allocations information of the instance. ### Request From 988242081f353bad56fb3d13e523abbdda4aaac7 Mon Sep 17 00:00:00 2001 From: vsian Date: Mon, 14 Oct 2024 17:57:33 +0800 Subject: [PATCH 7/7] Update docs/references/http_api_reference.mdx Co-authored-by: writinwaters <93570324+writinwaters@users.noreply.github.com> --- docs/references/http_api_reference.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/references/http_api_reference.mdx b/docs/references/http_api_reference.mdx index aa0a9a7974..f710cbdeef 100644 --- a/docs/references/http_api_reference.mdx +++ b/docs/references/http_api_reference.mdx @@ -3210,7 +3210,7 @@ The response includes a JSON object like the following: **GET** `/instance/memory/allocation` -Shows the memory allocations information of the instance. +Shows the memory allocation information of the instance. ### Request