class AwsCli::CLI::DYNAMO::Table

Public Instance Methods

create() click to toggle source
# File lib/awscli/cli/dynamo/table.rb, line 42
def create
  #name should be > 3 and can contain a-z, A-Z, 0-9, _, .
  #type should be in N, NS, S, SS
  #read and write capacity in between 5..10000
  create_dynamo_object
  @ddb.create options
end
delete() click to toggle source
# File lib/awscli/cli/dynamo/table.rb, line 52
def delete
  create_dynamo_object
  @ddb.delete options[:name]
end
info() click to toggle source
# File lib/awscli/cli/dynamo/table.rb, line 17
def info
  create_dynamo_object
  @ddb.describe options[:name]
end
list() click to toggle source

method_option :exclusive_start_table_name, :aliases => ‘-e’, :banner => ‘NAME’, :desc => ‘The name of the table that starts the list’

# File lib/awscli/cli/dynamo/table.rb, line 10
def list
  create_dynamo_object
  @ddb.list options
end
update() click to toggle source
# File lib/awscli/cli/dynamo/table.rb, line 61
def update
  create_dynamo_object
  @ddb.update options
end

Private Instance Methods

create_dynamo_object() click to toggle source
# File lib/awscli/cli/dynamo/table.rb, line 68
def create_dynamo_object
  puts 'Dynamo Establishing Connection...'
  $dynamo_conn =  if parent_options[:region]
                    Awscli::Connection.new.request_dynamo(parent_options[:region])
                  else
                    Awscli::Connection.new.request_dynamo
                  end
  puts 'Dynamo Establishing Connection... OK'
  @ddb = Awscli::DynamoDB::Table.new($dynamo_conn)
end