Status
Current state: "WIP/Under DiscussionAccepted"
Discussion thread: N/A
JIRA: N/A
...
Provide Http EndPoints for these components:
* Components:
* Root endpoint: List all the available endpoints
* * Config: Do the configuration.
* Bookkeeper : API related to BookKeeper.
* Ledger: API related to ledgers
...
/api/v1/<component>/<action>
2. Root endpoint:
/api/v1 |
---|
GET |
Get all the available endpoints |
Response Code | Description |
---|
200 | successful operation | 403 | Don't have permission |
|
3. Config:
/api/v1/config/valuesserver_config |
---|
GET |
Get value of all configured values overridden on local server config |
Response Code | Description |
---|
200 | successful operation | 403 | Don't have permission | 404Configuration | not foundError handling |
|
/api/v1/config/server_config |
---|
POSTPUT |
Update server configuration |
Parameters Name | Type | Required | Description |
---|
configName | String | Yes | Configuration name(key) | configValue | String | Yes | Configuration value(value) |
Body { "configs": { "configName1": "configValue1", "configName2": "configValue2" } } |
---|
Response Code | Description |
---|
204 | successful operation | 403 | Don't have permission | 404 | Configuration not found |
|
4. Bookkeeper:
/api/v1/bookkeeper/format_metadata/:force |
---|
POST |
Format bookkeeper metadata |
Parameters Name | Type | Required | Description |
---|
force | boolean | No | whether to force format and delete the old data |
Response Code | Description |
---|
204 | successful operation | 403 | Don't have permission |
|
/api/v1/bookkeeper/list_bookies/?type=<type>&print_hostnames=<hostnames> |
---|
GET |
Get all the available bookies. |
Parameters Name | Type | Required | Description |
---|
type | String | Yes | value: rw/ro , list read-write/read-only bookies | hostnames | Boolean | No | whether print hostname of bookie |
---|
Response Parameters Name | Type | Required | Description |
---|
idType | String | Yes | value: hostname/ip , Id by hostname or IP address |
Response Code | Description |
---|
200 | successful operation | 403 | Don't have permission |
|
/api/v1/bookkeeper/update_cookie/:idType |
---|
POST |
Update bookie id in cookie. |
Code | Description | 204 | successful operation | 403 | Don't have permission | 404Not | update, for errorsError handling |
|
...
53. Ledger:
...
:
...
Parameters
...
ensemble size
...
write quorum size
...
ack quorum size
...
...
...
Response
...
Don't have permission
...
No ledger found | /api/v1/ledger/delete/:?ledger_id=<ledger_id> |
---|
DELETE |
Delete a ledger. |
Parameters Name | Type | Required | Description |
---|
ledger_id | Long | Yes | ledger id of the ledger. |
Response Code | Description |
---|
200 | successful operation | 403 | Don't have permission | 404 | No ledger foundError handling |
|
/api/v1/ledger/list/:?print_metadata=<metadata> |
---|
GET |
List all the ledgers |
Parameters Name | Type | Required | Description |
---|
metadata | Boolean | No | whether print out metadata |
Response Code | Description |
---|
200 | successful operation. | 403 | Don't have permission | 404 | No ledger found |
|
/api/v1/ledger/metadata/:?ledger_id=<ledger_id> |
---|
GET |
Get the metadata of a ledger |
Parameters Name | Type | Required | Description |
---|
ledger_id | Long | Yes | ledger id of the ledger |
Response Code | Description |
---|
200 | successful operation. | 403 | Don't have permission | 404No | ledger foundError handling |
|
/api/v1/ledger/read/:?ledger_id/:=<ledger_id>&start_entry_id=<start_entry_id/:>&end_entry_id=<end_entry_id> |
---|
GET |
Read a range of entries from ledger |
Parameters Name | Type | Required | Description |
---|
ledger_id | Long | Yes | ledger id of the ledger | start_entry_id | Long | No | start entry id of read range | end_entry_id | Long | No | end entry id of read range |
Response Code | Description |
---|
200 | successful operation. | 403 | Don't have permission | 404No ledger found | Error handling |
|
4. Bookies
/api/v1/ledger/read/:ledger_id/:entry_data |
---|
PUT |
bookie/list_bookies/?type=<type>&print_hostnames=<hostnames> |
---|
GET |
Get all the available bookies.Write a entry to ledger |
Parameters Name | Type | Required | Description |
---|
ledger_idtype | LongString | Yes | ledger id of the ledger | value: rw/ro , list read-write/read-only bookies | hostnames | Boolean | No | whether print hostname of bookies | entry_data
| String | Yes | data to be written to ledger |
Response Code | Description | 204
---|
200 | successful operation | . | 403 | Don't have permission | 404 | No ledger found |
|
6. Bookies
/api/v1/bookie/formatlist_bookie/:delete_cookieinfo |
---|
PUT |
Format a bookie. |
Get |
Get bookies disk usage info of this cluster Parameters |
Name | Type | Required | Description |
---|
delete_cookie | Boolean | No | whether delete its cookie on zookeeper.
Response Code | Description |
---|
204200 | successful operation. | 403 | Don't have permission |
|
/api/v1/bookie/listlast_bookielog_infomark |
---|
GetGET |
Get current bookie disk usagethe last log marker. |
Response Code | Description |
---|
200 | successful operation. | 403 | Don't have permission |
|
/api/v1/bookie/list_disk_filesfile/:?file_type=<type> |
---|
GET |
Get all the files on disk of current bookie. |
Parameters Name | Type | Required | Description |
---|
type | String | No | file type: journal/entrylog/index. |
Response Code | Description |
---|
200 | successful operation. | 403 | Don't have permission |
|
/api/v1/bookie/read_entry_log/:print_msg/:ledger_id/:entry_id/:start_position/:end_positon |
---|
GET |
Read entry log content from entry log files. |
expand_storage |
---|
PUT |
Expand storage for a bookie. |
Parameters Name | Type | Required | Description |
---|
print_msg | Boolean | No | whether print message body. | ledger_id | Long | No | only read content of this ledger_id. | entry_id | Long | No | entry_id to read.. | start_position | Long | No | start position to read | end_positon | Long | No | end position of read |
Response Code | Description |
---|
200204 | successful operation. | 403 | Don't have permission |
|
5. Recover
/api/v1/ |
bookie/read_journal_file/:journal_dir/:journal_id/:print_msgGET |
Read journal fie content from disk.autorecovery/bookie/ |
---|
PUT |
Ledger data recovery for failed bookie |
Parameters Name | Type | Required | Description |
---|
|
journal |
dir |
Journal directory | bookie source to recovery | bookie_dest |
|
journal_id |
Yes | Journal file name/id. | No | bookie data recovery destination | delete_cookie |
|
print_msg |
whether print message body. | Response
Code | Description |
---|
200 | successful operation. |
403 | Don't have permission |
404 | File not found |
/api/v1/bookie/print_last_log_mark |
---|
GET |
Get the last log marker. |
Response Code | Description |
---|
200 | successful operation. | 403 | Don't have permission |
|
Body { "bookie_src": [ "bookie_src1", "bookie_src2"... ], "bookie_dest": [ "bookie_dest1", "bookie_dest2"... ], "delete_cookie": <bool_value> } |
---|
|
/api/v1/bookie/expend_storage |
---|
POST |
Format a bookie.Response |
204200 | successful operation. | 403 | Don't have permission |
|
...
/api/v1/ |
recover/bookie/:bookie_src/:bookie_dest/:delete_cookiePOST |
Ledger data recovery for failed bookieautorecovery/list_under_replicated_ledger/?missingreplica=<bookie_address>&excludingmissingreplica=<bookie_address> |
---|
GET |
Get all under replicated ledgers. |
Parameters Name | Type | Required | Description |
---|
|
bookie_srcbookie_dest | String | Yes | bookie data recovery destination |
delete_cookie | Boolean | No | Whether delete cookie |
|
Yes | bookie source to recovery | No | missing replica bookieId | excludingmissingreplica | String | No | exclude missing replica bookieId |
|
Response Code | Description |
---|
200 | successful operation. | 403 | Don't have permission | 404 | Not found |
|
Bookie |
/api/v1/recoverautorecovery/who_is_auditor |
---|
GET |
Get auditor bookie id. |
Response Code | Description |
---|
200 | successful operation. | 403 | Don't have permission | 404Not | found under replication node for auditorError handling |
|
/api/v1/recoverautorecovery/trigertrigger_audit |
---|
PUT |
Force trigger audit by resting the lostBookieRecoveryDelay. |
Response Code | Description |
---|
204200 | successful operation. | 403 | Don't have permission | 404Not | found under replication nodeError handling |
|
/api/v1/recoverautorecovery/lost_bookie_recovery_delay |
---|
GET |
Get lostBookieRecoveryDelay value in seconds. |
Response Code | Description |
---|
200 | successful operation. | 403 | Don't have permission | 404 | Not found under replication node |
|
/api/v1/recoverautorecover/lost_bookie_recovery_delay/:seconds |
---|
POSTPUT |
Set lostBookieRecoveryDelay value in seconds. |
Parameters Name | Type | Required | Description |
---|
delay_seconds | Long | Yes | set delay value in seconds. |
Body { "delay_seconds": <delay_seconds> } |
---|
Response Code | Description |
---|
204 | successful operation. | 403 | Don't have permission | 404 | Not found under replication node |
|
/api/v1/recoverautorecovery/decommission |
---|
POSTPUT |
Decommission Bookie, Force trigger Audittask and make sure all the ledgers stored in the decommissioning bookie are replicated. |
Parameters Response Code | Description |
---|
204 | successful operation. | 403 | Don't have permission | 404 | Not found under replication node |
|
/api/v1/recover/list_under_replicated_ledger |
---|
GET |
bookie_src | String | Yes | Bookie src to decommission. |
Body { "bookie_src": bookie_src, } |
---|
Get all under replicated ledgers.Response Code | Description |
---|
200204 | successful operation. | 403 | Don't have permission | 404 | Not found under replication node |
|
...
Compatibility, Deprecation, and Migration Plan
...