Class: OpsworksHelpers::ApplicationController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/opsworks_helpers/application_controller.rb

Instance Method Summary collapse

Instance Method Details

#healthcheckObject



6
7
8
# File 'app/controllers/opsworks_helpers/application_controller.rb', line 6

def healthcheck
  head 200
end

#statusObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/controllers/opsworks_helpers/application_controller.rb', line 10

def status
  if command_block = OpsworksHelpers.status_checks.presence
    checks = StatusChecks.new(command_block)
    checks.execute
    @errors = checks.errors
  end

  if @errors.present?
    render json: {
      status: :internal_server_error,
      message: 'Something went wrong',
      errors: @errors
    }, status: :internal_server_error
  else
    render json: {status: :ok, message: 'Everything is awesome!'}
  end
end