From 1f9935efb8664cdfb47bf2f9ed10ad9eceb8f6c6 Mon Sep 17 00:00:00 2001 From: tison Date: Mon, 8 Apr 2024 17:06:46 +0800 Subject: [PATCH 1/3] docs: for metasrc maintenance endpoints Signed-off-by: tison --- .../en/contributor-guide/metasrv/admin-api.md | 58 +++++++++++++++++++ .../zh/contributor-guide/metasrv/admin-api.md | 58 +++++++++++++++++++ 2 files changed, 116 insertions(+) diff --git a/docs/v0.7/en/contributor-guide/metasrv/admin-api.md b/docs/v0.7/en/contributor-guide/metasrv/admin-api.md index 4f73114c5..6a2bdf92b 100644 --- a/docs/v0.7/en/contributor-guide/metasrv/admin-api.md +++ b/docs/v0.7/en/contributor-guide/metasrv/admin-api.md @@ -8,6 +8,8 @@ Available APIs: - /health - /leader - /heartbeat +- /maintenance +- /maintenanace/set All these APIs are under the parent resource `/admin`. @@ -242,3 +244,59 @@ curl -X GET 'http://localhost:3002/admin/heartbeat?addr=127.0.0.1:4100' }] ] ``` + +## /maintenance HTTP endpoint + +The `/maintenance` endpoint accepts GET HTTP requests and you can use this endpoint to query the maintenance status of your metasrv instance. + +The metasrv will ignore detected region failures when under maintenance. This is useful when the datanodes are planned to be unavailable for a short period of time; for example, rolling upgrade for datanodes. + +### Definition + +```bash +curl -X GET http://localhost:3002/admin/maintenance +``` + +### Examples + +#### Request + +```bash +curl -X GET http://localhost:3002/admin/maintenance +``` + +#### Response + +```text +Maintenance mode is disabled +``` + +## /maintenance/set HTTP endpoint + +The `/maintenance/set` endpoint accepts POST HTTP requests and you can toggle the maintenance status of your metasrv instance. + +The metasrv will ignore detected region failures when under maintenance. This is useful when the datanodes are planned to be unavailable for a short period of time; for example, rolling upgrade for datanodes. + +### Definition + +```bash +curl -X GET http://localhost:3002/admin/maintenance/set +``` + +| Query String Parameter | Type | Optional/Required | Definition | +|:-----------------------|:-------|:------------------|:--------------------------| +| enable | String | Required | 'true' or 'false' | + +### Examples + +#### Request + +```bash +curl -X GET http://localhost:3002/admin/maintenance/set?enable=true +``` + +#### Response + +```text +Maintenance mode enabled +``` diff --git a/docs/v0.7/zh/contributor-guide/metasrv/admin-api.md b/docs/v0.7/zh/contributor-guide/metasrv/admin-api.md index 4f73114c5..6a2bdf92b 100644 --- a/docs/v0.7/zh/contributor-guide/metasrv/admin-api.md +++ b/docs/v0.7/zh/contributor-guide/metasrv/admin-api.md @@ -8,6 +8,8 @@ Available APIs: - /health - /leader - /heartbeat +- /maintenance +- /maintenanace/set All these APIs are under the parent resource `/admin`. @@ -242,3 +244,59 @@ curl -X GET 'http://localhost:3002/admin/heartbeat?addr=127.0.0.1:4100' }] ] ``` + +## /maintenance HTTP endpoint + +The `/maintenance` endpoint accepts GET HTTP requests and you can use this endpoint to query the maintenance status of your metasrv instance. + +The metasrv will ignore detected region failures when under maintenance. This is useful when the datanodes are planned to be unavailable for a short period of time; for example, rolling upgrade for datanodes. + +### Definition + +```bash +curl -X GET http://localhost:3002/admin/maintenance +``` + +### Examples + +#### Request + +```bash +curl -X GET http://localhost:3002/admin/maintenance +``` + +#### Response + +```text +Maintenance mode is disabled +``` + +## /maintenance/set HTTP endpoint + +The `/maintenance/set` endpoint accepts POST HTTP requests and you can toggle the maintenance status of your metasrv instance. + +The metasrv will ignore detected region failures when under maintenance. This is useful when the datanodes are planned to be unavailable for a short period of time; for example, rolling upgrade for datanodes. + +### Definition + +```bash +curl -X GET http://localhost:3002/admin/maintenance/set +``` + +| Query String Parameter | Type | Optional/Required | Definition | +|:-----------------------|:-------|:------------------|:--------------------------| +| enable | String | Required | 'true' or 'false' | + +### Examples + +#### Request + +```bash +curl -X GET http://localhost:3002/admin/maintenance/set?enable=true +``` + +#### Response + +```text +Maintenance mode enabled +``` From f93deeaeb3dc796e55c5c0c7edfb4def393729c2 Mon Sep 17 00:00:00 2001 From: tison Date: Tue, 9 Apr 2024 16:34:30 +0800 Subject: [PATCH 2/3] chore: update docs Signed-off-by: tison --- .../en/contributor-guide/metasrv/admin-api.md | 19 +++++-------------- .../zh/contributor-guide/metasrv/admin-api.md | 19 +++++-------------- 2 files changed, 10 insertions(+), 28 deletions(-) diff --git a/docs/v0.7/en/contributor-guide/metasrv/admin-api.md b/docs/v0.7/en/contributor-guide/metasrv/admin-api.md index 6a2bdf92b..bb512971b 100644 --- a/docs/v0.7/en/contributor-guide/metasrv/admin-api.md +++ b/docs/v0.7/en/contributor-guide/metasrv/admin-api.md @@ -9,7 +9,6 @@ Available APIs: - /leader - /heartbeat - /maintenance -- /maintenanace/set All these APIs are under the parent resource `/admin`. @@ -247,18 +246,16 @@ curl -X GET 'http://localhost:3002/admin/heartbeat?addr=127.0.0.1:4100' ## /maintenance HTTP endpoint -The `/maintenance` endpoint accepts GET HTTP requests and you can use this endpoint to query the maintenance status of your metasrv instance. - The metasrv will ignore detected region failures when under maintenance. This is useful when the datanodes are planned to be unavailable for a short period of time; for example, rolling upgrade for datanodes. -### Definition +### GET + +The `/maintenance` endpoint accepts GET HTTP requests and you can use this endpoint to query the maintenance status of your metasrv instance. ```bash curl -X GET http://localhost:3002/admin/maintenance ``` -### Examples - #### Request ```bash @@ -271,13 +268,9 @@ curl -X GET http://localhost:3002/admin/maintenance Maintenance mode is disabled ``` -## /maintenance/set HTTP endpoint +### PUT -The `/maintenance/set` endpoint accepts POST HTTP requests and you can toggle the maintenance status of your metasrv instance. - -The metasrv will ignore detected region failures when under maintenance. This is useful when the datanodes are planned to be unavailable for a short period of time; for example, rolling upgrade for datanodes. - -### Definition +The `/maintenance` endpoint accepts PUT HTTP requests and you can toggle the maintenance status of your metasrv instance. ```bash curl -X GET http://localhost:3002/admin/maintenance/set @@ -287,8 +280,6 @@ curl -X GET http://localhost:3002/admin/maintenance/set |:-----------------------|:-------|:------------------|:--------------------------| | enable | String | Required | 'true' or 'false' | -### Examples - #### Request ```bash diff --git a/docs/v0.7/zh/contributor-guide/metasrv/admin-api.md b/docs/v0.7/zh/contributor-guide/metasrv/admin-api.md index 6a2bdf92b..bb512971b 100644 --- a/docs/v0.7/zh/contributor-guide/metasrv/admin-api.md +++ b/docs/v0.7/zh/contributor-guide/metasrv/admin-api.md @@ -9,7 +9,6 @@ Available APIs: - /leader - /heartbeat - /maintenance -- /maintenanace/set All these APIs are under the parent resource `/admin`. @@ -247,18 +246,16 @@ curl -X GET 'http://localhost:3002/admin/heartbeat?addr=127.0.0.1:4100' ## /maintenance HTTP endpoint -The `/maintenance` endpoint accepts GET HTTP requests and you can use this endpoint to query the maintenance status of your metasrv instance. - The metasrv will ignore detected region failures when under maintenance. This is useful when the datanodes are planned to be unavailable for a short period of time; for example, rolling upgrade for datanodes. -### Definition +### GET + +The `/maintenance` endpoint accepts GET HTTP requests and you can use this endpoint to query the maintenance status of your metasrv instance. ```bash curl -X GET http://localhost:3002/admin/maintenance ``` -### Examples - #### Request ```bash @@ -271,13 +268,9 @@ curl -X GET http://localhost:3002/admin/maintenance Maintenance mode is disabled ``` -## /maintenance/set HTTP endpoint +### PUT -The `/maintenance/set` endpoint accepts POST HTTP requests and you can toggle the maintenance status of your metasrv instance. - -The metasrv will ignore detected region failures when under maintenance. This is useful when the datanodes are planned to be unavailable for a short period of time; for example, rolling upgrade for datanodes. - -### Definition +The `/maintenance` endpoint accepts PUT HTTP requests and you can toggle the maintenance status of your metasrv instance. ```bash curl -X GET http://localhost:3002/admin/maintenance/set @@ -287,8 +280,6 @@ curl -X GET http://localhost:3002/admin/maintenance/set |:-----------------------|:-------|:------------------|:--------------------------| | enable | String | Required | 'true' or 'false' | -### Examples - #### Request ```bash From c1683900500c03baca23249191ff5b10b78f3c19 Mon Sep 17 00:00:00 2001 From: tison Date: Tue, 9 Apr 2024 17:14:36 +0800 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Yiran --- docs/v0.7/en/contributor-guide/metasrv/admin-api.md | 4 ++-- docs/v0.7/zh/contributor-guide/metasrv/admin-api.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/v0.7/en/contributor-guide/metasrv/admin-api.md b/docs/v0.7/en/contributor-guide/metasrv/admin-api.md index bb512971b..912611c55 100644 --- a/docs/v0.7/en/contributor-guide/metasrv/admin-api.md +++ b/docs/v0.7/en/contributor-guide/metasrv/admin-api.md @@ -273,7 +273,7 @@ Maintenance mode is disabled The `/maintenance` endpoint accepts PUT HTTP requests and you can toggle the maintenance status of your metasrv instance. ```bash -curl -X GET http://localhost:3002/admin/maintenance/set +curl -X PUT http://localhost:3002/admin/maintenance ``` | Query String Parameter | Type | Optional/Required | Definition | @@ -283,7 +283,7 @@ curl -X GET http://localhost:3002/admin/maintenance/set #### Request ```bash -curl -X GET http://localhost:3002/admin/maintenance/set?enable=true +curl -X PUT http://localhost:3002/admin/maintenance?enable=true ``` #### Response diff --git a/docs/v0.7/zh/contributor-guide/metasrv/admin-api.md b/docs/v0.7/zh/contributor-guide/metasrv/admin-api.md index bb512971b..912611c55 100644 --- a/docs/v0.7/zh/contributor-guide/metasrv/admin-api.md +++ b/docs/v0.7/zh/contributor-guide/metasrv/admin-api.md @@ -273,7 +273,7 @@ Maintenance mode is disabled The `/maintenance` endpoint accepts PUT HTTP requests and you can toggle the maintenance status of your metasrv instance. ```bash -curl -X GET http://localhost:3002/admin/maintenance/set +curl -X PUT http://localhost:3002/admin/maintenance ``` | Query String Parameter | Type | Optional/Required | Definition | @@ -283,7 +283,7 @@ curl -X GET http://localhost:3002/admin/maintenance/set #### Request ```bash -curl -X GET http://localhost:3002/admin/maintenance/set?enable=true +curl -X PUT http://localhost:3002/admin/maintenance?enable=true ``` #### Response