LogoLogo
AboutOORT AIOORT StorageOORT Edge
  • What is OORT Storage
  • Getting Started
    • How it works
    • User Guide
      • Sign Up
      • Create a Bucket
      • Upload an Object
      • Download an Object
      • Delete Objects or Buckets
    • Billing and Pricing
      • Free Tier, Always Free
      • Pay-as-you-go Pricing
      • OORT Credits
      • Manage Your Payments
  • Manage Storage
    • Work with Buckets
    • Work with Objects
      • Objects Overview
      • Object Keys
      • Object Details
      • Upload Objects
      • Multipart Upload
      • Download Objects
      • Delete Objects
      • Share Objects
      • Use Folders
    • Storage Classes
    • Access Control
    • Tools and Clients
      • Use Rclone
      • Use AWS CLI
      • Use S3 Browser
      • Use Arq Backup
      • Use TntDrive
    • Sync files to OORT Storage
      • Step 1: Download the rclone
      • Step 2: Do the OORT Storage remote configuration
      • Step 3: Check where your files are stored in?
        • Google Drive
        • Amazon Drive
        • Tencent Cloud Object Storage (COS)
        • Alibaba Cloud (Aliyun) Object Storage System (OSS)
        • IPFS
        • Others
      • Step 4: Check the configuration
      • Step 5: Do the files syncs
  • Developing with OORT Storage
    • Access Keys
    • Use S3-Compatible API
  • OORT Storage for Business
    • Web3 Web Hosting
      • Upload Website
      • Backend Hosting
      • Publishing
Powered by GitBook
On this page
  • Prerequisites
  • Configure AWS CLI
  • Crete a bucket
  • Display buckets
  • Upload a file
  • List files in a bucket
  • Move a file
  • Copy a file
  • Download a file
  • Download a folder
  • Delete a file
  1. Manage Storage
  2. Tools and Clients

Use AWS CLI

How to Use the AWS CLI to Interact with OORT Storage S3 Compatible API.

PreviousUse RcloneNextUse S3 Browser

Last updated 1 year ago

What is AWS CLI?

The AWS CLI or Amazon Web Services Command Line Interface is a command-line tool developed by Amazon in Python to transfer data to an object storage service. This is one of the most used CLI tools for IT system administrators, developers, and programmers. Although this tool was developed by Amazon, you can use it with any S3-compatible API object storage service, including OORT Storage, to manage your storage objects and buckets.

For more information on AWS CLI, see .

Prerequisites

Access Key and Access Secret Keys will be stored in the AWS CLI configuration file, but each command needs to reference the API endpoint.

Configure AWS CLI

  1. First, configure the AWS CLI to use OORT Storage. To do this, open a new terminal window. From there, run the command:

aws configure

The command will generate a series of prompts, fill in the following:

  • Access Key ID: Vault Access Key

  • Secret Access Key: Vault Secret Key

  • Region: us-east-1

  • Output Format:Optional

aws configure set default.s3.signature_version s3v4
  1. After completing the prompts, start using the AWS CLI tools to interact with the OORT Storage S3 Compatible API. As long as your access ID and secret access key remain the same, you do not need to configure the AWS CLI again.

All AWS CLI commands will start with the section following this initial command, which will determine what to do and what bucket to use.

OORT Storage Endpoint API:

aws --endpoint https://s3-standard.oortech.com

Crete a bucket

To create a new bucket on OORT Storage using the AWS CLI, use the following command:

aws --endpoint https://s3-standard.oortech.com s3 mb s3://[bucket-name]

For example, to create a new bucket named "mybucket":

aws --endpoint https://s3-standard.oortech.com s3 mb s3://mybucket

Bucket names must be unique across all Oort users, be between 3 and 63 characters long, and can only contain lowercase characters, numbers, and dashes.

The terminal should return the following line:

make_bucket: mybucket

Display buckets

The following command will list all buckets in your Oort account:

aws --endpoint https://s3-standard.oortech.com s3 ls

Upload a file

To upload a single file, use the following command:

aws --endpoint https://s3-standard.oortech.com s3 cp [filename] s3://[bucket-name]

For example, to upload a file named "myphoto.png" to the bucket "mybucket":

aws --endpoint https://s3-standard.oortech.com s3 cp ~/Photos/myphoto.png s3://mybucket

To verify that this file was uploaded by listing the contents of the bucket with the command used earlier: s3 ls

aws --endpoint https://s3-standard.oortech.com s3 ls s3://mybucket

To upload multiple objects, use the following command:

aws --endpoint https://s3-standard.oortech.com s3 sync [folder name] s3://[bucket-name]

For example, to upload the contents of a folder named "Photos", use the following command:

aws --endpoint https://s3-standard.oortech.com s3 sync ~/Photos/ s3://mybucket/Photos/

List files in a bucket

To list the files of a bucket, use the following command:

aws --endpoint https://s3-standard.oortech.coms3 ls s3://[bucket-name]

For example, to list the files of 'mybucket':

aws --endpoint https://s3-standard.oortech.com s3 ls s3://mybucket

Move a file

To move from bucket 1 to bucket 2, use the following command:

aws --endpoint-url https://s3-standard.oortech.com s3 mv s3://[bucket-name1]/[file-name] s3://[bucket-name2]/

Copy a file

To copy from bucket 1 to bucket 2, use the following command:

aws --endpoint-url https://s3-standard.oortech.com s3 cp s3://[bucket-name1]/[file-name] s3://[bucket-name2]/

Download a file

To download a single file, use the following command:

aws --endpoint https://s3-standard.oortech.com s3 cp s3://[bucket-name]/[file-name] /path/to/download/filename

For example, to download a file named "myphoto.png" from the bucket "mybucket":

aws --endpoint https://s3-standard.oortech.com s3 cp s3://mybucket/Photos/myphoto.png ~/Photos/myphoto.png

Download a folder

To download a folder, use the following command:

aws --endpoint https://s3-standard.oortech.com s3 cp --recursive s3://[bucket-name]/[folder name] /path/to/download/folder

For example, to upload the contents of a folder named "photos", use the following command:

aws --endpoint https://s3-standard.oortech.com s3 cp --recursive s3://mybucket/photos ~/Photos

Delete a file

To delete files, use the following command:

aws --endpoint https://s3-standard.oortech.com s3 rm s3://[bucket_name]/[file_name]

Delete all files in a bucket

To delete all files in the bucket, use the following command:

aws --endpoint https://s3-standard.oortech.com s3 rm --recursive s3://[bucket_name]/

For example, to delete all files from the bucket "mybucket":

aws --endpoint https://s3-standard.oortech.com s3 rm --recursive s3://mybucket/

Generate a presigned S3 URL using the AWS CLI

To create a presigned URL using the AWS CLI, use the following command syntax:

aws s3 --endpoint https://s3-standard.oortech.com presign s3://mybucket/file.name

This command should return a presigned URL. By default, the expiration time is one hour.

You can specify different expiration times by adding flags and minutes. --expires-in

Standard:

Archive:

To verify that this file is available from the web console, go to

AWS CLI Help
Download and install
Sign up
here
https://s3-standard.oortech.com
https://s3-archive.oortech.com
https://console.oortech.com