Image-manager
Simple CRUD service for storing firmware image metadata and binaries
Images ¶
Image Collection ¶
List All ImagesGET/image{?label}
Example URI
- label
string
(optional) Example: "xyz"
Headers
Authorization: Bearer JWT
200
Headers
Content-Type: application/json
Body
[
{
"created": "2018-02-08T12:25:11.979313+00:00",
"confirmed": true,
"label": "ExampleFW",
"fw_version": "1.0.0-rc1",
"id": "b60aa5e9-cbe6-4b51-b76c-08cf8273db07"
},
{
"created": "2018-02-08T12:25:11.998107+00:00",
"confirmed": false,
"label": "ExampleFW",
"fw_version": "1.0.0-rc1",
"id": "51b39543-9de1-4751-9fe2-48c8d6038ba1"
},
{
"confirmed": false,
"created": "2018-02-22T21:30:39.740576+00:00",
"fw_version": "1.0.0-rc1",
"id": "c929e347-0cd3-4925-a9ed-44ec59f7a1b9",
"label": "ExampleFW"
}
]
401
Returned when there is no Authorization header or if it contains an invalid value.
Headers
Content-Type: application/json
Body
{
"message": "No authorization token has been supplied",
"status": 401
}
Create a New ImagePOST/image/
Creates a new image based on a JSON object containing the following metadata. All fields are required, images with missing metadata fields will return an error
-
label (string) - An informative human-readable label
-
fw_version (string) - FW Semantic versioning info
Example URI
Headers
Content-Type: application/json
Authorization: Bearer JWT
Body
{
"label": "FW_Example",
"fw_version": "1.0.0"
}
201
Headers
Content-Type: application/json
Location: /image/asdasdasdasdasdas
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "http://jsonschema.net",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"label": {
"type": "string"
},
"published_at": {
"type": "string"
},
"url": {
"type": "string",
"pattern": "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"
}
},
"required": [
"label",
"published_at",
"url"
]
}
400
Returned when there is missing fields in creation request
Headers
Content-Type: application/json
Body
{
"message": "failed to parse input",
"errors": {
"label": [
"Missing data for required field."
]
}
}
401
Returned when there is no Authorization header or if it contains an invalid value.
Headers
Content-Type: application/json
Body
{
"message": "No authorization token has been supplied",
"status": 401
}
Binary Collection ¶
List All BinariesGET/image/binary/
Example URI
Headers
Authorization: Bearer JWT
200
Headers
Content-Type: application/json
Body
[
"b60aa5e9-cbe6-4b51-b76c-08cf8273db07.hex"
]
401
Returned when there is no Authorization header or if it contains an invalid value.
Headers
Content-Type: application/json
Body
{
"message": "No authorization token has been supplied",
"status": 401
}
Images ¶
Retrieve a single image metadataGET/image/{image_id}
Example URI
- image_id
guid
(required) Example: b60aa5e9-cbe6-4b51-b76c-08cf8273db07Unique ID
Headers
Authorization: Bearer JWT
200
Headers
Content-Type: application/json
Body
{
"label": "FW_Example",
"fw_version": "1.0.0"
}
404
Headers
Content-Type: application/json
Body
{
"message": "No such image: efac",
"status": 404
}
401
Returned when there is no Authorization header or if it contains an invalid value.
Headers
Content-Type: application/json
Body
{
"message": "No authorization token has been supplied",
"status": 401
}
DeleteDELETE/image/{image_id}
Example URI
- image_id
guid
(required) Example: b60aa5e9-cbe6-4b51-b76c-08cf8273db07Unique ID
Headers
Authorization: Bearer JWT
200
Headers
Content-Type: application/json
Body
{
"removed_image": {
"confirmed": true,
"created": "2019-05-02T20:09:30.981452+00:00",
"fw_version": "1.0.0-rc1",
"id": "b60aa5e9-cbe6-4b51-b76c-08cf8273db07",
"label": "ExampleFW"
},
"result": "ok"
}
404
Headers
Content-Type: application/json
Body
{
"message": "No such image: efac",
"status": 404
}
401
Returned when there is no Authorization header or if it contains an invalid value.
Headers
Content-Type: application/json
Body
{
"message": "No authorization token has been supplied",
"status": 401
}
Image Binaries ¶
All files should have a “.hex” extension.
Retrieve a single image binaryGET/image/{image_id}/binary
Example URI
- image_id
guid
(required) Example: b60aa5e9-cbe6-4b51-b76c-08cf8273db07Unique ID
Headers
Authorization: Bearer JWT
200
Headers
Content-Type: application/octet-stream
404
Headers
Content-Type: application/json
Body
{
"message": "No such image: 57852f31-a906-4d5f-a0c3-fde41ff64d",
"status": 404
}
404
Headers
Content-Type: application/json
Body
{
"message": "Image does not have an binary file",
"status": 404
}
401
Returned when there is no Authorization header or if it contains an invalid value.
Headers
Content-Type: application/json
Body
{
"message": "No authorization token has been supplied",
"status": 401
}
DeleteDELETE/image/{image_id}/binary
Example URI
- image_id
guid
(required) Example: b60aa5e9-cbe6-4b51-b76c-08cf8273db07Unique ID
Headers
Authorization: Bearer JWT
200
Headers
Content-Type: application/json
Body
{
"result": "ok"
}
404
Headers
Content-Type: application/json
Body
{
"message": "No such image: 57852f31-a906-4d5f-a0c3-fde41ff64d",
"status": 404
}
401
Returned when there is no Authorization header or if it contains an invalid value.
Headers
Content-Type: application/json
Body
{
"message": "No authorization token has been supplied",
"status": 401
}
Add binary to an existing imagePOST/image/{image_id}/binary
Example URI
- image_id
guid
(required) Example: 51b39543-9de1-4751-9fe2-48c8d6038ba1Unique ID
Headers
Content-Type: multipart/form-data;boundary=BOUNDARY
Authorization: Bearer JWT
Body
--BOUNDARY
Content-Disposition: form-data; name="image"; filename="image.hex"
Content-Type: application/octet-stream
0123456789
--BOUNDARY--
200
Headers
Content-Type: application/json
Body
{
"image": "51b39543-9de1-4751-9fe2-48c8d6038ba1",
"message": "image uploaded"
}
404
Headers
Content-Type: application/json
Body
{
"message": "No such image: 57852f31-a906-4d5f-a0c3-fde41ff64d",
"status": 404
}
401
Returned when there is no Authorization header or if it contains an invalid value.
Headers
Content-Type: application/json
Body
{
"message": "No authorization token has been supplied",
"status": 401
}