cloudstack-cli 0.12.1 → 0.12.2
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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +14 -1
- data/lib/cloudstack-cli/commands/stack.rb +7 -5
- data/lib/cloudstack-cli/version.rb +1 -1
- metadata +2 -3
- data/CHANGELOG.md +0 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e382582b33a19593f0ab0f5743d9e9432dab2e88
|
4
|
+
data.tar.gz: a5702646ce71db7bbd8bad56cbd5c26290245d2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c03b172bf5457b28253cfa0c648928906ec60c7de8a8e460c34c2f08f61d321b264fe58a00e3ddf35c883f8dda6b180ffa22fb0ef95da86c85a4d49c73092ba2
|
7
|
+
data.tar.gz: baf300b01b00682d8836b8e027153d2de58d1a4066c8576e9ae1a6e2662e2657a9c706e839ebb508ee0ac358011f0fb4622569805c2227f257194f11fad27cc5
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -81,7 +81,7 @@ $ cs command listAlerts type=8
|
|
81
81
|
|
82
82
|
### Example: Creating a complete stack of servers
|
83
83
|
|
84
|
-
Cloudstack
|
84
|
+
Cloudstack CLI does support stack files in YAML or JSON.
|
85
85
|
|
86
86
|
An example stackfile could look like this (my_stackfile.yml):
|
87
87
|
|
@@ -118,6 +118,19 @@ Create the stack of servers from above:
|
|
118
118
|
```sh
|
119
119
|
$ cs stack create my_stackfile.yml
|
120
120
|
```
|
121
|
+
Hint: You can also parse a stackfile from a URI.
|
122
|
+
|
123
|
+
The following command destroys a stack using a definition gathered from a stackfile lying on a Github repository:
|
124
|
+
|
125
|
+
```sh
|
126
|
+
bundle exec cs stack destroy https://raw.githubusercontent.com/niwo/cloudstack-cli/master/test/stack_example.json
|
127
|
+
Destroy the following servers web-001, web-002, db-001? [y/N]: y
|
128
|
+
Destroy server web-001 : job completed
|
129
|
+
Destroy server web-002 : job completed
|
130
|
+
Destroy server db-001 : job completed
|
131
|
+
Completed: 3/3 (41.4s)
|
132
|
+
Finished.
|
133
|
+
```
|
121
134
|
|
122
135
|
### Example: Sort computing offerings
|
123
136
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'open-uri'
|
2
|
+
|
1
3
|
class Stack < CloudstackCli::Base
|
2
4
|
|
3
5
|
desc "create STACKFILE", "create a stack of servers"
|
@@ -8,7 +10,7 @@ class Stack < CloudstackCli::Base
|
|
8
10
|
jobs = []
|
9
11
|
client.verbose = false
|
10
12
|
stack["servers"].each do |instance|
|
11
|
-
instance["name"]
|
13
|
+
string_to_array(instance["name"]).each do |name|
|
12
14
|
server = client.get_server(name, project_id: projectid)
|
13
15
|
if server
|
14
16
|
say "Server #{name} (#{server["state"]}) already exists.", :yellow
|
@@ -46,13 +48,13 @@ class Stack < CloudstackCli::Base
|
|
46
48
|
say "Check for port forwarding rules...", :green
|
47
49
|
jobs = []
|
48
50
|
stack["servers"].each do |instance|
|
49
|
-
instance["name"]
|
51
|
+
string_to_array(instance["name"]).each do |name|
|
50
52
|
if port_rules = string_to_array(instance["port_rules"])
|
51
53
|
server = client(quiet: true).get_server(name, project_id: projectid)
|
52
54
|
create_port_rules(server, port_rules, false).each_with_index do |job_id, index|
|
53
55
|
jobs << {
|
54
56
|
id: job_id,
|
55
|
-
name: "Create port forwarding
|
57
|
+
name: "Create port forwarding rules (#{port_rules[index]}) for server #{name}"
|
56
58
|
}
|
57
59
|
end
|
58
60
|
end
|
@@ -79,7 +81,7 @@ class Stack < CloudstackCli::Base
|
|
79
81
|
client.verbose = false
|
80
82
|
servers = []
|
81
83
|
stack["servers"].each do |server|
|
82
|
-
server["name"]
|
84
|
+
string_to_array(server["name"]).each {|name| servers << name}
|
83
85
|
end
|
84
86
|
|
85
87
|
if options[:force] || yes?("Destroy the following servers #{servers.join(', ')}? [y/N]:", :yellow)
|
@@ -115,7 +117,7 @@ class Stack < CloudstackCli::Base
|
|
115
117
|
exit
|
116
118
|
end
|
117
119
|
begin
|
118
|
-
return handler.load
|
120
|
+
return handler.load open(stackfile){|f| f.read}
|
119
121
|
rescue SystemCallError
|
120
122
|
say "Can't find the stack file #{stackfile}.", :red
|
121
123
|
exit 1
|
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: 0.12.
|
4
|
+
version: 0.12.2
|
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-02-
|
11
|
+
date: 2015-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdoc
|
@@ -76,7 +76,6 @@ extensions: []
|
|
76
76
|
extra_rdoc_files: []
|
77
77
|
files:
|
78
78
|
- ".gitignore"
|
79
|
-
- CHANGELOG.md
|
80
79
|
- Gemfile
|
81
80
|
- Gemfile.lock
|
82
81
|
- LICENSE.txt
|
data/CHANGELOG.md
DELETED