Class: Api::V1::DomainsController

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

Direct Known Subclasses

Api::V2::DomainsController

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


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

def create
  @domain = Domain.new(params[:domain])
  process_response @domain.save
end

#destroyObject


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

def destroy
  process_response @domain.destroy
end

#indexObject


24
25
26
# File 'app/controllers/api/v1/domains_controller.rb', line 24

def index
  @domains = Domain.search_for(*search_options).paginate(paginate_options)
end

#showObject


31
32
# File 'app/controllers/api/v1/domains_controller.rb', line 31

def show
end

#updateObject


62
63
64
# File 'app/controllers/api/v1/domains_controller.rb', line 62

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