class AWSPricing::EC2
Constants
- EC2_BASE_URL
Elastic Compute pricing data
- EC2_RESERVED_BASE_URL
Public Class Methods
cloud_watch()
click to toggle source
Returns Hash of Cloudwatch monitoring pricing information
# File lib/aws-pricing/products/ec2.rb, line 49 def self.cloud_watch Base.get(EC2_BASE_URL + 'cloudwatch') end
data_transfer()
click to toggle source
Returns Hash of data transfer pricing information
# File lib/aws-pricing/products/ec2.rb, line 39 def self.data_transfer Base.get(EC2_BASE_URL + 'data-transfer') end
ebs()
click to toggle source
Returns Hash of elastic block storage pricing information
# File lib/aws-pricing/products/ec2.rb, line 34 def self.ebs Base.get(EC2_BASE_URL + 'ebs') end
elastic_ips()
click to toggle source
Returns Hash of elastic IP pricing information
# File lib/aws-pricing/products/ec2.rb, line 44 def self.elastic_ips Base.get(EC2_BASE_URL + 'elastic-ips') end
elb()
click to toggle source
Returns Hash of elastic loadbalancer pricing information
# File lib/aws-pricing/products/ec2.rb, line 54 def self.elb Base.get(EC2_BASE_URL + 'elb') end
instances()
click to toggle source
Returns Hash of on-demand server instance pricing information
# File lib/aws-pricing/products/ec2.rb, line 11 def self.instances Base.get(EC2_BASE_URL + 'on-demand-instances') end
reserved_instances(options = {})
click to toggle source
Returns Hash of reserved server instance pricing information
# File lib/aws-pricing/products/ec2.rb, line 16 def self.reserved_instances(options = {}) opts = { :os => 'linux', :utilization => 'heavy' }.merge(options) raise "AWSPricing: Invalid OS" unless /^linux|mswin+$/ =~ opts[:os].to_s raise "AWSPricing: Invalid Utilization" unless /^light|medium|heavy$/ =~ opts[:utilization].to_s Base.get(EC2_RESERVED_BASE_URL + "ri-#{opts[:utilization]}-#{opts[:os]}") end
spot_instances()
click to toggle source
Returns Hash of current spot instance pricing information (5m)
# File lib/aws-pricing/products/ec2.rb, line 26 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