Buckets handler

Handler for work with a buckets

class luna_image_store.app.handlers.buckets_handler.BucketsHandler(request)[source]

Handler for work with single bucket or several buckets.

Resource: “/{api_version}/buckets”

async get()[source]

Get all buckets. See spec_get_buckets.

Return type

HTTPResponse

Returns

response with status code 200 and list of all buckets

async post()[source]

Post request to create new bucket. See spec_post_buckets.

Return type

HTTPResponse

Returns

response with status code 201

luna_image_store.app.handlers.buckets_handler.validateBucketName(bucketName)[source]

Validate bucket name (depends on s3 restrictions, see https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html)

Parameters

bucketName (str) – input bucketName

Return type

str

Returns

bucketName

Raises

ValueError – if invalid bucket name