Class: Awsprice::EC2
Constant Summary collapse
- EC2_BASE_URL =
attr_accessor :all_instances, :ondemand_instances
"http://a0.awsstatic.com/pricing/1/ec2/"
- @@OS_TYPES =
EC2_BASE_URL = “aws-assets-pricing-prod.s3.amazonaws.com/pricing/ec2/”
[:linux, :mswin, :rhel, :sles, :mswinSQL, :mswinSQLWeb]
- @@RES_TYPES =
[:medium, :heavy]
Instance Method Summary collapse
- #get_price_ondemand ⇒ Object
- #get_price_reserved_heavy ⇒ Object
- #get_price_reserved_medium ⇒ Object
- #get_spec ⇒ Object
-
#initialize ⇒ EC2
constructor
A new instance of EC2.
Methods inherited from Info
Constructor Details
#initialize ⇒ EC2
Returns a new instance of EC2.
57 58 59 60 61 62 63 64 65 |
# File 'lib/awsprice.rb', line 57 def initialize @ec2_spec = {} @ec2_ondemand_price = [] @ec2_medium_reserved_price = [] @ec2_heavy_reserved_price = [] # unless File.exist? "awsprice.pstore" crawl # end end |
Instance Method Details
#get_price_ondemand ⇒ Object
81 82 83 84 85 86 |
# File 'lib/awsprice.rb', line 81 def get_price_ondemand @ec2_ondemand_price # @ec2_ondemand_price.each do |price| # puts "#{price.region} #{price.size} #{price.os} #{price.price_per_hour}" # end end |
#get_price_reserved_heavy ⇒ Object
74 75 76 77 78 79 |
# File 'lib/awsprice.rb', line 74 def get_price_reserved_heavy @ec2_heavy_reserved_price # @ec2_heavy_reserved_price.each do |price| # puts "#{price.region} #{price.size} #{price.os} #{price.yrTerm1} #{price.yrTerm1Hourly}, #{price.yrTerm3}, #{price.yrTerm3Hourly}" # end end |
#get_price_reserved_medium ⇒ Object
67 68 69 70 71 72 |
# File 'lib/awsprice.rb', line 67 def get_price_reserved_medium @ec2_medium_reserved_price # @ec2_medium_reserved_price.each do |price| # puts "#{price.region} #{price.size} #{price.os} #{price.yrTerm1} #{price.yrTerm1Hourly}, #{price.yrTerm3}, #{price.yrTerm3Hourly}" # end end |
#get_spec ⇒ Object
88 89 90 91 92 93 |
# File 'lib/awsprice.rb', line 88 def get_spec @ec2_spec.values # @ec2_spec.each do |key, ins| # puts "#{ins.size} #{ins.type} #{ins.memory}, #{ins.ecu}, #{ins.vcpu}, #{ins.storage}" # end end |