Choose your storage product

Polycloud

Object Storage

10 GB FREE

Device Backup

WD My Cloud Home

 

Choose your storage product

Polycloud

Object Storage

10 GB FREE

Device Backup

WD My Cloud Home

 

AWS SDK for Ruby

Installation:

$ gem install aws-sdk-s3

Create a file named `list.rb` with the following contents (substituting `mybucket`, `<your access key>`. `<your secret>` with your information):

require 'aws-sdk-s3' # v2: require 'aws-sdk'

s3 = Aws::S3::Client.new(
  endpoint: "https://polycloud.crowdapis.com",
  access_key_id: "<your access key>",
  secret_access_key: "<your secret>",
  region: 'us-east-1'
)

resp = s3.list_objects(bucket: 'mybucket')
resp.contents.each do |object|
  puts "#{object.key}"
end

Run the example:

$ ruby list.rb