The CDN API has two parts:
-
The web gateway uses plain HTTP.
See the specification of 🔗 DDC URLs.
-
Other operations use protobuf messages over HTTP.
See the model of messages in ☁ Storage Schema.
Resolve a query using a /ddc/
URI and return the content of a file or piece.
GET /ddc/…/file/…
GET /ddc/…/ifile/…
GET /ddc/…/piece/…
GET /ddc/…/ipiece/…
For file/
and ifile/
queries, return the file content. The response includes a Content-Type
header which is based, in order of priority, on the filename extension (like .mp4
), on the tag content-type
, or on the file content (MIME Sniffing).
For piece/
and ipiece/
queries, return the piece data structure encoded in binary ProtoBuf, or in JSON, or only the payload (piece.data
), depending on options (TODO: specify the options).
GET /api/rest/pieces/{{cid}}?bucketId={{bucket_id}}
- Status code: 200
- Body: SignedPiece model
PUT /api/rest/pieces
{{SignedPiece_model}}
- Status code: 201
- Body: Signature model
GET /api/rest/pieces
{{Query_model}}
- Status code: 200
- Bode: SearchResult model