Images handler¶
Handler for work with a images
- class luna_image_store.app.handlers.images_handler.ImagesHandler(request)[source]¶
Handler for work with single image or several images.
Resource: “/{api_version}/buckets/{bucketName}/images”
- async delete(bucketName)[source]¶
Delete images from bucket. See spec_delete_images.
- Parameters
bucketName (
str
) – bucket name- Return type
HTTPResponse
- Returns
response with status code 204, Error.EmptyJson with status code 400, if request contain empty json, Error.FieldNotInJSON with status code 400, if field “images” not found in json, Error.ImageCountExceededLimit with status code 400, if image count exceeded limit 1000.
- async post(bucketName)[source]¶
Post image to bucket. See spec_post_images.
- Parameters
bucketName (
str
) – bucket name- Return type
HTTPResponse
- Returns
response with image id and location, if status code 201, Error.BadContentType with status code 400, if bad content type, Error.ConvertImageError with status code 400, if failed convert image bytes.