Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Status

Current state"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 endpointConfig:

/api/v1

GET
Get all the available endpoints

Response

CodeDescription
200successful operation
403Don't have permission

 

3. Config:

/api/v1//config/server_config

GET

Get value of all configured values overridden on local server config

Response

CodeDescription
200successful operation
403

Don't have permission

404Configuration not foundError handling


/api/v1/config/server_config

POSTPUT
Update server configuration

Parameters

NameTypeRequiredDescription
configNameStringYesConfiguration name(key) 
configValueStringYesConfiguration value(value)

Body

{
   "configName1": "configValue1",
   "configName2": "configValue2"
}


Response

CodeDescription
204successful operation
403

Don't have permission

404Configuration not found

...

4. Bookkeeper:

 

/api/v1/bookkeeper/list_bookies/?type=<type>&print_hostnames=<hostnames>

GET
 Get all the available bookies.

Parameters

NameTypeRequiredDescription
typeStringYes

 value: rw/ro , list read-write/read-only bookies 

hostnamesBooleanNo whether print hostname of bookie  

Response

CodeDescription
200successful operation
403

Don't have permission

/api/v1/bookkeeper/update_cookie/?bookie_id_type=<idType>

POST

Update bookie id in cookie.

Parameters

NameTypeRequiredDescription
idTypeStringYes

 value:  hostname/ip ,  Id by hostname or IP address 

Response

CodeDescription
204successful operation
403

Don't have permission

404Not update, for errors

 

404Error handling

 

35. Ledger:

 

/api/v1/ledger/delete/?ledger_id=<ledger_id>

DELETE
Delete a ledger.

Parameters

NameTypeRequiredDescription
ledger_idLongYes

 ledger id of the ledger. 

Response

No ledger found
Code

Description

200successful operation
403

Don't have permission

404Error handling

/api/v1/ledger/list/?print_metadata=<metadata>

GET

List all the ledgers

Parameters

NameTypeRequiredDescription
metadataBooleanNo

 whether print out metadata 

Response

Code

Description

200successful operation.
403

Don't have permission

404No ledger found

/api/v1/ledger/metadata/?ledger_id=<ledger_id>

GET

Get the metadata of a ledger

Parameters

NameTypeRequiredDescription
ledger_idLongYes

 ledger id of the ledger 

Response

Code

Description

200successful 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

NameTypeRequiredDescription
ledger_idLongYes

 ledger id of the ledger 

start_entry_idLongNo

 start entry id of read range

end_entry_idLongNo

 end entry id of read range

Response

Code

Description

200successful operation.
403

Don't have permission

404No ledger foundError handling

 

64. Bookies

/api/v1/bookie/list_bookie_info

Get

Get current bookie disk usage.

Response

Code

Description

200successful operation.
403

Don't have permission

bookies/?type=<type>&print_hostnames=<hostnames>

GET
 Get all the available bookies.

Parameters

NameTypeRequiredDescription
typeStringYes

 value: rw/ro , list read-write/read-only bookies 

hostnamesBooleanNo whether print hostname of bookies

/api/v1/bookie/last_log_mark

GET
Get the last log marker.

Response

.
CodeDescription
200successful operation
403

Don't have permission

/api/v1/bookie/list_disk_files/?file_type=<type>

GET

Get all the files on disk of current bookie.

bookie_info

Get

Get bookies disk usage info of this cluster.

Parameters

NameTypeRequiredDescription
typeStringNo

  file type: journal/entrylog/index.

Response

Code

Description

200successful operation.
403

Don't have permission

/api/v1/bookie/read_entrylast_log/?print_msg=<print_msg>&ledger_id=<ledger_id>

&entry_id=<entry_id>&start_position=<start_position>&end_positon=<end_positon>

GET
Read entry log content from entry log files.

_mark

GET

Get the last log marker.

Parameters

NameTypeRequiredDescription
print_msgBooleanNo

whether print message body.

ledger_idLongNoonly read content of this ledger_id.
entry_idLongNoentry_id to read..
start_positionLongNo

start position to read

end_positonLongNo end position of read

Response

Code

Description

200successful operation.
403

Don't have permission

/api/v1/bookie/readlist_journaldisk_file/?journalfile_dir=<journal_dir>&journal_id=<journal_id>&print_msg=<print_msg>

GET

type=<type>

GET

Get all the files on disk of current bookieRead journal fie content from disk.

Parameters

whether print message body
NameTypeRequiredDescription
journal_dirtypeStringYes

Journal directory

journal_idStringYes

Journal file name/id.

No

  file type: journal/entrylog/index

print_msgBooleanNo

.

Response

File not found
Code

Description

200successful operation.
403

Don't have permission

404

/api/v1/bookie/expendexpand_storage

POSTPUT

Expend Expand storage for a bookie.

Response

Code

Description

204successful operation.
403

Don't have permission

 

 

75. Recover

/api/v1/autorecovery/bookie/

POSTPUT
Ledger data recovery for failed bookie

Parameters

NameTypeRequiredDescription
bookie_srcStringYesbookie source to recovery
bookie_destStringYesNobookie data recovery destination
delete_cookieBooleanNoWhether delete cookie

Body

{
 "bookie_src": [ "bookie_src1", "bookie_src2"... ],

 "bookie_dest": [ "bookie_dest1", "bookie_dest2"... ],

 "delete_cookie": <bool_value>

}

Response

Code

Description

200successful operation.
403

Don't have permission

404Not found Bookie

/api/v1/autorecovery/who_is_auditor/list_under_replicated_ledger/?missingreplica=<bookie_address>&excludingmissingreplica=<bookie_address>

GET
Get auditor id.all under replicated ledgers.

Parameters

NameTypeRequiredDescription
missingreplicaStringNomissing replica bookieId
excludingmissingreplicaStringNoexclude missing replica bookieId


Response

Code

Description

200successful operation.
403

Don't have permission

404Not found under replication node for auditor

/api/v1/autorecovery/who_is_auditor

GET
Get auditor bookie id.

Response

Code

Description

200successful operation.
403

Don't have permission

404Error handling

/api/v1/autorecovery/trigertrigger_audit

PUT
Force trigger audit by resting the lostBookieRecoveryDelay.

Response

Code

Description

204200successful operation.
403

Don't have permission

404Not found under replication nodeError handling

/api/v1/autorecovery/lost_bookie_recovery_delay

GET
Get lostBookieRecoveryDelay value in seconds.

Response

Code

Description

200successful operation.
403

Don't have permission

404Not found under replication node

/api/v1/autorecover/lost_bookie_recovery_delay

POSTPUT

Set lostBookieRecoveryDelay value in seconds.

Parameters

NameTypeRequiredDescription
delay_seconds
LongYes

 set delay value in seconds.

Body

{
 "delay_seconds": <delay_seconds>

}

Response

Code

Description

204successful operation.
403

Don't have permission

404Not found under replication node

/api/v1/autorecovery/decommission

POSTPUT
Decommission Bookie, Force trigger Audittask and make sure all the ledgers stored in the decommissioning bookie are replicated.

Parameters

NameTypeRequiredDescription
bookie_srcStringYes

 Bookie src to decommission.

 

Body

{
 "bookie_src": bookie_src,

}

Response

Code

Description

204successful operation.
403

Don't have permission

404Not found under replication node

/api/v1/autorecovery/list_under_replicated_ledger

GET
Get all under replicated ledgers.

Response

Code

Description

200successful operation.
403

Don't have permission

404Not found under replication node

...

 

Compatibility, Deprecation, and Migration Plan

...