Luna-image-store (v.3.5.6)

Download OpenAPI specification:Download

Introduction

The service is an abstraction for storing pictures and objects (currently supported objects types are plain/text and application/json) in some database. Now two types of databases are supported: aws S3 and a hard disk. All images and objects are stored in buckets. Thus, to save a picture or an object, create a bucket and then put a picture or object into it. Buckets are disjoint namespaces.

There are two ways to save the image in the system:

  1. Make the request by the POST method to the resource /1/buckets/{bucket}/images, put an image to the body of request. For the image, id will be generated in the uuid format, on which it will be possible in the future to receive this image.

  2. Make a request using the PUT method to the resource /1/buckets/{bucket}/images/{id}, put an image to the body of request. Further on the transmitted id, you can get this image.

All pictures are converted to jpg format if they were not.

There are two ways to save an object in the system:

  1. Make a request by the POST method to the resource /1/buckets/{bucket}/objects, put an object to the body of request. For the object, id will be generated in the uuid format, on which it will be possible in the future to receive this object.

  2. Make a request using the PUT method on the resource/1/buckets/{bucket}/objects/{id}, put an object to the body of request. Further on the passed id it is possible to receive this object.

At the moment, the following types of objects are supported: plain/text, application/json, application/zip, application/pdf.

The service provides following options:

  1. create * bucket *;
  2. save the image under your id in uuid format or under id issued by the system in the specified bucket;
  3. get the picture by it's ID from the specified bucket;
  4. generate small copies of the images for preview mappings during the image saving phase;
  5. delete a single image or several (up to 1000) together with small copies of the specified bucket.
  6. save the object under your id in uuid format or under id issued by the system in the specified bucket;
  7. get the object by it's id from the specified bucket;
  8. delete an individual object or several (up to 1000) from the specified bucket.

Service have api version, actual is 1. All url above /version, must starts with api version.

OpenAPI specification is the only valid document providing up-to-date information about the service API.

The specification can be used:

  • By documentation generation tools to visualize the API.
  • By code generation tools.

All the documents and code generated using this specification can include inaccuracies and should be carefully checked.

OpenAPI specification can be received using the "/docs/spec" resource. The "Accept" header should be set to "application/x-yaml".

version

get version

Get version of service.

header Parameters
Luna-Request-Id
string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4...
Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

External request ID. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

Responses

Response samples

Content type
application/json
{
  • "Version": {
    }
}

buckets

create a bucket with the provided name

Creation of bucket. bucket must have unique name. Name must comply storage's naming rules. If storage is hard drive, then bucket is a folder, if storage is s3, then bucket is present bucket in s3 and it's name must comply the naming rules for bucket in s3 (see https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html).

query Parameters
bucket
required
string (bucket) ^[a-z0-9-_]{1,255}$
Example: bucket=image_store-bucket

Bucket name.

header Parameters
Luna-Request-Id
string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4...
Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

External request ID. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

content-Type
string
Value: "application/json"

Content type is application/json.

Responses

Response samples

Content type
application/json
{}

get bucket list

Receiving list of all existing buckets.

Responses

Response samples

Content type
application/json
[
  • "image_store-bucket"
]

delete bucket

Delete current bucket.

path Parameters
bucket
required
string (bucket) ^[a-z0-9-_]{1,255}$
Example: image_store-bucket

Bucket name.

header Parameters
Luna-Request-Id
string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4...
Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

External request ID. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

Responses

Response samples

Content type
application/json
{}

objects

create objects

Save object with unique ID.

path Parameters
bucket
required
string (bucket) ^[a-z0-9-_]{1,255}$
Example: image_store-bucket

Bucket name.

query Parameters
account_id
string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb

Account ID.

header Parameters
Luna-Request-Id
string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4...
Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

External request ID. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

content-Type
required
string
Enum: "application/json" "application/pdf" "application/zip" "text/plain"

Type of transferring information, available - text, json, zip, pdf.

Request Body schema:
string (application_json)

Content type is application/json.

Responses

Request samples

Content type
{
  • "content": "json"
}

Response samples

Content type
application/json
{
  • "object_id": "b5d6fd45-fcca-453d-ac05-3e594054b813",
  • "url": "/1/buckets/image_store-bucket/objects/b5d6fd45-fcca-453d-ac05-3e594054b813"
}

delete objects

Delete list of objects.

path Parameters
bucket
required
string (bucket) ^[a-z0-9-_]{1,255}$
Example: image_store-bucket

Bucket name.

