Revision ebc810f4 src/cli/onezone
src/cli/onezone | ||
---|---|---|
91 | 91 |
end |
92 | 92 |
end |
93 | 93 |
|
94 |
addserver_desc = <<-EOT.unindent |
|
95 |
Add an OpenNebula server to this zone. |
|
96 |
EOT |
|
97 |
|
|
98 |
command :"server-add", addserver_desc, :zoneid, :options => |
|
99 |
[ OneZoneHelper::SERVER_NAME, OneZoneHelper::SERVER_ENDPOINT] do |
|
100 |
|
|
101 |
if options[:server_name].nil? || options[:server_rpc].nil? |
|
102 |
STDERR.puts "To add a server set:" |
|
103 |
STDERR.puts "\t-n <server name>" |
|
104 |
STDERR.puts "\t-r <RPC endpoint>" |
|
105 |
exit -1 |
|
106 |
end |
|
107 |
|
|
108 |
template = <<-EOT |
|
109 |
SERVER = [ |
|
110 |
NAME="#{options[:server_name]}", |
|
111 |
ENDPOINT="#{options[:server_rpc]}" |
|
112 |
] |
|
113 |
EOT |
|
114 |
|
|
115 |
helper.perform_action(args[0], options, "server added") do |o| |
|
116 |
o.add_servers(template) |
|
117 |
end |
|
118 |
|
|
119 |
end |
|
120 |
|
|
94 | 121 |
update_desc = <<-EOT.unindent |
95 | 122 |
Update the template contents. If a path is not provided the editor will |
96 | 123 |
be launched to modify the current content. |
Also available in: Unified diff