Skip to content

Commit ace6b33

Browse files
authored
Merge pull request #672 from ethersphere/2-3-0-openapi
updated openapi docs
2 parents 3cd91a8 + fd9496d commit ace6b33

File tree

2 files changed

+160
-11
lines changed

2 files changed

+160
-11
lines changed

openapi/Swarm.yaml

Lines changed: 112 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
openapi: 3.0.3
22

33
info:
4-
version: 7.1.0
4+
version: 7.2.0
55
title: Bee API
66
description: "A list of the currently provided Interfaces to interact with the swarm, implementing file operations and sending messages"
77

@@ -237,6 +237,7 @@ paths:
237237
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmCache"
238238
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmRedundancyStrategyParameter"
239239
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmRedundancyFallbackModeParameter"
240+
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmRedundancyLevelParameter"
240241
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmChunkRetrievalTimeoutParameter"
241242
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmActTimestamp"
242243
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmActPublisher"
@@ -269,7 +270,23 @@ paths:
269270
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmActHistoryAddress"
270271
responses:
271272
"200":
272-
description: Chunk exists
273+
description: The chunk exists.
274+
headers:
275+
Content-Type:
276+
description: The MIME type of the resource (e.g., application/octet-stream).
277+
schema:
278+
type: string
279+
example: application/octet-stream
280+
Content-Length:
281+
description: The size of the chunk in bytes.
282+
schema:
283+
type: integer
284+
example: 1024
285+
Access-Control-Expose-Headers:
286+
description: Headers exposed for CORS.
287+
schema:
288+
type: string
289+
example: Accept-Ranges, Content-Encoding
273290
"400":
274291
$ref: "SwarmCommon.yaml#/components/responses/400"
275292
"404":
@@ -424,6 +441,7 @@ paths:
424441
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmCache"
425442
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmRedundancyStrategyParameter"
426443
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmRedundancyFallbackModeParameter"
444+
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmRedundancyLevelParameter"
427445
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmChunkRetrievalTimeoutParameter"
428446
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmActTimestamp"
429447
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmActPublisher"
@@ -816,6 +834,28 @@ paths:
816834
default:
817835
description: Default response
818836

837+
"/gsoc/subscribe/{address}":
838+
get:
839+
summary: Subscribe to GSOC payloads
840+
tags:
841+
- GSOC
842+
- Subscribe
843+
- Websocket
844+
parameters:
845+
- in: path
846+
name: reference
847+
schema:
848+
$ref: "SwarmCommon.yaml#/components/schemas/SwarmReference"
849+
required: true
850+
description: "Single Owner Chunk address (which may have multiple payloads)"
851+
responses:
852+
"200":
853+
description: Returns a WebSocket with a subscription for incoming message data on the requested SOC address.
854+
"500":
855+
$ref: "SwarmCommon.yaml#/components/responses/500"
856+
default:
857+
description: Default response
858+
819859
"/soc/{owner}/{id}":
820860
post:
821861
summary: Upload single owner chunk
@@ -840,12 +880,11 @@ paths:
840880
$ref: "SwarmCommon.yaml#/components/schemas/HexString"
841881
required: true
842882
description: Signature
843-
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmPinParameter"
844883
- in: header
845884
name: swarm-postage-batch-id
846885
schema:
847886
$ref: "SwarmCommon.yaml#/components/parameters/SwarmPostageBatchId"
848-
required: false
887+
required: true
849888
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmPostageStamp"
850889
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmAct"
851890
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmActHistoryAddress"
@@ -877,6 +916,47 @@ paths:
877916
$ref: "SwarmCommon.yaml#/components/responses/500"
878917
default:
879918
description: Default response
919+
get:
920+
summary: Resolve Single Owner Chunk data
921+
tags:
922+
- Single owner chunk
923+
parameters:
924+
- in: path
925+
name: owner
926+
schema:
927+
$ref: "SwarmCommon.yaml#/components/schemas/EthereumAddress"
928+
required: true
929+
description: Ethereum address of the Owner of the SOC
930+
- in: path
931+
name: id
932+
schema:
933+
$ref: "SwarmCommon.yaml#/components/schemas/HexString"
934+
required: true
935+
description: Arbitrary identifier of the related data
936+
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmOnlyRootChunkParameter"
937+
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmCache"
938+
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmRedundancyStrategyParameter"
939+
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmRedundancyFallbackModeParameter"
940+
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmChunkRetrievalTimeoutParameter"
941+
responses:
942+
"200":
943+
description: Related Single Owner Chunk data
944+
headers:
945+
"swarm-soc-signature":
946+
$ref: "SwarmCommon.yaml#/components/headers/SwarmSocSignature"
947+
content:
948+
application/octet-stream:
949+
schema:
950+
type: string
951+
format: binary
952+
"400":
953+
$ref: "SwarmCommon.yaml#/components/responses/400"
954+
"401":
955+
$ref: "SwarmCommon.yaml#/components/responses/401"
956+
"500":
957+
$ref: "SwarmCommon.yaml#/components/responses/500"
958+
default:
959+
description: Default response
880960

