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
Issue 674: Documentation for HTTP endpoints #721
Conversation
site/docs/latest/admin/http.md
Outdated
title: BookKeeper http endpoints | ||
--- | ||
|
||
This document is to introducing BookKeeper http endpoints that could be used for BookKeeper administration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This document introduces BookKeeper HTTP endpoints, which can be used ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, will change it.
site/docs/latest/admin/http.md
Outdated
--- | ||
|
||
This document is to introducing BookKeeper http endpoints that could be used for BookKeeper administration. | ||
If user want to use this feature, parameter "httpServerEnabled" need to be set to "true" in file conf/bk_server.conf. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To use this feature, set "httpServerEnabled" to "true" in file conf/bk_server.conf.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, wll change it.
site/docs/latest/admin/http.md
Outdated
|
||
## All the endpoints | ||
|
||
Currently all the http endpoints could be divided into these 4 components: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The HTTP endpoints are divided into the following groups:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps they should be grouped by endpoints which are bookie specific and those which are for the whole cluster.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. will change the words.
And it is a good idea to do a new grouping following your suggestion. will consider to do it, and opened a new issue #722 to tracking this, but as the requirements goes on, maybe 2 big groups need futher dividing.
site/docs/latest/admin/http.md
Outdated
|200 | Successful operation | | ||
|403 | Don't have permission | | ||
|404 | Error handling | | ||
1. Method: PUT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there already an admin command to do this? Does this access a config in zookeeper or on the local disk?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems not command for this. it only update the inmemory value, which could be used for later ops.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure it's wise to expose functionality like this at all. It's just asking for people to change configuration in an uncontrolled and unpredictable manner. Was there a driving use case to add this to the http endpoints?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ivankelly I think http endpoints (and configuration service) was introduced by twitter initially and Jia extended it to cover all admin commands. I can see this is useful on dynamic configurations. but Twitter folks can chime in more on the use cases.
BTW If there is a question on a feature whether this should be included or not, we should probably be discussing a bit earlier on the coding pull request, rather than later on the documentation pull request. (for future improvements)
site/docs/latest/admin/http.md
Outdated
|
||
| Name | Type | Required | Description | | ||
|:-----|:-----|:---------|:------------| | ||
|metadata | Boolean | No | whether print out metadata | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
api doesn't print.
site/docs/latest/admin/http.md
Outdated
|404 | Error handling | | ||
|
||
### Endpoint: /api/v1/ledger/read/?ledger_id=<ledger_id>&start_entry_id=<start_entry_id>&end_entry_id=<end_entry_id> | ||
1. Method: GET |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What format are these entries returned in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks. will add the format
|
||
## Config | ||
|
||
### Endpoint: /api/v1/config/server_config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The format of the response should be included in each call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. the response is construct of code and body, and some of the command the response body not contains too much info. Will add the useful respone body format.
site/docs/latest/admin/http.md
Outdated
|
||
| Name | Type | Required | Description | | ||
|:-----|:-----|:---------|:------------| | ||
|bookie_src | String | Yes | bookie source to recovery | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
String or array of strings?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the strings have a specific format?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strings of host names or IP:Port
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
site/docs/latest/admin/http.md
Outdated
|
||
| Name | Type | Required | Description | | ||
|:-----|:-----|:---------|:------------| | ||
|missingreplica | String | No | missing replica bookieId | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These parameters should have underscores between words to be consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ivankelly I think this is a documentation for what existed. if the parameters should be changed, we should create an issue for it.
site/docs/latest/admin/http.md
Outdated
|
||
| Name | Type | Required | Description | | ||
|:-----|:-----|:---------|:------------| | ||
|type | String | Yes | value: rw/ro , list read-write/read-only bookies. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rw/ro is the value? or rw or ro?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will change to "rw or ro"
FAILURE --none-- |
/cc @lucperkins for documentation reviews. |
For the sake of maintainability, I think it'd be best to generate these docs from a JSON or YAML definition using a template, but I can do that work in a follow-up PR |
@lucperkins a nice point! +1 |
site/_data/sidebar.yaml
Outdated
@@ -28,6 +28,8 @@ groups: | |||
endpoint: metrics | |||
- name: Upgrade | |||
endpoint: upgrade | |||
- name: BookKeeper http endpoint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest changing "http endpoint" to "Admin REST API", which would be more accurate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks. will change it.
site/docs/latest/admin/http.md
Outdated
@@ -0,0 +1,394 @@ | |||
--- | |||
title: BookKeeper http endpoints |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest changing "http endpoint" to "Admin REST API", which would be more accurate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks. will change it.
site/_data/sidebar.yaml
Outdated
@@ -28,6 +28,8 @@ groups: | |||
endpoint: metrics | |||
- name: Upgrade | |||
endpoint: upgrade | |||
- name: BookKeeper http endpoint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Capitalize HTTP
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
“endpoints” instead of “endpoint”
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks. will follow @sijie 's comments
site/docs/latest/admin/http.md
Outdated
--- | ||
|
||
This document introduces BookKeeper HTTP endpoints, which can be used for BookKeeper administration. | ||
To use this feature, set "httpServerEnabled" to "true" in file conf/bk_server.conf. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All variable and file names should be in backticks rather than quotation marks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. will change it.
site/docs/latest/admin/http.md
Outdated
|
||
## All the endpoints | ||
|
||
Currently all the http endpoints could be divided into these 4 components: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HTTP should be capitalized when used in sentences
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. will change it.
FAILURE --none-- |
Descriptions of the changes in this PR: Add a document for http endpoints. Author: Jia Zhai <zhaijia@apache.org> Reviewers: Luc Perkins <lucperkins@gmail.com>, Sijie Guo <sijie@apache.org> This closes #721 from zhaijack/http_doc, closes #674 (cherry picked from commit c8c3f67) Signed-off-by: Jia Zhai <zhaijia@apache.org>
Descriptions of the changes in this PR: Add a document for http endpoints. Author: Jia Zhai <zhaijia@apache.org> Reviewers: Luc Perkins <lucperkins@gmail.com>, Sijie Guo <sijie@apache.org> This closes apache#721 from zhaijack/http_doc, closes apache#674
Descriptions of the changes in this PR: Add a document for http endpoints. Author: Jia Zhai <zhaijia@apache.org> Reviewers: Luc Perkins <lucperkins@gmail.com>, Sijie Guo <sijie@apache.org> This closes apache#721 from zhaijack/http_doc, closes apache#674
Descriptions of the changes in this PR:
Add a document for http endpoints.