Class: AWSPricing::EC2
- Inherits:
-
Object
- Object
- AWSPricing::EC2
- Defined in:
- lib/aws-pricing/ec2.rb
Class Method Summary collapse
-
.cloud_watch ⇒ Object
Returns Hash of Cloudwatch monitoring pricing information.
-
.data_transfer ⇒ Object
Returns Hash of data transfer pricing information.
-
.ebs ⇒ Object
Returns Hash of elastic block storage pricing information.
-
.elastic_ips ⇒ Object
Returns Hash of elastic IP pricing information.
-
.elb ⇒ Object
Returns Hash of elastic loadbalancer pricing information.
-
.instances ⇒ Object
Returns Hash of on-demand server instance pricing information.
-
.spot_instances ⇒ Object
Returns Hash of current spot instance pricing information (5m).
Class Method Details
.cloud_watch ⇒ Object
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_transfer ⇒ Object
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 |
.ebs ⇒ Object
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_ips ⇒ Object
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 |
.elb ⇒ Object
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 |
.instances ⇒ Object
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_instances ⇒ Object
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 |