881961
"/feeds/{owner}/{topic}":
882962
post:
@@ -961,18 +1041,26 @@ paths:
9611041
$ref: "SwarmCommon.yaml#/components/schemas/FeedType"
9621042
required: false
9631043
description: "Feed indexing scheme (default: sequence)"
1044+
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmOnlyRootChunkParameter"
1045+
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmCache"
1046+
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmRedundancyStrategyParameter"
1047+
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmRedundancyFallbackModeParameter"
1048+
- $ref: "SwarmCommon.yaml#/components/parameters/SwarmChunkRetrievalTimeoutParameter"
9641049
responses:
9651050
"200":
9661051
description: Latest feed update
9671052
headers:
1053+
"swarm-soc-signature":
1054+
$ref: "SwarmCommon.yaml#/components/headers/SwarmSocSignature"
9681055
"swarm-feed-index":
9691056
$ref: "SwarmCommon.yaml#/components/headers/SwarmFeedIndex"
9701057
"swarm-feed-index-next":
9711058
$ref: "SwarmCommon.yaml#/components/headers/SwarmFeedIndexNext"
9721059
content:
973-
application/json:
1060+
application/octet-stream:
9741061
schema:
975-
$ref: "SwarmCommon.yaml#/components/schemas/ReferenceResponse"
1062+
type: string
1063+
format: binary
9761064
"400":
9771065
$ref: "SwarmCommon.yaml#/components/responses/400"
9781066
"401":
@@ -2396,6 +2484,23 @@ paths:
23962484
default:
23972485
description: Default response.
23982486

2487+
"/status/neighborhoods":
2488+
get:
2489+
summary: Get the current neighborhoods status of this node.
2490+
tags:
2491+
- Node Status
2492+
responses:
2493+
"200":
2494+
description: Returns the neighborhoods status of this node
2495+
content:
2496+
application/json:
2497+
schema:
2498+
$ref: "SwarmCommon.yaml#/components/schemas/StatusNeighborhoodsResponse"
2499+
"400":
2500+
$ref: "SwarmCommon.yaml#/components/responses/400"
2501+
default:
2502+
description: Default response.
2503+
23992504
components:
24002505
securitySchemes:
24012506
basicAuth:
@@ -2405,4 +2510,4 @@ components:
24052510
bearerAuth:
24062511
type: http
24072512
scheme: bearer
2408-
bearerFormat: SecurityToken
2513+
bearerFormat: SecurityToken

openapi/SwarmCommon.yaml

Lines changed: 48 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
openapi: 3.0.3
22
info:
3-
version: 4.1.0
3+
version: 4.2.0
44
title: Common Data Types
55
description: |
66
\*****bzzz*****
@@ -242,6 +242,11 @@ components:
242242
type: string
243243
example: "5.0018ms"
244244

245+
Seconds:
246+
description: Go time.Duration format in seconds
247+
type: number
248+
example: 30.5
249+
245250
EthereumAddress:
246251
type: string
247252
pattern: "^[A-Fa-f0-9]{40}$"
@@ -923,6 +928,8 @@ components:
923928
type: boolean
924929
lastSyncedBlock:
925930
type: integer
931+
committedDepth:
932+
type: integer
926933

927934
StatusResponse:
928935
type: object
@@ -933,6 +940,30 @@ components:
933940
items:
934941
$ref: "#/components/schemas/StatusSnapshotResponse"
935942

943+
StatusNeighborhoodResponse:
944+
type: object
945+
properties:
946+
neighborhood:
947+
$ref: "#/components/schemas/Neighborhood"
948+
reserveSizeWithinRadius:
949+
type: integer
950+
proximity:
951+
type: integer
952+
953+
Neighborhood:
954+
type: string
955+
description: Swarm address of a neighborhood in string binary format, usually limited to as many bits as the current storage radius.
956+
example: "011010111"
957+
958+
StatusNeighborhoodsResponse:
959+
type: object
960+
properties:
961+
stamps:
962+
type: array
963+
nullable: false
964+
items:
965+
$ref: "#/components/schemas/StatusNeighborhoodResponse"
966+
936967
ApiChunkInclusionProof:
937968
type: object
938969
properties:
@@ -991,8 +1022,8 @@ components:
9911022
ApiRCHashResponse:
9921023
type: object
9931024
properties:
994-
duration:
995-
type: integer
1025+
durationSeconds:
1026+
$ref: "#/components/schemas/Seconds"
9961027
hash:
9971028
$ref: "#/components/schemas/SwarmAddress"
9981029
proofs:
@@ -1031,6 +1062,11 @@ components:
10311062
schema:
10321063
$ref: "#/components/schemas/HexString"
10331064

1065+
SwarmSocSignature:
1066+
description: "Attached digital signature of the Single Owner Chunk"
1067+
schema:
1068+
$ref: "#/components/schemas/HexString"
1069+
10341070
SwarmActHistoryAddress:
10351071
description: "Swarm address reference to the new ACT history entry"
10361072
schema:
@@ -1136,6 +1172,14 @@ components:
11361172
description: >
11371173
Specify the timeout for chunk retrieval. The default is 30 seconds.
11381174
1175+
SwarmOnlyRootChunkParameter:
1176+
in: header
1177+
name: swarm-only-root-chunk
1178+
schema:
1179+
type: boolean
1180+
required: false
1181+
description: "Returns only the root chunk of the content"
1182+
11391183
ContentTypePreserved:
11401184
in: header
11411185
name: Content-Type
@@ -1284,4 +1328,4 @@ components:
12841328
content:
12851329
application/problem+json:
12861330
schema:
1287-
$ref: "#/components/schemas/ProblemDetails"
1331+
$ref: "#/components/schemas/ProblemDetails"

0 commit comments

Comments
 (0)