The following S3 APIs are supported:
-
PutObject
-
CreateMultipartUpload
-
UploadPart
-
CompleteMultipartUpload
-
AbortMultipartUpload
-
ListObjects
-
ListObjectsV2
-
ListMultipartUploads
-
GetObject
-
DeleteObject
-
DeleteObjects
-
HeadObject
-
HeadBucket
S3-putObject
AWS CLI put-object
You can upload an object to your S3 bucket using the Amazon S3 API.
aws --endpoint https://$[endpoint_FQDN]:5005/S3 s3 cp $[source file] s3://$[S3 Vault name] $[key name]
aws --endpoint https://$[endpoint_FQDN]:5005/S3 s3api put-object --bucket $[S3 Vault name] --key $[key name] --body $[source file]{endpoint_FQDN}:5005/S3: Specifies the endpoint URL of the S3-compatible storage.{source file}: The local file that you want to upload to the S3 bucket.{S3 Vault name}: The name of the target S3 bucket (or S3 Vault).{key name}: The key (path) in the S3 bucket where the file will be stored.
Example Use Case: CockroachDB Backup
The S3 Vault can serve as a repository for storing your CockroachDB backups. To take a full backup of a cluster from the CockroachDB terminal:
BACKUP INTO 's3://{BUCKET_NAME}?AWS_ACCESS_KEY_ID={KEY_ID}&AWS_SECRET_ACCESS_KEY={SECRET_ACCESS_KEY}&AWS_ENDPOINT={ENDPOINT_URL}'
For more information, see the Cockroach Labs documentation site, Backup page.
S3-listObjects
AWS CLI list-objects
You can browse the contents of your S3 bucket using the Amazon S3 API.
aws --endpoint-url https://$[endpoint_FQDN]:5005/S3 s3api list-objects --bucket $[S3 Vault name] --prefix $[prefix] where:
{endpoint_FQDN}:5005/S3: Specifies the endpoint URL of the S3-compatible storage.{S3 Vault name}: The name of the S3 bucket (or S3 Vault) whose contents you want to list.<prefix>: Filters the results to include only objects with keys that start with the specified prefix.
List Objects from Command Center
-
From the Command Center navigation pane, go to Manage > Infrastructure.
The Infrastructure page appears.
-
Click the S3 Vault tile.
The S3 Vault page appears.
-
Click the S3 Vault that you want to browse.
The S3 vault overview page appears.
-
To view the contents of the S3 Vault, in the upper-right area of the page, click List objects.
S3-getObject
AWS CLI get-object
You can retrieve an object from your S3 bucket using the Amazon S3 API.
aws --endpoint https://$[endpoint_FQDN]:5005/S3 s3 cp s3://$[S3 Vault name] $[key name] {output file}
aws --endpoint https://$[endpoint_FQDN]:5005/S3 s3api get-object --bucket $[S3 Vault name] --key $[key name] {output file}{endpoint_FQDN}:5005/S3: Specifies the endpoint URL of the S3-compatible storage.{S3 Vault name}: The name of the S3 bucket (or S3 Vault) where the object is stored.{key name}: The key (path) of the object within the bucket that you want to retrieve.{output file}: The local file name where the retrieved object will be saved.
Restore from Command Center
-
From the Command Center navigation pane, go to Manage > Infrastructure.
The Infrastructure page appears.
-
Click the S3 Vault tile.
The S3 Vault page appears.
-
Click the S3 Vault that you want to browse.
The S3 vault overview page appears.
-
To view the contents of the S3 Vault, in the upper-right area of the page, click List objects.
The Vault Content page appears.
-
Select the objects to recover, and then click Recover.
The Recover options dialog box appears.
-
Click Submit.
Example Use Case: CockroachDB Restore
You can restore a CockroachDB database from an S3 Vault.
RESTORE DATABASE $[database_name] FROM LATEST IN 's3://$[s3vault_name]/$[folder]?AWS_ACCESS_KEY_ID=$[key]&AWS_SECRET_ACCESS_KEY=$[secret]&AWS_ENDPOINT=$[endpoint_info]';where:
<database_name>: The name of the database you want to restore.<s3vault_name>: The name of the S3 Vault where the backup is stored.<folder>: The folder path within the S3 Vault where the backup is located.<key>: The AWS access key ID used to authenticate access to the S3 Vault.<secret>: The AWS secret access key used to authenticate access to the S3 Vault.<endpoint_info>: The endpoint URL of the S3-compatible storage.
S3-deleteObject
AWS CLI delete-object
You can delete an object from your S3 bucket using the Amazon S3 API.
aws --endpoint-url https://$[endpoint_FQDN]500/S3 s3api delete-object --bucket $[S3 Vault name] --key $[key name]where:
{endpoint_FQDN}:5005/S3: Specifies the endpoint URL of the S3-compatible storage.$[S3 Vault name]: The name of the S3 bucket (or S3 Vault) where the object is stored.{key name}: The key (path) of the object within the bucket that you want to delete.