Skip to main content

buckets

Creates, updates, deletes, gets or lists a buckets resource.

Overview

Namebuckets
TypeResource
Idlinode.object_storage.buckets

Fields

The following fields are returned by SELECT queries:

The requested bucket.

NameDatatypeDescription
clusterstringDeprecated The legacy clusterId equivalent for the regionId where this bucket lives. The API maintains this for backward compatibility. > 📘 > > - This value and the regionId are interchangeable when used in requests. Best practice is to use the regionId. > > - This value is empty for newer regions that don't have a legacy clusterId. (example: us-east-1)
createdstring (date-time)When this bucket was created. (example: 2019-01-01T01:23:45)
endpoint_typestringThe type of s3_endpoint available to the active user in this region. See Endpoint types for more information. (example: E1)
hostnamestringThe hostname where this bucket can be accessed. This hostname can be accessed through a browser if the bucket is made public. (example: primary-bucket-1.us-east-12.linodeobjects.com)
labelstringThe name of this bucket. (example: primary-bucket)
objectsintegerThe number of objects stored in this bucket.
regionstringThe id of the region where this Object Storage bucket lives. (example: us-east)
s3_endpointstringThe active user's S3-compatible endpoint URL, based on the endpoint_type and region. (example: us-east-12.linodeobjects.com)
sizeintegerThe size of the bucket in bytes.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_object_storage_bucketselectReturns a single Object Storage bucket.

> 📘
>
> You can use an outside API, such as the Ceph Object Gateway S3 API for more options. OAuth scopes.

<br /> object_storage:read_only<br />

Learn more...
get_object_storage_bucketin_clusterselectReturns a list of buckets on your account, in the specified region.

> 📘
>
> You can use the Ceph Object Gateway S3 API for more options. OAuth scopes.

<br /> object_storage:read_only<br />

Learn more...
get_object_storage_bucketsselectReturns a paginated list of all Object Storage buckets available in your account.

> 📘
>
> You can use an outside API, such as the Ceph Object Gateway S3 API for more options. OAuth scopes.

<br /> object_storage:read_only<br />

Learn more...
post_object_storage_bucketinsertdata__label, data__clusterCreates an Object Storage bucket in the specified data center (region). If the bucket already exists on your account, this operation returns a 200 response with that bucket as if the API just created it.

> 📘
>
> - Accounts with negative balances can't access this operation.
>
> - The API still supports the clusterId equivalent (us-west-1) when setting a region for a new bucket, but you should use the regionId (us-west) instead.
>
> - You can use an outside API, such as the Ceph Object Gateway S3 API for more options. OAuth scopes.

<br /> object_storage:read_write<br />

Learn more...
delete_object_storage_bucketdeleteRemoves a single bucket.

> 📘
>
> - You need to remove all objects from a bucket before you can delete it. While you can delete a bucket using the CLI, this operation fails if the bucket contains too many objects. The best way to empty large buckets is to configure lifecycle policies with an outside API, such as the Ceph Object Gateway S3 API. Set a policy to remove all objects, wait a day or more for the system to remove all objects, then delete the bucket.
>
> - You can use an outside API, such as the Ceph Object Gateway S3 API for more options. OAuth scopes.

<br /> object_storage:read_write<br />

Learn more...
post_object_storage_object_urlexecname, methodCreates a pre-signed URL to access a single object in a bucket. Use it to share, create, or delete objects by using the appropriate HTTP method in your request body's method parameter.

> 📘
>
> You can use an outside API, such as the Ceph Object Gateway S3 API for more options. OAuth scopes.

<br /> object_storage:read_write<br />

Learn more...

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription

SELECT examples

Returns a single Object Storage bucket.

> 📘
>
> You can use an outside API, such as the Ceph Object Gateway S3 API for more options. OAuth scopes.

<br /> object_storage:read_only<br />

Learn more...

SELECT
cluster,
created,
endpoint_type,
hostname,
label,
objects,
region,
s3_endpoint,
size
FROM linode.object_storage.buckets;

INSERT examples

Creates an Object Storage bucket in the specified data center (region). If the bucket already exists on your account, this operation returns a 200 response with that bucket as if the API just created it.

> 📘
>
> - Accounts with negative balances can't access this operation.
>
> - The API still supports the clusterId equivalent (us-west-1) when setting a region for a new bucket, but you should use the regionId (us-west) instead.
>
> - You can use an outside API, such as the Ceph Object Gateway S3 API for more options. OAuth scopes.

<br /> object_storage:read_write<br />

Learn more...

INSERT INTO linode.object_storage.buckets (
data__acl,
data__cors_enabled,
data__endpoint_type,
data__label,
data__region,
data__s3_endpoint
)
SELECT
'{{ acl }}',
{{ cors_enabled }},
'{{ endpoint_type }}',
'{{ label }}' --required,
'{{ region }}',
'{{ s3_endpoint }}'
RETURNING
cluster,
created,
endpoint_type,
hostname,
label,
objects,
region,
s3_endpoint,
size
;

DELETE examples

Removes a single bucket.

> 📘
>
> - You need to remove all objects from a bucket before you can delete it. While you can delete a bucket using the CLI, this operation fails if the bucket contains too many objects. The best way to empty large buckets is to configure lifecycle policies with an outside API, such as the Ceph Object Gateway S3 API. Set a policy to remove all objects, wait a day or more for the system to remove all objects, then delete the bucket.
>
> - You can use an outside API, such as the Ceph Object Gateway S3 API for more options. OAuth scopes.

<br /> object_storage:read_write<br />

Learn more...

DELETE FROM linode.object_storage.buckets;

Lifecycle Methods

Creates a pre-signed URL to access a single object in a bucket. Use it to share, create, or delete objects by using the appropriate HTTP method in your request body's method parameter.

> 📘
>
> You can use an outside API, such as the Ceph Object Gateway S3 API for more options. OAuth scopes.

<br /> object_storage:read_write<br />

Learn more...

EXEC linode.object_storage.buckets.post_object_storage_object_url 
@@json=
'{
"content_type": "{{ content_type }}",
"expires_in": {{ expires_in }},
"method": "{{ method }}",
"name": "{{ name }}"
}';