amazon-pricing 0.1.79 → 0.1.80
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,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
MWIzYmE4ZWJlNDZlMDY5MGZhZWFjMWUxNWFjMjIyNTYwNzNjYzFmYQ==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: b5ff36ef9d065335f01c797f71e0f94c133403a7
|
4
|
+
data.tar.gz: ff0dd6b03824b91e55635338252c7b81090a297a
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
NjQyYjE2MGI5MmE3NWU2ZTM1ZGIyNDI4ZDY0NGE1NTY4OGZiNTcyODRmZDJi
|
11
|
-
MjY4MDgzYjZhYjgxMWI0MmNkMjY2MGVhYzM2ZjgwZDg0YmM4MjU=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
NmU5YzMzN2RhZjhlMGYyYTFiMWNhYjI2OGM2NjM5NjMxZjEyMmEzOTUzNTY1
|
14
|
-
ZmE4ZjA0NTY4ZDAyNjA4MzY2NTE5ODU0ZmRhYmY3ZjhiZTFiOGU0YTVlNmQy
|
15
|
-
Y2YxOTRlZjJiNjI3YzAzMTBmN2MxMDQwYTNkYTlmYWM0N2MzZDA=
|
6
|
+
metadata.gz: 77d7a74737d375018197cb1387193e3eed503d118c0d1178e9cbc1e4000bcdfe4970632060b9fcf9a7702b4542fd457561ecb9f59d4f9ba54749486beaa61b1e
|
7
|
+
data.tar.gz: 76c4cd522a0438b13de357832d0f7b7250e7a672693740a6b7d854e9fc08b0f82e5332545898d60a7b97d7138b3184f868bb4959f01a516b47fc7c8b1dae3115
|
data/Gemfile.lock
CHANGED
@@ -116,12 +116,18 @@ module AwsPricing
|
|
116
116
|
end
|
117
117
|
end
|
118
118
|
|
119
|
+
# Returns the bytes/s capacity if defined, `nil` otherwise
|
119
120
|
def self.disk_bytes_per_sec_capacity(api_name)
|
120
|
-
PER_SEC_CAPACITIES[api_name]
|
121
|
+
if PER_SEC_CAPACITIES[api_name]
|
122
|
+
PER_SEC_CAPACITIES[api_name][0] * 1024 * 1024
|
123
|
+
end
|
121
124
|
end
|
122
125
|
|
126
|
+
# Returns the ops/s capacity if defined, `nil` otherwise
|
123
127
|
def self.disk_ops_per_sec_capacity(api_name)
|
124
|
-
PER_SEC_CAPACITIES[api_name]
|
128
|
+
if PER_SEC_CAPACITIES[api_name]
|
129
|
+
PER_SEC_CAPACITIES[api_name][1]
|
130
|
+
end
|
125
131
|
end
|
126
132
|
|
127
133
|
protected
|
@@ -119,6 +119,8 @@ module AwsPricing
|
|
119
119
|
when 'upfront'
|
120
120
|
db.set_prepay(type_of_instance, years, p.to_f) unless type_of_instance == :noupfront || p == "N/A"
|
121
121
|
when 'monthlyStar'
|
122
|
+
# note for partialupfront, this purposely differs from AWS' "effective hourly" since we do not
|
123
|
+
# include the amortization of the partialupfront cost into this rate.
|
122
124
|
db.set_price_per_hour(type_of_instance, years, p.to_f * 12 / 365 / 24) unless type_of_instance == :allupfront || p == "N/A"
|
123
125
|
else
|
124
126
|
# Do nothing for other names
|
@@ -39,12 +39,18 @@ module AwsPricing
|
|
39
39
|
:sqlserver=> {:sqlserver_ex=>["li-ex"], :sqlserver_web=>["li-web"], :sqlserver_se=>["li-se","byol"], :sqlserver_ee=>["byol"]}
|
40
40
|
}
|
41
41
|
|
42
|
+
# the following cli will extract all the URLs referenced on the AWS pricing page that fetch_reserved_rds_instance_pricing2 uses:
|
43
|
+
# curl http://aws.amazon.com/rds/pricing/ 2>/dev/null | grep 'pricing' |grep reserved-instances
|
42
44
|
@@RESERVED_DB_DEPLOY_TYPE2 = {
|
43
45
|
:mysql => {:mysql=>["standard","multiAZ"]},
|
44
46
|
:postgresql => {:postgresql=>["standard","multiAZ"]},
|
45
47
|
:oracle => {:oracle_se1=>["license-included-standard", "license-included-multiAZ"],
|
46
48
|
:oracle_se=>["byol-standard", "byol-multiAZ"]},
|
47
|
-
:sqlserver => {
|
49
|
+
:sqlserver => {
|
50
|
+
:sqlserver_ex =>["license-included-standard"],
|
51
|
+
:sqlserver_web=>["license-included-standard"],
|
52
|
+
:sqlserver_se =>["byol-standard", "byol-multiAZ", "license-included-standard", "license-included-multiAZ"],
|
53
|
+
:sqlserver_ee =>["byol-standard", "byol-multiAZ", "license-included-standard", "license-included-multiAZ"]},
|
48
54
|
:aurora => {:aurora => ["multiAZ"]},
|
49
55
|
:mariadb => {:mariadb => ["standard", "multiAZ"]}
|
50
56
|
}
|
@@ -53,8 +59,11 @@ module AwsPricing
|
|
53
59
|
:mysql => [:mysql],
|
54
60
|
:postgresql => [:postgresql],
|
55
61
|
:oracle_se1 => [:oracle_se1],
|
56
|
-
:oracle_se => [:oracle_se, :
|
57
|
-
:
|
62
|
+
:oracle_se => [:oracle_se, :oracle_ee],
|
63
|
+
:sqlserver_ex => [:sqlserver_ex],
|
64
|
+
:sqlserver_web=> [:sqlserver_web],
|
65
|
+
:sqlserver_se => [:sqlserver_se],
|
66
|
+
:sqlserver_ee => [:sqlserver_ee],
|
58
67
|
:aurora => [:aurora],
|
59
68
|
:mariadb => [:mariadb]
|
60
69
|
}
|
@@ -119,7 +128,23 @@ module AwsPricing
|
|
119
128
|
# We believe Amazon made a mistake by hosting aurora's prices on a url that follows the multi-az pattern.
|
120
129
|
# Therefore we'll construct the URL as multi-az, but still treat the prices as for single-az.
|
121
130
|
is_multi_az = deploy_type.upcase.include?("MULTIAZ") && db != :aurora
|
122
|
-
|
131
|
+
|
132
|
+
# map sqlserver to aws strings (notice '-' between sql-server)
|
133
|
+
case db
|
134
|
+
when :sqlserver_se
|
135
|
+
db_str = 'sql-server-se'
|
136
|
+
when :sqlserver_ee
|
137
|
+
db_str = 'sql-server-ee'
|
138
|
+
when :sqlserver_web
|
139
|
+
db_str = 'sql-server-web'
|
140
|
+
when :sqlserver_ex
|
141
|
+
db_str = 'sql-server-express'
|
142
|
+
else
|
143
|
+
db_str = db.to_s.gsub(/_/, '-')
|
144
|
+
end
|
145
|
+
|
146
|
+
# nb: the intersection of @@RESERVED_DB_DEPLOY_TYPE2 and @@RESERVED_DB_WITH_SAME_PRICING2 should
|
147
|
+
# not overlap, since they have different pricings
|
123
148
|
dbs_with_same_pricing = @@RESERVED_DB_WITH_SAME_PRICING2[db]
|
124
149
|
fetch_reserved_rds_instance_pricing2(RDS_BASE_URL+"reserved-instances/#{db_str}-#{deploy_type}.min.js", dbs_with_same_pricing, is_multi_az, is_byol)
|
125
150
|
end
|
@@ -128,6 +153,7 @@ module AwsPricing
|
|
128
153
|
end
|
129
154
|
|
130
155
|
def fetch_reserved_rds_instance_pricing2(url, dbs, is_multi_az, is_byol)
|
156
|
+
#logger.debug "[#{__method__}] fetched #{url}"
|
131
157
|
res = PriceList.fetch_url(url)
|
132
158
|
res['config']['regions'].each do |reg|
|
133
159
|
region_name = reg['region']
|
@@ -211,6 +237,7 @@ module AwsPricing
|
|
211
237
|
end
|
212
238
|
|
213
239
|
def fetch_on_demand_rds_instance_pricing(url, type_of_rds_instance, db_type, is_byol, is_multi_az = false)
|
240
|
+
#logger.debug "[#{__method__}] fetched #{url}"
|
214
241
|
res = PriceList.fetch_url(url)
|
215
242
|
res['config']['regions'].each do |reg|
|
216
243
|
region_name = reg['region']
|
@@ -242,6 +269,7 @@ module AwsPricing
|
|
242
269
|
end
|
243
270
|
|
244
271
|
def fetch_reserved_rds_instance_pricing(url, type_of_rds_instance, db_type, is_byol)
|
272
|
+
#logger.debug "[#{__method__}] fetched #{url}"
|
245
273
|
res = PriceList.fetch_url(url)
|
246
274
|
res['config']['regions'].each do |reg|
|
247
275
|
region_name = reg['region']
|
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.80
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joe Kinsella
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A Ruby library for retrieving pricing for Amazon Web Services
|
14
14
|
email:
|
@@ -19,7 +19,7 @@ extra_rdoc_files:
|
|
19
19
|
- LICENSE
|
20
20
|
- README.md
|
21
21
|
files:
|
22
|
-
- .gitignore
|
22
|
+
- ".gitignore"
|
23
23
|
- CHANGELOG.md
|
24
24
|
- Gemfile
|
25
25
|
- Gemfile.lock
|
@@ -64,21 +64,21 @@ licenses:
|
|
64
64
|
metadata: {}
|
65
65
|
post_install_message:
|
66
66
|
rdoc_options:
|
67
|
-
- --title
|
67
|
+
- "--title"
|
68
68
|
- amazon-pricing documentation
|
69
|
-
- --line-numbers
|
70
|
-
- --main
|
69
|
+
- "--line-numbers"
|
70
|
+
- "--main"
|
71
71
|
- README.md
|
72
72
|
require_paths:
|
73
73
|
- lib
|
74
74
|
required_ruby_version: !ruby/object:Gem::Requirement
|
75
75
|
requirements:
|
76
|
-
- -
|
76
|
+
- - ">="
|
77
77
|
- !ruby/object:Gem::Version
|
78
78
|
version: '0'
|
79
79
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
|
-
- -
|
81
|
+
- - ">="
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '0'
|
84
84
|
requirements: []
|