amazon-pricing 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/amazon-pricing/instance-type.rb +17 -1
- data/lib/amazon-pricing/version.rb +1 -1
- data/test/test-ec2-instance-types.rb +8 -0
- metadata +23 -42
@@ -20,7 +20,7 @@ module AwsPricing
|
|
20
20
|
#
|
21
21
|
class InstanceType
|
22
22
|
attr_accessor :name, :api_name, :linux_price_per_hour, :windows_price_per_hour,
|
23
|
-
:memory_in_mb, :disk_in_mb, :platform, :compute_units
|
23
|
+
:memory_in_mb, :disk_in_mb, :platform, :compute_units, :virtual_cores
|
24
24
|
|
25
25
|
# Initializes and InstanceType object given a region, the internal
|
26
26
|
# type (e.g. stdODI) and the json for the specific instance. The json is
|
@@ -42,6 +42,7 @@ module AwsPricing
|
|
42
42
|
@disk_in_mb = @@Disk_Lookup[@api_name]
|
43
43
|
@platform = @@Platform_Lookup[@api_name]
|
44
44
|
@compute_units = @@Compute_Units_Lookup[@api_name]
|
45
|
+
@virtual_cores = @@Virtual_Cores_Lookup[@api_name]
|
45
46
|
end
|
46
47
|
|
47
48
|
# Returns whether an instance_type is available.
|
@@ -112,6 +113,7 @@ module AwsPricing
|
|
112
113
|
@@Memory_Lookup = {
|
113
114
|
'm1.small' => 1700, 'm1.medium' => 3750, 'm1.large' => 7500, 'm1.xlarge' => 15000,
|
114
115
|
'm2.xlarge' => 17100, 'm2.2xlarge' => 34200, 'm2.4xlarge' => 68400,
|
116
|
+
#'m3.xlarge' => 15, 'm3.2xlarge' => 30,
|
115
117
|
'c1.medium' => 1700, 'c1.xlarge' => 7000,
|
116
118
|
'hi1.4xlarge' => 60500,
|
117
119
|
'cg1.4xlarge' => 22000,
|
@@ -122,6 +124,7 @@ module AwsPricing
|
|
122
124
|
@@Disk_Lookup = {
|
123
125
|
'm1.small' => 160, 'm1.medium' => 410, 'm1.large' =>850, 'm1.xlarge' => 1690,
|
124
126
|
'm2.xlarge' => 420, 'm2.2xlarge' => 850, 'm2.4xlarge' => 1690,
|
127
|
+
#'m3.xlarge' => 0, 'm3.2xlarge' => 0,
|
125
128
|
'c1.medium' => 350, 'c1.xlarge' => 1690,
|
126
129
|
'hi1.4xlarge' => 2048,
|
127
130
|
'cg1.4xlarge' => 1690,
|
@@ -132,6 +135,7 @@ module AwsPricing
|
|
132
135
|
@@Platform_Lookup = {
|
133
136
|
'm1.small' => 32, 'm1.medium' => 32, 'm1.large' => 64, 'm1.xlarge' => 64,
|
134
137
|
'm2.xlarge' => 64, 'm2.2xlarge' => 64, 'm2.4xlarge' => 64,
|
138
|
+
#'m3.xlarge' => 64, 'm3.2xlarge' => 64,
|
135
139
|
'c1.medium' => 32, 'c1.xlarge' => 64,
|
136
140
|
'hi1.4xlarge' => 64,
|
137
141
|
'cg1.4xlarge' => 64,
|
@@ -142,6 +146,7 @@ module AwsPricing
|
|
142
146
|
@@Compute_Units_Lookup = {
|
143
147
|
'm1.small' => 1, 'm1.medium' => 2, 'm1.large' => 4, 'm1.xlarge' => 8,
|
144
148
|
'm2.xlarge' => 6, 'm2.2xlarge' => 13, 'm2.4xlarge' => 26,
|
149
|
+
#'m3.xlarge' => 13, 'm3.2xlarge' => 26,
|
145
150
|
'c1.medium' => 5, 'c1.xlarge' => 20,
|
146
151
|
'hi1.4xlarge' => 35,
|
147
152
|
'cg1.4xlarge' => 34,
|
@@ -149,6 +154,17 @@ module AwsPricing
|
|
149
154
|
't1.micro' => 2,
|
150
155
|
'unknown' => 0,
|
151
156
|
}
|
157
|
+
@@Virtual_Cores_Lookup = {
|
158
|
+
'm1.small' => 1, 'm1.medium' => 1, 'm1.large' => 2, 'm1.xlarge' => 4,
|
159
|
+
'm2.xlarge' => 2, 'm2.2xlarge' => 4, 'm2.4xlarge' => 8,
|
160
|
+
#'m3.xlarge' => 4, 'm3.2xlarge' => 8,
|
161
|
+
'c1.medium' => 2, 'c1.xlarge' => 8,
|
162
|
+
'hi1.4xlarge' => 16,
|
163
|
+
'cg1.4xlarge' => 8,
|
164
|
+
'cc1.4xlarge' => 8, 'cc2.8xlarge' => 16,
|
165
|
+
't1.micro' => 0,
|
166
|
+
'unknown' => 0,
|
167
|
+
}
|
152
168
|
end
|
153
169
|
|
154
170
|
end
|
@@ -97,4 +97,12 @@ class TestEc2InstanceTypes < Test::Unit::TestCase
|
|
97
97
|
assert_not_nil region.ebs_price.s3_snaps_per_gb
|
98
98
|
end
|
99
99
|
end
|
100
|
+
|
101
|
+
def test_virtual_cores
|
102
|
+
pricing = AwsPricing::PriceList.new
|
103
|
+
region = pricing.get_region('us-east')
|
104
|
+
instance = region.get_instance_type(:on_demand, 'm1.large')
|
105
|
+
assert instance.virtual_cores == 2
|
106
|
+
end
|
107
|
+
|
100
108
|
end
|
metadata
CHANGED
@@ -1,35 +1,25 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: amazon-pricing
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 1
|
9
|
-
- 3
|
10
|
-
version: 0.1.3
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.4
|
5
|
+
prerelease:
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Joe Kinsella
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
date: 2012-11-15 00:00:00 -05:00
|
19
|
-
default_executable:
|
12
|
+
date: 2012-11-28 00:00:00.000000000 Z
|
20
13
|
dependencies: []
|
21
|
-
|
22
14
|
description: A Ruby library for retrieving pricing for Amazon Web Services
|
23
|
-
email:
|
15
|
+
email:
|
24
16
|
- joe.kinsella@gmail.com
|
25
17
|
executables: []
|
26
|
-
|
27
18
|
extensions: []
|
28
|
-
|
29
|
-
extra_rdoc_files:
|
19
|
+
extra_rdoc_files:
|
30
20
|
- LICENSE
|
31
21
|
- README
|
32
|
-
files:
|
22
|
+
files:
|
33
23
|
- CHANGELOG
|
34
24
|
- Gemfile
|
35
25
|
- LICENSE
|
@@ -46,45 +36,36 @@ files:
|
|
46
36
|
- spec/price_list_spec.rb
|
47
37
|
- test/helper.rb
|
48
38
|
- test/test-ec2-instance-types.rb
|
49
|
-
has_rdoc: true
|
50
39
|
homepage: http://github.com/sonian/amazon-pricing
|
51
40
|
licenses: []
|
52
|
-
|
53
41
|
post_install_message:
|
54
|
-
rdoc_options:
|
42
|
+
rdoc_options:
|
55
43
|
- --title
|
56
44
|
- amazon-pricing documentation
|
57
45
|
- --line-numbers
|
58
46
|
- --main
|
59
47
|
- README
|
60
|
-
require_paths:
|
48
|
+
require_paths:
|
61
49
|
- lib
|
62
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
50
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
63
51
|
none: false
|
64
|
-
requirements:
|
65
|
-
- -
|
66
|
-
- !ruby/object:Gem::Version
|
67
|
-
|
68
|
-
|
69
|
-
- 0
|
70
|
-
version: "0"
|
71
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ! '>='
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
56
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
57
|
none: false
|
73
|
-
requirements:
|
74
|
-
- -
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
|
77
|
-
segments:
|
78
|
-
- 0
|
79
|
-
version: "0"
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
80
62
|
requirements: []
|
81
|
-
|
82
63
|
rubyforge_project: amazon-pricing
|
83
|
-
rubygems_version: 1.
|
64
|
+
rubygems_version: 1.8.24
|
84
65
|
signing_key:
|
85
66
|
specification_version: 3
|
86
67
|
summary: Amazon Web Services Pricing Ruby gem
|
87
|
-
test_files:
|
68
|
+
test_files:
|
88
69
|
- spec/instance_type_spec.rb
|
89
70
|
- spec/price_list_spec.rb
|
90
71
|
- test/helper.rb
|