Class: Api::V1::ArchitecturesController

Inherits:
BaseController show all
Defined in:
app/controllers/api/v1/architectures_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


29
30
31
32
# File 'app/controllers/api/v1/architectures_controller.rb', line 29

def create
  @architecture = Architecture.new(params[:architecture])
  process_response @architecture.save
end

#destroyObject


48
49
50
# File 'app/controllers/api/v1/architectures_controller.rb', line 48

def destroy
  process_response @architecture.destroy
end

#indexObject


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

def index
  @architectures = Architecture.includes(:operatingsystems).
    search_for(*search_options).paginate(paginate_options)
end

#showObject


20
21
# File 'app/controllers/api/v1/architectures_controller.rb', line 20

def show
end

#updateObject


41
42
43
# File 'app/controllers/api/v1/architectures_controller.rb', line 41

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