query Parameters
account_id
string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb

Account ID.

header Parameters
Luna-Request-Id
string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4...
Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

External request ID. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

Request Body schema: application/json
objects
Array of strings <uuid> (object_id)

Responses

Request samples

Content type
application/json
{
  • "objects": [
    ]
}

Response samples

Content type
application/json
Example
{}

object

put object

Save object with specified ID.

path Parameters
bucket
required
string (bucket) ^[a-z0-9-_]{1,255}$
Example: image_store-bucket

Bucket name.

object_id
required
string <uuid> (object_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Example: b668c4a5-2191-476e-a261-3b4f9ce2e25e

Object ID.

query Parameters
account_id
string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb

Account ID.

header Parameters
Luna-Request-Id
string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4...
Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

External request ID. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

content-Type
required
string
Enum: "application/json" "application/pdf" "application/zip" "text/plain"

Type of transferring information, available - text, json, zip, pdf.

Request Body schema:
string (application_json)

Content type is application/json.

Responses

Request samples

Content type
{
  • "content": "json"
}

Response samples

Content type
application/json
{
  • "object_id": "28b87262-43e2-4afc-ad1b-8308e2798b80",
  • "url": "/1/buckets/luna_image_store-test-bucket/objects/28b87262-43e2-4afc-ad1b-8308e2798b80"
}

get object

Receiving objects.

path Parameters
bucket
required
string (bucket) ^[a-z0-9-_]{1,255}$
Example: image_store-bucket

Bucket name.

object_id
required
string <uuid> (object_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Example: b668c4a5-2191-476e-a261-3b4f9ce2e25e

Object ID.

query Parameters
account_id
string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb

Account ID.

header Parameters
Luna-Request-Id
string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4...
Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

External request ID. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

accept
string (accept)
Enum: "application/json" "text/plain" "application/zip" "application/pdf"

Acceptable type of receiving data.

Responses

Response samples

Content type
{
  • "json": "example"
}

head object

Check object exists.

path Parameters
bucket
required
string (bucket) ^[a-z0-9-_]{1,255}$
Example: image_store-bucket

Bucket name.

object_id
required
string <uuid> (object_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Example: b668c4a5-2191-476e-a261-3b4f9ce2e25e

Object ID.

query Parameters
account_id
string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb

Account ID.

header Parameters
Luna-Request-Id
string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4...
Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

External request ID. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

accept
string (accept)
Enum: "application/json" "text/plain" "application/zip" "application/pdf"

Acceptable type of receiving data.

Responses

Response samples

Content type
application/json
{}

delete object

Delete object.

path Parameters
bucket
required
string (bucket) ^[a-z0-9-_]{1,255}$
Example: image_store-bucket

Bucket name.

object_id
required
string <uuid> (object_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Example: b668c4a5-2191-476e-a261-3b4f9ce2e25e

Object ID.

query Parameters
account_id
string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb

Account ID.

header Parameters
Luna-Request-Id
string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4...
Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

External request ID. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

Responses

Response samples

Content type
application/json
{}

images

create images

Save images with unique ID.

path Parameters
bucket
required
string (bucket) ^[a-z0-9-_]{1,255}$
Example: image_store-bucket

Bucket name.

query Parameters
account_id
string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb

Account ID.

header Parameters
Luna-Request-Id
string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4...
Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

External request ID. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

content-Type
string
Enum: "image/jpeg" "image/png" "image/bmp" "image/tiff" "image/gif" "image/x-portable-pixmap"

Type of transmitting image.

Request Body schema:
string <binary> (image_binary)

Responses

Response samples

Content type
application/json
{
  • "image_id": "141d2706-8baf-433b-82eb-8c7fada847da",
  • "url": "/1/buckets/image_store-bucket/images/141d2706-8baf-433b-82eb-8c7fada847da",
  • "url32": "/1/buckets/image_store-bucket/images/141d2706-8baf-433b-82eb-8c7fada847da_32",
  • "url64": "/1/buckets/image_store-bucket/images/141d2706-8baf-433b-82eb-8c7fada847da_64",
  • "url96": "/1/buckets/image_store-bucket/images/141d2706-8baf-433b-82eb-8c7fada847da_96",
  • "url160": "/1/buckets/image_store-bucket/images/141d2706-8baf-433b-82eb-8c7fada847da_160"
}

delete images

Delete a bundle of images from bucket.

path Parameters
bucket
required
string (bucket) ^[a-z0-9-_]{1,255}$
Example: image_store-bucket

Bucket name.

query Parameters
account_id
string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb

Account ID.

header Parameters
Luna-Request-Id
string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4...
Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

External request ID. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

Request Body schema: application/json
string (application_json)

Content type is application/json.

Responses

Request samples

Content type
application/json
{
  • "images": [
    ]
}

Response samples

Content type
application/json
Example
{}

image

put image

Image saving with specified ID.

path Parameters
bucket
required
string (bucket) ^[a-z0-9-_]{1,255}$
Example: image_store-bucket

Bucket name.

image_id
required
string <uuid> (image_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Example: b668c4a5-2191-476e-a261-3b4f9ce2e25e

Image ID.

query Parameters
account_id
string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb

Account ID.

header Parameters
Luna-Request-Id
string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4...
Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

External request ID. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

content-Type
string
Enum: "image/jpeg" "image/png" "image/bmp" "image/tiff" "image/gif" "image/x-portable-pixmap"

Type of transmitting image.

Request Body schema:
string <binary> (image_binary)

Responses

Response samples

Content type
application/json
{
  • "url": "/1/buckets/image_store-bucket/images/141d2706-8baf-433b-82eb-8c7fada847da"
}

head image

Check image exists.

path Parameters
bucket
required
string (bucket) ^[a-z0-9-_]{1,255}$
Example: image_store-bucket

Bucket name.

image_id
required
string <uuid> (image_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Example: b668c4a5-2191-476e-a261-3b4f9ce2e25e

Image ID.

query Parameters
account_id
string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb

Account ID.

header Parameters
Luna-Request-Id
string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4...
Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

External request ID. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

Responses

Response samples

Content type
application/json
{}

delete image

Delete an image with all preview copies.

path Parameters
bucket
required
string (bucket) ^[a-z0-9-_]{1,255}$
Example: image_store-bucket

Bucket name.

image_id
required
string <uuid> (image_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Example: b668c4a5-2191-476e-a261-3b4f9ce2e25e

Image ID.

query Parameters
account_id
string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb

Account ID.

header Parameters
Luna-Request-Id
string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4...
Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

External request ID. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

Responses

Response samples

Content type
application/json
Example
{}

get image

Receive an origin image.

path Parameters
bucket
required
string (bucket) ^[a-z0-9-_]{1,255}$
Example: image_store-bucket

Bucket name.

image_id
required
string <uuid> (image_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Example: b668c4a5-2191-476e-a261-3b4f9ce2e25e

Image ID.

query Parameters
account_id
string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb

Account ID.

header Parameters
Luna-Request-Id
string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4...
Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

External request ID. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

Responses

Response samples

Content type
application/json
{}

imageThumbnail

get image as a thumbnail

Receive an image as a thumbnail.

path Parameters
bucket
required
string (bucket) ^[a-z0-9-_]{1,255}$
Example: image_store-bucket

Bucket name.

image_id_with_thumbnail
required
string (image_id_with_thumbnail) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]...
Example: b668c4a5-2191-476e-a261-3b4f9ce2e25e_64

Image ID with thumbnail parameter. Thumbnail, possible only with methods GET and HEAD. Size of the maximum border in pixels.

header Parameters
Luna-Request-Id
string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4...
Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

External request ID. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

Responses

Response samples

Content type
application/json
{}

documents

get openapi documentation

Get service OpenApi documentation. If Accept request header is of type application/x-yaml, returns documentation in yaml format or returns html documentation, if Accept-Type is text/html.

header Parameters
Luna-Request-Id
string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4...
Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

External request ID. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

accept
required
string (accept_docs_handler)
Enum: "application/x-yaml" "text/html"

Acceptable type of receiving data.

Responses

Response samples

Content type
application/json
{}

get development manual

Get sphinx documentation - Development Manual. After the request you will be redirected to the page /docs/dev/index.html.

header Parameters
Luna-Request-Id
string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4...
Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

External request ID. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

Responses

Response samples

Content type
application/json
{}

config

get service configuration

Get service configuration. If Accept request header is of type application/json, returns documentation in json format or returns text documentation, if Accept-Type is text/plain.

header Parameters
Luna-Request-Id
string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4...
Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

External request ID. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

accept
string
Enum: "application/json" "text/plain"

Acceptable type of receiving data.

Responses

Response samples

Content type
{
  • "INFLUX_MONITORING": {
    }
}

health

get health

Get health of service.

header Parameters
Luna-Request-Id
string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4...
Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a

External request ID. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

Responses

Response samples

Content type
application/json
{
  • "execution_time": 0.123
}