Class: Api::V1::ComputeResourcesController

Inherits:
BaseController show all
Defined in:
app/controllers/api/v1/compute_resources_controller.rb

Direct Known Subclasses

Api::V2::ComputeResourcesController

Instance Method Summary collapse

Methods included from Api::Version1

#api_version

Methods inherited from BaseController

#get_resource, #resource_class, #resource_name

Methods included from Foreman::ThreadSession::Cleaner

#clear_thread, included

Instance Method Details

#createObject


37
38
39
40
# File 'app/controllers/api/v1/compute_resources_controller.rb', line 37

def create
    @compute_resource = ComputeResource.new_provider(params[:compute_resource])
    process_response @compute_resource.save
end

#destroyObject


65
66
67
# File 'app/controllers/api/v1/compute_resources_controller.rb', line 65

def destroy
  process_response @compute_resource.destroy
end

#indexObject


12
13
14
# File 'app/controllers/api/v1/compute_resources_controller.rb', line 12

def index
  @compute_resources = ComputeResource.my_compute_resources.search_for(*search_options).paginate(paginate_options)
end

#resource_scopeObject


69
70
71
# File 'app/controllers/api/v1/compute_resources_controller.rb', line 69

def resource_scope
  resource_class.my_compute_resources
end

#showObject


19
20
# File 'app/controllers/api/v1/compute_resources_controller.rb', line 19

def show
end

#updateObject


58
59
60
# File 'app/controllers/api/v1/compute_resources_controller.rb', line 58

def update
  process_response @compute_resource.update_attributes(params[:compute_resource])
end