Skip to content
Snippets Groups Projects
Commit 01d1c4b9 authored by Vincent Texier's avatar Vincent Texier
Browse files

Add node/sandboxes in bma api

parent 7d822aee
No related branches found
No related tags found
No related merge requests found
Pipeline #4094 passed
...@@ -23,15 +23,7 @@ logger = logging.getLogger("duniter/node") ...@@ -23,15 +23,7 @@ logger = logging.getLogger("duniter/node")
MODULE = 'node' MODULE = 'node'
SUMMARY_SCHEMA = {
async def summary(client: Client) -> dict:
"""
GET Duniter node version and infos
:param client: Client to connect to the api
:return:
"""
schema = {
"type": "object", "type": "object",
"properties": { "properties": {
"duniter": { "duniter": {
...@@ -53,4 +45,45 @@ async def summary(client: Client) -> dict: ...@@ -53,4 +45,45 @@ async def summary(client: Client) -> dict:
"required": ["duniter"] "required": ["duniter"]
} }
return await client.get(MODULE + '/summary', schema=schema) SANDBOX_SCHEMA = {
"type": "object",
"properties": {
"size": {
"type": "number"
},
"free": {
"type": "number"
}
},
"required": ["size", "free"]
}
SANDBOXES_SCHEMA = {
"type": "object",
"properties": {
"identities": SANDBOX_SCHEMA,
"memberships": SANDBOX_SCHEMA,
"transactions": SANDBOX_SCHEMA
},
"required": ["identities", "memberships", "transactions"]
}
async def summary(client: Client) -> dict:
"""
GET Duniter node version and infos
:param client: Client to connect to the api
:return:
"""
return await client.get(MODULE + '/summary', schema=SUMMARY_SCHEMA)
async def sandboxes(client: Client) -> dict:
"""
GET Duniter node version and infos
:param client: Client to connect to the api
:return:
"""
return await client.get(MODULE + '/sandboxes', schema=SANDBOXES_SCHEMA)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment