Class: Api::V2::AnsibleOverrideValuesController
- Inherits:
-
BaseController
- Object
- BaseController
- Api::V2::AnsibleOverrideValuesController
- Includes:
- Api::Version2, Foreman::Controller::Parameters::AnsibleOverrideValue
- Defined in:
- app/controllers/api/v2/ansible_override_values_controller.rb
Overview
API controller for Ansible Roles
Instance Method Summary collapse
Methods included from Foreman::Controller::Parameters::AnsibleOverrideValue
Instance Method Details
#create ⇒ Object
26 27 28 29 30 31 32 |
# File 'app/controllers/api/v2/ansible_override_values_controller.rb', line 26 def create @ansible_variable = AnsibleVariable.(:edit_ansible_variables). find_by(:id => params[:ansible_variable_id].to_i) @override_value = @ansible_variable.lookup_values.create!(lookup_value_params['override_value']) @ansible_variable.update_attribute(:override, true) render 'api/v2/ansible_override_values/show' end |
#destroy ⇒ Object
37 38 39 40 41 42 43 44 45 46 |
# File 'app/controllers/api/v2/ansible_override_values_controller.rb', line 37 def destroy @override_value = LookupValue.find_by(:id => params[:id]) if @override_value @ansible_variable = AnsibleVariable.where(:id => @override_value.lookup_key_id) @override_value.destroy render 'api/v2/ansible_override_values/show' else not_found end end |
#resource_name ⇒ Object
48 49 50 |
# File 'app/controllers/api/v2/ansible_override_values_controller.rb', line 48 def resource_name 'ansible_variable' end |