2023-03-15 14:10:53 +01:00
openapi : 3.0 .3
info :
version : 0.0 .1
2025-12-18 18:23:09 +01:00
title : Logos Storage API
description : "List of endpoints and interfaces available to Logos Storage API users"
2023-03-15 14:10:53 +01:00
security :
2025-01-24 18:18:00 +01:00
- {}
2023-03-15 14:10:53 +01:00
components :
schemas :
MultiAddress :
type : string
description : Address of node as specified by the multi-address specification https://multiformats.io/multiaddr/
example : /ip4/127.0.0.1/tcp/8080
PeerId :
type : string
description : Peer Identity reference as specified at https://docs.libp2p.io/concepts/fundamentals/peers/
example : QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N
2024-03-21 11:53:45 +01:00
Id :
type : string
description : 32bits identifier encoded in hex-decimal string.
2024-09-24 10:37:08 +02:00
minLength : 66
maxLength : 66
2024-03-21 11:53:45 +01:00
example : 0x...
2023-03-15 14:10:53 +01:00
Cid :
type : string
description : Content Identifier as specified at https://github.com/multiformats/cid
example : QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N
LogLevel :
type : string
description : "One of the log levels: TRACE, DEBUG, INFO, NOTICE, WARN, ERROR or FATAL"
example : DEBUG
2024-04-02 14:13:49 +03:00
SPR :
type : string
description : Signed Peer Record (libp2p)
SPRRead :
type : object
2025-04-02 16:09:23 +02:00
required :
- spr
2024-04-02 14:13:49 +03:00
properties :
spr :
$ref : "#/components/schemas/SPR"
PeerIdRead :
type : object
properties :
id :
$ref : "#/components/schemas/PeerId"
2024-10-25 08:20:00 +01:00
Node :
type : object
2025-04-02 16:09:23 +02:00
required :
- nodeId
- peerId
- record
- address
- seen
2024-10-25 08:20:00 +01:00
properties :
nodeId :
type : string
peerId :
type : string
record :
type : string
address :
type : string
seen :
type : boolean
2025-12-18 18:23:09 +01:00
StorageVersion :
2024-10-25 08:20:00 +01:00
type : object
properties :
version :
type : string
example : v0.1.7
revision :
type : string
example : 0c647d8
PeersTable :
type : object
2025-04-02 16:09:23 +02:00
required :
- localNode
- nodes
2024-10-25 08:20:00 +01:00
properties :
localNode :
$ref : "#/components/schemas/Node"
nodes :
type : array
items :
$ref : "#/components/schemas/Node"
2023-03-15 14:10:53 +01:00
DebugInfo :
type : object
2025-04-02 16:09:23 +02:00
required :
- id
- addrs
- repo
- spr
- announceAddresses
- table
2025-12-18 18:23:09 +01:00
- storage
2023-03-15 14:10:53 +01:00
properties :
id :
$ref : "#/components/schemas/PeerId"
addrs :
type : array
items :
$ref : "#/components/schemas/MultiAddress"
repo :
type : string
description : Path of the data repository where all nodes data are stored
spr :
2024-04-02 14:13:49 +03:00
$ref : "#/components/schemas/SPR"
2025-01-08 08:34:54 +01:00
announceAddresses :
type : array
items :
$ref : "#/components/schemas/MultiAddress"
2024-10-25 08:20:00 +01:00
table :
$ref : "#/components/schemas/PeersTable"
2025-12-18 18:23:09 +01:00
storage :
$ref : "#/components/schemas/StorageVersion"
2023-03-15 14:10:53 +01:00
2023-11-09 09:47:09 +01:00
DataList :
type : object
2025-04-02 16:09:23 +02:00
required :
- content
2023-11-09 09:47:09 +01:00
properties :
content :
type : array
items :
$ref : "#/components/schemas/DataItem"
DataItem :
type : object
2025-04-02 16:09:23 +02:00
required :
- cid
- manifest
2023-11-09 09:47:09 +01:00
properties :
cid :
$ref : "#/components/schemas/Cid"
manifest :
$ref : "#/components/schemas/ManifestItem"
ManifestItem :
type : object
2025-04-02 16:09:23 +02:00
required :
- treeCid
- datasetSize
- blockSize
2023-11-09 09:47:09 +01:00
properties :
2024-11-15 20:21:18 +07:00
treeCid :
2023-11-09 09:47:09 +01:00
$ref : "#/components/schemas/Cid"
2024-11-15 20:21:18 +07:00
description : "Unique data identifier"
datasetSize :
2024-03-29 19:18:41 +01:00
type : integer
2024-06-06 11:44:58 +02:00
format : int64
2023-11-09 09:47:09 +01:00
description : "Length of original content in bytes"
blockSize :
2024-03-29 19:18:41 +01:00
type : integer
2023-11-09 09:47:09 +01:00
description : "Size of blocks"
2024-10-25 14:43:19 +01:00
filename :
type : string
2024-11-15 20:21:18 +07:00
nullable : true
2024-10-25 14:43:19 +01:00
description : "The original name of the uploaded content (optional)"
example : codex.png
mimetype :
type : string
2024-11-15 20:21:18 +07:00
nullable : true
2024-10-25 14:43:19 +01:00
description : "The original mimetype of the uploaded content (optional)"
example : image/png
2023-11-09 09:47:09 +01:00
2023-12-14 11:57:16 +01:00
Space :
type : object
2025-04-02 16:09:23 +02:00
required :
- totalBlocks
- quotaMaxBytes
- quotaUsedBytes
- quotaReservedBytes
2023-12-14 11:57:16 +01:00
properties :
totalBlocks :
description : "Number of blocks stored by the node"
2024-03-29 19:18:41 +01:00
type : integer
2024-06-06 11:44:58 +02:00
format : int64
2023-12-14 11:57:16 +01:00
quotaMaxBytes :
2024-03-29 19:18:41 +01:00
type : integer
2024-06-06 11:44:58 +02:00
format : int64
2025-12-18 18:23:09 +01:00
description : "Maximum storage space (in bytes) available for the node in Logos Storage's local repository."
2023-12-14 11:57:16 +01:00
quotaUsedBytes :
2024-03-29 19:18:41 +01:00
type : integer
2024-06-06 11:44:58 +02:00
format : int64
2025-12-18 18:23:09 +01:00
description : "Amount of storage space (in bytes) currently used for storing files in Logos Storage's local repository."
2023-12-14 11:57:16 +01:00
quotaReservedBytes :
2024-03-29 19:18:41 +01:00
type : integer
2024-06-06 11:44:58 +02:00
format : int64
2025-12-18 18:23:09 +01:00
description : "Amount of storage reserved (in bytes) in the Logos Storage's local repository for future use when storage requests will be picked up and hosted by the node using node's availabilities. This does not include the storage currently in use."
2023-12-14 11:57:16 +01:00
2023-03-15 14:10:53 +01:00
servers :
2025-12-18 18:23:09 +01:00
- url : "http://localhost:8080/api/storage/v1"
2023-03-15 14:10:53 +01:00
tags :
- name : Data
description : Data operations
- name : Node
description : Node management
- name : Debug
description : Debugging configuration
paths :
"/connect/{peerId}" :
get :
summary : "Connect to a peer"
description : |
If `addrs` param is supplied, it will be used to dial the peer, otherwise the `peerId` is used
to invoke peer discovery, if it succeeds the returned addresses will be used to dial.
2025-01-24 18:18:00 +01:00
tags : [ Node]
2023-03-15 14:10:53 +01:00
operationId : connectPeer
parameters :
- in : path
name : peerId
required : true
schema :
2025-01-24 18:18:00 +01:00
$ref : "#/components/schemas/PeerId"
2023-03-15 14:10:53 +01:00
description : Peer that should be dialed.
- in : query
name : addrs
schema :
type : array
nullable : true
items :
$ref : "#/components/schemas/MultiAddress"
description : |
If supplied, it will be used to dial the peer.
The address has to target the listening address of the peer,
which is specified with the `--listen-addrs` CLI flag.
responses :
"200" :
description : Successfully connected to peer
"400" :
description : Peer either not found or was not possible to dial
2023-11-20 18:14:06 -06:00
"/data" :
2023-03-15 14:10:53 +01:00
get :
2023-11-09 09:47:09 +01:00
summary : "Lists manifest CIDs stored locally in node."
2025-01-24 18:18:00 +01:00
tags : [ Data]
2023-11-09 09:47:09 +01:00
operationId : listData
2023-03-15 14:10:53 +01:00
responses :
"200" :
2023-11-09 09:47:09 +01:00
description : Retrieved list of content CIDs
2023-03-15 14:10:53 +01:00
content :
2023-11-09 09:47:09 +01:00
application/json :
2023-03-15 14:10:53 +01:00
schema :
2024-03-26 16:12:15 +01:00
$ref : "#/components/schemas/DataList"
2023-03-15 14:10:53 +01:00
"400" :
description : Invalid CID is specified
"404" :
description : Content specified by the CID is not found
2024-10-25 14:43:19 +01:00
"422" :
description : The content type is not a valid content type or the filename is not valid
2023-03-15 14:10:53 +01:00
"500" :
description : Well it was bad-bad
post :
2023-11-09 09:47:09 +01:00
summary : "Upload a file in a streaming manner. Once finished, the file is stored in the node and can be retrieved by any node in the network using the returned CID."
2025-01-24 18:18:00 +01:00
tags : [ Data]
2023-03-15 14:10:53 +01:00
operationId : upload
2024-10-29 15:40:43 +01:00
parameters :
- name : content-type
in : header
required : false
description : The content type of the file. Must be valid.
schema :
type : string
example : "image/png"
- name : content-disposition
in : header
required : false
description : The content disposition used to send the filename.
schema :
type : string
2025-01-24 18:18:00 +01:00
example : 'attachment; filename="codex.png"'
2023-03-15 14:10:53 +01:00
requestBody :
content :
application/octet-stream :
schema :
type : string
format : binary
responses :
"200" :
description : CID of uploaded file
content :
text/plain :
schema :
type : string
2025-04-04 14:58:23 +02:00
"422" :
description : The mimetype of the filename is invalid
2023-03-15 14:10:53 +01:00
"500" :
description : Well it was bad-bad and the upload did not work out
2023-11-09 09:47:09 +01:00
"/data/{cid}" :
get :
2023-11-20 18:14:06 -06:00
summary : "Download a file from the local node in a streaming manner. If the file is not available locally, a 404 is returned."
2025-01-24 18:18:00 +01:00
tags : [ Data]
2023-11-20 18:14:06 -06:00
operationId : downloadLocal
parameters :
- in : path
name : cid
required : true
schema :
2025-01-24 18:18:00 +01:00
$ref : "#/components/schemas/Cid"
2023-11-20 18:14:06 -06:00
description : File to be downloaded.
responses :
"200" :
description : Retrieved content specified by CID
content :
application/octet-stream :
schema :
type : string
format : binary
"400" :
description : Invalid CID is specified
"404" :
description : Content specified by the CID is unavailable locally
"500" :
description : Well it was bad-bad
2025-05-03 18:54:38 +02:00
delete :
summary : "Deletes either a single block or an entire dataset from the local node."
tags : [ Data]
operationId : deleteLocal
parameters :
- in : path
name : cid
required : true
schema :
$ref : "#/components/schemas/Cid"
description : Block or dataset to be deleted.
responses :
"204" :
description : Data was successfully deleted.
"400" :
description : Invalid CID is specified
"500" :
description : There was an error during deletion
2023-11-20 18:14:06 -06:00
"/data/{cid}/network" :
2024-10-17 18:54:28 +02:00
post :
summary : "Download a file from the network to the local node if it's not available locally. Note: Download is performed async. Call can return before download is completed."
2025-01-24 18:18:00 +01:00
tags : [ Data]
2024-10-17 18:54:28 +02:00
operationId : downloadNetwork
parameters :
- in : path
name : cid
required : true
schema :
2025-01-24 18:18:00 +01:00
$ref : "#/components/schemas/Cid"
2024-10-17 18:54:28 +02:00
description : "File to be downloaded."
responses :
"200" :
description : Manifest information for download that has been started.
content :
application/json :
schema :
$ref : "#/components/schemas/DataItem"
"400" :
description : Invalid CID is specified
"404" :
description : Failed to download dataset manifest
"500" :
description : Well it was bad-bad
"/data/{cid}/network/stream" :
2023-11-20 18:14:06 -06:00
get :
summary : "Download a file from the network in a streaming manner. If the file is not available locally, it will be retrieved from other nodes in the network if able."
2025-01-24 18:18:00 +01:00
tags : [ Data]
2024-10-17 18:54:28 +02:00
operationId : downloadNetworkStream
2023-11-09 09:47:09 +01:00
parameters :
- in : path
name : cid
required : true
schema :
2025-01-24 18:18:00 +01:00
$ref : "#/components/schemas/Cid"
2023-12-14 11:57:16 +01:00
description : "File to be downloaded."
2023-11-09 09:47:09 +01:00
responses :
"200" :
description : Retrieved content specified by CID
content :
application/octet-stream :
schema :
type : string
format : binary
"400" :
description : Invalid CID is specified
"404" :
description : Content specified by the CID is not found
"500" :
description : Well it was bad-bad
2024-10-17 18:54:28 +02:00
"/data/{cid}/network/manifest" :
get :
summary : "Download only the dataset manifest from the network to the local node if it's not available locally."
2025-01-24 18:18:00 +01:00
tags : [ Data]
2024-10-17 18:54:28 +02:00
operationId : downloadNetworkManifest
parameters :
- in : path
name : cid
required : true
schema :
2025-01-24 18:18:00 +01:00
$ref : "#/components/schemas/Cid"
2024-10-17 18:54:28 +02:00
description : "File for which the manifest is to be downloaded."
responses :
"200" :
description : Manifest information.
content :
application/json :
schema :
$ref : "#/components/schemas/DataItem"
"400" :
description : Invalid CID is specified
"404" :
description : Failed to download dataset manifest
"500" :
description : Well it was bad-bad
2025-11-02 08:32:47 +04:00
"/data/{cid}/exists" :
get :
summary : "Check if a block identified by CID exists in the local node."
tags : [ Data]
operationId : hasBlock
parameters :
- in : path
name : cid
required : true
schema :
$ref : "#/components/schemas/Cid"
description : "CID of the block to check."
responses :
"200" :
description : Block existence information
content :
application/json :
schema :
type : object
properties :
has :
type : boolean
description : Indicates whether the block exists in the local node
"400" :
description : Invalid CID is specified
"500" :
description : Well it was bad-bad
2023-12-14 11:57:16 +01:00
"/space" :
get :
summary : "Gets a summary of the storage space allocation of the node."
2025-01-24 18:18:00 +01:00
tags : [ Data]
2023-12-14 11:57:16 +01:00
operationId : space
responses :
"200" :
description : "Summary of storage allocation"
content :
application/json :
schema :
$ref : "#/components/schemas/Space"
"500" :
description : "It's not working as planned"
2024-10-14 19:26:58 +02:00
"/spr" :
2024-04-02 14:13:49 +03:00
get :
summary : "Get Node's SPR"
operationId : getSPR
2025-01-24 18:18:00 +01:00
tags : [ Node]
2024-04-02 14:13:49 +03:00
responses :
"200" :
description : Node's SPR
content :
2025-04-02 16:09:23 +02:00
text/plain :
2024-04-02 14:13:49 +03:00
schema :
$ref : "#/components/schemas/SPR"
application/json :
schema :
$ref : "#/components/schemas/SPRRead"
"503" :
description : Node SPR not ready, try again later
2024-10-14 19:26:58 +02:00
"/peerid" :
2024-04-02 14:13:49 +03:00
get :
summary : "Get Node's PeerID"
operationId : getPeerId
2025-01-24 18:18:00 +01:00
tags : [ Node]
2024-04-02 14:13:49 +03:00
responses :
"200" :
description : Node's Peer ID
content :
2025-04-02 16:09:23 +02:00
text/plain :
2024-04-02 14:13:49 +03:00
schema :
$ref : "#/components/schemas/PeerId"
application/json :
schema :
$ref : "#/components/schemas/PeerIdRead"
2023-03-15 14:10:53 +01:00
"/debug/chronicles/loglevel" :
post :
summary : "Set log level at run time"
2025-01-24 18:18:00 +01:00
tags : [ Debug]
2023-03-15 14:10:53 +01:00
operationId : setDebugLogLevel
parameters :
- in : query
name : level
required : true
schema :
$ref : "#/components/schemas/LogLevel"
responses :
"200" :
description : Successfully log level set
"400" :
description : Invalid or missing log level
"500" :
description : Well it was bad-bad
"/debug/info" :
get :
summary : "Gets node information"
operationId : getDebugInfo
2025-01-24 18:18:00 +01:00
tags : [ Debug]
2023-03-15 14:10:53 +01:00
responses :
"200" :
description : Node's information
content :
application/json :
schema :
$ref : "#/components/schemas/DebugInfo"