awscosts 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. data/README.md +10 -0
  2. data/Rakefile +1 -0
  3. data/awscosts.gemspec +2 -0
  4. data/fixtures/vcr_cassettes/AWSCosts_EBS.yml +225 -0
  5. data/fixtures/vcr_cassettes/AWSCosts_EC2OnDemand/EC2_type_of_linux.yml +726 -0
  6. data/fixtures/vcr_cassettes/AWSCosts_EC2OnDemand/EC2_type_of_rhel.yml +740 -0
  7. data/fixtures/vcr_cassettes/AWSCosts_EC2OnDemand/EC2_type_of_sles.yml +740 -0
  8. data/fixtures/vcr_cassettes/AWSCosts_EC2OnDemand/EC2_type_of_windows.yml +450 -0
  9. data/fixtures/vcr_cassettes/AWSCosts_EC2OnDemand/EC2_type_of_windows_with_sql.yml +450 -0
  10. data/fixtures/vcr_cassettes/AWSCosts_EC2OnDemand/EC2_type_of_windows_with_sql_web.yml +450 -0
  11. data/fixtures/vcr_cassettes/AWSCosts_EC2ReservedInstances/EC2_type_of_linux.yml +1810 -0
  12. data/fixtures/vcr_cassettes/AWSCosts_EC2ReservedInstances/EC2_type_of_rhel.yml +1810 -0
  13. data/fixtures/vcr_cassettes/AWSCosts_EC2ReservedInstances/EC2_type_of_sles.yml +1810 -0
  14. data/fixtures/vcr_cassettes/AWSCosts_EC2ReservedInstances/EC2_type_of_windows.yml +1609 -0
  15. data/fixtures/vcr_cassettes/AWSCosts_EC2ReservedInstances/EC2_type_of_windows_with_sql.yml +1810 -0
  16. data/fixtures/vcr_cassettes/AWSCosts_EC2ReservedInstances/EC2_type_of_windows_with_sql_web.yml +1810 -0
  17. data/fixtures/vcr_cassettes/AWSCosts_ELB.yml +119 -0
  18. data/fixtures/vcr_cassettes/AWSCosts_EMR.yml +767 -0
  19. data/fixtures/vcr_cassettes/AWSCosts_S3DataTransfer.yml +369 -0
  20. data/fixtures/vcr_cassettes/AWSCosts_S3Requests.yml +170 -0
  21. data/fixtures/vcr_cassettes/AWSCosts_S3Storage.yml +591 -0
  22. data/lib/awscosts/cache.rb +22 -0
  23. data/lib/awscosts/ec2.rb +7 -2
  24. data/lib/awscosts/ec2_ebs.rb +36 -0
  25. data/lib/awscosts/ec2_elb.rb +2 -6
  26. data/lib/awscosts/ec2_on_demand.rb +6 -14
  27. data/lib/awscosts/ec2_reserved_instances.rb +4 -11
  28. data/lib/awscosts/emr.rb +2 -7
  29. data/lib/awscosts/s3_data_transfer.rb +2 -3
  30. data/lib/awscosts/s3_requests.rb +2 -5
  31. data/lib/awscosts/s3_storage.rb +2 -6
  32. data/lib/awscosts/version.rb +1 -1
  33. data/lib/awscosts.rb +1 -0
  34. data/spec/awscosts/ec2_ebs_spec.rb +42 -0
  35. data/spec/awscosts/ec2_elb_spec.rb +12 -0
  36. data/spec/awscosts/ec2_on_demand_spec.rb +14 -0
  37. data/spec/awscosts/ec2_reserved_instances_spec.rb +28 -0
  38. data/spec/awscosts/emr_spec.rb +15 -0
  39. data/spec/awscosts/s3_data_transfer_spec.rb +11 -0
  40. data/spec/awscosts/s3_requests_spec.rb +10 -0
  41. data/spec/awscosts/s3_storage_spec.rb +12 -0
  42. data/spec/spec_helper.rb +9 -0
  43. metadata +72 -4
data/README.md CHANGED
@@ -73,6 +73,15 @@ And request pricing
73
73
 
74
74
  region.s3.request.price
75
75
 
76
+ ### EBS
77
+
78
+ To find the price of Amazon EBS standard volumes in the Ireland region.
79
+
80
+ AWSCosts.region('eu-west-1').ec2.elb.price(:standard)
81
+
82
+ `.price` also supports `:provisioned_iops` and `:snapshots_to_s3`
83
+
84
+
76
85
  ## Supported Services
77
86
 
78
87
  The following AWS services are currently support (more to come):
@@ -82,6 +91,7 @@ The following AWS services are currently support (more to come):
82
91
  * Reserved medium utilisation
83
92
  * Reserved heavy utilisation
