cloudstack-cli 1.0.0.rc4 → 1.0.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c62c4842e7f8a3c3a1c4a6ff6ba2017e2b41fec
|
4
|
+
data.tar.gz: 68281a3c904eafe27ade74e4d2b695b37b4919d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce6deeb265b58051bfab68096e7d3c3eb936d87312138985bfc5d2d0023579d39111007668a4ed1e20e6a03516ded95b98b2e2f8a8f902144865c2cdc610346e
|
7
|
+
data.tar.gz: d33e16c691f1f5c413a48854b93a5782f22132853f998362af66aad31b6144f41f0adb46e866f7524efa81af5ddcbb898efadf071536ab22e8005af2564de913
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
cloudstack-cli (1.0.0
|
4
|
+
cloudstack-cli (1.0.0)
|
5
5
|
cloudstack_client (~> 1.0.3)
|
6
6
|
thor (~> 0.19.1)
|
7
7
|
|
@@ -14,8 +14,8 @@ PATH
|
|
14
14
|
GEM
|
15
15
|
remote: https://rubygems.org/
|
16
16
|
specs:
|
17
|
-
json (1.8.
|
18
|
-
msgpack (0.5.
|
17
|
+
json (1.8.3)
|
18
|
+
msgpack (0.5.12)
|
19
19
|
rake (10.4.2)
|
20
20
|
rdoc (4.2.0)
|
21
21
|
json (~> 1.4)
|
@@ -8,17 +8,7 @@ class ComputeOffer < CloudstackCli::Base
|
|
8
8
|
if offerings.size < 1
|
9
9
|
puts "No offerings found."
|
10
10
|
else
|
11
|
-
|
12
|
-
offerings.each do |offering|
|
13
|
-
table << [
|
14
|
-
offering["name"],
|
15
|
-
offering["displaytext"],
|
16
|
-
offering["domain"],
|
17
|
-
offering["id"]
|
18
|
-
]
|
19
|
-
end
|
20
|
-
print_table table
|
21
|
-
say "Total number of offerings: #{offerings.size}"
|
11
|
+
print_compute_offerings(offerings)
|
22
12
|
end
|
23
13
|
end
|
24
14
|
|
@@ -33,12 +23,21 @@ class ComputeOffer < CloudstackCli::Base
|
|
33
23
|
def create(name)
|
34
24
|
resolve_domain
|
35
25
|
options[:name] = name
|
36
|
-
|
26
|
+
say("OK", :green) if client.create_service_offering(options)
|
37
27
|
end
|
38
28
|
|
39
29
|
desc 'delete ID', 'delete compute offering'
|
40
30
|
def delete(id)
|
41
|
-
|
31
|
+
offerings = client.list_service_offerings(id: id)
|
32
|
+
if offerings && offerings.size == 1
|
33
|
+
say "Are you sure you want to delete compute offering below?", :yellow
|
34
|
+
print_compute_offerings(offerings, false)
|
35
|
+
if yes?("[y/N]:", :yellow)
|
36
|
+
say("OK", :green) if client.delete_service_offering(id: id)
|
37
|
+
end
|
38
|
+
else
|
39
|
+
say "No offering with ID #{id} found.", :yellow
|
40
|
+
end
|
42
41
|
end
|
43
42
|
|
44
43
|
desc 'sort', 'sort by cpu and memory grouped by domain'
|
@@ -59,4 +58,20 @@ class ComputeOffer < CloudstackCli::Base
|
|
59
58
|
end
|
60
59
|
end
|
61
60
|
|
61
|
+
no_commands do
|
62
|
+
def print_compute_offerings(offerings, totals = true)
|
63
|
+
table = [%w(Name Displaytext Domain ID)]
|
64
|
+
offerings.each do |offering|
|
65
|
+
table << [
|
66
|
+
offering["name"],
|
67
|
+
offering["displaytext"],
|
68
|
+
offering["domain"],
|
69
|
+
offering["id"]
|
70
|
+
]
|
71
|
+
end
|
72
|
+
print_table table
|
73
|
+
say "Total number of offerings: #{offerings.size}" if totals
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
62
77
|
end
|
@@ -16,6 +16,7 @@ class Volume < CloudstackCli::Base
|
|
16
16
|
say "No volumes found."
|
17
17
|
else
|
18
18
|
table = [%w(Name Type Size VM Storage Offeringname Zone Status)]
|
19
|
+
table.first << 'Project' if options[:project]
|
19
20
|
volumes.each do |volume|
|
20
21
|
table << [
|
21
22
|
volume['name'], volume['type'],
|
@@ -26,6 +27,7 @@ class Volume < CloudstackCli::Base
|
|
26
27
|
volume['zonename'],
|
27
28
|
volume['state']
|
28
29
|
]
|
30
|
+
table.last << volume['project'] if options[:project]
|
29
31
|
end
|
30
32
|
print_table(table)
|
31
33
|
say "Total number of volumes: #{volumes.size}"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloudstack-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0
|
4
|
+
version: 1.0.0
|
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-
|
11
|
+
date: 2015-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdoc
|
@@ -98,7 +98,6 @@ files:
|
|
98
98
|
- lib/cloudstack-cli/commands/domain.rb
|
99
99
|
- lib/cloudstack-cli/commands/environment.rb
|
100
100
|
- lib/cloudstack-cli/commands/host.rb
|
101
|
-
- lib/cloudstack-cli/commands/infrastructure_stack.rb
|
102
101
|
- lib/cloudstack-cli/commands/ip_address.rb
|
103
102
|
- lib/cloudstack-cli/commands/iso.rb
|
104
103
|
- lib/cloudstack-cli/commands/job.rb
|
@@ -144,9 +143,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
144
143
|
version: 1.9.3
|
145
144
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
146
145
|
requirements:
|
147
|
-
- - "
|
146
|
+
- - ">="
|
148
147
|
- !ruby/object:Gem::Version
|
149
|
-
version:
|
148
|
+
version: '0'
|
150
149
|
requirements: []
|
151
150
|
rubyforge_project:
|
152
151
|
rubygems_version: 2.2.2
|
@@ -1,26 +0,0 @@
|
|
1
|
-
class InfrastructureStack < CloudstackCli::Base
|
2
|
-
|
3
|
-
desc "create STACKFILE", "create a infrastructure stack"
|
4
|
-
def create(stackfile)
|
5
|
-
stack = parse_file(stackfile)
|
6
|
-
say "Create '#{stack["name"]}' infrastructure stack...", :green
|
7
|
-
|
8
|
-
Domain.new.create_domains(stack['domains'])
|
9
|
-
|
10
|
-
say "Infrastructure stack '#{stack["name"]}' finished.", :green
|
11
|
-
end
|
12
|
-
|
13
|
-
desc "destroy STACKFILE", "destroy a infrastructure stack"
|
14
|
-
def destroy(stackfile)
|
15
|
-
stack = parse_file(stackfile)
|
16
|
-
say "Destroy '#{stack["name"]}' infrastructure stack...", :green
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
Domain.new.delete_domains(stack['domains'].reverse)
|
21
|
-
say "Infrastructure stack '#{stack["name"]}' finished.", :green
|
22
|
-
end
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
end
|