mirror of
https://github.com/logos-storage/logos-storage-py-api-client.git
synced 2026-02-16 11:23:13 +00:00
Generated API update
This commit is contained in:
parent
7fd5545959
commit
19e8f5cb50
@ -4,63 +4,45 @@ codex_api_client/__init__.py
|
||||
codex_api_client/api/__init__.py
|
||||
codex_api_client/api/data_api.py
|
||||
codex_api_client/api/debug_api.py
|
||||
codex_api_client/api/marketplace_api.py
|
||||
codex_api_client/api/node_api.py
|
||||
codex_api_client/api_client.py
|
||||
codex_api_client/api_response.py
|
||||
codex_api_client/configuration.py
|
||||
codex_api_client/exceptions.py
|
||||
codex_api_client/models/__init__.py
|
||||
codex_api_client/models/codex_version.py
|
||||
codex_api_client/models/content.py
|
||||
codex_api_client/models/data_item.py
|
||||
codex_api_client/models/data_list.py
|
||||
codex_api_client/models/debug_info.py
|
||||
codex_api_client/models/has_block200_response.py
|
||||
codex_api_client/models/manifest_item.py
|
||||
codex_api_client/models/node.py
|
||||
codex_api_client/models/peer_id_read.py
|
||||
codex_api_client/models/peers_table.py
|
||||
codex_api_client/models/purchase.py
|
||||
codex_api_client/models/reservation.py
|
||||
codex_api_client/models/sales_availability.py
|
||||
codex_api_client/models/sales_availability_read.py
|
||||
codex_api_client/models/slot.py
|
||||
codex_api_client/models/slot_agent.py
|
||||
codex_api_client/models/space.py
|
||||
codex_api_client/models/spr_read.py
|
||||
codex_api_client/models/storage_ask.py
|
||||
codex_api_client/models/storage_request.py
|
||||
codex_api_client/models/storage_request_creation.py
|
||||
codex_api_client/models/storage_version.py
|
||||
codex_api_client/py.typed
|
||||
codex_api_client/rest.py
|
||||
docs/CodexVersion.md
|
||||
docs/Content.md
|
||||
docs/DataApi.md
|
||||
docs/DataItem.md
|
||||
docs/DataList.md
|
||||
docs/DebugApi.md
|
||||
docs/DebugInfo.md
|
||||
docs/HasBlock200Response.md
|
||||
docs/ManifestItem.md
|
||||
docs/MarketplaceApi.md
|
||||
docs/Node.md
|
||||
docs/NodeApi.md
|
||||
docs/PeerIdRead.md
|
||||
docs/PeersTable.md
|
||||
docs/Purchase.md
|
||||
docs/Reservation.md
|
||||
docs/SPRRead.md
|
||||
docs/SalesAvailability.md
|
||||
docs/SalesAvailabilityREAD.md
|
||||
docs/Slot.md
|
||||
docs/SlotAgent.md
|
||||
docs/Space.md
|
||||
docs/StorageAsk.md
|
||||
docs/StorageRequest.md
|
||||
docs/StorageRequestCreation.md
|
||||
docs/StorageVersion.md
|
||||
pyproject.toml
|
||||
requirements.txt
|
||||
setup.cfg
|
||||
setup.py
|
||||
test-requirements.txt
|
||||
test/__init__.py
|
||||
test/test_has_block200_response.py
|
||||
test/test_storage_version.py
|
||||
tox.ini
|
||||
|
||||
31
README.md
31
README.md
@ -1,5 +1,5 @@
|
||||
# codex-api-client
|
||||
List of endpoints and interfaces available to Codex API users
|
||||
List of endpoints and interfaces available to Logos Storage API users
|
||||
|
||||
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
||||
|
||||
@ -33,10 +33,10 @@ import codex_api_client
|
||||
from codex_api_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
|
||||
# Defining the host is optional and defaults to http://localhost:8080/api/codex/v1
|
||||
# Defining the host is optional and defaults to http://localhost:8080/api/storage/v1
|
||||
# See configuration.py for a list of all supported configuration parameters.
|
||||
configuration = codex_api_client.Configuration(
|
||||
host = "http://localhost:8080/api/codex/v1"
|
||||
host = "http://localhost:8080/api/storage/v1"
|
||||
)
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@ with codex_api_client.ApiClient(configuration) as api_client:
|
||||
|
||||
## Documentation for API Endpoints
|
||||
|
||||
All URIs are relative to *http://localhost:8080/api/codex/v1*
|
||||
All URIs are relative to *http://localhost:8080/api/storage/v1*
|
||||
|
||||
Class | Method | HTTP request | Description
|
||||
------------ | ------------- | ------------- | -------------
|
||||
@ -66,20 +66,12 @@ Class | Method | HTTP request | Description
|
||||
*DataApi* | [**download_network**](docs/DataApi.md#download_network) | **POST** /data/{cid}/network | 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.
|
||||
*DataApi* | [**download_network_manifest**](docs/DataApi.md#download_network_manifest) | **GET** /data/{cid}/network/manifest | Download only the dataset manifest from the network to the local node if it's not available locally.
|
||||
*DataApi* | [**download_network_stream**](docs/DataApi.md#download_network_stream) | **GET** /data/{cid}/network/stream | 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.
|
||||
*DataApi* | [**has_block**](docs/DataApi.md#has_block) | **GET** /data/{cid}/exists | Check if a block identified by CID exists in the local node.
|
||||
*DataApi* | [**list_data**](docs/DataApi.md#list_data) | **GET** /data | Lists manifest CIDs stored locally in node.
|
||||
*DataApi* | [**space**](docs/DataApi.md#space) | **GET** /space | Gets a summary of the storage space allocation of the node.
|
||||
*DataApi* | [**upload**](docs/DataApi.md#upload) | **POST** /data | 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.
|
||||
*DebugApi* | [**get_debug_info**](docs/DebugApi.md#get_debug_info) | **GET** /debug/info | Gets node information
|
||||
*DebugApi* | [**set_debug_log_level**](docs/DebugApi.md#set_debug_log_level) | **POST** /debug/chronicles/loglevel | Set log level at run time
|
||||
*MarketplaceApi* | [**create_storage_request**](docs/MarketplaceApi.md#create_storage_request) | **POST** /storage/request/{cid} | Creates a new Request for storage
|
||||
*MarketplaceApi* | [**get_active_slot_by_id**](docs/MarketplaceApi.md#get_active_slot_by_id) | **GET** /sales/slots/{slotId} | Returns active slot with id {slotId} for the host
|
||||
*MarketplaceApi* | [**get_active_slots**](docs/MarketplaceApi.md#get_active_slots) | **GET** /sales/slots | Returns active slots
|
||||
*MarketplaceApi* | [**get_availabilities**](docs/MarketplaceApi.md#get_availabilities) | **GET** /sales/availability | Returns storage that is for sale
|
||||
*MarketplaceApi* | [**get_purchase**](docs/MarketplaceApi.md#get_purchase) | **GET** /storage/purchases/{id} | Returns purchase details
|
||||
*MarketplaceApi* | [**get_purchases**](docs/MarketplaceApi.md#get_purchases) | **GET** /storage/purchases | Returns list of purchase IDs
|
||||
*MarketplaceApi* | [**get_reservations**](docs/MarketplaceApi.md#get_reservations) | **GET** /sales/availability/{id}/reservations | Get availability's reservations
|
||||
*MarketplaceApi* | [**offer_storage**](docs/MarketplaceApi.md#offer_storage) | **POST** /sales/availability | Offers storage for sale
|
||||
*MarketplaceApi* | [**update_offered_storage**](docs/MarketplaceApi.md#update_offered_storage) | **PATCH** /sales/availability/{id} | Updates availability
|
||||
*NodeApi* | [**connect_peer**](docs/NodeApi.md#connect_peer) | **GET** /connect/{peerId} | Connect to a peer
|
||||
*NodeApi* | [**get_peer_id**](docs/NodeApi.md#get_peer_id) | **GET** /peerid | Get Node's PeerID
|
||||
*NodeApi* | [**get_spr**](docs/NodeApi.md#get_spr) | **GET** /spr | Get Node's SPR
|
||||
@ -87,26 +79,17 @@ Class | Method | HTTP request | Description
|
||||
|
||||
## Documentation For Models
|
||||
|
||||
- [CodexVersion](docs/CodexVersion.md)
|
||||
- [Content](docs/Content.md)
|
||||
- [DataItem](docs/DataItem.md)
|
||||
- [DataList](docs/DataList.md)
|
||||
- [DebugInfo](docs/DebugInfo.md)
|
||||
- [HasBlock200Response](docs/HasBlock200Response.md)
|
||||
- [ManifestItem](docs/ManifestItem.md)
|
||||
- [Node](docs/Node.md)
|
||||
- [PeerIdRead](docs/PeerIdRead.md)
|
||||
- [PeersTable](docs/PeersTable.md)
|
||||
- [Purchase](docs/Purchase.md)
|
||||
- [Reservation](docs/Reservation.md)
|
||||
- [SPRRead](docs/SPRRead.md)
|
||||
- [SalesAvailability](docs/SalesAvailability.md)
|
||||
- [SalesAvailabilityREAD](docs/SalesAvailabilityREAD.md)
|
||||
- [Slot](docs/Slot.md)
|
||||
- [SlotAgent](docs/SlotAgent.md)
|
||||
- [Space](docs/Space.md)
|
||||
- [StorageAsk](docs/StorageAsk.md)
|
||||
- [StorageRequest](docs/StorageRequest.md)
|
||||
- [StorageRequestCreation](docs/StorageRequestCreation.md)
|
||||
- [StorageVersion](docs/StorageVersion.md)
|
||||
|
||||
|
||||
<a id="documentation-for-authorization"></a>
|
||||
|
||||
573
codex.yaml
573
codex.yaml
@ -2,8 +2,8 @@ openapi: 3.0.3
|
||||
|
||||
info:
|
||||
version: 0.0.1
|
||||
title: Codex API
|
||||
description: "List of endpoints and interfaces available to Codex API users"
|
||||
title: Logos Storage API
|
||||
description: "List of endpoints and interfaces available to Logos Storage API users"
|
||||
|
||||
security:
|
||||
- {}
|
||||
@ -32,42 +32,11 @@ components:
|
||||
description: Content Identifier as specified at https://github.com/multiformats/cid
|
||||
example: QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N
|
||||
|
||||
SlotId:
|
||||
type: string
|
||||
description: Keccak hash of the abi encoded tuple (RequestId, slot index)
|
||||
example: 268a781e0db3f7cf36b18e5f4fdb7f586ec9edd08e5500b17c0e518a769f114a
|
||||
|
||||
LogLevel:
|
||||
type: string
|
||||
description: "One of the log levels: TRACE, DEBUG, INFO, NOTICE, WARN, ERROR or FATAL"
|
||||
example: DEBUG
|
||||
|
||||
EthereumAddress:
|
||||
type: string
|
||||
description: Address of Ethereum address
|
||||
|
||||
PricePerBytePerSecond:
|
||||
type: string
|
||||
description: The amount of tokens paid per byte per second per slot to hosts the client is willing to pay
|
||||
|
||||
CollateralPerByte:
|
||||
type: string
|
||||
description: Number as decimal string that represents how much collateral per byte is asked from hosts that wants to fill a slots
|
||||
|
||||
Duration:
|
||||
type: integer
|
||||
format: int64
|
||||
description: The duration of the request in seconds
|
||||
|
||||
ProofProbability:
|
||||
type: string
|
||||
description: How often storage proofs are required as decimal string
|
||||
|
||||
Expiry:
|
||||
type: integer
|
||||
format: int64
|
||||
description: A timestamp as seconds since unix epoch at which this request expires if the Request does not find requested amount of nodes to host the data.
|
||||
|
||||
SPR:
|
||||
type: string
|
||||
description: Signed Peer Record (libp2p)
|
||||
@ -86,15 +55,6 @@ components:
|
||||
id:
|
||||
$ref: "#/components/schemas/PeerId"
|
||||
|
||||
Content:
|
||||
type: object
|
||||
required:
|
||||
- cid
|
||||
description: Parameters specifying the content
|
||||
properties:
|
||||
cid:
|
||||
$ref: "#/components/schemas/Cid"
|
||||
|
||||
Node:
|
||||
type: object
|
||||
required:
|
||||
@ -115,7 +75,7 @@ components:
|
||||
seen:
|
||||
type: boolean
|
||||
|
||||
CodexVersion:
|
||||
StorageVersion:
|
||||
type: object
|
||||
properties:
|
||||
version:
|
||||
@ -124,9 +84,6 @@ components:
|
||||
revision:
|
||||
type: string
|
||||
example: 0c647d8
|
||||
contracts:
|
||||
type: string
|
||||
example: 0b537c7
|
||||
|
||||
PeersTable:
|
||||
type: object
|
||||
@ -150,7 +107,7 @@ components:
|
||||
- spr
|
||||
- announceAddresses
|
||||
- table
|
||||
- codex
|
||||
- storage
|
||||
properties:
|
||||
id:
|
||||
$ref: "#/components/schemas/PeerId"
|
||||
@ -169,253 +126,8 @@ components:
|
||||
$ref: "#/components/schemas/MultiAddress"
|
||||
table:
|
||||
$ref: "#/components/schemas/PeersTable"
|
||||
codex:
|
||||
$ref: "#/components/schemas/CodexVersion"
|
||||
|
||||
SalesAvailability:
|
||||
type: object
|
||||
required:
|
||||
- totalSize
|
||||
- duration
|
||||
- minPricePerBytePerSecond
|
||||
- totalCollateral
|
||||
properties:
|
||||
totalSize:
|
||||
type: integer
|
||||
format: int64
|
||||
description: Total size of availability's storage in bytes
|
||||
duration:
|
||||
$ref: "#/components/schemas/Duration"
|
||||
minPricePerBytePerSecond:
|
||||
type: string
|
||||
description: Minimal price per byte per second paid (in amount of tokens) for the hosted request's slot for the request's duration as decimal string
|
||||
totalCollateral:
|
||||
type: string
|
||||
description: Total collateral (in amount of tokens) that can be used for matching requests
|
||||
enabled:
|
||||
type: boolean
|
||||
description: Enable the ability to receive sales on this availability.
|
||||
default: true
|
||||
until:
|
||||
type: integer
|
||||
description: Specifies the latest timestamp, after which the availability will no longer host any slots. If set to 0, there will be no restrictions.
|
||||
default: 0
|
||||
|
||||
SalesAvailabilityREAD:
|
||||
required:
|
||||
- id
|
||||
- totalRemainingCollateral
|
||||
- freeSize
|
||||
allOf:
|
||||
- $ref: "#/components/schemas/SalesAvailability"
|
||||
- type: object
|
||||
properties:
|
||||
id:
|
||||
$ref: "#/components/schemas/Id"
|
||||
readonly: true
|
||||
freeSize:
|
||||
type: integer
|
||||
format: int64
|
||||
description: Unused size of availability's storage in bytes as decimal string
|
||||
readOnly: true
|
||||
totalRemainingCollateral:
|
||||
type: string
|
||||
description: Total collateral effective (in amount of tokens) that can be used for matching requests
|
||||
readOnly: true
|
||||
|
||||
Slot:
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
- request
|
||||
- slotIndex
|
||||
properties:
|
||||
id:
|
||||
$ref: "#/components/schemas/SlotId"
|
||||
request:
|
||||
$ref: "#/components/schemas/StorageRequest"
|
||||
slotIndex:
|
||||
type: integer
|
||||
format: int64
|
||||
description: Slot Index number
|
||||
|
||||
SlotAgent:
|
||||
type: object
|
||||
required:
|
||||
- state
|
||||
- requestId
|
||||
- slotIndex
|
||||
properties:
|
||||
slotIndex:
|
||||
type: integer
|
||||
format: int64
|
||||
description: Slot Index number
|
||||
requestId:
|
||||
$ref: "#/components/schemas/Id"
|
||||
request:
|
||||
$ref: "#/components/schemas/StorageRequest"
|
||||
reservation:
|
||||
$ref: "#/components/schemas/Reservation"
|
||||
state:
|
||||
type: string
|
||||
description: Description of the slot's
|
||||
enum:
|
||||
- SaleCancelled
|
||||
- SaleDownloading
|
||||
- SaleErrored
|
||||
- SaleFailed
|
||||
- SaleFilled
|
||||
- SaleFilling
|
||||
- SaleFinished
|
||||
- SaleIgnored
|
||||
- SaleInitialProving
|
||||
- SalePayout
|
||||
- SalePreparing
|
||||
- SaleProving
|
||||
- SaleUnknown
|
||||
|
||||
Reservation:
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
- availabilityId
|
||||
- size
|
||||
- requestId
|
||||
- slotIndex
|
||||
- validUntil
|
||||
properties:
|
||||
id:
|
||||
$ref: "#/components/schemas/Id"
|
||||
availabilityId:
|
||||
$ref: "#/components/schemas/Id"
|
||||
size:
|
||||
type: integer
|
||||
format: int64
|
||||
description: Size of the slot in bytes
|
||||
requestId:
|
||||
$ref: "#/components/schemas/Id"
|
||||
slotIndex:
|
||||
type: integer
|
||||
format: int64
|
||||
description: Slot Index number
|
||||
validUntil:
|
||||
type: integer
|
||||
description: Timestamp after which the reservation will no longer be valid.
|
||||
|
||||
StorageRequestCreation:
|
||||
type: object
|
||||
required:
|
||||
- pricePerBytePerSecond
|
||||
- duration
|
||||
- proofProbability
|
||||
- collateralPerByte
|
||||
- expiry
|
||||
properties:
|
||||
duration:
|
||||
$ref: "#/components/schemas/Duration"
|
||||
pricePerBytePerSecond:
|
||||
$ref: "#/components/schemas/PricePerBytePerSecond"
|
||||
proofProbability:
|
||||
$ref: "#/components/schemas/ProofProbability"
|
||||
nodes:
|
||||
description: Minimal number of nodes the content should be stored on
|
||||
type: integer
|
||||
default: 3
|
||||
minimum: 3
|
||||
tolerance:
|
||||
description: Additional number of nodes on top of the `nodes` property that can be lost before pronouncing the content lost
|
||||
type: integer
|
||||
default: 1
|
||||
minimum: 1
|
||||
collateralPerByte:
|
||||
$ref: "#/components/schemas/CollateralPerByte"
|
||||
expiry:
|
||||
type: integer
|
||||
format: int64
|
||||
description: Number that represents expiry threshold in seconds from when the Request is submitted. When the threshold is reached and the Request does not find requested amount of nodes to host the data, the Request is voided. The number of seconds can not be higher then the Request's duration itself.
|
||||
StorageAsk:
|
||||
type: object
|
||||
required:
|
||||
- slots
|
||||
- slotSize
|
||||
- duration
|
||||
- proofProbability
|
||||
- pricePerBytePerSecond
|
||||
- collateralPerByte
|
||||
- maxSlotLoss
|
||||
properties:
|
||||
slots:
|
||||
description: Number of slots (eq. hosts) that the Request want to have the content spread over
|
||||
type: integer
|
||||
format: int64
|
||||
slotSize:
|
||||
type: integer
|
||||
format: int64
|
||||
description: Amount of storage per slot in bytes
|
||||
duration:
|
||||
$ref: "#/components/schemas/Duration"
|
||||
proofProbability:
|
||||
$ref: "#/components/schemas/ProofProbability"
|
||||
pricePerBytePerSecond:
|
||||
$ref: "#/components/schemas/PricePerBytePerSecond"
|
||||
collateralPerByte:
|
||||
$ref: "#/components/schemas/CollateralPerByte"
|
||||
maxSlotLoss:
|
||||
type: integer
|
||||
format: int64
|
||||
description: Max slots that can be lost without data considered to be lost
|
||||
|
||||
StorageRequest:
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
- client
|
||||
- ask
|
||||
- content
|
||||
- expiry
|
||||
- nonce
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
description: Request ID
|
||||
client:
|
||||
$ref: "#/components/schemas/EthereumAddress"
|
||||
ask:
|
||||
$ref: "#/components/schemas/StorageAsk"
|
||||
content:
|
||||
$ref: "#/components/schemas/Content"
|
||||
expiry:
|
||||
$ref: "#/components/schemas/Expiry"
|
||||
nonce:
|
||||
type: string
|
||||
description: Random data
|
||||
|
||||
Purchase:
|
||||
type: object
|
||||
required:
|
||||
- state
|
||||
- requestId
|
||||
properties:
|
||||
state:
|
||||
type: string
|
||||
description: Description of the Request's state
|
||||
enum:
|
||||
- cancelled
|
||||
- errored
|
||||
- failed
|
||||
- finished
|
||||
- pending
|
||||
- started
|
||||
- submitted
|
||||
- unknown
|
||||
error:
|
||||
type: string
|
||||
nullable: true
|
||||
description: If Request failed, then here is presented the error message
|
||||
request:
|
||||
$ref: "#/components/schemas/StorageRequest"
|
||||
requestId:
|
||||
$ref: "#/components/schemas/Id"
|
||||
storage:
|
||||
$ref: "#/components/schemas/StorageVersion"
|
||||
|
||||
DataList:
|
||||
type: object
|
||||
@ -444,7 +156,6 @@ components:
|
||||
- treeCid
|
||||
- datasetSize
|
||||
- blockSize
|
||||
- protected
|
||||
properties:
|
||||
treeCid:
|
||||
$ref: "#/components/schemas/Cid"
|
||||
@ -456,9 +167,6 @@ components:
|
||||
blockSize:
|
||||
type: integer
|
||||
description: "Size of blocks"
|
||||
protected:
|
||||
type: boolean
|
||||
description: "Indicates if content is protected by erasure-coding"
|
||||
filename:
|
||||
type: string
|
||||
nullable: true
|
||||
@ -485,22 +193,20 @@ components:
|
||||
quotaMaxBytes:
|
||||
type: integer
|
||||
format: int64
|
||||
description: "Maximum storage space (in bytes) available for the node in Codex's local repository."
|
||||
description: "Maximum storage space (in bytes) available for the node in Logos Storage's local repository."
|
||||
quotaUsedBytes:
|
||||
type: integer
|
||||
format: int64
|
||||
description: "Amount of storage space (in bytes) currently used for storing files in Codex's local repository."
|
||||
description: "Amount of storage space (in bytes) currently used for storing files in Logos Storage's local repository."
|
||||
quotaReservedBytes:
|
||||
type: integer
|
||||
format: int64
|
||||
description: "Amount of storage reserved (in bytes) in the Codex'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."
|
||||
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."
|
||||
|
||||
servers:
|
||||
- url: "http://localhost:8080/api/codex/v1"
|
||||
- url: "http://localhost:8080/api/storage/v1"
|
||||
|
||||
tags:
|
||||
- name: Marketplace
|
||||
description: Marketplace information and operations
|
||||
- name: Data
|
||||
description: Data operations
|
||||
- name: Node
|
||||
@ -727,6 +433,34 @@ paths:
|
||||
"500":
|
||||
description: Well it was bad-bad
|
||||
|
||||
"/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
|
||||
|
||||
"/space":
|
||||
get:
|
||||
summary: "Gets a summary of the storage space allocation of the node."
|
||||
@ -743,237 +477,6 @@ paths:
|
||||
"500":
|
||||
description: "It's not working as planned"
|
||||
|
||||
"/sales/slots":
|
||||
get:
|
||||
summary: "Returns active slots"
|
||||
tags: [Marketplace]
|
||||
operationId: getActiveSlots
|
||||
responses:
|
||||
"200":
|
||||
description: Retrieved active slots
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/Slot"
|
||||
|
||||
"503":
|
||||
description: Persistence is not enabled
|
||||
|
||||
"/sales/slots/{slotId}":
|
||||
get:
|
||||
summary: "Returns active slot with id {slotId} for the host"
|
||||
tags: [Marketplace]
|
||||
operationId: getActiveSlotById
|
||||
parameters:
|
||||
- in: path
|
||||
name: slotId
|
||||
required: true
|
||||
schema:
|
||||
$ref: "#/components/schemas/Cid"
|
||||
description: File to be downloaded.
|
||||
responses:
|
||||
"200":
|
||||
description: Retrieved active slot
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/SlotAgent"
|
||||
|
||||
"400":
|
||||
description: Invalid or missing SlotId
|
||||
|
||||
"404":
|
||||
description: Host is not in an active sale for the slot
|
||||
|
||||
"503":
|
||||
description: Persistence is not enabled
|
||||
|
||||
"/sales/availability":
|
||||
get:
|
||||
summary: "Returns storage that is for sale"
|
||||
tags: [Marketplace]
|
||||
operationId: getAvailabilities
|
||||
responses:
|
||||
"200":
|
||||
description: Retrieved storage availabilities of the node
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/SalesAvailabilityREAD"
|
||||
"500":
|
||||
description: Error getting unused availabilities
|
||||
"503":
|
||||
description: Persistence is not enabled
|
||||
|
||||
post:
|
||||
summary: "Offers storage for sale"
|
||||
operationId: offerStorage
|
||||
tags: [Marketplace]
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/SalesAvailability"
|
||||
responses:
|
||||
"201":
|
||||
description: Created storage availability
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/SalesAvailabilityREAD"
|
||||
"400":
|
||||
description: Invalid data input
|
||||
"422":
|
||||
description: Not enough node's storage quota available or the provided parameters did not pass validation
|
||||
"500":
|
||||
description: Error reserving availability
|
||||
"503":
|
||||
description: Persistence is not enabled
|
||||
"/sales/availability/{id}":
|
||||
patch:
|
||||
summary: "Updates availability"
|
||||
description: |
|
||||
The new parameters will be only considered for new requests.
|
||||
Existing Requests linked to this Availability will continue as is.
|
||||
operationId: updateOfferedStorage
|
||||
tags: [Marketplace]
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
description: ID of Availability
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/SalesAvailability"
|
||||
responses:
|
||||
"204":
|
||||
description: Availability successfully updated
|
||||
"400":
|
||||
description: Invalid data input
|
||||
"404":
|
||||
description: Availability not found
|
||||
"422":
|
||||
description: The provided parameters did not pass validation
|
||||
"500":
|
||||
description: Error reserving availability
|
||||
"503":
|
||||
description: Persistence is not enabled
|
||||
|
||||
"/sales/availability/{id}/reservations":
|
||||
get:
|
||||
summary: "Get availability's reservations"
|
||||
description: Return's list of Reservations for ongoing Storage Requests that the node hosts.
|
||||
operationId: getReservations
|
||||
tags: [Marketplace]
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
description: ID of Availability
|
||||
responses:
|
||||
"200":
|
||||
description: Retrieved storage availabilities of the node
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/Reservation"
|
||||
"400":
|
||||
description: Invalid Availability ID
|
||||
"404":
|
||||
description: Availability not found
|
||||
"500":
|
||||
description: Error getting reservations
|
||||
"503":
|
||||
description: Persistence is not enabled
|
||||
|
||||
"/storage/request/{cid}":
|
||||
post:
|
||||
summary: "Creates a new Request for storage"
|
||||
tags: [Marketplace]
|
||||
operationId: createStorageRequest
|
||||
parameters:
|
||||
- in: path
|
||||
name: cid
|
||||
required: true
|
||||
schema:
|
||||
$ref: "#/components/schemas/Cid"
|
||||
description: CID of the uploaded data that should be stored
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/StorageRequestCreation"
|
||||
responses:
|
||||
"200":
|
||||
description: Returns the Request ID as decimal string
|
||||
content:
|
||||
text/plain:
|
||||
schema:
|
||||
type: string
|
||||
"400":
|
||||
description: Invalid or missing Request ID
|
||||
"422":
|
||||
description: The storage request parameters are not valid
|
||||
"404":
|
||||
description: Request ID not found
|
||||
"503":
|
||||
description: Persistence is not enabled
|
||||
|
||||
"/storage/purchases":
|
||||
get:
|
||||
summary: "Returns list of purchase IDs"
|
||||
tags: [Marketplace]
|
||||
operationId: getPurchases
|
||||
responses:
|
||||
"200":
|
||||
description: Gets all purchase IDs stored in node
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
"503":
|
||||
description: Persistence is not enabled
|
||||
|
||||
"/storage/purchases/{id}":
|
||||
get:
|
||||
summary: "Returns purchase details"
|
||||
tags: [Marketplace]
|
||||
operationId: getPurchase
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
description: Hexadecimal ID of a Purchase
|
||||
responses:
|
||||
"200":
|
||||
description: Purchase details
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Purchase"
|
||||
"400":
|
||||
description: Invalid or missing Purchase ID
|
||||
"404":
|
||||
description: Purchase not found
|
||||
"503":
|
||||
description: Persistence is not enabled
|
||||
|
||||
"/spr":
|
||||
get:
|
||||
summary: "Get Node's SPR"
|
||||
|
||||
@ -3,9 +3,9 @@
|
||||
# flake8: noqa
|
||||
|
||||
"""
|
||||
Codex API
|
||||
Logos Storage API
|
||||
|
||||
List of endpoints and interfaces available to Codex API users
|
||||
List of endpoints and interfaces available to Logos Storage API users
|
||||
|
||||
The version of the OpenAPI document: 0.0.1
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
@ -19,7 +19,6 @@ __version__ = "0.4.0"
|
||||
# import apis into sdk package
|
||||
from codex_api_client.api.data_api import DataApi
|
||||
from codex_api_client.api.debug_api import DebugApi
|
||||
from codex_api_client.api.marketplace_api import MarketplaceApi
|
||||
from codex_api_client.api.node_api import NodeApi
|
||||
|
||||
# import ApiClient
|
||||
@ -34,23 +33,14 @@ from codex_api_client.exceptions import ApiAttributeError
|
||||
from codex_api_client.exceptions import ApiException
|
||||
|
||||
# import models into sdk package
|
||||
from codex_api_client.models.codex_version import CodexVersion
|
||||
from codex_api_client.models.content import Content
|
||||
from codex_api_client.models.data_item import DataItem
|
||||
from codex_api_client.models.data_list import DataList
|
||||
from codex_api_client.models.debug_info import DebugInfo
|
||||
from codex_api_client.models.has_block200_response import HasBlock200Response
|
||||
from codex_api_client.models.manifest_item import ManifestItem
|
||||
from codex_api_client.models.node import Node
|
||||
from codex_api_client.models.peer_id_read import PeerIdRead
|
||||
from codex_api_client.models.peers_table import PeersTable
|
||||
from codex_api_client.models.purchase import Purchase
|
||||
from codex_api_client.models.reservation import Reservation
|
||||
from codex_api_client.models.spr_read import SPRRead
|
||||
from codex_api_client.models.sales_availability import SalesAvailability
|
||||
from codex_api_client.models.sales_availability_read import SalesAvailabilityREAD
|
||||
from codex_api_client.models.slot import Slot
|
||||
from codex_api_client.models.slot_agent import SlotAgent
|
||||
from codex_api_client.models.space import Space
|
||||
from codex_api_client.models.storage_ask import StorageAsk
|
||||
from codex_api_client.models.storage_request import StorageRequest
|
||||
from codex_api_client.models.storage_request_creation import StorageRequestCreation
|
||||
from codex_api_client.models.storage_version import StorageVersion
|
||||
|
||||
@ -3,6 +3,5 @@
|
||||
# import apis into api package
|
||||
from codex_api_client.api.data_api import DataApi
|
||||
from codex_api_client.api.debug_api import DebugApi
|
||||
from codex_api_client.api.marketplace_api import MarketplaceApi
|
||||
from codex_api_client.api.node_api import NodeApi
|
||||
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Codex API
|
||||
Logos Storage API
|
||||
|
||||
List of endpoints and interfaces available to Codex API users
|
||||
List of endpoints and interfaces available to Logos Storage API users
|
||||
|
||||
The version of the OpenAPI document: 0.0.1
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
@ -21,6 +21,7 @@ from typing import Optional, Tuple, Union
|
||||
from typing_extensions import Annotated
|
||||
from codex_api_client.models.data_item import DataItem
|
||||
from codex_api_client.models.data_list import DataList
|
||||
from codex_api_client.models.has_block200_response import HasBlock200Response
|
||||
from codex_api_client.models.space import Space
|
||||
|
||||
from codex_api_client.api_client import ApiClient, RequestSerialized
|
||||
@ -1361,6 +1362,269 @@ class DataApi:
|
||||
|
||||
|
||||
|
||||
@validate_call
|
||||
def has_block(
|
||||
self,
|
||||
cid: Annotated[StrictStr, Field(description="CID of the block to check.")],
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
_headers: Optional[Dict[StrictStr, Any]] = None,
|
||||
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
||||
) -> HasBlock200Response:
|
||||
"""Check if a block identified by CID exists in the local node.
|
||||
|
||||
|
||||
:param cid: CID of the block to check. (required)
|
||||
:type cid: str
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
timeout. It can also be a pair (tuple) of
|
||||
(connection, read) timeouts.
|
||||
:type _request_timeout: int, tuple(int, int), optional
|
||||
:param _request_auth: set to override the auth_settings for an a single
|
||||
request; this effectively ignores the
|
||||
authentication in the spec for a single request.
|
||||
:type _request_auth: dict, optional
|
||||
:param _content_type: force content-type for the request.
|
||||
:type _content_type: str, Optional
|
||||
:param _headers: set to override the headers for a single
|
||||
request; this effectively ignores the headers
|
||||
in the spec for a single request.
|
||||
:type _headers: dict, optional
|
||||
:param _host_index: set to override the host_index for a single
|
||||
request; this effectively ignores the host_index
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._has_block_serialize(
|
||||
cid=cid,
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "HasBlock200Response",
|
||||
'400': None,
|
||||
'500': None,
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
).data
|
||||
|
||||
|
||||
@validate_call
|
||||
def has_block_with_http_info(
|
||||
self,
|
||||
cid: Annotated[StrictStr, Field(description="CID of the block to check.")],
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
_headers: Optional[Dict[StrictStr, Any]] = None,
|
||||
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
||||
) -> ApiResponse[HasBlock200Response]:
|
||||
"""Check if a block identified by CID exists in the local node.
|
||||
|
||||
|
||||
:param cid: CID of the block to check. (required)
|
||||
:type cid: str
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
timeout. It can also be a pair (tuple) of
|
||||
(connection, read) timeouts.
|
||||
:type _request_timeout: int, tuple(int, int), optional
|
||||
:param _request_auth: set to override the auth_settings for an a single
|
||||
request; this effectively ignores the
|
||||
authentication in the spec for a single request.
|
||||
:type _request_auth: dict, optional
|
||||
:param _content_type: force content-type for the request.
|
||||
:type _content_type: str, Optional
|
||||
:param _headers: set to override the headers for a single
|
||||
request; this effectively ignores the headers
|
||||
in the spec for a single request.
|
||||
:type _headers: dict, optional
|
||||
:param _host_index: set to override the host_index for a single
|
||||
request; this effectively ignores the host_index
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._has_block_serialize(
|
||||
cid=cid,
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "HasBlock200Response",
|
||||
'400': None,
|
||||
'500': None,
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
)
|
||||
|
||||
|
||||
@validate_call
|
||||
def has_block_without_preload_content(
|
||||
self,
|
||||
cid: Annotated[StrictStr, Field(description="CID of the block to check.")],
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
_headers: Optional[Dict[StrictStr, Any]] = None,
|
||||
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
||||
) -> RESTResponseType:
|
||||
"""Check if a block identified by CID exists in the local node.
|
||||
|
||||
|
||||
:param cid: CID of the block to check. (required)
|
||||
:type cid: str
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
timeout. It can also be a pair (tuple) of
|
||||
(connection, read) timeouts.
|
||||
:type _request_timeout: int, tuple(int, int), optional
|
||||
:param _request_auth: set to override the auth_settings for an a single
|
||||
request; this effectively ignores the
|
||||
authentication in the spec for a single request.
|
||||
:type _request_auth: dict, optional
|
||||
:param _content_type: force content-type for the request.
|
||||
:type _content_type: str, Optional
|
||||
:param _headers: set to override the headers for a single
|
||||
request; this effectively ignores the headers
|
||||
in the spec for a single request.
|
||||
:type _headers: dict, optional
|
||||
:param _host_index: set to override the host_index for a single
|
||||
request; this effectively ignores the host_index
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._has_block_serialize(
|
||||
cid=cid,
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "HasBlock200Response",
|
||||
'400': None,
|
||||
'500': None,
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
return response_data.response
|
||||
|
||||
|
||||
def _has_block_serialize(
|
||||
self,
|
||||
cid,
|
||||
_request_auth,
|
||||
_content_type,
|
||||
_headers,
|
||||
_host_index,
|
||||
) -> RequestSerialized:
|
||||
|
||||
_host = None
|
||||
|
||||
_collection_formats: Dict[str, str] = {
|
||||
}
|
||||
|
||||
_path_params: Dict[str, str] = {}
|
||||
_query_params: List[Tuple[str, str]] = []
|
||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||
_form_params: List[Tuple[str, str]] = []
|
||||
_files: Dict[
|
||||
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
||||
] = {}
|
||||
_body_params: Optional[bytes] = None
|
||||
|
||||
# process the path parameters
|
||||
if cid is not None:
|
||||
_path_params['cid'] = cid
|
||||
# process the query parameters
|
||||
# process the header parameters
|
||||
# process the form parameters
|
||||
# process the body parameter
|
||||
|
||||
|
||||
# set the HTTP header `Accept`
|
||||
if 'Accept' not in _header_params:
|
||||
_header_params['Accept'] = self.api_client.select_header_accept(
|
||||
[
|
||||
'application/json'
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
# authentication setting
|
||||
_auth_settings: List[str] = [
|
||||
]
|
||||
|
||||
return self.api_client.param_serialize(
|
||||
method='GET',
|
||||
resource_path='/data/{cid}/exists',
|
||||
path_params=_path_params,
|
||||
query_params=_query_params,
|
||||
header_params=_header_params,
|
||||
body=_body_params,
|
||||
post_params=_form_params,
|
||||
files=_files,
|
||||
auth_settings=_auth_settings,
|
||||
collection_formats=_collection_formats,
|
||||
_host=_host,
|
||||
_request_auth=_request_auth
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
@validate_call
|
||||
def list_data(
|
||||
self,
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Codex API
|
||||
Logos Storage API
|
||||
|
||||
List of endpoints and interfaces available to Codex API users
|
||||
List of endpoints and interfaces available to Logos Storage API users
|
||||
|
||||
The version of the OpenAPI document: 0.0.1
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Codex API
|
||||
Logos Storage API
|
||||
|
||||
List of endpoints and interfaces available to Codex API users
|
||||
List of endpoints and interfaces available to Logos Storage API users
|
||||
|
||||
The version of the OpenAPI document: 0.0.1
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Codex API
|
||||
Logos Storage API
|
||||
|
||||
List of endpoints and interfaces available to Codex API users
|
||||
List of endpoints and interfaces available to Logos Storage API users
|
||||
|
||||
The version of the OpenAPI document: 0.0.1
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Codex API
|
||||
Logos Storage API
|
||||
|
||||
List of endpoints and interfaces available to Codex API users
|
||||
List of endpoints and interfaces available to Logos Storage API users
|
||||
|
||||
The version of the OpenAPI document: 0.0.1
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
@ -188,7 +188,7 @@ class Configuration:
|
||||
) -> None:
|
||||
"""Constructor
|
||||
"""
|
||||
self._base_path = "http://localhost:8080/api/codex/v1" if host is None else host
|
||||
self._base_path = "http://localhost:8080/api/storage/v1" if host is None else host
|
||||
"""Default Base url
|
||||
"""
|
||||
self.server_index = 0 if server_index is None and host is None else server_index
|
||||
@ -511,7 +511,7 @@ class Configuration:
|
||||
"""
|
||||
return [
|
||||
{
|
||||
'url': "http://localhost:8080/api/codex/v1",
|
||||
'url': "http://localhost:8080/api/storage/v1",
|
||||
'description': "No description provided",
|
||||
}
|
||||
]
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Codex API
|
||||
Logos Storage API
|
||||
|
||||
List of endpoints and interfaces available to Codex API users
|
||||
List of endpoints and interfaces available to Logos Storage API users
|
||||
|
||||
The version of the OpenAPI document: 0.0.1
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
@ -2,9 +2,9 @@
|
||||
|
||||
# flake8: noqa
|
||||
"""
|
||||
Codex API
|
||||
Logos Storage API
|
||||
|
||||
List of endpoints and interfaces available to Codex API users
|
||||
List of endpoints and interfaces available to Logos Storage API users
|
||||
|
||||
The version of the OpenAPI document: 0.0.1
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
@ -14,23 +14,14 @@
|
||||
|
||||
|
||||
# import models into model package
|
||||
from codex_api_client.models.codex_version import CodexVersion
|
||||
from codex_api_client.models.content import Content
|
||||
from codex_api_client.models.data_item import DataItem
|
||||
from codex_api_client.models.data_list import DataList
|
||||
from codex_api_client.models.debug_info import DebugInfo
|
||||
from codex_api_client.models.has_block200_response import HasBlock200Response
|
||||
from codex_api_client.models.manifest_item import ManifestItem
|
||||
from codex_api_client.models.node import Node
|
||||
from codex_api_client.models.peer_id_read import PeerIdRead
|
||||
from codex_api_client.models.peers_table import PeersTable
|
||||
from codex_api_client.models.purchase import Purchase
|
||||
from codex_api_client.models.reservation import Reservation
|
||||
from codex_api_client.models.spr_read import SPRRead
|
||||
from codex_api_client.models.sales_availability import SalesAvailability
|
||||
from codex_api_client.models.sales_availability_read import SalesAvailabilityREAD
|
||||
from codex_api_client.models.slot import Slot
|
||||
from codex_api_client.models.slot_agent import SlotAgent
|
||||
from codex_api_client.models.space import Space
|
||||
from codex_api_client.models.storage_ask import StorageAsk
|
||||
from codex_api_client.models.storage_request import StorageRequest
|
||||
from codex_api_client.models.storage_request_creation import StorageRequestCreation
|
||||
from codex_api_client.models.storage_version import StorageVersion
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Codex API
|
||||
Logos Storage API
|
||||
|
||||
List of endpoints and interfaces available to Codex API users
|
||||
List of endpoints and interfaces available to Logos Storage API users
|
||||
|
||||
The version of the OpenAPI document: 0.0.1
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Codex API
|
||||
Logos Storage API
|
||||
|
||||
List of endpoints and interfaces available to Codex API users
|
||||
List of endpoints and interfaces available to Logos Storage API users
|
||||
|
||||
The version of the OpenAPI document: 0.0.1
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Codex API
|
||||
Logos Storage API
|
||||
|
||||
List of endpoints and interfaces available to Codex API users
|
||||
List of endpoints and interfaces available to Logos Storage API users
|
||||
|
||||
The version of the OpenAPI document: 0.0.1
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
@ -19,8 +19,8 @@ import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List
|
||||
from codex_api_client.models.codex_version import CodexVersion
|
||||
from codex_api_client.models.peers_table import PeersTable
|
||||
from codex_api_client.models.storage_version import StorageVersion
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
@ -34,8 +34,8 @@ class DebugInfo(BaseModel):
|
||||
spr: StrictStr = Field(description="Signed Peer Record (libp2p)")
|
||||
announce_addresses: List[StrictStr] = Field(alias="announceAddresses")
|
||||
table: PeersTable
|
||||
codex: CodexVersion
|
||||
__properties: ClassVar[List[str]] = ["id", "addrs", "repo", "spr", "announceAddresses", "table", "codex"]
|
||||
storage: StorageVersion
|
||||
__properties: ClassVar[List[str]] = ["id", "addrs", "repo", "spr", "announceAddresses", "table", "storage"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
@ -79,9 +79,9 @@ class DebugInfo(BaseModel):
|
||||
# override the default output from pydantic by calling `to_dict()` of table
|
||||
if self.table:
|
||||
_dict['table'] = self.table.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of codex
|
||||
if self.codex:
|
||||
_dict['codex'] = self.codex.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of storage
|
||||
if self.storage:
|
||||
_dict['storage'] = self.storage.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
@ -100,7 +100,7 @@ class DebugInfo(BaseModel):
|
||||
"spr": obj.get("spr"),
|
||||
"announceAddresses": obj.get("announceAddresses"),
|
||||
"table": PeersTable.from_dict(obj["table"]) if obj.get("table") is not None else None,
|
||||
"codex": CodexVersion.from_dict(obj["codex"]) if obj.get("codex") is not None else None
|
||||
"storage": StorageVersion.from_dict(obj["storage"]) if obj.get("storage") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
87
codex_api_client/models/has_block200_response.py
Normal file
87
codex_api_client/models/has_block200_response.py
Normal file
@ -0,0 +1,87 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Logos Storage API
|
||||
|
||||
List of endpoints and interfaces available to Logos Storage API users
|
||||
|
||||
The version of the OpenAPI document: 0.0.1
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictBool
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class HasBlock200Response(BaseModel):
|
||||
"""
|
||||
HasBlock200Response
|
||||
""" # noqa: E501
|
||||
has: Optional[StrictBool] = Field(default=None, description="Indicates whether the block exists in the local node")
|
||||
__properties: ClassVar[List[str]] = ["has"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of HasBlock200Response from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of HasBlock200Response from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"has": obj.get("has")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Codex API
|
||||
Logos Storage API
|
||||
|
||||
List of endpoints and interfaces available to Codex API users
|
||||
List of endpoints and interfaces available to Logos Storage API users
|
||||
|
||||
The version of the OpenAPI document: 0.0.1
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
@ -17,7 +17,7 @@ import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
@ -29,10 +29,9 @@ class ManifestItem(BaseModel):
|
||||
tree_cid: StrictStr = Field(description="Content Identifier as specified at https://github.com/multiformats/cid", alias="treeCid")
|
||||
dataset_size: StrictInt = Field(description="Length of original content in bytes", alias="datasetSize")
|
||||
block_size: StrictInt = Field(description="Size of blocks", alias="blockSize")
|
||||
protected: StrictBool = Field(description="Indicates if content is protected by erasure-coding")
|
||||
filename: Optional[StrictStr] = Field(default=None, description="The original name of the uploaded content (optional)")
|
||||
mimetype: Optional[StrictStr] = Field(default=None, description="The original mimetype of the uploaded content (optional)")
|
||||
__properties: ClassVar[List[str]] = ["treeCid", "datasetSize", "blockSize", "protected", "filename", "mimetype"]
|
||||
__properties: ClassVar[List[str]] = ["treeCid", "datasetSize", "blockSize", "filename", "mimetype"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
@ -98,7 +97,6 @@ class ManifestItem(BaseModel):
|
||||
"treeCid": obj.get("treeCid"),
|
||||
"datasetSize": obj.get("datasetSize"),
|
||||
"blockSize": obj.get("blockSize"),
|
||||
"protected": obj.get("protected"),
|
||||
"filename": obj.get("filename"),
|
||||
"mimetype": obj.get("mimetype")
|
||||
})
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Codex API
|
||||
Logos Storage API
|
||||
|
||||
List of endpoints and interfaces available to Codex API users
|
||||
List of endpoints and interfaces available to Logos Storage API users
|
||||
|
||||
The version of the OpenAPI document: 0.0.1
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Codex API
|
||||
Logos Storage API
|
||||
|
||||
List of endpoints and interfaces available to Codex API users
|
||||
List of endpoints and interfaces available to Logos Storage API users
|
||||
|
||||
The version of the OpenAPI document: 0.0.1
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Codex API
|
||||
Logos Storage API
|
||||
|
||||
List of endpoints and interfaces available to Codex API users
|
||||
List of endpoints and interfaces available to Logos Storage API users
|
||||
|
||||
The version of the OpenAPI document: 0.0.1
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Codex API
|
||||
Logos Storage API
|
||||
|
||||
List of endpoints and interfaces available to Codex API users
|
||||
List of endpoints and interfaces available to Logos Storage API users
|
||||
|
||||
The version of the OpenAPI document: 0.0.1
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
@ -27,9 +27,9 @@ class Space(BaseModel):
|
||||
Space
|
||||
""" # noqa: E501
|
||||
total_blocks: StrictInt = Field(description="Number of blocks stored by the node", alias="totalBlocks")
|
||||
quota_max_bytes: StrictInt = Field(description="Maximum storage space (in bytes) available for the node in Codex's local repository.", alias="quotaMaxBytes")
|
||||
quota_used_bytes: StrictInt = Field(description="Amount of storage space (in bytes) currently used for storing files in Codex's local repository.", alias="quotaUsedBytes")
|
||||
quota_reserved_bytes: StrictInt = Field(description="Amount of storage reserved (in bytes) in the Codex'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.", alias="quotaReservedBytes")
|
||||
quota_max_bytes: StrictInt = Field(description="Maximum storage space (in bytes) available for the node in Logos Storage's local repository.", alias="quotaMaxBytes")
|
||||
quota_used_bytes: StrictInt = Field(description="Amount of storage space (in bytes) currently used for storing files in Logos Storage's local repository.", alias="quotaUsedBytes")
|
||||
quota_reserved_bytes: StrictInt = Field(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.", alias="quotaReservedBytes")
|
||||
__properties: ClassVar[List[str]] = ["totalBlocks", "quotaMaxBytes", "quotaUsedBytes", "quotaReservedBytes"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Codex API
|
||||
Logos Storage API
|
||||
|
||||
List of endpoints and interfaces available to Codex API users
|
||||
List of endpoints and interfaces available to Logos Storage API users
|
||||
|
||||
The version of the OpenAPI document: 0.0.1
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
89
codex_api_client/models/storage_version.py
Normal file
89
codex_api_client/models/storage_version.py
Normal file
@ -0,0 +1,89 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Logos Storage API
|
||||
|
||||
List of endpoints and interfaces available to Logos Storage API users
|
||||
|
||||
The version of the OpenAPI document: 0.0.1
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class StorageVersion(BaseModel):
|
||||
"""
|
||||
StorageVersion
|
||||
""" # noqa: E501
|
||||
version: Optional[StrictStr] = None
|
||||
revision: Optional[StrictStr] = None
|
||||
__properties: ClassVar[List[str]] = ["version", "revision"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of StorageVersion from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of StorageVersion from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"version": obj.get("version"),
|
||||
"revision": obj.get("revision")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Codex API
|
||||
Logos Storage API
|
||||
|
||||
List of endpoints and interfaces available to Codex API users
|
||||
List of endpoints and interfaces available to Logos Storage API users
|
||||
|
||||
The version of the OpenAPI document: 0.0.1
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
103
docs/DataApi.md
103
docs/DataApi.md
@ -1,6 +1,6 @@
|
||||
# codex_api_client.DataApi
|
||||
|
||||
All URIs are relative to *http://localhost:8080/api/codex/v1*
|
||||
All URIs are relative to *http://localhost:8080/api/storage/v1*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
@ -9,6 +9,7 @@ Method | HTTP request | Description
|
||||
[**download_network**](DataApi.md#download_network) | **POST** /data/{cid}/network | 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.
|
||||
[**download_network_manifest**](DataApi.md#download_network_manifest) | **GET** /data/{cid}/network/manifest | Download only the dataset manifest from the network to the local node if it's not available locally.
|
||||
[**download_network_stream**](DataApi.md#download_network_stream) | **GET** /data/{cid}/network/stream | 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.
|
||||
[**has_block**](DataApi.md#has_block) | **GET** /data/{cid}/exists | Check if a block identified by CID exists in the local node.
|
||||
[**list_data**](DataApi.md#list_data) | **GET** /data | Lists manifest CIDs stored locally in node.
|
||||
[**space**](DataApi.md#space) | **GET** /space | Gets a summary of the storage space allocation of the node.
|
||||
[**upload**](DataApi.md#upload) | **POST** /data | 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.
|
||||
@ -27,10 +28,10 @@ import codex_api_client
|
||||
from codex_api_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
|
||||
# Defining the host is optional and defaults to http://localhost:8080/api/codex/v1
|
||||
# Defining the host is optional and defaults to http://localhost:8080/api/storage/v1
|
||||
# See configuration.py for a list of all supported configuration parameters.
|
||||
configuration = codex_api_client.Configuration(
|
||||
host = "http://localhost:8080/api/codex/v1"
|
||||
host = "http://localhost:8080/api/storage/v1"
|
||||
)
|
||||
|
||||
|
||||
@ -92,10 +93,10 @@ import codex_api_client
|
||||
from codex_api_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
|
||||
# Defining the host is optional and defaults to http://localhost:8080/api/codex/v1
|
||||
# Defining the host is optional and defaults to http://localhost:8080/api/storage/v1
|
||||
# See configuration.py for a list of all supported configuration parameters.
|
||||
configuration = codex_api_client.Configuration(
|
||||
host = "http://localhost:8080/api/codex/v1"
|
||||
host = "http://localhost:8080/api/storage/v1"
|
||||
)
|
||||
|
||||
|
||||
@ -161,10 +162,10 @@ from codex_api_client.models.data_item import DataItem
|
||||
from codex_api_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
|
||||
# Defining the host is optional and defaults to http://localhost:8080/api/codex/v1
|
||||
# Defining the host is optional and defaults to http://localhost:8080/api/storage/v1
|
||||
# See configuration.py for a list of all supported configuration parameters.
|
||||
configuration = codex_api_client.Configuration(
|
||||
host = "http://localhost:8080/api/codex/v1"
|
||||
host = "http://localhost:8080/api/storage/v1"
|
||||
)
|
||||
|
||||
|
||||
@ -230,10 +231,10 @@ from codex_api_client.models.data_item import DataItem
|
||||
from codex_api_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
|
||||
# Defining the host is optional and defaults to http://localhost:8080/api/codex/v1
|
||||
# Defining the host is optional and defaults to http://localhost:8080/api/storage/v1
|
||||
# See configuration.py for a list of all supported configuration parameters.
|
||||
configuration = codex_api_client.Configuration(
|
||||
host = "http://localhost:8080/api/codex/v1"
|
||||
host = "http://localhost:8080/api/storage/v1"
|
||||
)
|
||||
|
||||
|
||||
@ -298,10 +299,10 @@ import codex_api_client
|
||||
from codex_api_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
|
||||
# Defining the host is optional and defaults to http://localhost:8080/api/codex/v1
|
||||
# Defining the host is optional and defaults to http://localhost:8080/api/storage/v1
|
||||
# See configuration.py for a list of all supported configuration parameters.
|
||||
configuration = codex_api_client.Configuration(
|
||||
host = "http://localhost:8080/api/codex/v1"
|
||||
host = "http://localhost:8080/api/storage/v1"
|
||||
)
|
||||
|
||||
|
||||
@ -353,6 +354,74 @@ No authorization required
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **has_block**
|
||||
> HasBlock200Response has_block(cid)
|
||||
|
||||
Check if a block identified by CID exists in the local node.
|
||||
|
||||
### Example
|
||||
|
||||
|
||||
```python
|
||||
import codex_api_client
|
||||
from codex_api_client.models.has_block200_response import HasBlock200Response
|
||||
from codex_api_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
|
||||
# Defining the host is optional and defaults to http://localhost:8080/api/storage/v1
|
||||
# See configuration.py for a list of all supported configuration parameters.
|
||||
configuration = codex_api_client.Configuration(
|
||||
host = "http://localhost:8080/api/storage/v1"
|
||||
)
|
||||
|
||||
|
||||
# Enter a context with an instance of the API client
|
||||
with codex_api_client.ApiClient(configuration) as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = codex_api_client.DataApi(api_client)
|
||||
cid = 'cid_example' # str | CID of the block to check.
|
||||
|
||||
try:
|
||||
# Check if a block identified by CID exists in the local node.
|
||||
api_response = api_instance.has_block(cid)
|
||||
print("The response of DataApi->has_block:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling DataApi->has_block: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**cid** | **str**| CID of the block to check. |
|
||||
|
||||
### Return type
|
||||
|
||||
[**HasBlock200Response**](HasBlock200Response.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json
|
||||
|
||||
### HTTP response details
|
||||
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
**200** | Block existence information | - |
|
||||
**400** | Invalid CID is specified | - |
|
||||
**500** | Well it was bad-bad | - |
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **list_data**
|
||||
> DataList list_data()
|
||||
|
||||
@ -367,10 +436,10 @@ from codex_api_client.models.data_list import DataList
|
||||
from codex_api_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
|
||||
# Defining the host is optional and defaults to http://localhost:8080/api/codex/v1
|
||||
# Defining the host is optional and defaults to http://localhost:8080/api/storage/v1
|
||||
# See configuration.py for a list of all supported configuration parameters.
|
||||
configuration = codex_api_client.Configuration(
|
||||
host = "http://localhost:8080/api/codex/v1"
|
||||
host = "http://localhost:8080/api/storage/v1"
|
||||
)
|
||||
|
||||
|
||||
@ -433,10 +502,10 @@ from codex_api_client.models.space import Space
|
||||
from codex_api_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
|
||||
# Defining the host is optional and defaults to http://localhost:8080/api/codex/v1
|
||||
# Defining the host is optional and defaults to http://localhost:8080/api/storage/v1
|
||||
# See configuration.py for a list of all supported configuration parameters.
|
||||
configuration = codex_api_client.Configuration(
|
||||
host = "http://localhost:8080/api/codex/v1"
|
||||
host = "http://localhost:8080/api/storage/v1"
|
||||
)
|
||||
|
||||
|
||||
@ -495,10 +564,10 @@ import codex_api_client
|
||||
from codex_api_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
|
||||
# Defining the host is optional and defaults to http://localhost:8080/api/codex/v1
|
||||
# Defining the host is optional and defaults to http://localhost:8080/api/storage/v1
|
||||
# See configuration.py for a list of all supported configuration parameters.
|
||||
configuration = codex_api_client.Configuration(
|
||||
host = "http://localhost:8080/api/codex/v1"
|
||||
host = "http://localhost:8080/api/storage/v1"
|
||||
)
|
||||
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
# codex_api_client.DebugApi
|
||||
|
||||
All URIs are relative to *http://localhost:8080/api/codex/v1*
|
||||
All URIs are relative to *http://localhost:8080/api/storage/v1*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
@ -22,10 +22,10 @@ from codex_api_client.models.debug_info import DebugInfo
|
||||
from codex_api_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
|
||||
# Defining the host is optional and defaults to http://localhost:8080/api/codex/v1
|
||||
# Defining the host is optional and defaults to http://localhost:8080/api/storage/v1
|
||||
# See configuration.py for a list of all supported configuration parameters.
|
||||
configuration = codex_api_client.Configuration(
|
||||
host = "http://localhost:8080/api/codex/v1"
|
||||
host = "http://localhost:8080/api/storage/v1"
|
||||
)
|
||||
|
||||
|
||||
@ -83,10 +83,10 @@ import codex_api_client
|
||||
from codex_api_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
|
||||
# Defining the host is optional and defaults to http://localhost:8080/api/codex/v1
|
||||
# Defining the host is optional and defaults to http://localhost:8080/api/storage/v1
|
||||
# See configuration.py for a list of all supported configuration parameters.
|
||||
configuration = codex_api_client.Configuration(
|
||||
host = "http://localhost:8080/api/codex/v1"
|
||||
host = "http://localhost:8080/api/storage/v1"
|
||||
)
|
||||
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@ Name | Type | Description | Notes
|
||||
**spr** | **str** | Signed Peer Record (libp2p) |
|
||||
**announce_addresses** | **List[str]** | |
|
||||
**table** | [**PeersTable**](PeersTable.md) | |
|
||||
**codex** | [**CodexVersion**](CodexVersion.md) | |
|
||||
**storage** | [**StorageVersion**](StorageVersion.md) | |
|
||||
|
||||
## Example
|
||||
|
||||
|
||||
29
docs/HasBlock200Response.md
Normal file
29
docs/HasBlock200Response.md
Normal file
@ -0,0 +1,29 @@
|
||||
# HasBlock200Response
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**has** | **bool** | Indicates whether the block exists in the local node | [optional]
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from codex_api_client.models.has_block200_response import HasBlock200Response
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of HasBlock200Response from a JSON string
|
||||
has_block200_response_instance = HasBlock200Response.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(HasBlock200Response.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
has_block200_response_dict = has_block200_response_instance.to_dict()
|
||||
# create an instance of HasBlock200Response from a dict
|
||||
has_block200_response_from_dict = HasBlock200Response.from_dict(has_block200_response_dict)
|
||||
```
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@ -8,7 +8,6 @@ Name | Type | Description | Notes
|
||||
**tree_cid** | **str** | Content Identifier as specified at https://github.com/multiformats/cid |
|
||||
**dataset_size** | **int** | Length of original content in bytes |
|
||||
**block_size** | **int** | Size of blocks |
|
||||
**protected** | **bool** | Indicates if content is protected by erasure-coding |
|
||||
**filename** | **str** | The original name of the uploaded content (optional) | [optional]
|
||||
**mimetype** | **str** | The original mimetype of the uploaded content (optional) | [optional]
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
# codex_api_client.NodeApi
|
||||
|
||||
All URIs are relative to *http://localhost:8080/api/codex/v1*
|
||||
All URIs are relative to *http://localhost:8080/api/storage/v1*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
@ -26,10 +26,10 @@ import codex_api_client
|
||||
from codex_api_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
|
||||
# Defining the host is optional and defaults to http://localhost:8080/api/codex/v1
|
||||
# Defining the host is optional and defaults to http://localhost:8080/api/storage/v1
|
||||
# See configuration.py for a list of all supported configuration parameters.
|
||||
configuration = codex_api_client.Configuration(
|
||||
host = "http://localhost:8080/api/codex/v1"
|
||||
host = "http://localhost:8080/api/storage/v1"
|
||||
)
|
||||
|
||||
|
||||
@ -92,10 +92,10 @@ import codex_api_client
|
||||
from codex_api_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
|
||||
# Defining the host is optional and defaults to http://localhost:8080/api/codex/v1
|
||||
# Defining the host is optional and defaults to http://localhost:8080/api/storage/v1
|
||||
# See configuration.py for a list of all supported configuration parameters.
|
||||
configuration = codex_api_client.Configuration(
|
||||
host = "http://localhost:8080/api/codex/v1"
|
||||
host = "http://localhost:8080/api/storage/v1"
|
||||
)
|
||||
|
||||
|
||||
@ -153,10 +153,10 @@ import codex_api_client
|
||||
from codex_api_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
|
||||
# Defining the host is optional and defaults to http://localhost:8080/api/codex/v1
|
||||
# Defining the host is optional and defaults to http://localhost:8080/api/storage/v1
|
||||
# See configuration.py for a list of all supported configuration parameters.
|
||||
configuration = codex_api_client.Configuration(
|
||||
host = "http://localhost:8080/api/codex/v1"
|
||||
host = "http://localhost:8080/api/storage/v1"
|
||||
)
|
||||
|
||||
|
||||
|
||||
@ -6,9 +6,9 @@
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**total_blocks** | **int** | Number of blocks stored by the node |
|
||||
**quota_max_bytes** | **int** | Maximum storage space (in bytes) available for the node in Codex's local repository. |
|
||||
**quota_used_bytes** | **int** | Amount of storage space (in bytes) currently used for storing files in Codex's local repository. |
|
||||
**quota_reserved_bytes** | **int** | Amount of storage reserved (in bytes) in the Codex'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. |
|
||||
**quota_max_bytes** | **int** | Maximum storage space (in bytes) available for the node in Logos Storage's local repository. |
|
||||
**quota_used_bytes** | **int** | Amount of storage space (in bytes) currently used for storing files in Logos Storage's local repository. |
|
||||
**quota_reserved_bytes** | **int** | 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. |
|
||||
|
||||
## Example
|
||||
|
||||
|
||||
30
docs/StorageVersion.md
Normal file
30
docs/StorageVersion.md
Normal file
@ -0,0 +1,30 @@
|
||||
# StorageVersion
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**version** | **str** | | [optional]
|
||||
**revision** | **str** | | [optional]
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from codex_api_client.models.storage_version import StorageVersion
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of StorageVersion from a JSON string
|
||||
storage_version_instance = StorageVersion.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(StorageVersion.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
storage_version_dict = storage_version_instance.to_dict()
|
||||
# create an instance of StorageVersion from a dict
|
||||
storage_version_from_dict = StorageVersion.from_dict(storage_version_dict)
|
||||
```
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
[tool.poetry]
|
||||
name = "codex_api_client"
|
||||
version = "0.4.0"
|
||||
description = "Codex API"
|
||||
description = "Logos Storage API"
|
||||
authors = ["OpenAPI Generator Community <team@openapitools.org>"]
|
||||
license = "NoLicense"
|
||||
readme = "README.md"
|
||||
repository = "https://github.com/codex-storage/py-codex-api-client"
|
||||
keywords = ["OpenAPI", "OpenAPI-Generator", "Codex API"]
|
||||
keywords = ["OpenAPI", "OpenAPI-Generator", "Logos Storage API"]
|
||||
include = ["codex_api_client/py.typed"]
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
|
||||
10
setup.py
10
setup.py
@ -1,9 +1,9 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Codex API
|
||||
Logos Storage API
|
||||
|
||||
List of endpoints and interfaces available to Codex API users
|
||||
List of endpoints and interfaces available to Logos Storage API users
|
||||
|
||||
The version of the OpenAPI document: 0.0.1
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
@ -33,17 +33,17 @@ REQUIRES = [
|
||||
setup(
|
||||
name=NAME,
|
||||
version=VERSION,
|
||||
description="Codex API",
|
||||
description="Logos Storage API",
|
||||
author="OpenAPI Generator community",
|
||||
author_email="team@openapitools.org",
|
||||
url="https://github.com/codex-storage/py-codex-api-client",
|
||||
keywords=["OpenAPI", "OpenAPI-Generator", "Codex API"],
|
||||
keywords=["OpenAPI", "OpenAPI-Generator", "Logos Storage API"],
|
||||
install_requires=REQUIRES,
|
||||
packages=find_packages(exclude=["test", "tests"]),
|
||||
include_package_data=True,
|
||||
long_description_content_type='text/markdown',
|
||||
long_description="""\
|
||||
List of endpoints and interfaces available to Codex API users
|
||||
List of endpoints and interfaces available to Logos Storage API users
|
||||
""", # noqa: E501
|
||||
package_data={"codex_api_client": ["py.typed"]},
|
||||
)
|
||||
51
test/test_has_block200_response.py
Normal file
51
test/test_has_block200_response.py
Normal file
@ -0,0 +1,51 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Logos Storage API
|
||||
|
||||
List of endpoints and interfaces available to Logos Storage API users
|
||||
|
||||
The version of the OpenAPI document: 0.0.1
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
import unittest
|
||||
|
||||
from codex_api_client.models.has_block200_response import HasBlock200Response
|
||||
|
||||
class TestHasBlock200Response(unittest.TestCase):
|
||||
"""HasBlock200Response unit test stubs"""
|
||||
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
def tearDown(self):
|
||||
pass
|
||||
|
||||
def make_instance(self, include_optional) -> HasBlock200Response:
|
||||
"""Test HasBlock200Response
|
||||
include_optional is a boolean, when False only required
|
||||
params are included, when True both required and
|
||||
optional params are included """
|
||||
# uncomment below to create an instance of `HasBlock200Response`
|
||||
"""
|
||||
model = HasBlock200Response()
|
||||
if include_optional:
|
||||
return HasBlock200Response(
|
||||
has = True
|
||||
)
|
||||
else:
|
||||
return HasBlock200Response(
|
||||
)
|
||||
"""
|
||||
|
||||
def testHasBlock200Response(self):
|
||||
"""Test HasBlock200Response"""
|
||||
# inst_req_only = self.make_instance(include_optional=False)
|
||||
# inst_req_and_optional = self.make_instance(include_optional=True)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
52
test/test_storage_version.py
Normal file
52
test/test_storage_version.py
Normal file
@ -0,0 +1,52 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Logos Storage API
|
||||
|
||||
List of endpoints and interfaces available to Logos Storage API users
|
||||
|
||||
The version of the OpenAPI document: 0.0.1
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
import unittest
|
||||
|
||||
from codex_api_client.models.storage_version import StorageVersion
|
||||
|
||||
class TestStorageVersion(unittest.TestCase):
|
||||
"""StorageVersion unit test stubs"""
|
||||
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
def tearDown(self):
|
||||
pass
|
||||
|
||||
def make_instance(self, include_optional) -> StorageVersion:
|
||||
"""Test StorageVersion
|
||||
include_optional is a boolean, when False only required
|
||||
params are included, when True both required and
|
||||
optional params are included """
|
||||
# uncomment below to create an instance of `StorageVersion`
|
||||
"""
|
||||
model = StorageVersion()
|
||||
if include_optional:
|
||||
return StorageVersion(
|
||||
version = 'v0.1.7',
|
||||
revision = '0c647d8'
|
||||
)
|
||||
else:
|
||||
return StorageVersion(
|
||||
)
|
||||
"""
|
||||
|
||||
def testStorageVersion(self):
|
||||
"""Test StorageVersion"""
|
||||
# inst_req_only = self.make_instance(include_optional=False)
|
||||
# inst_req_and_optional = self.make_instance(include_optional=True)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Loading…
x
Reference in New Issue
Block a user