Sha256: fc285619b4cef9962caa3645a7ccd2dca406c780a8fdb8079fedcc6dfc1eee90

Contents?: true

Size: 1.16 KB

Versions: 3

Compression:

Stored size: 1.16 KB

Contents

module Sdbport
  class CLI
    class Import

      def import
        opts   = read_options
        logger = SdbportLogger.new :log_level => opts[:level]
        domain = Domain.new :name       => opts[:name],
                            :region     => opts[:region],
                            :access_key => opts[:access_key],
                            :secret_key => opts[:secret_key],
                            :logger     => logger
        unless domain.import opts[:input]
          exit 1
        end
      end

      def read_options
        Trollop::options do
          version Sdbport::VERSION
          banner <<-EOS

Import SimpleDB domain.

Usage:

sdbport import -a xxx -k yyy -r us-west-1 -i /tmp/file -n domain

EOS
          opt :help, "Display Help"
          opt :level, "Log Level", :type => :string, :default => 'info'
          opt :name, "Simple DB Domain Name", :type => :string
          opt :input, "Input File", :type => :string
          opt :region, "AWS region", :type => :string
          opt :access_key, "AWS Access Key ID", :type => :string
          opt :secret_key, "AWS Secret Access Key", :type => :string
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sdbport-0.2.0 lib/sdbport/cli/import.rb
sdbport-0.1.1 lib/sdbport/cli/import.rb
sdbport-0.1.0 lib/sdbport/cli/import.rb