cloudstack_client 0.3.5 → 0.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4cb1427e6c34dbd08a11efe73596d391afbb4507
4
- data.tar.gz: 73d14950cf035e0078290e6f1014d9bb2cf9b88c
3
+ metadata.gz: dec70317784dcbbde93d5f8b66b22b0e93229f48
4
+ data.tar.gz: 3d53de49fd5d9ca92edf12082f6d1f89dc274cb2
5
5
  SHA512:
6
- metadata.gz: 76d331fd4846aad6a1bf686161ce1256291d3aa16939b97ec9ad1d8a2eb0629989a70b328823f3b68f6ece7e0043ae91e5b1b127fbbd177cc766f520243792cb
7
- data.tar.gz: eb7a29f513f49c26db71b8dc07277944ed3c146d32fd6753651a2813ef08aa164f2e25d59fcb7bb98db866c5a0a55dea804bad2711f0f096494acbaf50eef9dc
6
+ metadata.gz: 2c5d69c56cf83e03576eafccc1bcca0484b58398033ac1a25933a348819c6c196a908067d8d8c97b4e2e506b0f76ac931bd27d53cc79ba6af995d4ef57c0c230
7
+ data.tar.gz: 8e35e1d89ad61a8a2dd827c71a778894d94c48ebd066e60d0010eb3609b20ad3ac7266350ba91baf7a3e468dc54f0ade57c5fafc753e5d4e88cfe515df925537
@@ -14,7 +14,7 @@ module CloudstackClient
14
14
  params['projectid'] = args[:project_id] if args[:project_id]
15
15
 
16
16
  if args[:account]
17
- if account = list_accounts({name: args[:account]}).first
17
+ if account = list_accounts(name: args[:account]).first
18
18
  params['domainid'] = account["domainid"]
19
19
  params['account'] = args[:account]
20
20
  end
@@ -96,28 +96,28 @@ module CloudstackClient
96
96
  ##
97
97
  # Lists servers.
98
98
 
99
- def list_servers(options = {})
99
+ def list_servers(args = {})
100
100
  params = {
101
101
  'command' => 'listVirtualMachines',
102
102
  'listAll' => true
103
103
  }
104
- params['projectid'] = options[:project_id] if options[:project_id]
105
- params['state'] = options[:status] if options[:status]
106
- params['groupid'] = options[:group_id] if options[:group_id]
104
+ params['projectid'] = args[:project_id] if args[:project_id]
105
+ params['state'] = args[:status] if args[:status]
106
+ params['groupid'] = args[:group_id] if args[:group_id]
107
107
 
108
- if options[:zone]
109
- zone = get_zone(options[:zone])
108
+ if args[:zone]
109
+ zone = get_zone(args[:zone])
110
110
  unless zone
111
- puts "Error: Zone #{options[:zone]} not found"
111
+ puts "Error: Zone #{args[:zone]} not found"
112
112
  exit 1
113
113
  end
114
114
  params['zoneid'] = zone['id']
115
115
  end
116
116
 
117
- if options[:account]
118
- if account = list_accounts({name: options[:account]}).first
117
+ if args[:account]
118
+ if account = list_accounts(name: args[:account]).first
119
119
  params['domainid'] = account["domainid"]
120
- params['account'] = options[:account]
120
+ params['account'] = args[:account]
121
121
  end
122
122
  end
123
123
 
@@ -14,7 +14,7 @@ module CloudstackClient
14
14
  params['listall'] = true if args[:listall]
15
15
 
16
16
  if args[:account]
17
- account = list_accounts({name: args[:account]}).first
17
+ account = list_accounts(name: args[:account]).first
18
18
  unless account
19
19
  puts "Error: Account #{args[:account]} not found."
20
20
  exit 1
@@ -5,12 +5,33 @@ module CloudstackClient
5
5
  ##
6
6
  # Lists all volumes.
7
7
 
8
- def list_volumes(project_id = nil)
8
+ def list_volumes(args = {})
9
9
  params = {
10
10
  'command' => 'listVolumes',
11
11
  'listall' => true,
12
12
  }
13
- params['projectid'] = project_id if project_id
13
+
14
+ if args[:zone]
15
+ zone = get_zone(args[:zone])
16
+ unless zone
17
+ puts "Error: Zone #{args[:zone]} not found"
18
+ exit 1
19
+ end
20
+ params['zoneid'] = zone['id']
21
+ end
22
+
23
+ if args[:account]
24
+ if account = list_accounts(name: args[:account]).first
25
+ params['domainid'] = account["domainid"]
26
+ params['account'] = args[:account]
27
+ end
28
+ end
29
+
30
+ params['projectid'] = args[:project_id] if args[:project_id]
31
+ params['type'] = args[:type] if args[:type]
32
+ params['keyword'] = args[:keyword] if args[:keyword]
33
+ params['name'] = args[:name] if args[:name]
34
+
14
35
  json = send_request(params)
15
36
  json['volume'] || []
16
37
  end
@@ -1,3 +1,3 @@
1
1
  module CloudstackClient
2
- VERSION = "0.3.5"
2
+ VERSION = "0.3.6"
3
3
  end
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: 0.3.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nik Wolfgramm
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-13 00:00:00.000000000 Z
11
+ date: 2014-01-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rdoc