Class: Api::V1::ImagesController

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

Instance Method Summary collapse

Methods included from Api::Version1

#api_version

Methods inherited from BaseController

#get_resource, #resource_class, #resource_name, #resource_scope

Methods included from Foreman::ThreadSession::Cleaner

#clear_thread, included

Instance Method Details

#createObject


36
37
38
39
# File 'app/controllers/api/v1/images_controller.rb', line 36

def create
  @image = @compute_resource.images.new(params[:image])
  process_response @image.save, @compute_resource
end

#destroyObject


61
62
63
# File 'app/controllers/api/v1/images_controller.rb', line 61

def destroy
  process_response @image.destroy
end

#indexObject


14
15
16
# File 'app/controllers/api/v1/images_controller.rb', line 14

def index
  @images = @compute_resource.images.search_for(*search_options).paginate(paginate_options)
end

#showObject


22
23
# File 'app/controllers/api/v1/images_controller.rb', line 22

def show
end

#updateObject


53
54
55
# File 'app/controllers/api/v1/images_controller.rb', line 53

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