Skip to content

Commit ef4f7a9

Browse files
Generated API update (#4)
Co-authored-by: codex-storage-bot <[email protected]>
1 parent bd67201 commit ef4f7a9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+339
-217
lines changed

.openapi-generator/FILES

-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ codex_api_client/models/peers_table.py
2323
codex_api_client/models/purchase.py
2424
codex_api_client/models/reservation.py
2525
codex_api_client/models/sales_availability.py
26-
codex_api_client/models/sales_availability_create.py
2726
codex_api_client/models/sales_availability_read.py
2827
codex_api_client/models/slot.py
2928
codex_api_client/models/slot_agent.py
@@ -51,7 +50,6 @@ docs/Purchase.md
5150
docs/Reservation.md
5251
docs/SPRRead.md
5352
docs/SalesAvailability.md
54-
docs/SalesAvailabilityCREATE.md
5553
docs/SalesAvailabilityREAD.md
5654
docs/Slot.md
5755
docs/SlotAgent.md

README.md

-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ Class | Method | HTTP request | Description
101101
- [Reservation](docs/Reservation.md)
102102
- [SPRRead](docs/SPRRead.md)
103103
- [SalesAvailability](docs/SalesAvailability.md)
104-
- [SalesAvailabilityCREATE](docs/SalesAvailabilityCREATE.md)
105104
- [SalesAvailabilityREAD](docs/SalesAvailabilityREAD.md)
106105
- [Slot](docs/Slot.md)
107106
- [SlotAgent](docs/SlotAgent.md)

codex.yaml

+119-23
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ components:
5050
type: string
5151
description: The amount of tokens paid per byte per second per slot to hosts the client is willing to pay
5252

53+
CollateralPerByte:
54+
type: string
55+
description: Number as decimal string that represents how much collateral per byte is asked from hosts that wants to fill a slots
56+
5357
Duration:
5458
type: integer
5559
format: int64
@@ -70,6 +74,8 @@ components:
7074

7175
SPRRead:
7276
type: object
77+
required:
78+
- spr
7379
properties:
7480
spr:
7581
$ref: "#/components/schemas/SPR"
@@ -82,13 +88,21 @@ components:
8288

8389
Content:
8490
type: object
91+
required:
92+
- cid
8593
description: Parameters specifying the content
8694
properties:
8795
cid:
8896
$ref: "#/components/schemas/Cid"
8997

9098
Node:
9199
type: object
100+
required:
101+
- nodeId
102+
- peerId
103+
- record
104+
- address
105+
- seen
92106
properties:
93107
nodeId:
94108
type: string
@@ -110,9 +124,15 @@ components:
110124
revision:
111125
type: string
112126
example: 0c647d8
127+
contracts:
128+
type: string
129+
example: 0b537c7
113130

114131
PeersTable:
115132
type: object
133+
required:
134+
- localNode
135+
- nodes
116136
properties:
117137
localNode:
118138
$ref: "#/components/schemas/Node"
@@ -123,6 +143,14 @@ components:
123143

124144
DebugInfo:
125145
type: object
146+
required:
147+
- id
148+
- addrs
149+
- repo
150+
- spr
151+
- announceAddresses
152+
- table
153+
- codex
126154
properties:
127155
id:
128156
$ref: "#/components/schemas/PeerId"
@@ -146,9 +174,12 @@ components:
146174

147175
SalesAvailability:
148176
type: object
177+
required:
178+
- totalSize
179+
- duration
180+
- minPricePerBytePerSecond
181+
- totalCollateral
149182
properties:
150-
id:
151-
$ref: "#/components/schemas/Id"
152183
totalSize:
153184
type: integer
154185
format: int64
@@ -161,28 +192,42 @@ components:
161192
totalCollateral:
162193
type: string
163194
description: Total collateral (in amount of tokens) that can be used for matching requests
195+
enabled:
196+
type: boolean
197+
description: Enable the ability to receive sales on this availability.
198+
default: true
199+
until:
200+
type: integer
201+
description: Specifies the latest timestamp, after which the availability will no longer host any slots. If set to 0, there will be no restrictions.
202+
default: 0
164203

165204
SalesAvailabilityREAD:
205+
required:
206+
- id
207+
- totalRemainingCollateral
166208
allOf:
167209
- $ref: "#/components/schemas/SalesAvailability"
168210
- type: object
169211
properties:
212+
id:
213+
$ref: "#/components/schemas/Id"
214+
readonly: true
170215
freeSize:
171216
type: integer
172217
format: int64
173-
description: Unused size of availability's storage in bytes
174-
175-
SalesAvailabilityCREATE:
176-
allOf:
177-
- $ref: "#/components/schemas/SalesAvailability"
178-
- required:
179-
- totalSize
180-
- minPricePerBytePerSecond
181-
- totalCollateral
182-
- duration
218+
description: Unused size of availability's storage in bytes as decimal string
219+
readOnly: true
220+
totalRemainingCollateral:
221+
type: string
222+
description: Total collateral effective (in amount of tokens) that can be used for matching requests
223+
readOnly: true
183224

184225
Slot:
185226
type: object
227+
required:
228+
- id
229+
- request
230+
- slotIndex
186231
properties:
187232
id:
188233
$ref: "#/components/schemas/SlotId"
@@ -195,9 +240,11 @@ components:
195240

196241
SlotAgent:
197242
type: object
243+
required:
244+
- state
245+
- requestId
246+
- slotIndex
198247
properties:
199-
id:
200-
$ref: "#/components/schemas/SlotId"
201248
slotIndex:
202249
type: integer
203250
format: int64
@@ -228,6 +275,13 @@ components:
228275

229276
Reservation:
230277
type: object
278+
required:
279+
- id
280+
- availabilityId
281+
- size
282+
- requestId
283+
- slotIndex
284+
- validUntil
231285
properties:
232286
id:
233287
$ref: "#/components/schemas/Id"
@@ -243,6 +297,9 @@ components:
243297
type: integer
244298
format: int64
245299
description: Slot Index number
300+
validUntil:
301+
type: integer
302+
description: Timestamp after which the reservation will no longer be valid.
246303

247304
StorageRequestCreation:
248305
type: object
@@ -270,16 +327,21 @@ components:
270327
default: 1
271328
minimum: 1
272329
collateralPerByte:
273-
type: string
274-
description: Number as decimal string that represents how much collateral per byte is asked from hosts that wants to fill a slots
330+
$ref: "#/components/schemas/CollateralPerByte"
275331
expiry:
276332
type: integer
277333
format: int64
278334
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.
279335
StorageAsk:
280336
type: object
281337
required:
338+
- slots
339+
- slotSize
340+
- duration
341+
- proofProbability
282342
- pricePerBytePerSecond
343+
- collateralPerByte
344+
- maxSlotLoss
283345
properties:
284346
slots:
285347
description: Number of slots (eq. hosts) that the Request want to have the content spread over
@@ -288,20 +350,29 @@ components:
288350
slotSize:
289351
type: integer
290352
format: int64
291-
description: Amount of storage per slot (in bytes) as decimal string
353+
description: Amount of storage per slot in bytes
292354
duration:
293355
$ref: "#/components/schemas/Duration"
294356
proofProbability:
295357
$ref: "#/components/schemas/ProofProbability"
296358
pricePerBytePerSecond:
297359
$ref: "#/components/schemas/PricePerBytePerSecond"
360+
collateralPerByte:
361+
$ref: "#/components/schemas/CollateralPerByte"
298362
maxSlotLoss:
299363
type: integer
300364
format: int64
301365
description: Max slots that can be lost without data considered to be lost
302366

303367
StorageRequest:
304368
type: object
369+
required:
370+
- id
371+
- client
372+
- ask
373+
- content
374+
- expiry
375+
- nonce
305376
properties:
306377
id:
307378
type: string
@@ -320,13 +391,16 @@ components:
320391

321392
Purchase:
322393
type: object
394+
required:
395+
- state
396+
- requestId
323397
properties:
324398
state:
325399
type: string
326400
description: Description of the Request's state
327401
enum:
328402
- cancelled
329-
- error
403+
- errored
330404
- failed
331405
- finished
332406
- pending
@@ -335,12 +409,17 @@ components:
335409
- unknown
336410
error:
337411
type: string
412+
nullable: true
338413
description: If Request failed, then here is presented the error message
339414
request:
340415
$ref: "#/components/schemas/StorageRequest"
416+
requestId:
417+
$ref: "#/components/schemas/Id"
341418

342419
DataList:
343420
type: object
421+
required:
422+
- content
344423
properties:
345424
content:
346425
type: array
@@ -349,6 +428,9 @@ components:
349428

350429
DataItem:
351430
type: object
431+
required:
432+
- cid
433+
- manifest
352434
properties:
353435
cid:
354436
$ref: "#/components/schemas/Cid"
@@ -357,6 +439,11 @@ components:
357439

358440
ManifestItem:
359441
type: object
442+
required:
443+
- treeCid
444+
- datasetSize
445+
- blockSize
446+
- protected
360447
properties:
361448
treeCid:
362449
$ref: "#/components/schemas/Cid"
@@ -384,6 +471,11 @@ components:
384471

385472
Space:
386473
type: object
474+
required:
475+
- totalBlocks
476+
- quotaMaxBytes
477+
- quotaUsedBytes
478+
- quotaReservedBytes
387479
properties:
388480
totalBlocks:
389481
description: "Number of blocks stored by the node"
@@ -502,6 +594,8 @@ paths:
502594
text/plain:
503595
schema:
504596
type: string
597+
"422":
598+
description: The mimetype of the filename is invalid
505599
"500":
506600
description: Well it was bad-bad and the upload did not work out
507601

@@ -702,7 +796,7 @@ paths:
702796
content:
703797
application/json:
704798
schema:
705-
$ref: "#/components/schemas/SalesAvailabilityCREATE"
799+
$ref: "#/components/schemas/SalesAvailability"
706800
responses:
707801
"201":
708802
description: Created storage availability
@@ -713,7 +807,7 @@ paths:
713807
"400":
714808
description: Invalid data input
715809
"422":
716-
description: Not enough node's storage quota available
810+
description: Not enough node's storage quota available or the provided parameters did not pass validation
717811
"500":
718812
description: Error reserving availability
719813
"503":
@@ -746,7 +840,7 @@ paths:
746840
"404":
747841
description: Availability not found
748842
"422":
749-
description: Not enough node's storage quota available
843+
description: The provided parameters did not pass validation
750844
"500":
751845
description: Error reserving availability
752846
"503":
@@ -809,6 +903,8 @@ paths:
809903
type: string
810904
"400":
811905
description: Invalid or missing Request ID
906+
"422":
907+
description: The storage request parameters are not valid
812908
"404":
813909
description: Request ID not found
814910
"503":
@@ -866,7 +962,7 @@ paths:
866962
"200":
867963
description: Node's SPR
868964
content:
869-
plain/text:
965+
text/plain:
870966
schema:
871967
$ref: "#/components/schemas/SPR"
872968
application/json:
@@ -884,7 +980,7 @@ paths:
884980
"200":
885981
description: Node's Peer ID
886982
content:
887-
plain/text:
983+
text/plain:
888984
schema:
889985
$ref: "#/components/schemas/PeerId"
890986
application/json:

codex_api_client/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
from codex_api_client.models.reservation import Reservation
4848
from codex_api_client.models.spr_read import SPRRead
4949
from codex_api_client.models.sales_availability import SalesAvailability
50-
from codex_api_client.models.sales_availability_create import SalesAvailabilityCREATE
5150
from codex_api_client.models.sales_availability_read import SalesAvailabilityREAD
5251
from codex_api_client.models.slot import Slot
5352
from codex_api_client.models.slot_agent import SlotAgent

0 commit comments

Comments
 (0)