84
93
  * Elastic Load Balancer (ELB)
94
+ * Elastic Block Storage (EBS)
85
95
  * Elastic MapReduce (EMR)
86
96
  * S3
87
97
 
data/Rakefile CHANGED
@@ -6,6 +6,7 @@ RSpec::Core::RakeTask.new(:spec) do |t|
6
6
  t.pattern = ENV['rspec_pattern'] || "spec/**/*_spec.rb"
7
7
  t.rspec_opts = [
8
8
  "--colour",
9
+ "--format documentation",
9
10
  "--require", "spec_helper"
10
11
  ]
11
12
  end
data/awscosts.gemspec CHANGED
@@ -23,4 +23,6 @@ Gem::Specification.new do |spec|
23
23
  spec.add_development_dependency "bundler", "~> 1.3"
24
24
  spec.add_development_dependency "rake"
25
25
  spec.add_development_dependency 'rspec'
26
+ spec.add_development_dependency 'vcr'
27
+ spec.add_development_dependency 'fakeweb'
26
28
  end
@@ -0,0 +1,225 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://aws.amazon.com/ec2/pricing/pricing-ebs.json
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ connection:
11
+ - close
12
+ response:
13
+ status:
14
+ code: 200
15
+ message: OK
16
+ headers:
17
+ date:
18
+ - Mon, 27 May 2013 04:10:45 GMT
19
+ server:
20
+ - Server
21
+ x-amz-id-1:
22
+ - 17PS2VC57B1JEP6N5GPG
23
+ x-amz-id-2:
24
+ - pYsWUX9GVE0vDLrQKYYs8v33FFYfIRkc1NUTisPL6OI=
25
+ cache-control:
26
+ - max-age=0
27
+ expires:
28
+ - Mon, 27 May 2013 04:10:45 GMT
29
+ content-type:
30
+ - text/html; charset=UTF-8
31
+ set-cookie:
32
+ - x-wl-uid=1TBZxieN8YCpivBZQ/GUoLEdt7O9/iYXAloIUEvwRVo0xPRc7NEWq7yrz747CS97taqETekxqBWg=;
33
+ path=/; domain=.amazon.com; expires=Tue, 01-Jan-2036 00:00:01 GMT
34
+ - aws-session-id-time=2082758401l; path=/; domain=.amazon.com; expires=Tue,
35
+ 01-Jan-2036 00:00:01 GMT
36
+ - aws-session-id=178-6108933-3958905; path=/; domain=.amazon.com; expires=Tue,
37
+ 01-Jan-2036 00:00:01 GMT
38
+ vary:
39
+ - User-Agent
40
+ transfer-encoding:
41
+ - chunked
42
+ body:
43
+ encoding: US-ASCII
44
+ string: ! "\n\n {\n \"vers\": 0.01,\n \"config\": {\n \"currencies\":
45
+ [\n \"USD\"\n ],\n \"rate\": \"perGB\",\n \"regions\":
46
+ [\n {\n \"region\": \"us-east\",\n \"types\":
47
+ [\n {\n \"name\": \"ebsVols\",\n
48
+ \ \"values\": [\n {\n \"prices\":
49
+ {\n \"USD\": \"0.10\"\n },\n
50
+ \ \"rate\": \"perGBmoProvStorage\"\n },\n
51
+ \ {\n \"prices\":
52
+ {\n \"USD\": \"0.10\"\n },\n
53
+ \ \"rate\": \"perMMIOreq\"\n }\n
54
+ \ ]\n },\n {\n
55
+ \ \"name\": \"ebsPIOPSVols\",\n \"values\":
56
+ [\n {\n \"prices\":
57
+ {\n \"USD\": \"0.125\"\n },\n
58
+ \ \"rate\": \"perGBmoProvStorage\"\n },\n
59
+ \ {\n \"prices\":
60
+ {\n \"USD\": \"0.10\"\n },\n
61
+ \ \"rate\": \"perPIOPSreq\"\n }\n
62
+ \ ]\n },\n {\n
63
+ \ \"name\": \"ebsSnapsToS3\",\n \"values\":
64
+ [\n {\n \"prices\":
65
+ {\n \"USD\": \"0.095\"\n },\n
66
+ \ \"rate\": \"perGBmoDataStored\"\n }\n
67
+ \ ]\n }\n ]\n },\n
68
+ \ {\n \"region\": \"us-west-2\",\n \"types\":
69
+ [\n {\n \"name\": \"ebsVols\",\n
70
+ \ \"values\": [\n {\n \"prices\":
71
+ {\n \"USD\": \"0.10\"\n },\n
72
+ \ \"rate\": \"perGBmoProvStorage\"\n },\n
73
+ \ {\n \"prices\":
74
+ {\n \"USD\": \"0.10\"\n },\n
75
+ \ \"rate\": \"perMMIOreq\"\n }\n
76
+ \ ]\n },\n {\n
77
+ \ \"name\": \"ebsPIOPSVols\",\n \"values\":
78
+ [\n {\n \"prices\":
79
+ {\n \"USD\": \"0.125\"\n },\n
80
+ \ \"rate\": \"perGBmoProvStorage\"\n },\n
81
+ \ {\n \"prices\":
82
+ {\n \"USD\": \"0.10\"\n },\n
83
+ \ \"rate\": \"perPIOPSreq\"\n }\n
84
+ \ ]\n },\n {\n
85
+ \ \"name\": \"ebsSnapsToS3\",\n \"values\":
86
+ [\n {\n \"prices\":
87
+ {\n \"USD\": \"0.095\"\n },\n
88
+ \ \"rate\": \"perGBmoDataStored\"\n }\n
89
+ \ ]\n }\n ]\n },\n
90
+ \ {\n \"region\": \"us-west\",\n \"types\":
91
+ [\n {\n \"name\": \"ebsVols\",\n
92
+ \ \"values\": [\n {\n \"prices\":
93
+ {\n \"USD\": \"0.11\"\n },\n
94
+ \ \"rate\": \"perGBmoProvStorage\"\n },\n
95
+ \ {\n \"prices\":
96
+ {\n \"USD\": \"0.11\"\n },\n
97
+ \ \"rate\": \"perMMIOreq\"\n }\n
98
+ \ ]\n },\n {\n
99
+ \ \"name\": \"ebsPIOPSVols\",\n \"values\":
100
+ [\n {\n \"prices\":
101
+ {\n \"USD\": \"0.138\"\n },\n
102
+ \ \"rate\": \"perGBmoProvStorage\"\n },\n
103
+ \ {\n \"prices\":
104
+ {\n \"USD\": \"0.11\"\n },\n
105
+ \ \"rate\": \"perPIOPSreq\"\n }\n
106
+ \ ]\n },\n {\n
107
+ \ \"name\": \"ebsSnapsToS3\",\n \"values\":
108
+ [\n {\n \"prices\":
109
+ {\n \"USD\": \"0.105\"\n },\n
110
+ \ \"rate\": \"perGBmoDataStored\"\n }\n
111
+ \ ]\n }\n ]\n },\n
112
+ \ {\n \"region\": \"eu-ireland\",\n \"types\":
113
+ [\n {\n \"name\": \"ebsVols\",\n
114
+ \ \"values\": [\n {\n \"prices\":
115
+ {\n \"USD\": \"0.11\"\n },\n
116
+ \ \"rate\": \"perGBmoProvStorage\"\n },\n
117
+ \ {\n \"prices\":
118
+ {\n \"USD\": \"0.11\"\n },\n
119
+ \ \"rate\": \"perMMIOreq\"\n }\n
120
+ \ ]\n },\n {\n
121
+ \ \"name\": \"ebsPIOPSVols\",\n \"values\":
122
+ [\n {\n \"prices\":
123
+ {\n \"USD\": \"0.138\"\n },\n
124
+ \ \"rate\": \"perGBmoProvStorage\"\n },\n
125
+ \ {\n \"prices\":
126
+ {\n \"USD\": \"0.11\"\n },\n
127
+ \ \"rate\": \"perPIOPSreq\"\n }\n
128
+ \ ]\n },\n {\n
129
+ \ \"name\": \"ebsSnapsToS3\",\n \"values\":
130
+ [\n {\n \"prices\":
131
+ {\n \"USD\": \"0.095\"\n },\n
132
+ \ \"rate\": \"perGBmoDataStored\"\n }\n
133
+ \ ]\n }\n ]\n },\n
134
+ \ {\n \"region\": \"apac-sin\",\n \"types\":
135
+ [\n {\n \"name\": \"ebsVols\",\n
136
+ \ \"values\": [\n {\n \"prices\":
137
+ {\n \"USD\": \"0.11\"\n },\n
138
+ \ \"rate\": \"perGBmoProvStorage\"\n },\n
139
+ \ {\n \"prices\":
140
+ {\n \"USD\": \"0.11\"\n },\n
141
+ \ \"rate\": \"perMMIOreq\"\n }\n
142
+ \ ]\n },\n {\n
143
+ \ \"name\": \"ebsPIOPSVols\",\n \"values\":
144
+ [\n {\n \"prices\":
145
+ {\n \"USD\": \"0.138\"\n },\n
146
+ \ \"rate\": \"perGBmoProvStorage\"\n },\n
147
+ \ {\n \"prices\":
148
+ {\n \"USD\": \"0.11\"\n },\n
149
+ \ \"rate\": \"perPIOPSreq\"\n }\n
150
+ \ ]\n },\n {\n
151
+ \ \"name\": \"ebsSnapsToS3\",\n \"values\":
152
+ [\n {\n \"prices\":
153
+ {\n \"USD\": \"0.095\"\n },\n
154
+ \ \"rate\": \"perGBmoDataStored\"\n }\n
155
+ \ ]\n }\n ]\n },\n
156
+ \ {\n \"region\": \"apac-tokyo\",\n \"types\":
157
+ [\n {\n \"name\": \"ebsVols\",\n
158
+ \ \"values\": [\n {\n \"prices\":
159
+ {\n \"USD\": \"0.12\"\n },\n
160
+ \ \"rate\": \"perGBmoProvStorage\"\n },\n
161
+ \ {\n \"prices\":
162
+ {\n \"USD\": \"0.12\"\n },\n
163
+ \ \"rate\": \"perMMIOreq\"\n }\n
164
+ \ ]\n },\n {\n
165
+ \ \"name\": \"ebsPIOPSVols\",\n \"values\":
166
+ [\n {\n \"prices\":
167
+ {\n \"USD\": \"0.150\"\n },\n
168
+ \ \"rate\": \"perGBmoProvStorage\"\n },\n
169
+ \ {\n \"prices\":
170
+ {\n \"USD\": \"0.12\"\n },\n
171
+ \ \"rate\": \"perPIOPSreq\"\n }\n
172
+ \ ]\n },\n {\n
173
+ \ \"name\": \"ebsSnapsToS3\",\n \"values\":
174
+ [\n {\n \"prices\":
175
+ {\n \"USD\": \"0.10\"\n },\n
176
+ \ \"rate\": \"perGBmoDataStored\"\n }\n
177
+ \ ]\n }\n ]\n },\t\t\t\n
178
+ \ {\n \"region\": \"apac-syd\",\n \"types\":
179
+ [\n {\n \"name\": \"ebsVols\",\n
180
+ \ \"values\": [\n {\n \"prices\":
181
+ {\n \"USD\": \"0.11\"\n },\n
182
+ \ \"rate\": \"perGBmoProvStorage\"\n },\n
183
+ \ {\n \"prices\":
184
+ {\n \"USD\": \"0.11\"\n },\n
185
+ \ \"rate\": \"perMMIOreq\"\n }\n
186
+ \ ]\n },\n {\n
187
+ \ \"name\": \"ebsPIOPSVols\",\n \"values\":
188
+ [\n {\n \"prices\":
189
+ {\n \"USD\": \"0.138\"\n },\n
190
+ \ \"rate\": \"perGBmoProvStorage\"\n },\n
191
+ \ {\n \"prices\":
192
+ {\n \"USD\": \"0.11\"\n },\n
193
+ \ \"rate\": \"perPIOPSreq\"\n }\n
194
+ \ ]\n },\n {\n
195
+ \ \"name\": \"ebsSnapsToS3\",\n \"values\":
196
+ [\n {\n \"prices\":
197
+ {\n \"USD\": \"0.105\"\n },\n
198
+ \ \"rate\": \"perGBmoDataStored\"\n }\n
199
+ \ ]\n }\n ]\n },\n
200
+ \ {\n \"region\": \"sa-east-1\",\n \"types\":
201
+ [\n {\n \"name\": \"ebsVols\",\n
202
+ \ \"values\": [\n {\n \"prices\":
203
+ {\n \"USD\": \"0.19\"\n },\n
204
+ \ \"rate\": \"perGBmoProvStorage\"\n },\n
205
+ \ {\n \"prices\":
206
+ {\n \"USD\": \"0.14\"\n },\n
207
+ \ \"rate\": \"perMMIOreq\"\n }\n
208
+ \ ]\n },\n {\n
209
+ \ \"name\": \"ebsPIOPSVols\",\n \"values\":
210
+ [\n {\n \"prices\":
211
+ {\n \"USD\": \"0.238\"\n },\n
212
+ \ \"rate\": \"perGBmoProvStorage\"\n },\n
213
+ \ {\n \"prices\":
214
+ {\n \"USD\": \"0.14\"\n },\n
215
+ \ \"rate\": \"perPIOPSreq\"\n }\n
216
+ \ ]\n },\n {\n
217
+ \ \"name\": \"ebsSnapsToS3\",\n \"values\":
218
+ [\n {\n \"prices\":
219
+ {\n \"USD\": \"0.13\"\n },\n
220
+ \ \"rate\": \"perGBmoDataStored\"\n }\n
221
+ \ ]\n }\n ]\n }\n
222
+ \ ]\n }\n}\n\n\n\n"
223
+ http_version: '1.1'
224
+ recorded_at: Mon, 27 May 2013 04:10:47 GMT
225
+ recorded_with: VCR 2.0.1