Sha256: 88dd7233f66a141b165343391379556e2ac79be7675b668b297d6c6d02c87173
Contents?: true
Size: 1.16 KB
Versions: 54
Compression:
Stored size: 1.16 KB
Contents
module Rudy; module CLI; module AWS; module S3; class Buckets < Rudy::CLI::CommandBase def buckets raise "No bucket name supplied" if !@argv.name && @option.list s3 = Rudy::AWS::S3.new(@@global.accesskey, @@global.secretkey, @@global.region) unless @option.list (s3.list_buckets || []).each do |b| puts b.name end else puts "All objects in #{@argv.name}:" (s3.list_bucket_objects(@argv.name) || []).each do |o| puts o end end end def create_buckets_valid? raise "No bucket name supplied" unless @argv.name true end def create_buckets s3 = Rudy::AWS::S3.new(@@global.accesskey, @@global.secretkey, @@global.region) s3.create_bucket(@argv.name, @option.location) buckets end def destroy_buckets_valid? raise "No bucket name supplied" unless @argv.name true end def destroy_buckets execute_check(:medium) s3 = Rudy::AWS::S3.new(@@global.accesskey, @@global.secretkey, @@global.region) s3.destroy_bucket(@argv.name) buckets end end end; end end; end
Version data entries
54 entries across 54 versions & 3 rubygems