Class: Api::V2::ForemanDatacenter::DeviceRolesController

Inherits:
BaseController
  • Object
show all
Includes:
ForemanDatacenter::Controller::Parameters::DeviceRole
Defined in:
app/controllers/api/v2/foreman_datacenter/device_roles_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

#createObject



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

def create
  @device_role = ::ForemanDatacenter::DeviceRole.new(device_role_params)
  process_response @device_role.save
end

#destroyObject



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

def destroy
  process_response @device_role.destroy
end

#indexObject



15
16
17
# File 'app/controllers/api/v2/foreman_datacenter/device_roles_controller.rb', line 15

def index
  @device_roles = resource_scope_for_index
end

#showObject



22
23
# File 'app/controllers/api/v2/foreman_datacenter/device_roles_controller.rb', line 22

def show
end

#updateObject



44
45
46
# File 'app/controllers/api/v2/foreman_datacenter/device_roles_controller.rb', line 44

def update
  process_response @device_role.update(device_role_params)
end