Class: AWS::SimpleDB::DomainMetadata

Inherits:
Object
  • Object
show all
Defined in:
lib/aws/simple_db/domain_metadata.rb

Overview

SimpleDB can report on the amount of data stored in a domain, the number of items, etc.

Examples:


sdb = SimpleDB.new
sdb.domains['mydomain']..to_h

# the hash returned above might look like:
{
  :timestamp => 1300841880,
  :attribute_names_size_bytes => 12,
  :item_count => 1,
  :attribute_value_count => 6,
  :attribute_values_size_bytes => 25,
  :item_names_size_bytes => 3,
  :attribute_name_count => 3
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(domain, options = {}) ⇒ DomainMetadata



53
54
55
56
# File 'lib/aws/simple_db/domain_metadata.rb', line 53

def initialize domain, options = {}
  @domain = domain
  super
end

Instance Attribute Details

#domainDomain (readonly)



59
60
61
# File 'lib/aws/simple_db/domain_metadata.rb', line 59

def domain
  @domain
end

Instance Method Details

#attribute_name_countInteger



74
75
76
# File 'lib/aws/simple_db/domain_metadata.rb', line 74

def attribute_name_count
  self.to_h[:attribute_name_count]
end

#attribute_names_size_bytesInteger



80
81
82
# File 'lib/aws/simple_db/domain_metadata.rb', line 80

def attribute_names_size_bytes
  self.to_h[:attribute_names_size_bytes]
end

#attribute_value_countInteger



86
87
88
# File 'lib/aws/simple_db/domain_metadata.rb', line 86

def attribute_value_count
  self.to_h[:attribute_value_count]
end

#attribute_values_size_bytesInteger



91
92
93
# File 'lib/aws/simple_db/domain_metadata.rb', line 91

def attribute_values_size_bytes
  self.to_h[:attribute_values_size_bytes]
end

#item_countInteger



62
63
64
# File 'lib/aws/simple_db/domain_metadata.rb', line 62

def item_count
  self.to_h[:item_count]
end

#item_names_size_bytesInteger



68
69
70
# File 'lib/aws/simple_db/domain_metadata.rb', line 68

def item_names_size_bytes
  self.to_h[:item_names_size_bytes]
end

#timestampInteger



97
98
99
# File 'lib/aws/simple_db/domain_metadata.rb', line 97

def timestamp
  self.to_h[:timestamp]
end

#to_hHash



103
104
105
106
# File 'lib/aws/simple_db/domain_metadata.rb', line 103

def to_h
  meta = client.(:domain_name => domain.name)
  ATTRIBUTES.inject({}) {|h,attr| h[attr] = meta.send(attr); h }
end