Skip to content

ImmuxDB http api changes #154

@poppindouble

Description

@poppindouble

Currently we have totally 10 http APIs exposed in ImmuxDB, here are the APIs:

Get:

get_chain_name: http://{host}/{grouping}?chain
unconditional select: http://{host}/{grouping}?select
inspect: http://{host}/{grouping}/{id}?inspect
get_by_id: http://{host}/{grouping}/{id}

Put:

revert_by_id: http://{host}/{grouping}/{id}?revert={height}
revert_all_query: http://{host}/{grouping}/{id}?revert_all={height}
switch_chain: http://{host}/?chain={chain_name}
create_index: http://{host}/{grouping}?index={property_name}
set_batch_units: http://{host}/{grouping}/internal_api_target_id_identifier, body: {units}
set_unit: http://{host}/{grouping}/{id}, body: {unit}

Current APIs we have is a bit ad hoc, I went through the codebase, and here is the new APIs I want to introduced.

Get:

get chain: http://{host}/chain

unconditional select: http://{host}/{chain_name}/{grouping}/units

fetch unit by id: http://{host}/{chain_name}/{grouping}/units/{id}

fetch units by name property: http://{host}/{chain_name}/{grouping}/units?property_name={property_name}&unit_content_str={unit_content_str}

inspect unit: http://{host}/{chain_name}/{grouping}/units/{id}/journal

Put:

set chain: http://{host}/chain 
body: chain_name

add unit to grouping: http://{host}/{chain_name}/{grouping}/units/{id}
body: unit_content

set batch units: http://{host}/{chain_name}/{grouping}/units
body: units

revert single unit: http://{host}/{chain_name}/{grouping}/units/{id}/journal
body: height

revert all: http://{host}/{chain_name}/{grouping}/units/journal
body: height

create index: http://{host}/{chain_name}/{grouping}/indexes
body: property_name

I am thinking the body of put method is gonna be a json string, so when we received on the server side, we can use serde to parse it into a json. I am working on it now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions