Limiting the maximum size of a bucket
Object Storage allows you to limit the maximum size of a bucket.
For example, if you provide the users of your service with the ability to upload objects to Object Storage, then, by limiting the maximum volume, you can better control user actions and avoid unnecessary costs.
-
In the management console
, select the appropriate folder. -
Select Object Storage.
-
Click the name of the bucket you need.
-
Click the Settings tab.
-
Set the value of the Max size field.
If the value is
0
, the maximum size is not limited and is similar to the enabled No limit option. -
Click Save.
If you don't have the Nebius AI command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
-
View a description of the CLI command to update a bucket:
ncp storage bucket update --help
-
Get a list of buckets in the default folder:
ncp storage bucket list
Result:
+------------------+----------------------+----------+-----------------------+---------------------+ | NAME | FOLDER ID | MAX SIZE | DEFAULT STORAGE CLASS | CREATED AT | +------------------+----------------------+----------+-----------------------+---------------------+ | first-bucket | b1gmit33ngp6******** | 0 | STANDARD | 2022-12-16 13:58:18 | +------------------+----------------------+----------+-----------------------+---------------------+
-
Using the
NAME
column, save the name of the bucket to limit the size for. -
Limit the maximum size of the bucket:
ncp storage bucket update \ --name <bucket_name> \ --max-size <maximum_bucket_size>
Where:
--name
: Name of the bucket to limit the size for.--max_size
: Maximum bucket size (bytes).0
: No limit.
Result:
name: first-bucket older_id: b1gmit33ngp6******** default_storage_class: STANDARD versioning: VERSIONING_DISABLED max_size: "26843545600" created_at: "2022-12-16T13:58:18.933814Z"