Containers
Creating
To create an S3 container:
In the Control panel, go to Object storage → Containers.
Click Create button.
Specify a name for the container you are creating. It is acceptable to use Latin letters in a DNS-compatible format. Naming rules:
The name must be in lowercase.
Allowed characters: ‘a-z’, ‘0-9’, ‘-’, ‘.’.
The name must begin and end with a letter or number.
The name must be at least 3 and no more than 255 characters long.
There must be at least three characters between periods in the name.
Select the container access type:
Private – only authorized users will have access to the container.
Public objects – anyone can read objects without additional authorization. However, reading the list of objects without authorization is prohibited.
Public full – all internet users have full read access to the container and objects without additional authorization.
Select the storage region.
Note
Currently, we are working on availability of the Object storage in 3HCloud regions
Click the Create Container button.
Billing
Data storage in Object storage: $0,008/GB per month.
Incoming traffic to Object Storage: $0.00/GB.
Outgoing traffic from Object storage:
To other 3HCloud services in the region: $0.00/GB.
To the Internet: $0,008/GB.
Settings
The created container will appear in the Object storage → Containers section.
To further configure the container, click the More button.
To upload files to the container, click Upload and select the desired files, or drag and drop files to the designated area. You can combine files into folders and, if necessary, delete unnecessary ones.
To change a container’s access type, click the Edit button in the Access type section, select the desired access type, and click Save:
If you select Public objects, each uploaded object will have a personalized link for accessing the object without authorization.
If you select Public full, a link will appear for accessing the container, which opens an XML file with a list of the container’s objects.
Removing
To remove the container:
In the Control panel, go to Object storage → Containers.
Open the settings for the desired container by clicking Details.
Attention
Deleting a container is only possible after deleting all hosted objects.
Select all objects in the container and click Delete.
If there are folders, delete each folder individually by clicking the trash can icon.
After deleting all files and folders, click Delete and confirm the deletion.
Installing AWS-CLI
Installing AWS-CLI
There are several ways to install AWS-CLI, depending on your operating system:
On Microsoft Windows, use the MSI installer.
On Linux or macOS, use pip (a package manager for Python software) or install it manually using the installer.
Installing with pip requires Python to be installed first (if it isn’t already installed). You can verify this by running:
python3 --version
pip3 --help
Assuming both are installed, use the following command to install the AWS CLI:
$ pip3 install awscli
If python3 and pip3 are not installed, run:
$ sudo apt install python3 -y # for Debian, Ubuntu
$ sudo yum install python3 -y # for CentOS
$ sudo dnf install python3 -y # for CentOS8
$ Python3 -m Pip install
Next, install the awscli plugin:
pip3 install awscli-plugin-endpoint
Verify that the AWS CLI is installed correctly by reviewing the help file. Open a terminal, shell, or command prompt and run:
$ aws help
Configuring
After installation is complete, enter the connection address, access key, and EC2 secret key from your personal account into the created AWS configuration file:
$ mcedit .aws/config - you can use any text redactor utility;
[plugins]
endpoint = awscli_plugin_endpoint
[profile *any name*]
aws_access_key_id = *Your open EC2 key from account*
aws_secret_access_key = *Your closed EC2 key from account*
region = us-east-1
s3 =
endpoint_url = https://s3.mia.3hcloud.com
max_concurrent_requests = 20
signature_version = s3
addressing_style = auto
s3api =
endpoint_url = https://s3.mia.3hcloud.com
max_concurrent_requests = 20
Check the connection to the container:
$ aws --profile *profile name from config* s3 ls
2009-02-03 19:45:09 example
The command to view the files in the container:
$ aws --profile *profile name from config* s3 ls s3://example/
2022-04-08 14:23:57 12749 1.png
2022-05-18 16:02:30 110574 asbru_export.yml
2022-04-07 15:35:12 144817 photo_2022-04-07_15-34-05.jpg
2022-04-14 16:18:41 123186 photo_2022-04-14_16-17-51.jpg
2022-05-25 12:54:47 115560 vhod.jpg
2022-05-18 16:01:15 274181883 z.zip
2022-05-27 12:46:40 486018 George Clason.pdf
View file
For a more detailed view of files in the container, enter:
$ aws --profile *profile name from config* s3 ls s3://example/ --human --summarize
2022-04-08 14:23:57 12.5 KiB 1.png
2022-05-18 16:02:30 108.0 KiB asbru_export.yml
2022-04-07 15:35:12 141.4 KiB photo_2022-04-07_15-34-05.jpg
2022-04-14 16:18:41 120.3 KiB photo_2022-04-14_16-17-51.jpg
2022-05-25 12:54:47 112.9 KiB vhod.jpg
2022-05-18 16:01:15 261.5 MiB z.zip
2022-05-27 12:46:40 474.6 KiB George Clason.pdf
Total Objects: 7
Total Size: 262.4 MiB
Upload file
Uploading a file to a container is done with the command:
$ aws --profile *profile name from config* s3 cp "/home/PC/Download/RouterOS.raw" s3://example/
Delete file
Files in a container are deleted with the command:
$ aws --profile *profile name from config* s3 rm s3://example/RouterOS.raw
Available S3 API functions
When accessing object storage via the S3 API, the following functions can be used:
S3 REST API method |
Category |
Swift S3 API |
|---|---|---|
Core-API |
Yes |
|
Core-API |
Yes |
|
Core-API |
Yes |
|
Core-API |
Yes |
|
Core-API |
Yes |
|
Core-API |
Yes |
|
Core-API |
Yes |
|
Core-API |
Yes |
|
Core-API |
Yes |
|
Core-API |
Yes |
|
Core-API |
Yes |
|
Core-API |
Yes |
|
Core-API |
Yes |
|
Core-API |
Yes |
|
Core-API |
Yes |
|
Core-API |
Yes |
|
Versioning |
Yes |
|
Advanced Feature |
Yes |