rebuilderd icon indicating copy to clipboard operation
rebuilderd copied to clipboard

Add API documentation

Open jelly opened this issue 5 years ago • 2 comments

To easily create integrations with rebuilderd it would be nice if the API endpoints would be documented and available somewhere.

jelly avatar Apr 24 '20 14:04 jelly

I'd love to help out here, do you want them documented and do you have a preferred way to document them?

jelly avatar Apr 24 '20 14:04 jelly

The routes are defined here: https://github.com/kpcyrd/rebuilderd/blob/master/daemon/src/api.rs

#[get("/api/v0/workers")]
#[post("/api/v0/job/sync")]
#[get("/api/v0/pkgs/list")]
#[post("/api/v0/queue/list")]
#[post("/api/v0/queue/push")]
#[post("/api/v0/queue/pop")]
#[post("/api/v0/queue/drop")]
#[post("/api/v0/build/ping")]
#[post("/api/v0/build/report")]

The struct to requests/responses are defined at the bottom of this file: https://github.com/kpcyrd/rebuilderd/blob/master/common/src/api.rs

I don't have preferences about the format to document this, any ideas?

kpcyrd avatar Apr 26 '20 00:04 kpcyrd