cloudstack_client 0.9.3 → 0.9.5
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d1d51bf68725404db9006534420b13ac450a1bb
|
4
|
+
data.tar.gz: d09a8235274755a8bd11dab962df25291018dc88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92c1dbd1365de20fb70d73b98f691c7ad228bc18f048d8f1a3bbf28702851b53dc5e5fca16a1d84a35c487486207c19b164529992f5f2564e9ee75f9832074c1
|
7
|
+
data.tar.gz: d203d2ca6a8361b210c7dcfa05874e70a4cdaf0940f03dd1c252483ccdf02f7ec1388631c4fe8da60500561d819e835204ed8925810fd97b75d0563e8e6ba891
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module CloudstackClient
|
2
2
|
|
3
|
-
|
3
|
+
module Router
|
4
4
|
|
5
5
|
##
|
6
6
|
# Get a router with a given name.
|
@@ -17,7 +17,7 @@ module CloudstackClient
|
|
17
17
|
json['router'] ? json['router'].first : nil
|
18
18
|
end
|
19
19
|
|
20
|
-
|
20
|
+
##
|
21
21
|
# Lists all virtual routers.
|
22
22
|
|
23
23
|
def list_routers(args = {:account => nil, :zone => nil, :projectid => nil, :status => nil, :name => nil})
|
@@ -84,7 +84,7 @@ module CloudstackClient
|
|
84
84
|
opts[:async] ? send_async_request(params)['router'] : send_request(params)
|
85
85
|
end
|
86
86
|
|
87
|
-
|
87
|
+
##
|
88
88
|
# Reboot virtual router.
|
89
89
|
|
90
90
|
def reboot_router(id, opts = {async: true})
|
@@ -95,6 +95,6 @@ module CloudstackClient
|
|
95
95
|
opts[:async] ? send_async_request(params)['router'] : send_request(params)
|
96
96
|
end
|
97
97
|
|
98
|
-
|
98
|
+
end
|
99
99
|
|
100
100
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module CloudstackClient
|
2
2
|
|
3
|
-
|
3
|
+
module Server
|
4
4
|
|
5
|
-
|
5
|
+
##
|
6
6
|
# Finds the server with the specified name.
|
7
7
|
|
8
8
|
def get_server(name, args = {})
|
@@ -23,7 +23,9 @@ module CloudstackClient
|
|
23
23
|
params['account'] = args[:account]
|
24
24
|
end
|
25
25
|
|
26
|
-
if args[:
|
26
|
+
if args[:project_id]
|
27
|
+
params['projectid'] = args[:project_id]
|
28
|
+
elsif args[:project]
|
27
29
|
project = get_project(args[:project])
|
28
30
|
if !project
|
29
31
|
msg = "Project '#{args[:project]}' is invalid"
|
@@ -31,8 +33,6 @@ module CloudstackClient
|
|
31
33
|
exit 1
|
32
34
|
end
|
33
35
|
params['projectid'] = project['id']
|
34
|
-
elsif args[:project_id]
|
35
|
-
params['projectid'] = args[:project_id]
|
36
36
|
end
|
37
37
|
|
38
38
|
json = send_request(params)
|
@@ -116,7 +116,7 @@ module CloudstackClient
|
|
116
116
|
'command' => 'listVirtualMachines',
|
117
117
|
'listAll' => true
|
118
118
|
}
|
119
|
-
|
119
|
+
params.merge!(args[:custom]) if args[:custom]
|
120
120
|
|
121
121
|
params['state'] = args[:state] if args[:state]
|
122
122
|
params['state'] = args[:status] if args[:status]
|
@@ -21,6 +21,8 @@ module CloudstackClient
|
|
21
21
|
|
22
22
|
params['state'] = args[:state] if args[:state]
|
23
23
|
params['podid'] = args[:podid] if args[:podid]
|
24
|
+
params['systemvmtype'] = args[:type] if args[:type]
|
25
|
+
params['storageid'] = args[:storage_id] if args[:storage_id]
|
24
26
|
|
25
27
|
json = send_request(params)
|
26
28
|
json['systemvm'] || []
|
@@ -28,4 +30,53 @@ module CloudstackClient
|
|
28
30
|
|
29
31
|
end
|
30
32
|
|
33
|
+
##
|
34
|
+
# Stop system VM.
|
35
|
+
#
|
36
|
+
|
37
|
+
def stop_system_vm(id, args = {})
|
38
|
+
params = {
|
39
|
+
'command' => 'stopSystemVm',
|
40
|
+
'id' => id
|
41
|
+
}
|
42
|
+
params['forced'] = true if args[:forced]
|
43
|
+
args[:sync] ? send_request(params) : send_async_request(params)['systemvm']
|
44
|
+
end
|
45
|
+
|
46
|
+
##
|
47
|
+
# Start system VM.
|
48
|
+
#
|
49
|
+
|
50
|
+
def start_system_vm(id, args = {})
|
51
|
+
params = {
|
52
|
+
'command' => 'startSystemVm',
|
53
|
+
'id' => id
|
54
|
+
}
|
55
|
+
args[:sync] ? send_request(params) : send_async_request(params)['systemvm']
|
56
|
+
end
|
57
|
+
|
58
|
+
##
|
59
|
+
# Reboot sytem VM.
|
60
|
+
#
|
61
|
+
|
62
|
+
def reboot_system_vm(id, args = {})
|
63
|
+
params = {
|
64
|
+
'command' => 'rebootSystemVm',
|
65
|
+
'id' => id
|
66
|
+
}
|
67
|
+
args[:sync] ? send_request(params) : send_async_request(params)['systemvm']
|
68
|
+
end
|
69
|
+
|
70
|
+
##
|
71
|
+
# Destroy sytem VM.
|
72
|
+
#
|
73
|
+
|
74
|
+
def destroy_system_vm(id, args = {})
|
75
|
+
params = {
|
76
|
+
'command' => 'destroySystemVm',
|
77
|
+
'id' => id
|
78
|
+
}
|
79
|
+
args[:sync] ? send_request(params) : send_async_request(params)['systemvm']
|
80
|
+
end
|
81
|
+
|
31
82
|
end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
module CloudstackClient
|
2
2
|
|
3
|
-
|
3
|
+
module Volume
|
4
4
|
|
5
|
-
|
5
|
+
##
|
6
6
|
# Lists all volumes.
|
7
|
-
|
7
|
+
|
8
8
|
def list_volumes(args = {})
|
9
9
|
params = {
|
10
10
|
'command' => 'listVolumes',
|
@@ -13,11 +13,11 @@ module CloudstackClient
|
|
13
13
|
|
14
14
|
if args[:zone]
|
15
15
|
zone = get_zone(args[:zone])
|
16
|
-
unless zone
|
16
|
+
unless zone
|
17
17
|
puts "Error: Zone #{args[:zone]} not found"
|
18
18
|
exit 1
|
19
19
|
end
|
20
|
-
params['zoneid'] = zone['id']
|
20
|
+
params['zoneid'] = zone['id']
|
21
21
|
end
|
22
22
|
|
23
23
|
if args[:account]
|
@@ -44,11 +44,11 @@ module CloudstackClient
|
|
44
44
|
params['tags'] = args[:tags] if args[:tags]
|
45
45
|
params['podid'] = args[:pod_id] if args[:pod_id]
|
46
46
|
params['isrecursive'] = args[:is_recursive] if args[:is_recursive]
|
47
|
-
|
47
|
+
|
48
48
|
json = send_request(params)
|
49
49
|
json['volume'] || []
|
50
50
|
end
|
51
51
|
|
52
|
-
|
52
|
+
end
|
53
53
|
|
54
|
-
end
|
54
|
+
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.9.
|
4
|
+
version: 0.9.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nik Wolfgramm
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdoc
|