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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8562c2cb0af37d2b216bda954ec7e3ab45253d62
4
- data.tar.gz: b0b3c13b9981d10eb2560ce5af656a0b0e05da4e
3
+ metadata.gz: e44fc99142b981278ff7bc7536fbd3367b572c8c
4
+ data.tar.gz: 6cfbdfaf0772109b003045e485e71ec8d958956c
5
5
  SHA512:
6
- metadata.gz: ca6bfa863bffa4cf837bddd64239285e5b2a1fa46120af0e4194f15b49ab3074f646a016b138e610898b5ad6968b3ca8ff8b26ae0f408c200e5152defda274cf
7
- data.tar.gz: 9e9eb8f2ff761872d21afb868bc3cd37411ca1807e2f09b648489d1097e2ba2550e4bc5425458ffa784e09119ecd4939c3a21aa3b519a243d3a27ebe8c6a7303
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
- params['publickey'] = args[:public_key] if args[:public_key]
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
@@ -1,3 +1,3 @@
1
1
  module CloudstackClient
2
- VERSION = "0.2.13"
2
+ VERSION = "0.2.14"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudstack_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.13
4
+ version: 0.2.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nik Wolfgramm