Class: Api::V2::ForemanDatacenter::DeviceInterfaceConnectionsController

Inherits:
BaseController
  • Object
show all
Includes:
ForemanDatacenter::Controller::Parameters::DeviceInterfaceConnection
Defined in:
app/controllers/api/v2/foreman_datacenter/device_interface_connections_controller.rb

Instance Method Summary collapse

Methods inherited from BaseController

#action_permission, #controller_permission, #find_resource, #resource_class, #resource_class_for, #resource_finder, #resource_name, #resource_scope, #scope_for

Instance Method Details

#connectedObject



59
60
61
# File 'app/controllers/api/v2/foreman_datacenter/device_interface_connections_controller.rb', line 59

def connected
  process_response @device_interface_connection.connected!
end

#createObject



34
35
36
37
38
# File 'app/controllers/api/v2/foreman_datacenter/device_interface_connections_controller.rb', line 34

def create
  @device_interface_connection = ::ForemanDatacenter::DeviceInterfaceConnection.new(device_interface_connection_params.merge(interface_a: params[:device_interface_id]))
  @device_interface_connection.first_interface = get_device_interface
  process_response @device_interface_connection.save
end

#destroyObject



43
44
45
# File 'app/controllers/api/v2/foreman_datacenter/device_interface_connections_controller.rb', line 43

def destroy
  process_response @device_interface_connection.destroy
end

#indexObject



12
13
14
# File 'app/controllers/api/v2/foreman_datacenter/device_interface_connections_controller.rb', line 12

def index
  @device_interface_connections = resource_scope_for_index
end

#plannedObject



51
52
53
# File 'app/controllers/api/v2/foreman_datacenter/device_interface_connections_controller.rb', line 51

def planned
  process_response @device_interface_connection.planned!
end

#showObject



19
20
# File 'app/controllers/api/v2/foreman_datacenter/device_interface_connections_controller.rb', line 19

def show
end