class NetworkinterfaceController
Controller class handling all networkinterface-related requests. Implements retrieval, creation and deletion of networkinterface instances.
Public Instance Methods
create()
click to toggle source
POST /link/networkinterface/
# File app/controllers/networkinterface_controller.rb, line 18 def create networkinterface = request_occi_collection(Occi::Core::Link).links.first networkinterface_location = backend_instance.compute_attach_network(networkinterface) respond_with("#{server_url}/link/networkinterface/#{networkinterface_location}", status: 201, flag: :link_only) end
delete()
click to toggle source
DELETE /link/networkinterface/:id
# File app/controllers/networkinterface_controller.rb, line 26 def delete result = backend_instance.compute_detach_network(params[:id]) if result respond_with(Occi::Collection.new) else respond_with(Occi::Collection.new, status: 304) end end
show()
click to toggle source
GET /link/networkinterface/:id
# File app/controllers/networkinterface_controller.rb, line 5 def show @networkinterface = Occi::Collection.new @networkinterface << backend_instance.compute_get_network(params[:id]) unless @networkinterface.empty? update_mixins_in_coll(@networkinterface) respond_with(@networkinterface) else respond_with(Occi::Collection.new, status: 404) end end