Class: AlertManagement::HttpIntegration

Inherits:
ApplicationRecord show all
Includes:
Gitlab::Routing
Defined in:
app/models/alert_management/http_integration.rb

Constant Summary collapse

LEGACY_IDENTIFIERS =
%w[legacy legacy-prometheus].freeze

Constants inherited from ApplicationRecord

ApplicationRecord::MAX_PLUCK

Constants included from ResetOnUnionError

ResetOnUnionError::MAX_RESET_PERIOD

Instance Method Summary collapse

Methods included from Gitlab::Routing

includes_helpers, redirect_legacy_paths, url_helpers

Methods inherited from ApplicationRecord

cached_column_list, #create_or_load_association, declarative_enum, default_select_columns, id_in, id_not_in, iid_in, pluck_primary_key, primary_key_in, #readable_by?, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, #to_ability_name, underscore, where_exists, where_not_exists, with_fast_read_statement_timeout, without_order

Methods included from SensitiveSerializableHash

#serializable_hash

Instance Method Details

#legacy?Boolean

Returns:

  • (Boolean)


54
55
56
# File 'app/models/alert_management/http_integration.rb', line 54

def legacy?
  LEGACY_IDENTIFIERS.include?(endpoint_identifier)
end

#urlObject



43
44
45
46
47
48
49
50
51
52
# File 'app/models/alert_management/http_integration.rb', line 43

def url
  case endpoint_identifier
  when 'legacy'
    project_alerts_notify_url(project, format: :json)
  when 'legacy-prometheus'
    notify_project_prometheus_alerts_url(project, format: :json)
  else
    project_alert_http_integration_url(project, name_slug, endpoint_identifier, format: :json)
  end
end