Skip to content
This repository has been archived by the owner on Nov 29, 2024. It is now read-only.

Latest commit

 

History

History
75 lines (44 loc) · 1.41 KB

cdn-api.md

File metadata and controls

75 lines (44 loc) · 1.41 KB

☁ CDN API

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.

Web Gateway

Resolve a query using a /ddc/ URI and return the content of a file or piece.

Request

GET /ddc/…/file/…
GET /ddc/…/ifile/…
GET /ddc/…/piece/…
GET /ddc/…/ipiece/…

Response

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).

Download Piece

Request

GET /api/rest/pieces/{{cid}}?bucketId={{bucket_id}}

Response

  • Status code: 200
  • Body: SignedPiece model

Upload piece

Request

PUT /api/rest/pieces

{{SignedPiece_model}}

Response

  • Status code: 201
  • Body: Signature model

Search pieces

Request

GET /api/rest/pieces

{{Query_model}}

Response

  • Status code: 200
  • Bode: SearchResult model