Class: Api::V2::WebhooksController

Inherits:
V2::BaseController
  • Object
show all
Includes:
Api::Version2, ForemanWebhooks::Controller::Parameters::Webhook
Defined in:
app/controllers/api/v2/webhooks_controller.rb

Instance Method Summary collapse

Methods included from ForemanWebhooks::Controller::Parameters::Webhook

#webhook_params

Instance Method Details

#createObject



43
44
45
46
# File 'app/controllers/api/v2/webhooks_controller.rb', line 43

def create
  @webhook = Webhook.new(webhook_params)
  process_response @webhook.save
end

#destroyObject



57
58
59
# File 'app/controllers/api/v2/webhooks_controller.rb', line 57

def destroy
  process_response @webhook.destroy
end

#indexObject



14
15
16
# File 'app/controllers/api/v2/webhooks_controller.rb', line 14

def index
  @webhooks = resource_scope_for_index
end

#showObject



20
# File 'app/controllers/api/v2/webhooks_controller.rb', line 20

def show; end

#updateObject



51
52
53
# File 'app/controllers/api/v2/webhooks_controller.rb', line 51

def update
  process_response @webhook.update(webhook_params)
end