cloudstack_client 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -4
- data/Gemfile.lock +1 -1
- data/lib/cloudstack_client/api.rb +7 -6
- data/lib/cloudstack_client/utils.rb +10 -1
- data/lib/cloudstack_client/version.rb +1 -1
- data/test/api_test.rb +12 -0
- 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: 34dba51fe3666605497c2ec7f485717c4a04165a
|
4
|
+
data.tar.gz: 7cfebfaa6b48835e4320520c11dd811c87b8d131
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 620d683ee029823a04dfb22bcfa154d1fcb06d24d4df61820dee4a21f6b8312e0eef96684e7f2bfb87e0d785245d8f612e49bcedfac27b99a3ee9fd524e73662
|
7
|
+
data.tar.gz: 6799dea26324f16af8155b9c9bae6d8f47056901c43dc664accdffcc58c02fdfa8f7e17ed0f2d9aeec4edc319c1e1e1c69977f095d73b72130474e748a5aa3f7
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
require "zlib"
|
2
2
|
require "json"
|
3
|
+
require "cloudstack_client/utils"
|
3
4
|
|
4
5
|
module CloudstackClient
|
5
6
|
class Api
|
7
|
+
include Utils
|
6
8
|
|
7
9
|
DEFAULT_API_VERSION = "4.5"
|
8
10
|
API_PATH = File.expand_path("../../../data/", __FILE__)
|
@@ -23,15 +25,14 @@ module CloudstackClient
|
|
23
25
|
end
|
24
26
|
|
25
27
|
def command_supported?(command)
|
26
|
-
@commands.has_key? command
|
28
|
+
@commands.has_key? underscore_to_camel_case(command)
|
27
29
|
end
|
28
30
|
|
29
31
|
def command_supports_param?(command, key)
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
end
|
32
|
+
command = underscore_to_camel_case(command)
|
33
|
+
@commands[command]["params"].detect do |params|
|
34
|
+
params["name"] == key.to_s
|
35
|
+
end ? true : false
|
35
36
|
end
|
36
37
|
|
37
38
|
def required_params(command)
|
@@ -8,6 +8,15 @@ module CloudstackClient
|
|
8
8
|
tr("-", "_").downcase
|
9
9
|
end
|
10
10
|
|
11
|
+
def underscore_to_camel_case(underscore)
|
12
|
+
if underscore.include? "_"
|
13
|
+
string = underscore.split('_').collect(&:capitalize).join
|
14
|
+
string[0].downcase + string[1..-1]
|
15
|
+
else
|
16
|
+
underscore
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
11
20
|
def print_debug_output(output, seperator = '-' * 80)
|
12
21
|
puts
|
13
22
|
puts seperator
|
@@ -15,6 +24,6 @@ module CloudstackClient
|
|
15
24
|
puts seperator
|
16
25
|
puts
|
17
26
|
end
|
18
|
-
|
27
|
+
|
19
28
|
end
|
20
29
|
end
|
data/test/api_test.rb
CHANGED
@@ -52,13 +52,25 @@ describe CloudstackClient::Api do
|
|
52
52
|
@api.command_supported?('listVirtualMachines').must_equal true
|
53
53
|
end
|
54
54
|
|
55
|
+
it "must respond positively for 'list_virtual_machines'" do
|
56
|
+
@api.command_supported?('list_virtual_machines').must_equal true
|
57
|
+
end
|
58
|
+
|
55
59
|
it "must respond positively for 'createUser'" do
|
56
60
|
@api.command_supported?('createUser').must_equal true
|
57
61
|
end
|
58
62
|
|
63
|
+
it "must respond positively for 'create_user'" do
|
64
|
+
@api.command_supported?('create_user').must_equal true
|
65
|
+
end
|
66
|
+
|
59
67
|
it "must respond netagively for 'listClowns'" do
|
60
68
|
@api.command_supported?('listClowns').must_equal false
|
61
69
|
end
|
70
|
+
|
71
|
+
it "must respond netagively for 'list_clowns'" do
|
72
|
+
@api.command_supported?('list_clowns').must_equal false
|
73
|
+
end
|
62
74
|
end
|
63
75
|
|
64
76
|
describe "when asked about supported params" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloudstack_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nik Wolfgramm
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|