Class: AWSPricing::EC2

Inherits:
Object
  • Object
show all
Defined in:
lib/aws-pricing/ec2.rb

Class Method Summary collapse

Class Method Details

.cloud_watchObject

Returns Hash of Cloudwatch monitoring pricing information



35
36
37
# File 'lib/aws-pricing/ec2.rb', line 35

def self.cloud_watch
  Base.get('/ec2/pricing/pricing-cloudwatch.json')
end

.data_transferObject

Returns Hash of data transfer pricing information



25
26
27
# File 'lib/aws-pricing/ec2.rb', line 25

def self.data_transfer
  Base.get('/ec2/pricing/pricing-data-transfer.json')
end

.ebsObject

Returns Hash of elastic block storage pricing information



20
21
22
# File 'lib/aws-pricing/ec2.rb', line 20

def self.ebs
  Base.get('/ec2/pricing/pricing-ebs.json')
end

.elastic_ipsObject

Returns Hash of elastic IP pricing information



30
31
32
# File 'lib/aws-pricing/ec2.rb', line 30

def self.elastic_ips
  Base.get('/ec2/pricing/pricing-elastic-ips.json')
end

.elbObject

Returns Hash of elastic loadbalancer pricing information



40
41
42
# File 'lib/aws-pricing/ec2.rb', line 40

def self.elb
  Base.get('/ec2/pricing/pricing-elb.json')
end

.instancesObject

Returns Hash of on-demand server instance pricing information



7
8
9
# File 'lib/aws-pricing/ec2.rb', line 7

def self.instances
  Base.get('/ec2/pricing/pricing-on-demand-instances.json')
end

.spot_instancesObject

Returns Hash of current spot instance pricing information (5m)



12
13
14
15
16
17
# File 'lib/aws-pricing/ec2.rb', line 12

def self.spot_instances
  callback_response = Net::HTTP.get_response(URI.parse 'http://spot-price.s3.amazonaws.com/spot.js').body
  callback_response.gsub!('callback(','')
  callback_response.slice!(callback_response.length-1)
  JSON.parse callback_response
end