Storage
cloudlayer.io supports three different storage types.
No storage - All calls must be synchronous, and the response returns the results immediately.
Cloud Storage - Calls can be synchronous or asynchronous. Your document is stored in your account using the storage included in your subscription.
User Storage - All calls must be asynchronous. Configure your own private S3 compatible storage, such as AWS S3, Digital Ocean Spaces, or similar.
Using the cloud storage available as part of your account is the recommended approach unless you have specific needs to use the others.
storage
The bucket to store all the assets.
Required
{ id: <string> } | boolean
Default: "true"
{
"storage": "false"
}
{
"storage": "true"
}
{
"storage": {
"id": "123456ab-1234-abcd-1234-123abc12"
}
}
No Storage
All calls must be synchronous, and the response returns the results immediately.
Using the no storage option is the most limiting option and prevents the usage and integration of other services but may be a good option if you have sensitive documents that you want to ensure are never stored on our servers.
{
"storage": false
}
- In
v2
storage: true
is the default. - In
v1
storage: false
is the default.
When using No Storage
, the asset endpoints are disabled.
Cloud Storage
Cloud Storage is storage that gets included with your account. The size depends on the plan you selected. Using cloud storage is the preferred method. All new users and calls should prefer this method to integrate tightly with our other services and future offerings.
When using Cloud Storage, you can use the assets endpoints to get, list, and delete your assets.
{
"storage": true
}
The v2
endpoint has storage enabled by default, so no configuration is required.
User Storage
User Storage is the most complex of the storage options. Only supports asynchronous calls. Allows storage of your assets in your own private S3 compatible storage such as AWS S3, Digital Ocean Spaces, Wasabi, Ceph, etc.
The following endpoints are provided to manage user storage:
The storage endpoints let you manage user storage, such as add, get, list, and delete.
To enable user storage, you must use the storage POST
endpoint to create a user storage configuration. Then pass the id of that configuration into the request.
Account information added is encrypted using bank level encryption and is kept secure at all times.
{
"storage": {
"id": "123456ab-1234-abcd-1234-123abc12"
}
}
Several endpoints exist to manage User Storage. These endpoints allow adding storage accounts, getting the id of the storage account, and listing storage accounts.
User Storage Endpoints
Using a plan that supports user-owned storage, such as the Enterprise plan, you can set up your S3 compatible storage instead of the built-in cloud storage that comes with your account.
It is important to remember that not all account types support user storage. If your plan does not support it you will receive an error when attempting to add.
POST /storage
This endpoint adds a storage account. By default, it uses AWS. However, you may specify a custom endpoint to support any S3 compatible storage.
User Storage Params get passed into this endpoint.
https://api.cloudlayer.io/v2/storage
{
"title": "AWS Storage 1",
"region": "us-east-1",
"secretAccessKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"accessKeyId": "XXXXXXXXXXXXXXXXXXX",
"bucket": "mybucket"
}
{
"title": "Digital Ocean Spaces",
"region": "us-east-1",
"secretAccessKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"accessKeyId": "XXXXXXXXXXXXXXXXXXX",
"bucket": "mybucket",
"endpoint": "https://nyc3.digitaloceanspaces.com"
}
{
"status": "success"
}
Returns success
or error
.
GET /storage:id
This endpoint retrieves the title and id of the storage document by id.
https://api.cloudlayer.io/v2/storage/123456ab-1234-abcd-1234-123abc12
{
"title": "AWS Storage 1",
"id": "123456ab-1234-abcd-1234-123abc12"
}
If an error occurs or no records found will return a 400
with a message indicating the reason.
GET /storage
This endpoint retrieves the title and id of all the storage accounts configured for your account.
https://api.cloudlayer.io/v2/storage
[
{
"title": "AWS Storage 1",
"id": "123456ab-1234-abcd-1234-123abc12"
},
{
"title": "Digital Ocean Spaces",
"id": "x3df2faf-cv3f-21df-1d1d-3d5da373"
}
]
Returns an empty array []
if no results found.
DEL /storage:id
This endpoint removes the configured storage account by id.
https://api.cloudlayer.io/v2/storage:id
If an error occurs or no records found will return a 400
with a message indicating the reason.
User Storage Params
title
The title of the storage credential used for reference must be unique across all storage credentials in your account.
Required
string
Default: ""
{ "title": "My AWS Storage" }
region
Region for the AWS region. If using an S3, compatible storage option but not AWS, follow that provider's directions. For example, Digital Ocean specifies to pass in us-east-1
for all regions.
Required
string
Default: ""
{ "region": "us-east-1" }
secretAccessKey
The SecretAccessKey provided by the provider.
Required
string
Default: ""
{ "secretAccessKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }
accessKeyId
The AccessKeyId provided by the provider.
Required
string
Default: ""
{ "accessKeyId": "XXXXXXXXXXXXXXXXXXX" }
bucket
The bucket to store all the assets.
Required
string
Default: ""
{ "bucket": "mybucket" }
endpoint
The bucket to store all the assets.
Optional
string
Default: ""
{ "endpoint": "https://nyc3.digitaloceanspaces.com" }