app/controllers/servers_controller.rb in rumm-0.0.23 vs app/controllers/servers_controller.rb in rumm-0.0.24
- old
+ new
@@ -29,23 +29,33 @@
server = compute.servers.bootstrap options
command.output.puts " done."
return server
end
+ def update
+ template = Servers::UpdateForm
+ argv = MVCLI::Argv.new command.argv
+ form = template.new argv.options
+ form.validate!
+
+ unupdated_server = server
+ unupdated_server.name = form.name unless form.name == nil
+ unupdated_server.ipv4_address = form.ipv4 unless form.ipv4 == nil
+ unupdated_server.ipv6_address = form.ipv6 unless form.ipv6 == nil
+
+ unupdated_server.update
+ end
+
def destroy
server.tap do |s|
s.destroy
end
end
private
def server
index.find {|s| s.name == params[:id]} or fail Fog::Errors::NotFound
- end
-
- def generate_name
- 'divine-reef'
end
def ssh
test = server
ip_address = test.ipv4_address