Class: Api::V2::ComputeProfilesController

Inherits:
BaseController show all
Includes:
Foreman::Controller::Parameters::ComputeProfile
Defined in:
app/controllers/api/v2/compute_profiles_controller.rb

Instance Method Summary collapse

Methods inherited from BaseController

#append_array_of_ids, #check_media_type, #metadata_by, #metadata_order, #metadata_page, #metadata_per_page, #metadata_search, #metadata_subtotal, #metadata_total, #render_error, #root_node_name, #setup_has_many_params

Methods included from Api::Version2

#api_version

Methods inherited from BaseController

#api_request?, #controller_permission, #get_resource, parameter_filter_context, #parent_scope, #resource_class_join, #resource_scope, #resource_scope_for_index

Methods included from Foreman::Controller::BruteforceProtection

#bruteforce_attempt?

Methods included from ApplicationShared

#current_permission, #find_default_taxonomy, #find_session_taxonomy, #scope_by_resource_id, #set_current_taxonomy, #set_current_user, #set_taxonomy, #store_default_taxonomy, #store_taxonomy

Methods included from FindCommon

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

Methods included from Foreman::ThreadSession::Cleaner

#clear_thread

Methods included from Foreman::Controller::Timezone

#set_timezone

Methods included from Foreman::Controller::TopbarSweeper

#set_topbar_sweeper_controller

Methods included from Foreman::Controller::Session

#backup_session_content, #expire_session, #ignore_api_request?, #session_expiry, #set_activity_time, #update_activity_time

Methods included from Foreman::Controller::Authentication

#authenticate, #authorized, #available_sso, #check_user_enabled, #is_admin?, #path_to_authenticate, #require_login

Methods included from Foreman::Controller::MigrationChecker

needs_migration?

Instance Method Details

#createObject


31
32
33
34
# File 'app/controllers/api/v2/compute_profiles_controller.rb', line 31

def create
  @compute_profile = ComputeProfile.new(compute_profile_params)
  process_response @compute_profile.save
end

#destroyObject


47
48
49
# File 'app/controllers/api/v2/compute_profiles_controller.rb', line 47

def destroy
  process_response @compute_profile.destroy
end

#indexObject


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

def index
  @compute_profiles = resource_scope_for_index
end

#showObject


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

def show
end

#updateObject


40
41
42
# File 'app/controllers/api/v2/compute_profiles_controller.rb', line 40

def update
  process_response @compute_profile.update(compute_profile_params)
end