Compare commits

..

9 Commits

Author SHA1 Message Date
AuHau
7fd5545959 Version bump 2025-05-22 06:52:43 +00:00
Adam Uhlíř
ed88a74c73
fix: update openapi generator (#6) 2025-05-22 08:41:00 +02:00
github-actions[bot]
00a3c7a086
Generated API update (#7)
Co-authored-by: codex-storage-bot <154258435+codex-storage-bot@users.noreply.github.com>
2025-05-22 08:35:56 +02:00
Adam Uhlíř
9e0759658a
ci: cleanup generate yaml (#5) 2025-04-23 11:19:37 +02:00
AuHau
60aaa4696a Version bump 2025-04-23 09:00:38 +00:00
github-actions[bot]
ef4f7a9b3d
Generated API update (#4)
Co-authored-by: codex-storage-bot <154258435+codex-storage-bot@users.noreply.github.com>
2025-04-23 10:59:04 +02:00
AuHau
bd67201dac Version bump 2025-03-31 16:48:52 +00:00
github-actions[bot]
9dd754e2d9
Generated API update (#3)
Co-authored-by: AuHau <6072250+AuHau@users.noreply.github.com>
2025-03-31 18:47:51 +02:00
AuHau
cb896ee083 Version bump 2025-03-31 15:53:21 +00:00
57 changed files with 741 additions and 246 deletions

View File

@ -6,7 +6,7 @@ permissions:
on:
repository_dispatch:
types: [generate, release]
types: [generate]
workflow_dispatch:
inputs:
openapi_url:
@ -25,10 +25,6 @@ jobs:
echo "Error: 'openapi_url' is missing in client_payload."
exit 1
fi
if [ "${{ github.event.action }}" == "release" ] && [ -z "${{ github.event.client_payload.version }}" ]; then
echo "Error: We are supposed to release, but 'version' is missing in client_payload."
exit 1
fi
echo "OPENAPI_URL=${{ github.event.client_payload.openapi_url }}" >> $GITHUB_ENV
else

View File

@ -23,7 +23,6 @@ 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_create.py
codex_api_client/models/sales_availability_read.py
codex_api_client/models/slot.py
codex_api_client/models/slot_agent.py
@ -51,7 +50,6 @@ docs/Purchase.md
docs/Reservation.md
docs/SPRRead.md
docs/SalesAvailability.md
docs/SalesAvailabilityCREATE.md
docs/SalesAvailabilityREAD.md
docs/Slot.md
docs/SlotAgent.md

View File

@ -1 +1 @@
7.10.0
7.12.0

View File

@ -4,8 +4,8 @@ List of endpoints and interfaces available to Codex API users
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
- API version: 0.0.1
- Package version: 0.2.0
- Generator version: 7.10.0
- Package version: 0.4.0
- Generator version: 7.12.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
## Requirements.
@ -45,15 +45,13 @@ configuration = codex_api_client.Configuration(
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 | File to be downloaded.
cid = 'cid_example' # str | Block or dataset to be deleted.
try:
# Download a file from the local node in a streaming manner. If the file is not available locally, a 404 is returned.
api_response = api_instance.download_local(cid)
print("The response of DataApi->download_local:\n")
pprint(api_response)
# Deletes either a single block or an entire dataset from the local node.
api_instance.delete_local(cid)
except ApiException as e:
print("Exception when calling DataApi->download_local: %s\n" % e)
print("Exception when calling DataApi->delete_local: %s\n" % e)
```
@ -63,6 +61,7 @@ All URIs are relative to *http://localhost:8080/api/codex/v1*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*DataApi* | [**delete_local**](docs/DataApi.md#delete_local) | **DELETE** /data/{cid} | Deletes either a single block or an entire dataset from the local node.
*DataApi* | [**download_local**](docs/DataApi.md#download_local) | **GET** /data/{cid} | Download a file from the local node in a streaming manner. If the file is not available locally, a 404 is returned.
*DataApi* | [**download_network**](docs/DataApi.md#download_network) | **POST** /data/{cid}/network | Download a file from the network to the local node if it&#39;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&#39;s not available locally.
@ -101,7 +100,6 @@ Class | Method | HTTP request | Description
- [Reservation](docs/Reservation.md)
- [SPRRead](docs/SPRRead.md)
- [SalesAvailability](docs/SalesAvailability.md)
- [SalesAvailabilityCREATE](docs/SalesAvailabilityCREATE.md)
- [SalesAvailabilityREAD](docs/SalesAvailabilityREAD.md)
- [Slot](docs/Slot.md)
- [SlotAgent](docs/SlotAgent.md)

View File

@ -50,6 +50,10 @@ components:
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
@ -70,6 +74,8 @@ components:
SPRRead:
type: object
required:
- spr
properties:
spr:
$ref: "#/components/schemas/SPR"
@ -82,6 +88,8 @@ components:
Content:
type: object
required:
- cid
description: Parameters specifying the content
properties:
cid:
@ -89,6 +97,12 @@ components:
Node:
type: object
required:
- nodeId
- peerId
- record
- address
- seen
properties:
nodeId:
type: string
@ -110,9 +124,15 @@ components:
revision:
type: string
example: 0c647d8
contracts:
type: string
example: 0b537c7
PeersTable:
type: object
required:
- localNode
- nodes
properties:
localNode:
$ref: "#/components/schemas/Node"
@ -123,6 +143,14 @@ components:
DebugInfo:
type: object
required:
- id
- addrs
- repo
- spr
- announceAddresses
- table
- codex
properties:
id:
$ref: "#/components/schemas/PeerId"
@ -146,9 +174,12 @@ components:
SalesAvailability:
type: object
required:
- totalSize
- duration
- minPricePerBytePerSecond
- totalCollateral
properties:
id:
$ref: "#/components/schemas/Id"
totalSize:
type: integer
format: int64
@ -161,28 +192,43 @@ components:
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
SalesAvailabilityCREATE:
allOf:
- $ref: "#/components/schemas/SalesAvailability"
- required:
- totalSize
- minPricePerBytePerSecond
- totalCollateral
- duration
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"
@ -195,9 +241,11 @@ components:
SlotAgent:
type: object
required:
- state
- requestId
- slotIndex
properties:
id:
$ref: "#/components/schemas/SlotId"
slotIndex:
type: integer
format: int64
@ -228,6 +276,13 @@ components:
Reservation:
type: object
required:
- id
- availabilityId
- size
- requestId
- slotIndex
- validUntil
properties:
id:
$ref: "#/components/schemas/Id"
@ -243,6 +298,9 @@ components:
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
@ -263,13 +321,14 @@ components:
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:
type: string
description: Number as decimal string that represents how much collateral per byte is asked from hosts that wants to fill a slots
$ref: "#/components/schemas/CollateralPerByte"
expiry:
type: integer
format: int64
@ -277,26 +336,44 @@ components:
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: string
description: Amount of storage per slot (in bytes) as decimal string
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
@ -315,13 +392,16 @@ components:
Purchase:
type: object
required:
- state
- requestId
properties:
state:
type: string
description: Description of the Request's state
enum:
- cancelled
- error
- errored
- failed
- finished
- pending
@ -330,12 +410,17 @@ components:
- 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"
DataList:
type: object
required:
- content
properties:
content:
type: array
@ -344,6 +429,9 @@ components:
DataItem:
type: object
required:
- cid
- manifest
properties:
cid:
$ref: "#/components/schemas/Cid"
@ -352,6 +440,11 @@ components:
ManifestItem:
type: object
required:
- treeCid
- datasetSize
- blockSize
- protected
properties:
treeCid:
$ref: "#/components/schemas/Cid"
@ -379,6 +472,11 @@ components:
Space:
type: object
required:
- totalBlocks
- quotaMaxBytes
- quotaUsedBytes
- quotaReservedBytes
properties:
totalBlocks:
description: "Number of blocks stored by the node"
@ -497,6 +595,8 @@ paths:
text/plain:
schema:
type: string
"422":
description: The mimetype of the filename is invalid
"500":
description: Well it was bad-bad and the upload did not work out
@ -528,6 +628,26 @@ paths:
"500":
description: Well it was bad-bad
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
"/data/{cid}/network":
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."
@ -697,7 +817,7 @@ paths:
content:
application/json:
schema:
$ref: "#/components/schemas/SalesAvailabilityCREATE"
$ref: "#/components/schemas/SalesAvailability"
responses:
"201":
description: Created storage availability
@ -708,7 +828,7 @@ paths:
"400":
description: Invalid data input
"422":
description: Not enough node's storage quota available
description: Not enough node's storage quota available or the provided parameters did not pass validation
"500":
description: Error reserving availability
"503":
@ -741,7 +861,7 @@ paths:
"404":
description: Availability not found
"422":
description: Not enough node's storage quota available
description: The provided parameters did not pass validation
"500":
description: Error reserving availability
"503":
@ -804,6 +924,8 @@ paths:
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":
@ -861,7 +983,7 @@ paths:
"200":
description: Node's SPR
content:
plain/text:
text/plain:
schema:
$ref: "#/components/schemas/SPR"
application/json:
@ -879,7 +1001,7 @@ paths:
"200":
description: Node's Peer ID
content:
plain/text:
text/plain:
schema:
$ref: "#/components/schemas/PeerId"
application/json:

View File

@ -14,7 +14,7 @@
""" # noqa: E501
__version__ = "0.2.0"
__version__ = "0.4.0"
# import apis into sdk package
from codex_api_client.api.data_api import DataApi
@ -47,7 +47,6 @@ 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_create import SalesAvailabilityCREATE
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

View File

@ -41,6 +41,262 @@ class DataApi:
self.api_client = api_client
@validate_call
def delete_local(
self,
cid: Annotated[StrictStr, Field(description="Block or dataset to be deleted.")],
_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,
) -> None:
"""Deletes either a single block or an entire dataset from the local node.
:param cid: Block or dataset to be deleted. (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._delete_local_serialize(
cid=cid,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'204': None,
'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 delete_local_with_http_info(
self,
cid: Annotated[StrictStr, Field(description="Block or dataset to be deleted.")],
_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[None]:
"""Deletes either a single block or an entire dataset from the local node.
:param cid: Block or dataset to be deleted. (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._delete_local_serialize(
cid=cid,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'204': None,
'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 delete_local_without_preload_content(
self,
cid: Annotated[StrictStr, Field(description="Block or dataset to be deleted.")],
_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:
"""Deletes either a single block or an entire dataset from the local node.
:param cid: Block or dataset to be deleted. (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._delete_local_serialize(
cid=cid,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'204': None,
'400': None,
'500': None,
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
return response_data.response
def _delete_local_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
# authentication setting
_auth_settings: List[str] = [
]
return self.api_client.param_serialize(
method='DELETE',
resource_path='/data/{cid}',
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 download_local(
self,
@ -1666,6 +1922,7 @@ class DataApi:
_response_types_map: Dict[str, Optional[str]] = {
'200': "str",
'422': None,
'500': None,
}
response_data = self.api_client.call_api(
@ -1741,6 +1998,7 @@ class DataApi:
_response_types_map: Dict[str, Optional[str]] = {
'200': "str",
'422': None,
'500': None,
}
response_data = self.api_client.call_api(
@ -1816,6 +2074,7 @@ class DataApi:
_response_types_map: Dict[str, Optional[str]] = {
'200': "str",
'422': None,
'500': None,
}
response_data = self.api_client.call_api(

View File

@ -22,7 +22,6 @@ from typing_extensions import Annotated
from codex_api_client.models.purchase import Purchase
from codex_api_client.models.reservation import Reservation
from codex_api_client.models.sales_availability import SalesAvailability
from codex_api_client.models.sales_availability_create import SalesAvailabilityCREATE
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
@ -105,6 +104,7 @@ class MarketplaceApi:
_response_types_map: Dict[str, Optional[str]] = {
'200': "str",
'400': None,
'422': None,
'404': None,
'503': None,
}
@ -178,6 +178,7 @@ class MarketplaceApi:
_response_types_map: Dict[str, Optional[str]] = {
'200': "str",
'400': None,
'422': None,
'404': None,
'503': None,
}
@ -251,6 +252,7 @@ class MarketplaceApi:
_response_types_map: Dict[str, Optional[str]] = {
'200': "str",
'400': None,
'422': None,
'404': None,
'503': None,
}
@ -1885,7 +1887,7 @@ class MarketplaceApi:
@validate_call
def offer_storage(
self,
sales_availability_create: Optional[SalesAvailabilityCREATE] = None,
sales_availability: Optional[SalesAvailability] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
@ -1902,8 +1904,8 @@ class MarketplaceApi:
"""Offers storage for sale
:param sales_availability_create:
:type sales_availability_create: SalesAvailabilityCREATE
:param sales_availability:
:type sales_availability: SalesAvailability
: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
@ -1927,7 +1929,7 @@ class MarketplaceApi:
""" # noqa: E501
_param = self._offer_storage_serialize(
sales_availability_create=sales_availability_create,
sales_availability=sales_availability,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
@ -1955,7 +1957,7 @@ class MarketplaceApi:
@validate_call
def offer_storage_with_http_info(
self,
sales_availability_create: Optional[SalesAvailabilityCREATE] = None,
sales_availability: Optional[SalesAvailability] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
@ -1972,8 +1974,8 @@ class MarketplaceApi:
"""Offers storage for sale
:param sales_availability_create:
:type sales_availability_create: SalesAvailabilityCREATE
:param sales_availability:
:type sales_availability: SalesAvailability
: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
@ -1997,7 +1999,7 @@ class MarketplaceApi:
""" # noqa: E501
_param = self._offer_storage_serialize(
sales_availability_create=sales_availability_create,
sales_availability=sales_availability,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
@ -2025,7 +2027,7 @@ class MarketplaceApi:
@validate_call
def offer_storage_without_preload_content(
self,
sales_availability_create: Optional[SalesAvailabilityCREATE] = None,
sales_availability: Optional[SalesAvailability] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
@ -2042,8 +2044,8 @@ class MarketplaceApi:
"""Offers storage for sale
:param sales_availability_create:
:type sales_availability_create: SalesAvailabilityCREATE
:param sales_availability:
:type sales_availability: SalesAvailability
: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
@ -2067,7 +2069,7 @@ class MarketplaceApi:
""" # noqa: E501
_param = self._offer_storage_serialize(
sales_availability_create=sales_availability_create,
sales_availability=sales_availability,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
@ -2090,7 +2092,7 @@ class MarketplaceApi:
def _offer_storage_serialize(
self,
sales_availability_create,
sales_availability,
_request_auth,
_content_type,
_headers,
@ -2116,8 +2118,8 @@ class MarketplaceApi:
# process the header parameters
# process the form parameters
# process the body parameter
if sales_availability_create is not None:
_body_params = sales_availability_create
if sales_availability is not None:
_body_params = sales_availability
# set the HTTP header `Accept`

View File

@ -527,7 +527,7 @@ class NodeApi:
if 'Accept' not in _header_params:
_header_params['Accept'] = self.api_client.select_header_accept(
[
'plain/text',
'text/plain',
'application/json'
]
)
@ -773,7 +773,7 @@ class NodeApi:
if 'Accept' not in _header_params:
_header_params['Accept'] = self.api_client.select_header_accept(
[
'plain/text',
'text/plain',
'application/json'
]
)

View File

@ -517,7 +517,7 @@ class ApiClient:
if k in collection_formats:
collection_format = collection_formats[k]
if collection_format == 'multi':
new_params.extend((k, str(value)) for value in v)
new_params.extend((k, quote(str(value))) for value in v)
else:
if collection_format == 'ssv':
delimiter = ' '

View File

@ -18,7 +18,7 @@ import logging
from logging import FileHandler
import multiprocessing
import sys
from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict
from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict, Union
from typing_extensions import NotRequired, Self
import urllib3
@ -160,6 +160,8 @@ class Configuration:
:param ssl_ca_cert: str - the path to a file of concatenated CA certificates
in PEM format.
:param retries: Number of retries for API requests.
:param ca_cert_data: verify the peer using concatenated CA certificate data
in PEM (str) or DER (bytes) format.
"""
@ -173,13 +175,14 @@ class Configuration:
username: Optional[str]=None,
password: Optional[str]=None,
access_token: Optional[str]=None,
server_index: Optional[int]=None,
server_index: Optional[int]=None,
server_variables: Optional[ServerVariablesT]=None,
server_operation_index: Optional[Dict[int, int]]=None,
server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None,
ignore_operation_servers: bool=False,
ssl_ca_cert: Optional[str]=None,
retries: Optional[int] = None,
ca_cert_data: Optional[Union[str, bytes]] = None,
*,
debug: Optional[bool] = None,
) -> None:
@ -257,6 +260,10 @@ class Configuration:
self.ssl_ca_cert = ssl_ca_cert
"""Set this to customize the certificate file to verify the peer.
"""
self.ca_cert_data = ca_cert_data
"""Set this to verify the peer using PEM (str) or DER (bytes)
certificate data.
"""
self.cert_file = None
"""client certificate file
"""
@ -494,7 +501,7 @@ class Configuration:
"OS: {env}\n"\
"Python Version: {pyversion}\n"\
"Version of the API: 0.0.1\n"\
"SDK Package Version: 0.2.0".\
"SDK Package Version: 0.4.0".\
format(env=sys.platform, pyversion=sys.version)
def get_host_settings(self) -> List[HostSetting]:

View File

@ -150,6 +150,13 @@ class ApiException(OpenApiException):
if http_resp.status == 404:
raise NotFoundException(http_resp=http_resp, body=body, data=data)
# Added new conditions for 409 and 422
if http_resp.status == 409:
raise ConflictException(http_resp=http_resp, body=body, data=data)
if http_resp.status == 422:
raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data)
if 500 <= http_resp.status <= 599:
raise ServiceException(http_resp=http_resp, body=body, data=data)
raise ApiException(http_resp=http_resp, body=body, data=data)
@ -188,6 +195,16 @@ class ServiceException(ApiException):
pass
class ConflictException(ApiException):
"""Exception for HTTP 409 Conflict."""
pass
class UnprocessableEntityException(ApiException):
"""Exception for HTTP 422 Unprocessable Entity."""
pass
def render_path(path_to_item):
"""Returns a string representation of a path"""
result = ""

View File

@ -27,7 +27,6 @@ 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_create import SalesAvailabilityCREATE
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

View File

@ -28,7 +28,8 @@ class CodexVersion(BaseModel):
""" # noqa: E501
version: Optional[StrictStr] = None
revision: Optional[StrictStr] = None
__properties: ClassVar[List[str]] = ["version", "revision"]
contracts: Optional[StrictStr] = None
__properties: ClassVar[List[str]] = ["version", "revision", "contracts"]
model_config = ConfigDict(
populate_by_name=True,
@ -82,7 +83,8 @@ class CodexVersion(BaseModel):
_obj = cls.model_validate({
"version": obj.get("version"),
"revision": obj.get("revision")
"revision": obj.get("revision"),
"contracts": obj.get("contracts")
})
return _obj

View File

@ -18,7 +18,7 @@ import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Any, ClassVar, Dict, List
from typing import Optional, Set
from typing_extensions import Self
@ -26,7 +26,7 @@ class Content(BaseModel):
"""
Parameters specifying the content
""" # noqa: E501
cid: Optional[StrictStr] = Field(default=None, description="Content Identifier as specified at https://github.com/multiformats/cid")
cid: StrictStr = Field(description="Content Identifier as specified at https://github.com/multiformats/cid")
__properties: ClassVar[List[str]] = ["cid"]
model_config = ConfigDict(

View File

@ -18,7 +18,7 @@ import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Any, ClassVar, Dict, List
from codex_api_client.models.manifest_item import ManifestItem
from typing import Optional, Set
from typing_extensions import Self
@ -27,8 +27,8 @@ class DataItem(BaseModel):
"""
DataItem
""" # noqa: E501
cid: Optional[StrictStr] = Field(default=None, description="Content Identifier as specified at https://github.com/multiformats/cid")
manifest: Optional[ManifestItem] = None
cid: StrictStr = Field(description="Content Identifier as specified at https://github.com/multiformats/cid")
manifest: ManifestItem
__properties: ClassVar[List[str]] = ["cid", "manifest"]
model_config = ConfigDict(

View File

@ -18,7 +18,7 @@ import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict
from typing import Any, ClassVar, Dict, List, Optional
from typing import Any, ClassVar, Dict, List
from codex_api_client.models.data_item import DataItem
from typing import Optional, Set
from typing_extensions import Self
@ -27,7 +27,7 @@ class DataList(BaseModel):
"""
DataList
""" # noqa: E501
content: Optional[List[DataItem]] = None
content: List[DataItem]
__properties: ClassVar[List[str]] = ["content"]
model_config = ConfigDict(

View File

@ -18,7 +18,7 @@ import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
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 typing import Optional, Set
@ -28,13 +28,13 @@ class DebugInfo(BaseModel):
"""
DebugInfo
""" # noqa: E501
id: Optional[StrictStr] = Field(default=None, description="Peer Identity reference as specified at https://docs.libp2p.io/concepts/fundamentals/peers/")
addrs: Optional[List[StrictStr]] = None
repo: Optional[StrictStr] = Field(default=None, description="Path of the data repository where all nodes data are stored")
spr: Optional[StrictStr] = Field(default=None, description="Signed Peer Record (libp2p)")
announce_addresses: Optional[List[StrictStr]] = Field(default=None, alias="announceAddresses")
table: Optional[PeersTable] = None
codex: Optional[CodexVersion] = None
id: StrictStr = Field(description="Peer Identity reference as specified at https://docs.libp2p.io/concepts/fundamentals/peers/")
addrs: List[StrictStr]
repo: StrictStr = Field(description="Path of the data repository where all nodes data are stored")
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"]
model_config = ConfigDict(

View File

@ -26,10 +26,10 @@ class ManifestItem(BaseModel):
"""
ManifestItem
""" # noqa: E501
tree_cid: Optional[StrictStr] = Field(default=None, description="Content Identifier as specified at https://github.com/multiformats/cid", alias="treeCid")
dataset_size: Optional[StrictInt] = Field(default=None, description="Length of original content in bytes", alias="datasetSize")
block_size: Optional[StrictInt] = Field(default=None, description="Size of blocks", alias="blockSize")
protected: Optional[StrictBool] = Field(default=None, description="Indicates if content is protected by erasure-coding")
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"]

View File

@ -18,7 +18,7 @@ import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Any, ClassVar, Dict, List
from typing import Optional, Set
from typing_extensions import Self
@ -26,11 +26,11 @@ class Node(BaseModel):
"""
Node
""" # noqa: E501
node_id: Optional[StrictStr] = Field(default=None, alias="nodeId")
peer_id: Optional[StrictStr] = Field(default=None, alias="peerId")
record: Optional[StrictStr] = None
address: Optional[StrictStr] = None
seen: Optional[StrictBool] = None
node_id: StrictStr = Field(alias="nodeId")
peer_id: StrictStr = Field(alias="peerId")
record: StrictStr
address: StrictStr
seen: StrictBool
__properties: ClassVar[List[str]] = ["nodeId", "peerId", "record", "address", "seen"]
model_config = ConfigDict(

View File

@ -18,7 +18,7 @@ import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field
from typing import Any, ClassVar, Dict, List, Optional
from typing import Any, ClassVar, Dict, List
from codex_api_client.models.node import Node
from typing import Optional, Set
from typing_extensions import Self
@ -27,8 +27,8 @@ class PeersTable(BaseModel):
"""
PeersTable
""" # noqa: E501
local_node: Optional[Node] = Field(default=None, alias="localNode")
nodes: Optional[List[Node]] = None
local_node: Node = Field(alias="localNode")
nodes: List[Node]
__properties: ClassVar[List[str]] = ["localNode", "nodes"]
model_config = ConfigDict(

View File

@ -19,6 +19,7 @@ import json
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List, Optional
from typing_extensions import Annotated
from codex_api_client.models.storage_request import StorageRequest
from typing import Optional, Set
from typing_extensions import Self
@ -27,19 +28,17 @@ class Purchase(BaseModel):
"""
Purchase
""" # noqa: E501
state: Optional[StrictStr] = Field(default=None, description="Description of the Request's state")
state: StrictStr = Field(description="Description of the Request's state")
error: Optional[StrictStr] = Field(default=None, description="If Request failed, then here is presented the error message")
request: Optional[StorageRequest] = None
__properties: ClassVar[List[str]] = ["state", "error", "request"]
request_id: Annotated[str, Field(min_length=66, strict=True, max_length=66)] = Field(description="32bits identifier encoded in hex-decimal string.", alias="requestId")
__properties: ClassVar[List[str]] = ["state", "error", "request", "requestId"]
@field_validator('state')
def state_validate_enum(cls, value):
"""Validates the enum"""
if value is None:
return value
if value not in set(['cancelled', 'error', 'failed', 'finished', 'pending', 'started', 'submitted', 'unknown']):
raise ValueError("must be one of enum values ('cancelled', 'error', 'failed', 'finished', 'pending', 'started', 'submitted', 'unknown')")
if value not in set(['cancelled', 'errored', 'failed', 'finished', 'pending', 'started', 'submitted', 'unknown']):
raise ValueError("must be one of enum values ('cancelled', 'errored', 'failed', 'finished', 'pending', 'started', 'submitted', 'unknown')")
return value
model_config = ConfigDict(
@ -84,6 +83,11 @@ class Purchase(BaseModel):
# override the default output from pydantic by calling `to_dict()` of request
if self.request:
_dict['request'] = self.request.to_dict()
# set to None if error (nullable) is None
# and model_fields_set contains the field
if self.error is None and "error" in self.model_fields_set:
_dict['error'] = None
return _dict
@classmethod
@ -98,7 +102,8 @@ class Purchase(BaseModel):
_obj = cls.model_validate({
"state": obj.get("state"),
"error": obj.get("error"),
"request": StorageRequest.from_dict(obj["request"]) if obj.get("request") is not None else None
"request": StorageRequest.from_dict(obj["request"]) if obj.get("request") is not None else None,
"requestId": obj.get("requestId")
})
return _obj

View File

@ -18,7 +18,7 @@ import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictInt
from typing import Any, ClassVar, Dict, List, Optional
from typing import Any, ClassVar, Dict, List
from typing_extensions import Annotated
from typing import Optional, Set
from typing_extensions import Self
@ -27,12 +27,13 @@ class Reservation(BaseModel):
"""
Reservation
""" # noqa: E501
id: Optional[Annotated[str, Field(min_length=66, strict=True, max_length=66)]] = Field(default=None, description="32bits identifier encoded in hex-decimal string.")
availability_id: Optional[Annotated[str, Field(min_length=66, strict=True, max_length=66)]] = Field(default=None, description="32bits identifier encoded in hex-decimal string.", alias="availabilityId")
size: Optional[StrictInt] = Field(default=None, description="Size of the slot in bytes")
request_id: Optional[Annotated[str, Field(min_length=66, strict=True, max_length=66)]] = Field(default=None, description="32bits identifier encoded in hex-decimal string.", alias="requestId")
slot_index: Optional[StrictInt] = Field(default=None, description="Slot Index number", alias="slotIndex")
__properties: ClassVar[List[str]] = ["id", "availabilityId", "size", "requestId", "slotIndex"]
id: Annotated[str, Field(min_length=66, strict=True, max_length=66)] = Field(description="32bits identifier encoded in hex-decimal string.")
availability_id: Annotated[str, Field(min_length=66, strict=True, max_length=66)] = Field(description="32bits identifier encoded in hex-decimal string.", alias="availabilityId")
size: StrictInt = Field(description="Size of the slot in bytes")
request_id: Annotated[str, Field(min_length=66, strict=True, max_length=66)] = Field(description="32bits identifier encoded in hex-decimal string.", alias="requestId")
slot_index: StrictInt = Field(description="Slot Index number", alias="slotIndex")
valid_until: StrictInt = Field(description="Timestamp after which the reservation will no longer be valid.", alias="validUntil")
__properties: ClassVar[List[str]] = ["id", "availabilityId", "size", "requestId", "slotIndex", "validUntil"]
model_config = ConfigDict(
populate_by_name=True,
@ -89,7 +90,8 @@ class Reservation(BaseModel):
"availabilityId": obj.get("availabilityId"),
"size": obj.get("size"),
"requestId": obj.get("requestId"),
"slotIndex": obj.get("slotIndex")
"slotIndex": obj.get("slotIndex"),
"validUntil": obj.get("validUntil")
})
return _obj

View File

@ -17,9 +17,8 @@ import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing_extensions import Annotated
from typing import Optional, Set
from typing_extensions import Self
@ -27,12 +26,13 @@ class SalesAvailability(BaseModel):
"""
SalesAvailability
""" # noqa: E501
id: Optional[Annotated[str, Field(min_length=66, strict=True, max_length=66)]] = Field(default=None, description="32bits identifier encoded in hex-decimal string.")
total_size: Optional[StrictInt] = Field(default=None, description="Total size of availability's storage in bytes", alias="totalSize")
duration: Optional[StrictInt] = Field(default=None, description="The duration of the request in seconds")
min_price_per_byte_per_second: Optional[StrictStr] = Field(default=None, 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", alias="minPricePerBytePerSecond")
total_collateral: Optional[StrictStr] = Field(default=None, description="Total collateral (in amount of tokens) that can be used for matching requests", alias="totalCollateral")
__properties: ClassVar[List[str]] = ["id", "totalSize", "duration", "minPricePerBytePerSecond", "totalCollateral"]
total_size: StrictInt = Field(description="Total size of availability's storage in bytes", alias="totalSize")
duration: StrictInt = Field(description="The duration of the request in seconds")
min_price_per_byte_per_second: StrictStr = Field(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", alias="minPricePerBytePerSecond")
total_collateral: StrictStr = Field(description="Total collateral (in amount of tokens) that can be used for matching requests", alias="totalCollateral")
enabled: Optional[StrictBool] = Field(default=True, description="Enable the ability to receive sales on this availability.")
until: Optional[StrictInt] = Field(default=0, description="Specifies the latest timestamp, after which the availability will no longer host any slots. If set to 0, there will be no restrictions.")
__properties: ClassVar[List[str]] = ["totalSize", "duration", "minPricePerBytePerSecond", "totalCollateral", "enabled", "until"]
model_config = ConfigDict(
populate_by_name=True,
@ -85,11 +85,12 @@ class SalesAvailability(BaseModel):
return cls.model_validate(obj)
_obj = cls.model_validate({
"id": obj.get("id"),
"totalSize": obj.get("totalSize"),
"duration": obj.get("duration"),
"minPricePerBytePerSecond": obj.get("minPricePerBytePerSecond"),
"totalCollateral": obj.get("totalCollateral")
"totalCollateral": obj.get("totalCollateral"),
"enabled": obj.get("enabled") if obj.get("enabled") is not None else True,
"until": obj.get("until") if obj.get("until") is not None else 0
})
return _obj

View File

@ -17,7 +17,7 @@ import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing_extensions import Annotated
from typing import Optional, Set
@ -27,13 +27,16 @@ class SalesAvailabilityREAD(BaseModel):
"""
SalesAvailabilityREAD
""" # noqa: E501
id: Optional[Annotated[str, Field(min_length=66, strict=True, max_length=66)]] = Field(default=None, description="32bits identifier encoded in hex-decimal string.")
total_size: Optional[StrictInt] = Field(default=None, description="Total size of availability's storage in bytes", alias="totalSize")
duration: Optional[StrictInt] = Field(default=None, description="The duration of the request in seconds")
min_price_per_byte_per_second: Optional[StrictStr] = Field(default=None, 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", alias="minPricePerBytePerSecond")
total_collateral: Optional[StrictStr] = Field(default=None, description="Total collateral (in amount of tokens) that can be used for matching requests", alias="totalCollateral")
free_size: Optional[StrictInt] = Field(default=None, description="Unused size of availability's storage in bytes", alias="freeSize")
__properties: ClassVar[List[str]] = ["id", "totalSize", "duration", "minPricePerBytePerSecond", "totalCollateral", "freeSize"]
total_size: StrictInt = Field(description="Total size of availability's storage in bytes", alias="totalSize")
duration: StrictInt = Field(description="The duration of the request in seconds")
min_price_per_byte_per_second: StrictStr = Field(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", alias="minPricePerBytePerSecond")
total_collateral: StrictStr = Field(description="Total collateral (in amount of tokens) that can be used for matching requests", alias="totalCollateral")
enabled: Optional[StrictBool] = Field(default=True, description="Enable the ability to receive sales on this availability.")
until: Optional[StrictInt] = Field(default=0, description="Specifies the latest timestamp, after which the availability will no longer host any slots. If set to 0, there will be no restrictions.")
id: Annotated[str, Field(min_length=66, strict=True, max_length=66)] = Field(description="32bits identifier encoded in hex-decimal string.")
free_size: StrictInt = Field(description="Unused size of availability's storage in bytes as decimal string", alias="freeSize")
total_remaining_collateral: StrictStr = Field(description="Total collateral effective (in amount of tokens) that can be used for matching requests", alias="totalRemainingCollateral")
__properties: ClassVar[List[str]] = ["totalSize", "duration", "minPricePerBytePerSecond", "totalCollateral", "enabled", "until", "id", "freeSize", "totalRemainingCollateral"]
model_config = ConfigDict(
populate_by_name=True,
@ -65,8 +68,12 @@ class SalesAvailabilityREAD(BaseModel):
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
* OpenAPI `readOnly` fields are excluded.
* OpenAPI `readOnly` fields are excluded.
"""
excluded_fields: Set[str] = set([
"free_size",
"total_remaining_collateral",
])
_dict = self.model_dump(
@ -86,12 +93,15 @@ class SalesAvailabilityREAD(BaseModel):
return cls.model_validate(obj)
_obj = cls.model_validate({
"id": obj.get("id"),
"totalSize": obj.get("totalSize"),
"duration": obj.get("duration"),
"minPricePerBytePerSecond": obj.get("minPricePerBytePerSecond"),
"totalCollateral": obj.get("totalCollateral"),
"freeSize": obj.get("freeSize")
"enabled": obj.get("enabled") if obj.get("enabled") is not None else True,
"until": obj.get("until") if obj.get("until") is not None else 0,
"id": obj.get("id"),
"freeSize": obj.get("freeSize"),
"totalRemainingCollateral": obj.get("totalRemainingCollateral")
})
return _obj

View File

@ -18,7 +18,7 @@ import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Any, ClassVar, Dict, List
from codex_api_client.models.storage_request import StorageRequest
from typing import Optional, Set
from typing_extensions import Self
@ -27,9 +27,9 @@ class Slot(BaseModel):
"""
Slot
""" # noqa: E501
id: Optional[StrictStr] = Field(default=None, description="Keccak hash of the abi encoded tuple (RequestId, slot index)")
request: Optional[StorageRequest] = None
slot_index: Optional[StrictInt] = Field(default=None, description="Slot Index number", alias="slotIndex")
id: StrictStr = Field(description="Keccak hash of the abi encoded tuple (RequestId, slot index)")
request: StorageRequest
slot_index: StrictInt = Field(description="Slot Index number", alias="slotIndex")
__properties: ClassVar[List[str]] = ["id", "request", "slotIndex"]
model_config = ConfigDict(

View File

@ -29,20 +29,16 @@ class SlotAgent(BaseModel):
"""
SlotAgent
""" # noqa: E501
id: Optional[StrictStr] = Field(default=None, description="Keccak hash of the abi encoded tuple (RequestId, slot index)")
slot_index: Optional[StrictInt] = Field(default=None, description="Slot Index number", alias="slotIndex")
request_id: Optional[Annotated[str, Field(min_length=66, strict=True, max_length=66)]] = Field(default=None, description="32bits identifier encoded in hex-decimal string.", alias="requestId")
slot_index: StrictInt = Field(description="Slot Index number", alias="slotIndex")
request_id: Annotated[str, Field(min_length=66, strict=True, max_length=66)] = Field(description="32bits identifier encoded in hex-decimal string.", alias="requestId")
request: Optional[StorageRequest] = None
reservation: Optional[Reservation] = None
state: Optional[StrictStr] = Field(default=None, description="Description of the slot's")
__properties: ClassVar[List[str]] = ["id", "slotIndex", "requestId", "request", "reservation", "state"]
state: StrictStr = Field(description="Description of the slot's")
__properties: ClassVar[List[str]] = ["slotIndex", "requestId", "request", "reservation", "state"]
@field_validator('state')
def state_validate_enum(cls, value):
"""Validates the enum"""
if value is None:
return value
if value not in set(['SaleCancelled', 'SaleDownloading', 'SaleErrored', 'SaleFailed', 'SaleFilled', 'SaleFilling', 'SaleFinished', 'SaleIgnored', 'SaleInitialProving', 'SalePayout', 'SalePreparing', 'SaleProving', 'SaleUnknown']):
raise ValueError("must be one of enum values ('SaleCancelled', 'SaleDownloading', 'SaleErrored', 'SaleFailed', 'SaleFilled', 'SaleFilling', 'SaleFinished', 'SaleIgnored', 'SaleInitialProving', 'SalePayout', 'SalePreparing', 'SaleProving', 'SaleUnknown')")
return value
@ -104,7 +100,6 @@ class SlotAgent(BaseModel):
return cls.model_validate(obj)
_obj = cls.model_validate({
"id": obj.get("id"),
"slotIndex": obj.get("slotIndex"),
"requestId": obj.get("requestId"),
"request": StorageRequest.from_dict(obj["request"]) if obj.get("request") is not None else None,

View File

@ -18,7 +18,7 @@ import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictInt
from typing import Any, ClassVar, Dict, List, Optional
from typing import Any, ClassVar, Dict, List
from typing import Optional, Set
from typing_extensions import Self
@ -26,10 +26,10 @@ class Space(BaseModel):
"""
Space
""" # noqa: E501
total_blocks: Optional[StrictInt] = Field(default=None, description="Number of blocks stored by the node", alias="totalBlocks")
quota_max_bytes: Optional[StrictInt] = Field(default=None, description="Maximum storage space (in bytes) available for the node in Codex's local repository.", alias="quotaMaxBytes")
quota_used_bytes: Optional[StrictInt] = Field(default=None, description="Amount of storage space (in bytes) currently used for storing files in Codex's local repository.", alias="quotaUsedBytes")
quota_reserved_bytes: Optional[StrictInt] = Field(default=None, 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")
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")
__properties: ClassVar[List[str]] = ["totalBlocks", "quotaMaxBytes", "quotaUsedBytes", "quotaReservedBytes"]
model_config = ConfigDict(

View File

@ -18,7 +18,7 @@ import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Any, ClassVar, Dict, List
from typing import Optional, Set
from typing_extensions import Self
@ -26,7 +26,7 @@ class SPRRead(BaseModel):
"""
SPRRead
""" # noqa: E501
spr: Optional[StrictStr] = Field(default=None, description="Signed Peer Record (libp2p)")
spr: StrictStr = Field(description="Signed Peer Record (libp2p)")
__properties: ClassVar[List[str]] = ["spr"]
model_config = ConfigDict(

View File

@ -18,7 +18,7 @@ import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Any, ClassVar, Dict, List
from typing import Optional, Set
from typing_extensions import Self
@ -26,13 +26,14 @@ class StorageAsk(BaseModel):
"""
StorageAsk
""" # noqa: E501
slots: Optional[StrictInt] = Field(default=None, description="Number of slots (eq. hosts) that the Request want to have the content spread over")
slot_size: Optional[StrictStr] = Field(default=None, description="Amount of storage per slot (in bytes) as decimal string", alias="slotSize")
duration: Optional[StrictInt] = Field(default=None, description="The duration of the request in seconds")
proof_probability: Optional[StrictStr] = Field(default=None, description="How often storage proofs are required as decimal string", alias="proofProbability")
slots: StrictInt = Field(description="Number of slots (eq. hosts) that the Request want to have the content spread over")
slot_size: StrictInt = Field(description="Amount of storage per slot in bytes", alias="slotSize")
duration: StrictInt = Field(description="The duration of the request in seconds")
proof_probability: StrictStr = Field(description="How often storage proofs are required as decimal string", alias="proofProbability")
price_per_byte_per_second: StrictStr = Field(description="The amount of tokens paid per byte per second per slot to hosts the client is willing to pay", alias="pricePerBytePerSecond")
max_slot_loss: Optional[StrictInt] = Field(default=None, description="Max slots that can be lost without data considered to be lost", alias="maxSlotLoss")
__properties: ClassVar[List[str]] = ["slots", "slotSize", "duration", "proofProbability", "pricePerBytePerSecond", "maxSlotLoss"]
collateral_per_byte: StrictStr = Field(description="Number as decimal string that represents how much collateral per byte is asked from hosts that wants to fill a slots", alias="collateralPerByte")
max_slot_loss: StrictInt = Field(description="Max slots that can be lost without data considered to be lost", alias="maxSlotLoss")
__properties: ClassVar[List[str]] = ["slots", "slotSize", "duration", "proofProbability", "pricePerBytePerSecond", "collateralPerByte", "maxSlotLoss"]
model_config = ConfigDict(
populate_by_name=True,
@ -90,6 +91,7 @@ class StorageAsk(BaseModel):
"duration": obj.get("duration"),
"proofProbability": obj.get("proofProbability"),
"pricePerBytePerSecond": obj.get("pricePerBytePerSecond"),
"collateralPerByte": obj.get("collateralPerByte"),
"maxSlotLoss": obj.get("maxSlotLoss")
})
return _obj

View File

@ -18,7 +18,7 @@ import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Any, ClassVar, Dict, List
from codex_api_client.models.content import Content
from codex_api_client.models.storage_ask import StorageAsk
from typing import Optional, Set
@ -28,12 +28,12 @@ class StorageRequest(BaseModel):
"""
StorageRequest
""" # noqa: E501
id: Optional[StrictStr] = Field(default=None, description="Request ID")
client: Optional[StrictStr] = Field(default=None, description="Address of Ethereum address")
ask: Optional[StorageAsk] = None
content: Optional[Content] = None
expiry: Optional[StrictInt] = Field(default=None, 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.")
nonce: Optional[StrictStr] = Field(default=None, description="Random data")
id: StrictStr = Field(description="Request ID")
client: StrictStr = Field(description="Address of Ethereum address")
ask: StorageAsk
content: Content
expiry: StrictInt = Field(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.")
nonce: StrictStr = Field(description="Random data")
__properties: ClassVar[List[str]] = ["id", "client", "ask", "content", "expiry", "nonce"]
model_config = ConfigDict(

View File

@ -19,6 +19,7 @@ import json
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing_extensions import Annotated
from typing import Optional, Set
from typing_extensions import Self
@ -29,8 +30,8 @@ class StorageRequestCreation(BaseModel):
duration: StrictInt = Field(description="The duration of the request in seconds")
price_per_byte_per_second: StrictStr = Field(description="The amount of tokens paid per byte per second per slot to hosts the client is willing to pay", alias="pricePerBytePerSecond")
proof_probability: StrictStr = Field(description="How often storage proofs are required as decimal string", alias="proofProbability")
nodes: Optional[StrictInt] = Field(default=3, description="Minimal number of nodes the content should be stored on")
tolerance: Optional[StrictInt] = Field(default=1, description="Additional number of nodes on top of the `nodes` property that can be lost before pronouncing the content lost")
nodes: Optional[Annotated[int, Field(strict=True, ge=3)]] = Field(default=3, description="Minimal number of nodes the content should be stored on")
tolerance: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=1, description="Additional number of nodes on top of the `nodes` property that can be lost before pronouncing the content lost")
collateral_per_byte: StrictStr = Field(description="Number as decimal string that represents how much collateral per byte is asked from hosts that wants to fill a slots", alias="collateralPerByte")
expiry: StrictInt = Field(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.")
__properties: ClassVar[List[str]] = ["duration", "pricePerBytePerSecond", "proofProbability", "nodes", "tolerance", "collateralPerByte", "expiry"]

View File

@ -76,6 +76,7 @@ class RESTClientObject:
"ca_certs": configuration.ssl_ca_cert,
"cert_file": configuration.cert_file,
"key_file": configuration.key_file,
"ca_cert_data": configuration.ca_cert_data,
}
if configuration.assert_hostname is not None:
pool_args['assert_hostname'] = (

View File

@ -7,6 +7,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**version** | **str** | | [optional]
**revision** | **str** | | [optional]
**contracts** | **str** | | [optional]
## Example

View File

@ -6,7 +6,7 @@ Parameters specifying the content
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**cid** | **str** | Content Identifier as specified at https://github.com/multiformats/cid | [optional]
**cid** | **str** | Content Identifier as specified at https://github.com/multiformats/cid |
## Example

View File

@ -4,6 +4,7 @@ All URIs are relative to *http://localhost:8080/api/codex/v1*
Method | HTTP request | Description
------------- | ------------- | -------------
[**delete_local**](DataApi.md#delete_local) | **DELETE** /data/{cid} | Deletes either a single block or an entire dataset from the local node.
[**download_local**](DataApi.md#download_local) | **GET** /data/{cid} | Download a file from the local node in a streaming manner. If the file is not available locally, a 404 is returned.
[**download_network**](DataApi.md#download_network) | **POST** /data/{cid}/network | Download a file from the network to the local node if it&#39;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&#39;s not available locally.
@ -13,6 +14,71 @@ Method | HTTP request | Description
[**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.
# **delete_local**
> delete_local(cid)
Deletes either a single block or an entire dataset from the local node.
### Example
```python
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
# See configuration.py for a list of all supported configuration parameters.
configuration = codex_api_client.Configuration(
host = "http://localhost:8080/api/codex/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 | Block or dataset to be deleted.
try:
# Deletes either a single block or an entire dataset from the local node.
api_instance.delete_local(cid)
except Exception as e:
print("Exception when calling DataApi->delete_local: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**cid** | **str**| Block or dataset to be deleted. |
### Return type
void (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**204** | Data was successfully deleted. | - |
**400** | Invalid CID is specified | - |
**500** | There was an error during deletion | - |
[[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)
# **download_local**
> bytearray download_local(cid)
@ -482,6 +548,7 @@ No authorization required
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | CID of uploaded file | - |
**422** | The mimetype of the filename is invalid | - |
**500** | Well it was bad-bad and the upload did not work out | - |
[[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)

View File

@ -5,8 +5,8 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**cid** | **str** | Content Identifier as specified at https://github.com/multiformats/cid | [optional]
**manifest** | [**ManifestItem**](ManifestItem.md) | | [optional]
**cid** | **str** | Content Identifier as specified at https://github.com/multiformats/cid |
**manifest** | [**ManifestItem**](ManifestItem.md) | |
## Example

View File

@ -5,7 +5,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**content** | [**List[DataItem]**](DataItem.md) | | [optional]
**content** | [**List[DataItem]**](DataItem.md) | |
## Example

View File

@ -5,13 +5,13 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **str** | Peer Identity reference as specified at https://docs.libp2p.io/concepts/fundamentals/peers/ | [optional]
**addrs** | **List[str]** | | [optional]
**repo** | **str** | Path of the data repository where all nodes data are stored | [optional]
**spr** | **str** | Signed Peer Record (libp2p) | [optional]
**announce_addresses** | **List[str]** | | [optional]
**table** | [**PeersTable**](PeersTable.md) | | [optional]
**codex** | [**CodexVersion**](CodexVersion.md) | | [optional]
**id** | **str** | Peer Identity reference as specified at https://docs.libp2p.io/concepts/fundamentals/peers/ |
**addrs** | **List[str]** | |
**repo** | **str** | Path of the data repository where all nodes data are stored |
**spr** | **str** | Signed Peer Record (libp2p) |
**announce_addresses** | **List[str]** | |
**table** | [**PeersTable**](PeersTable.md) | |
**codex** | [**CodexVersion**](CodexVersion.md) | |
## Example

View File

@ -5,10 +5,10 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**tree_cid** | **str** | Content Identifier as specified at https://github.com/multiformats/cid | [optional]
**dataset_size** | **int** | Length of original content in bytes | [optional]
**block_size** | **int** | Size of blocks | [optional]
**protected** | **bool** | Indicates if content is protected by erasure-coding | [optional]
**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]

View File

@ -81,6 +81,7 @@ No authorization required
|-------------|-------------|------------------|
**200** | Returns the Request ID as decimal string | - |
**400** | Invalid or missing Request ID | - |
**422** | The storage request parameters are not valid | - |
**404** | Request ID not found | - |
**503** | Persistence is not enabled | - |
@ -486,7 +487,7 @@ 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)
# **offer_storage**
> SalesAvailabilityREAD offer_storage(sales_availability_create=sales_availability_create)
> SalesAvailabilityREAD offer_storage(sales_availability=sales_availability)
Offers storage for sale
@ -495,7 +496,7 @@ Offers storage for sale
```python
import codex_api_client
from codex_api_client.models.sales_availability_create import SalesAvailabilityCREATE
from codex_api_client.models.sales_availability import SalesAvailability
from codex_api_client.models.sales_availability_read import SalesAvailabilityREAD
from codex_api_client.rest import ApiException
from pprint import pprint
@ -511,11 +512,11 @@ configuration = codex_api_client.Configuration(
with codex_api_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = codex_api_client.MarketplaceApi(api_client)
sales_availability_create = codex_api_client.SalesAvailabilityCREATE() # SalesAvailabilityCREATE | (optional)
sales_availability = codex_api_client.SalesAvailability() # SalesAvailability | (optional)
try:
# Offers storage for sale
api_response = api_instance.offer_storage(sales_availability_create=sales_availability_create)
api_response = api_instance.offer_storage(sales_availability=sales_availability)
print("The response of MarketplaceApi->offer_storage:\n")
pprint(api_response)
except Exception as e:
@ -529,7 +530,7 @@ with codex_api_client.ApiClient(configuration) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**sales_availability_create** | [**SalesAvailabilityCREATE**](SalesAvailabilityCREATE.md)| | [optional]
**sales_availability** | [**SalesAvailability**](SalesAvailability.md)| | [optional]
### Return type
@ -550,7 +551,7 @@ No authorization required
|-------------|-------------|------------------|
**201** | Created storage availability | - |
**400** | Invalid data input | - |
**422** | Not enough node&#39;s storage quota available | - |
**422** | Not enough node&#39;s storage quota available or the provided parameters did not pass validation | - |
**500** | Error reserving availability | - |
**503** | Persistence is not enabled | - |
@ -561,7 +562,9 @@ No authorization required
Updates availability
The new parameters will be only considered for new requests. Existing Requests linked to this Availability will continue as is.
The new parameters will be only considered for new requests.
Existing Requests linked to this Availability will continue as is.
### Example
@ -623,7 +626,7 @@ No authorization required
**204** | Availability successfully updated | - |
**400** | Invalid data input | - |
**404** | Availability not found | - |
**422** | Not enough node&#39;s storage quota available | - |
**422** | The provided parameters did not pass validation | - |
**500** | Error reserving availability | - |
**503** | Persistence is not enabled | - |

View File

@ -5,11 +5,11 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**node_id** | **str** | | [optional]
**peer_id** | **str** | | [optional]
**record** | **str** | | [optional]
**address** | **str** | | [optional]
**seen** | **bool** | | [optional]
**node_id** | **str** | |
**peer_id** | **str** | |
**record** | **str** | |
**address** | **str** | |
**seen** | **bool** | |
## Example

View File

@ -14,7 +14,9 @@ Method | HTTP request | Description
Connect to a peer
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.
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.
### Example
@ -128,7 +130,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: plain/text, application/json
- **Accept**: text/plain, application/json
### HTTP response details
@ -189,7 +191,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: plain/text, application/json
- **Accept**: text/plain, application/json
### HTTP response details

View File

@ -5,8 +5,8 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**local_node** | [**Node**](Node.md) | | [optional]
**nodes** | [**List[Node]**](Node.md) | | [optional]
**local_node** | [**Node**](Node.md) | |
**nodes** | [**List[Node]**](Node.md) | |
## Example

View File

@ -5,9 +5,10 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**state** | **str** | Description of the Request&#39;s state | [optional]
**state** | **str** | Description of the Request&#39;s state |
**error** | **str** | If Request failed, then here is presented the error message | [optional]
**request** | [**StorageRequest**](StorageRequest.md) | | [optional]
**request_id** | **str** | 32bits identifier encoded in hex-decimal string. |
## Example

View File

@ -5,11 +5,12 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **str** | 32bits identifier encoded in hex-decimal string. | [optional]
**availability_id** | **str** | 32bits identifier encoded in hex-decimal string. | [optional]
**size** | **int** | Size of the slot in bytes | [optional]
**request_id** | **str** | 32bits identifier encoded in hex-decimal string. | [optional]
**slot_index** | **int** | Slot Index number | [optional]
**id** | **str** | 32bits identifier encoded in hex-decimal string. |
**availability_id** | **str** | 32bits identifier encoded in hex-decimal string. |
**size** | **int** | Size of the slot in bytes |
**request_id** | **str** | 32bits identifier encoded in hex-decimal string. |
**slot_index** | **int** | Slot Index number |
**valid_until** | **int** | Timestamp after which the reservation will no longer be valid. |
## Example

View File

@ -5,7 +5,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**spr** | **str** | Signed Peer Record (libp2p) | [optional]
**spr** | **str** | Signed Peer Record (libp2p) |
## Example

View File

@ -5,11 +5,12 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **str** | 32bits identifier encoded in hex-decimal string. | [optional]
**total_size** | **int** | Total size of availability&#39;s storage in bytes | [optional]
**duration** | **int** | The duration of the request in seconds | [optional]
**min_price_per_byte_per_second** | **str** | Minimal price per byte per second paid (in amount of tokens) for the hosted request&#39;s slot for the request&#39;s duration as decimal string | [optional]
**total_collateral** | **str** | Total collateral (in amount of tokens) that can be used for matching requests | [optional]
**total_size** | **int** | Total size of availability&#39;s storage in bytes |
**duration** | **int** | The duration of the request in seconds |
**min_price_per_byte_per_second** | **str** | Minimal price per byte per second paid (in amount of tokens) for the hosted request&#39;s slot for the request&#39;s duration as decimal string |
**total_collateral** | **str** | Total collateral (in amount of tokens) that can be used for matching requests |
**enabled** | **bool** | Enable the ability to receive sales on this availability. | [optional] [default to True]
**until** | **int** | Specifies the latest timestamp, after which the availability will no longer host any slots. If set to 0, there will be no restrictions. | [optional] [default to 0]
## Example

View File

@ -5,12 +5,15 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **str** | 32bits identifier encoded in hex-decimal string. | [optional]
**total_size** | **int** | Total size of availability&#39;s storage in bytes | [optional]
**duration** | **int** | The duration of the request in seconds | [optional]
**min_price_per_byte_per_second** | **str** | Minimal price per byte per second paid (in amount of tokens) for the hosted request&#39;s slot for the request&#39;s duration as decimal string | [optional]
**total_collateral** | **str** | Total collateral (in amount of tokens) that can be used for matching requests | [optional]
**free_size** | **int** | Unused size of availability&#39;s storage in bytes | [optional]
**total_size** | **int** | Total size of availability&#39;s storage in bytes |
**duration** | **int** | The duration of the request in seconds |
**min_price_per_byte_per_second** | **str** | Minimal price per byte per second paid (in amount of tokens) for the hosted request&#39;s slot for the request&#39;s duration as decimal string |
**total_collateral** | **str** | Total collateral (in amount of tokens) that can be used for matching requests |
**enabled** | **bool** | Enable the ability to receive sales on this availability. | [optional] [default to True]
**until** | **int** | Specifies the latest timestamp, after which the availability will no longer host any slots. If set to 0, there will be no restrictions. | [optional] [default to 0]
**id** | **str** | 32bits identifier encoded in hex-decimal string. |
**free_size** | **int** | Unused size of availability&#39;s storage in bytes as decimal string | [readonly]
**total_remaining_collateral** | **str** | Total collateral effective (in amount of tokens) that can be used for matching requests | [readonly]
## Example

View File

@ -5,9 +5,9 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **str** | Keccak hash of the abi encoded tuple (RequestId, slot index) | [optional]
**request** | [**StorageRequest**](StorageRequest.md) | | [optional]
**slot_index** | **int** | Slot Index number | [optional]
**id** | **str** | Keccak hash of the abi encoded tuple (RequestId, slot index) |
**request** | [**StorageRequest**](StorageRequest.md) | |
**slot_index** | **int** | Slot Index number |
## Example

View File

@ -5,12 +5,11 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **str** | Keccak hash of the abi encoded tuple (RequestId, slot index) | [optional]
**slot_index** | **int** | Slot Index number | [optional]
**request_id** | **str** | 32bits identifier encoded in hex-decimal string. | [optional]
**slot_index** | **int** | Slot Index number |
**request_id** | **str** | 32bits identifier encoded in hex-decimal string. |
**request** | [**StorageRequest**](StorageRequest.md) | | [optional]
**reservation** | [**Reservation**](Reservation.md) | | [optional]
**state** | **str** | Description of the slot&#39;s | [optional]
**state** | **str** | Description of the slot&#39;s |
## Example

View File

@ -5,10 +5,10 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**total_blocks** | **int** | Number of blocks stored by the node | [optional]
**quota_max_bytes** | **int** | Maximum storage space (in bytes) available for the node in Codex&#39;s local repository. | [optional]
**quota_used_bytes** | **int** | Amount of storage space (in bytes) currently used for storing files in Codex&#39;s local repository. | [optional]
**quota_reserved_bytes** | **int** | Amount of storage reserved (in bytes) in the Codex&#39;s local repository for future use when storage requests will be picked up and hosted by the node using node&#39;s availabilities. This does not include the storage currently in use. | [optional]
**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&#39;s local repository. |
**quota_used_bytes** | **int** | Amount of storage space (in bytes) currently used for storing files in Codex&#39;s local repository. |
**quota_reserved_bytes** | **int** | Amount of storage reserved (in bytes) in the Codex&#39;s local repository for future use when storage requests will be picked up and hosted by the node using node&#39;s availabilities. This does not include the storage currently in use. |
## Example

View File

@ -5,12 +5,13 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**slots** | **int** | Number of slots (eq. hosts) that the Request want to have the content spread over | [optional]
**slot_size** | **str** | Amount of storage per slot (in bytes) as decimal string | [optional]
**duration** | **int** | The duration of the request in seconds | [optional]
**proof_probability** | **str** | How often storage proofs are required as decimal string | [optional]
**slots** | **int** | Number of slots (eq. hosts) that the Request want to have the content spread over |
**slot_size** | **int** | Amount of storage per slot in bytes |
**duration** | **int** | The duration of the request in seconds |
**proof_probability** | **str** | How often storage proofs are required as decimal string |
**price_per_byte_per_second** | **str** | The amount of tokens paid per byte per second per slot to hosts the client is willing to pay |
**max_slot_loss** | **int** | Max slots that can be lost without data considered to be lost | [optional]
**collateral_per_byte** | **str** | Number as decimal string that represents how much collateral per byte is asked from hosts that wants to fill a slots |
**max_slot_loss** | **int** | Max slots that can be lost without data considered to be lost |
## Example

View File

@ -5,12 +5,12 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **str** | Request ID | [optional]
**client** | **str** | Address of Ethereum address | [optional]
**ask** | [**StorageAsk**](StorageAsk.md) | | [optional]
**content** | [**Content**](Content.md) | | [optional]
**expiry** | **int** | 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. | [optional]
**nonce** | **str** | Random data | [optional]
**id** | **str** | Request ID |
**client** | **str** | Address of Ethereum address |
**ask** | [**StorageAsk**](StorageAsk.md) | |
**content** | [**Content**](Content.md) | |
**expiry** | **int** | 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. |
**nonce** | **str** | Random data |
## Example

View File

@ -2,6 +2,6 @@
"$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json",
"spaces": 2,
"generator-cli": {
"version": "7.10.0"
"version": "7.12.0"
}
}

View File

@ -1,6 +1,6 @@
[tool.poetry]
name = "codex_api_client"
version = "0.2.0"
version = "0.4.0"
description = "Codex API"
authors = ["OpenAPI Generator Community <team@openapitools.org>"]
license = "NoLicense"
@ -12,7 +12,7 @@ include = ["codex_api_client/py.typed"]
[tool.poetry.dependencies]
python = "^3.8"
urllib3 = ">= 1.25.3 < 3.0.0"
urllib3 = ">= 1.25.3, < 3.0.0"
python-dateutil = ">= 2.8.2"
pydantic = ">= 2"
typing-extensions = ">= 4.7.1"

View File

@ -21,7 +21,7 @@ from setuptools import setup, find_packages # noqa: H301
# prerequisite: setuptools
# http://pypi.python.org/pypi/setuptools
NAME = "codex-api-client"
VERSION = "0.2.0"
VERSION = "0.4.0"
PYTHON_REQUIRES = ">= 3.8"
REQUIRES = [
"urllib3 >= 1.25.3, < 3.0.0",
@ -46,4 +46,4 @@ setup(
List of endpoints and interfaces available to Codex API users
""", # noqa: E501
package_data={"codex_api_client": ["py.typed"]},
)
)