Class: ForemanPuppet::Api::V2::EnvironmentsController
- Inherits:
-
PuppetBaseController
- Object
- Api::V2::BaseController
- PuppetBaseController
- ForemanPuppet::Api::V2::EnvironmentsController
- Includes:
- Parameters::Environment
- Defined in:
- app/controllers/foreman_puppet/api/v2/environments_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #index ⇒ Object
- #resource_class ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Methods included from Parameters::Environment
Instance Method Details
#create ⇒ Object
43 44 45 46 |
# File 'app/controllers/foreman_puppet/api/v2/environments_controller.rb', line 43 def create @environment = Environment.new(environment_params) process_response @environment.save end |
#destroy ⇒ Object
59 60 61 |
# File 'app/controllers/foreman_puppet/api/v2/environments_controller.rb', line 59 def destroy process_response @environment.destroy end |
#index ⇒ Object
23 24 25 |
# File 'app/controllers/foreman_puppet/api/v2/environments_controller.rb', line 23 def index @environments = resource_scope_for_index end |
#resource_class ⇒ Object
63 64 65 |
# File 'app/controllers/foreman_puppet/api/v2/environments_controller.rb', line 63 def resource_class ForemanPuppet::Environment end |
#show ⇒ Object
30 31 |
# File 'app/controllers/foreman_puppet/api/v2/environments_controller.rb', line 30 def show end |
#update ⇒ Object
52 53 54 |
# File 'app/controllers/foreman_puppet/api/v2/environments_controller.rb', line 52 def update process_response @environment.update(environment_params) end |