amazon-pricing 0.1.52 → 0.1.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZjhmYmJjYTBkNmVmYzk3NWUwM2FhZTk4ZTFhZGQ4MjM5NTg1YWE0Nw==
4
+ ZTE5NzY3ZTgxMWJiMzJlN2E5ZjEyN2U0YjZmYTQxODE5OGU0ZjY4Mw==
5
5
  data.tar.gz: !binary |-
6
- NzdlMjYwNWRlMDBhZDA4ZWUxY2RmOWFhY2NhMjU4ZmRiYTA4NmMyNA==
6
+ NDkxOTg3NzlkMGVlNmEwNTRiNjUzZTVlYTlhYTUxMGE3NjYwMmZmYw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YTI2ZGQwZGRiZjUxNjEyNDlhZTkwMWM5MmI5NjAzM2RlMDAxZTFlZTY0OTAw
10
- NTY1YTZmMWJiZmUwNWM3N2MwMjZmODlmZjNjYTIxYmJhNDllOGNkNTEzMTEx
11
- Y2QxOTI3OGZlODUyOTdhZjIyZWQxZjE3MDljM2QzYTIwZTljNTQ=
9
+ MWRlOWM5NDk2NzFjMzUxYzRjNWM3OTIwMTNkMzJmNWQ0OTQ2NzYxY2E3MWQ4
10
+ MDI2N2FjOWEwZmUzOTU4YjM4NGU4MzAyZjhkOTY3YzBhZjU1Zjc5NjM0NTMz
11
+ ZWUwZTU2MjIzZTFiNzFmMDgyYjg0MTg4MjQ4OTNmNGNlOGE2Mjk=
12
12
  data.tar.gz: !binary |-
13
- YTY1NTI5MWE5Njg1Y2VhYjA0MmJiNDcwYTM1MjMzZDdlMTEzNThmZWQ4YTU2
14
- MmE1MmJjMTI2NDQ0NjFjNDM4MjhmMjg0YjQ3Y2I5YzI0NjI0MjRkYjhmN2Jj
15
- NTYwZGIxNDliMGU3ZjBkOGFiNzExNDBjMGRlMzczZTIyNTVmYjI=
13
+ YWQyYWI5MjcyYmVhOGIxYjE2NDIyMzFhNWFiMTYwZGUzMjllNDVhNDdjYWNk
14
+ NDQ4OGRhNzJkYTk2ZWQyOTgzMDQyZWJiN2FmNWNjNjQ3YjNiMTVhYTU4YjQz
15
+ NDQ5ODJkM2NlNjU5ZmY2ZGMyOGZjNzEyM2MwZWQyYzgzMjBhYTg=
@@ -8,5 +8,5 @@
8
8
  # Home:: http://github.com/CloudHealth/amazon-pricing
9
9
  #++
10
10
  module AwsPricing
11
- VERSION = '0.1.52'
11
+ VERSION = '0.1.53'
12
12
  end
@@ -47,6 +47,14 @@ module AwsPricing
47
47
  url = "#{EC2_BASE_URL}ri-v2/#{target}-shared.min.js"
48
48
  fetch_ec2_instance_pricing_ri_v2(url, operating_system)
49
49
  end
50
+
51
+ # I give up on finding a pattern so just iterating over known URLs
52
+ page_targets = {"linux-unix" => :linux, "red-hat-enterprise-linux" => :rhel, "suse-linux" => :sles, "windows" => :mswin, "windows-with-sql-server-standard" => :mswinSQL, "windows-with-sql-server-web" => :mswinSQLWeb}
53
+ page_targets.each_pair do |target, operating_system|
54
+ url = "#{EC2_BASE_URL}previous-generation/ri-v2/#{target}-shared.min.js"
55
+ fetch_ec2_instance_pricing_ri_v2(url, operating_system)
56
+ end
57
+
50
58
  end
51
59
 
52
60
  # Retrieves the EC2 on-demand instance pricing.
@@ -119,6 +119,22 @@ class TestEc2InstanceTypes < Test::Unit::TestCase
119
119
  assert os.allupfront_effective_rate_3_year == 0.0388
120
120
  end
121
121
 
122
+ def test_new_reservation_types_for_legacy_instance
123
+ region = @@ec2_pricing.get_region('us-east')
124
+ instance = region.get_ec2_instance_type('m2.4xlarge')
125
+ os = instance.get_operating_system(:linux)
126
+ assert os.ondemand_price_per_hour == 0.980
127
+ assert os.partialupfront_prepay_1_year == 1894
128
+ assert os.allupfront_prepay_1_year == 3255
129
+ assert os.partialupfront_prepay_3_year == 2875
130
+ assert os.allupfront_prepay_3_year == 5839
131
+ assert os.noupfront_effective_rate_1_year == 0.444
132
+ assert os.partialupfront_effective_rate_1_year == 0.3792
133
+ assert os.allupfront_effective_rate_1_year == 0.3716
134
+ assert os.partialupfront_effective_rate_3_year == 0.2364
135
+ assert os.allupfront_effective_rate_3_year == 0.2222
136
+ end
137
+
122
138
  def test_bad_data
123
139
  # Someone at AWS is fat fingering the pricing data and putting the text "os" where there should be the actual operating system (e.g. "linux") - see http://a0.awsstatic.com/pricing/1/ec2/linux-od.min.js
124
140
  @@ec2_pricing.regions.each do |region|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amazon-pricing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.52
4
+ version: 0.1.53
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Kinsella