amazon-pricing 0.1.69 → 0.1.70
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/Gemfile.lock +1 -1
- data/lib/amazon-pricing/common/ec2_common.rb +2 -2
- data/lib/amazon-pricing/definitions/ec2-instance-type.rb +5 -3
- data/lib/amazon-pricing/definitions/rds-instance-type.rb +1 -1
- data/lib/amazon-pricing/ec2-price-list.rb +3 -2
- data/lib/amazon-pricing/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OWUyYTMwNDM1MGU5ZGM4MzM2MTYzZjZiZmI3ZjA2ZTYwZjkzMTU0Mg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NGE3OTFmYmMzNDU0MmRiNDA2ZTIxYjJiMGFhNzRjODRkZmRjYzNlYw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
M2ZiMTM1NTZjNGNhZWNkNGE4MWVmZGYxN2IzYTg4ZmU4NDVhYzM4ODVjMDQw
|
10
|
+
ZWU2OGI1ZTRmNDY1YWRmNzRkZDMzY2Q3MDE0MTJjZGE4YWE3NjYwZWZlNTlh
|
11
|
+
YTAwOWQzMDQ0NDM1NTgyY2NjMDIzYzI0NzIwNWEwNDgwZmE5MWI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NWUxZTRlNDczNTVmMTE1NWEyNjIyNjU0ODhiY2JjMzIwN2E2ZTcyNWFjOGRk
|
14
|
+
YTJmZGY0ZjU4ZWQ1MzI2OTZkMDYwOTIwOTlhYzdmOGU1ZTBiMzMwYzRlNmY4
|
15
|
+
Njg5ZjNlZDA1ZTU2ODZiZWM1MzNmNTllNDE3NTJkYzUxZjQ3ZmY=
|
data/Gemfile.lock
CHANGED
@@ -63,10 +63,10 @@ module AwsPricing
|
|
63
63
|
prices = option["valueColumns"]
|
64
64
|
upfront = prices.select{|i| i["name"] == "upfront"}.first
|
65
65
|
price = upfront["prices"]["USD"]
|
66
|
-
instance_type.update_pricing_new(operating_system, reservation_type, price
|
66
|
+
instance_type.update_pricing_new(operating_system, reservation_type, price, duration, true) unless reservation_type == :noupfront || price == "N/A"
|
67
67
|
hourly = prices.select{|i| i["name"] == "monthlyStar"}.first
|
68
68
|
price = hourly["prices"]["USD"]
|
69
|
-
instance_type.update_pricing_new(operating_system, reservation_type, price
|
69
|
+
instance_type.update_pricing_new(operating_system, reservation_type, price, duration, false) unless reservation_type == :allupfront || price == "N/A"
|
70
70
|
end
|
71
71
|
end
|
72
72
|
|
@@ -28,15 +28,17 @@ module AwsPricing
|
|
28
28
|
@category_types[operating_system] = os
|
29
29
|
end
|
30
30
|
|
31
|
+
p = coerce_price(price)
|
32
|
+
|
31
33
|
if type_of_instance == :ondemand
|
32
|
-
os.set_price_per_hour(type_of_instance, nil,
|
34
|
+
os.set_price_per_hour(type_of_instance, nil, p)
|
33
35
|
else
|
34
36
|
years = :year1 if term == "yrTerm1"
|
35
37
|
years = :year3 if term == "yrTerm3"
|
36
38
|
if is_prepay
|
37
|
-
os.set_prepay(type_of_instance, years,
|
39
|
+
os.set_prepay(type_of_instance, years, p)
|
38
40
|
else
|
39
|
-
os.set_price_per_hour(type_of_instance, years,
|
41
|
+
os.set_price_per_hour(type_of_instance, years, p * 12 / 365 / 24)
|
40
42
|
end
|
41
43
|
end
|
42
44
|
end
|
@@ -110,7 +110,7 @@ module AwsPricing
|
|
110
110
|
}
|
111
111
|
years = terms_to_years[term]
|
112
112
|
prices.each do |price|
|
113
|
-
p = price['prices']['USD']
|
113
|
+
p = coerce_price(price['prices']['USD'])
|
114
114
|
case price['name']
|
115
115
|
when 'upfront'
|
116
116
|
db.set_prepay(type_of_instance, years, p.to_f) unless type_of_instance == :noupfront || p == "N/A"
|
@@ -14,10 +14,11 @@ module AwsPricing
|
|
14
14
|
protected
|
15
15
|
|
16
16
|
@@OS_TYPES = [:linux, :mswin, :rhel, :sles, :mswinSQL, :mswinSQLWeb]
|
17
|
+
@@NEW_OS_TYPES = [:mswinSQLEnterprise]
|
17
18
|
@@LEGACY_RES_TYPES = [:light, :medium, :heavy]
|
18
19
|
|
19
20
|
def get_ec2_on_demand_instance_pricing
|
20
|
-
@@OS_TYPES.each do |os|
|
21
|
+
(@@OS_TYPES + @@NEW_OS_TYPES).each do |os|
|
21
22
|
fetch_ec2_instance_pricing(EC2_BASE_URL + "#{os}-od.min.js", :ondemand, os)
|
22
23
|
end
|
23
24
|
# Rinse & repeat for legacy instances
|
@@ -43,7 +44,7 @@ module AwsPricing
|
|
43
44
|
|
44
45
|
def get_ec2_reserved_instance_pricing
|
45
46
|
# I give up on finding a pattern so just iterating over known URLs
|
46
|
-
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}
|
47
|
+
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, "windows-with-sql-server-enterprise" => :mswinSQLEnterprise}
|
47
48
|
page_targets.each_pair do |target, operating_system|
|
48
49
|
url = "#{EC2_BASE_URL}ri-v2/#{target}-shared.min.js"
|
49
50
|
fetch_ec2_instance_pricing_ri_v2(url, operating_system)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: amazon-pricing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.70
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joe Kinsella
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A Ruby library for retrieving pricing for Amazon Web Services
|
14
14
|
email:
|