Objects handler¶
Handler for work with a objects
- class luna_image_store.app.handlers.objects_handler.ObjectsHandler(request)[source]¶
Handler for work with signel object or several objects.
Resource: “{api_version}/buckets/{bucketName}/objects”
- async delete(bucketName)[source]¶
Delete objects from bucket. See spec_delete_objects.
- Parameters
bucketName (
str
) – bucket name- Return type
HTTPResponse
- Returns
response with status code 204, Error.FieldNotInJSON with status code 400, if field “objects” not found in json, Error.ObjectInBucketCountExceededLimit with status code 400, if object count exceeded limit 1000.
- class luna_image_store.app.handlers.objects_handler.StreamObjectsHandler(request)[source]¶
Handler for post objects with stream.
Separate class used due to strange behavior of sanic/cow - after decorating single method other methods becomes “stream” too and user has to consume stream instead of getting data from request.body.
Resource: “{api_version}/buckets/{bucketName}/objects”
- async post(bucketName)[source]¶
Post object to bucket. See spec_post_objects.
- Parameters
bucketName (
str
) – bucket name- Return type
HTTPResponse
- Returns
response with object id and location, if status code 201, Error.UnsupportedMediaType with status code 415, if unsupported media type.