cloudstack_client 0.2.13 → 0.2.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cloudstack_client/commands/ssh_key_pair.rb +32 -1
- data/lib/cloudstack_client/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e44fc99142b981278ff7bc7536fbd3367b572c8c
|
4
|
+
data.tar.gz: 6cfbdfaf0772109b003045e485e71ec8d958956c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5260fde17a790de97c3c9b615ca0cf86dfdc239e59b409529f084cbbf6f5d615b37fd39f111c86832be1ced65ba134a3f6b06802d645ec11eae586b26e9686b
|
7
|
+
data.tar.gz: 8f813c144856a8cae51dbe6bf6a5bfd92ce02c453126f03c4b8280cc8d57267946c7fcdaafb8f25adf176bee2ba3387c81ccfbe357e83eb0d6731ac8c10b5ccb
|
@@ -64,7 +64,38 @@ module CloudstackClient
|
|
64
64
|
params['domainid'] = account["domainid"]
|
65
65
|
params['account'] = args[:account]
|
66
66
|
end
|
67
|
-
|
67
|
+
|
68
|
+
json = send_request(params)['keypair']
|
69
|
+
end
|
70
|
+
|
71
|
+
##
|
72
|
+
# Register ssh key pairs.
|
73
|
+
#
|
74
|
+
|
75
|
+
def register_ssh_key_pair(name, publickey, args = {})
|
76
|
+
params = {
|
77
|
+
'command' => 'registerSSHKeyPair',
|
78
|
+
'name' => name,
|
79
|
+
'publickey' => publickey
|
80
|
+
}
|
81
|
+
if args[:project]
|
82
|
+
project = get_project(args[:project])
|
83
|
+
unless project
|
84
|
+
puts "Error: project #{args[:project]} not found."
|
85
|
+
exit 1
|
86
|
+
end
|
87
|
+
params['projectid'] = project['id']
|
88
|
+
end
|
89
|
+
|
90
|
+
if args[:account]
|
91
|
+
account = list_accounts({name: args[:account]}).first
|
92
|
+
unless account
|
93
|
+
puts "Error: Account #{args[:account]} not found."
|
94
|
+
exit 1
|
95
|
+
end
|
96
|
+
params['domainid'] = account["domainid"]
|
97
|
+
params['account'] = args[:account]
|
98
|
+
end
|
68
99
|
|
69
100
|
json = send_request(params)['keypair']
|
70
101
|
end
|