Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: for metasrv maintenance endpoints #878

Merged
merged 3 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions docs/v0.7/en/contributor-guide/metasrv/admin-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Available APIs:
- /health
- /leader
- /heartbeat
- /maintenance

All these APIs are under the parent resource `/admin`.

Expand Down Expand Up @@ -242,3 +243,51 @@ curl -X GET 'http://localhost:3002/admin/heartbeat?addr=127.0.0.1:4100'
}]
]
```

## /maintenance HTTP endpoint

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.

### 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
```

#### Request

```bash
curl -X GET http://localhost:3002/admin/maintenance
```

#### Response

```text
Maintenance mode is disabled
```

### PUT

The `/maintenance` endpoint accepts PUT HTTP requests and you can toggle the maintenance status of your metasrv instance.

```bash
curl -X PUT http://localhost:3002/admin/maintenance
```

| Query String Parameter | Type | Optional/Required | Definition |
|:-----------------------|:-------|:------------------|:--------------------------|
| enable | String | Required | 'true' or 'false' |

#### Request

```bash
curl -X PUT http://localhost:3002/admin/maintenance?enable=true
```

#### Response

```text
Maintenance mode enabled
```
49 changes: 49 additions & 0 deletions docs/v0.7/zh/contributor-guide/metasrv/admin-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Available APIs:
- /health
- /leader
- /heartbeat
- /maintenance

All these APIs are under the parent resource `/admin`.

Expand Down Expand Up @@ -242,3 +243,51 @@ curl -X GET 'http://localhost:3002/admin/heartbeat?addr=127.0.0.1:4100'
}]
]
```

## /maintenance HTTP endpoint

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.

### 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
```

#### Request

```bash
curl -X GET http://localhost:3002/admin/maintenance
```

#### Response

```text
Maintenance mode is disabled
```

### PUT

The `/maintenance` endpoint accepts PUT HTTP requests and you can toggle the maintenance status of your metasrv instance.

```bash
curl -X PUT http://localhost:3002/admin/maintenance
```

| Query String Parameter | Type | Optional/Required | Definition |
|:-----------------------|:-------|:------------------|:--------------------------|
| enable | String | Required | 'true' or 'false' |

#### Request

```bash
curl -X PUT http://localhost:3002/admin/maintenance?enable=true
```

#### Response

```text
Maintenance mode enabled
```
Loading