cloudability 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cloudability.rb +11 -8
- data/lib/cloudability/client/billing_reports.rb +3 -3
- data/lib/cloudability/client/budgets.rb +2 -2
- data/lib/cloudability/client/credentials.rb +2 -2
- data/lib/cloudability/client/organizations.rb +1 -1
- data/lib/cloudability/client/usage_reports.rb +2 -2
- data/lib/cloudability/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91765810ca59b0ee578b639e8a4e0501eb63e50c
|
4
|
+
data.tar.gz: aafec5772c39d5c7b3dd65ff19cecac6a9f4f82c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2363768fce7a35a567eb39897757ed8b815dda2f41f446c33a4b49cd3a911c8b1e896a7d74ecff5611b799b9cb223f4179b6437b490594ebea448e003e8b4612
|
7
|
+
data.tar.gz: 2968647530d907f388c1cbc87c2f6686ff2ff80b4a6a44ed27db3fc1cb53c5b56f97088ecec1782810e4eaf705710bb0017ff10cf9af893c0c7fd37c623a2bd1
|
data/lib/cloudability.rb
CHANGED
@@ -10,8 +10,11 @@ require 'cloudability/client/organizations'
|
|
10
10
|
|
11
11
|
require 'cloudability/version'
|
12
12
|
|
13
|
-
|
14
13
|
module Cloudability
|
14
|
+
|
15
|
+
# Exceptions
|
16
|
+
class RequestError < StandardError; end
|
17
|
+
|
15
18
|
class Client
|
16
19
|
include Cloudability::Client::BillingReports
|
17
20
|
include Cloudability::Client::UsageReports
|
@@ -32,28 +35,28 @@ module Cloudability
|
|
32
35
|
|
33
36
|
def get(url, params={})
|
34
37
|
response = self.class.get(url, options(query: params))
|
35
|
-
response.success? ? response : raise(response.
|
38
|
+
response.success? ? response : raise(RequestError, response.message)
|
36
39
|
end
|
37
40
|
|
38
41
|
def post(url, params={})
|
39
42
|
response = self.class.post(url, options(query: params))
|
40
|
-
response.success? ? response : raise(response.
|
43
|
+
response.success? ? response : raise(RequestError, response.message)
|
41
44
|
end
|
42
45
|
|
43
46
|
def put(url, params={})
|
44
47
|
response = self.class.put(url, options(query: params))
|
45
|
-
response.success? ? response : raise(response.
|
48
|
+
response.success? ? response : raise(RequestError, response.message)
|
46
49
|
end
|
47
50
|
|
48
51
|
def delete(url, params={})
|
49
52
|
response = self.class.delete(url, options(query: params))
|
50
|
-
response.success? ? response : raise(response.
|
53
|
+
response.success? ? response : raise(RequestError, response.message)
|
51
54
|
end
|
52
55
|
|
53
56
|
# Convert the an array of hashes into an array of Mashes!
|
54
57
|
#
|
55
|
-
# @param [String] array of hashes
|
56
|
-
# @return [Array] array of Hashie::Mashes
|
58
|
+
# @param [String] array of Ruby hashes
|
59
|
+
# @return [Array<Hashie::Mash>] array of Hashie::Mashes
|
57
60
|
def convert_to_mashes(array)
|
58
61
|
array.map { |element| Hashie::Mash.new(element) }
|
59
62
|
end
|
@@ -67,4 +70,4 @@ module Cloudability
|
|
67
70
|
end
|
68
71
|
|
69
72
|
end
|
70
|
-
end
|
73
|
+
end
|
@@ -5,7 +5,7 @@ module Cloudability
|
|
5
5
|
# Generate a report of your spend
|
6
6
|
#
|
7
7
|
# @param [Hash] optional parameters
|
8
|
-
# @return [Array] array of Hashie::Mashes
|
8
|
+
# @return [Array<Hashie::Mash>] array of Hashie::Mashes
|
9
9
|
# @see http://developers.cloudability.com/resources/billing_reports/
|
10
10
|
# @example generate report
|
11
11
|
# .billing_report(vendor: 'Amazon')
|
@@ -16,7 +16,7 @@ module Cloudability
|
|
16
16
|
convert_to_mashes request
|
17
17
|
end
|
18
18
|
alias :billing_reports :billing_report
|
19
|
-
|
19
|
+
|
20
20
|
end
|
21
21
|
end
|
22
|
-
end
|
22
|
+
end
|
data/lib/cloudability/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloudability
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Colby Aley
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2014-01-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httparty
|