blob: 27e4832d8f6412c7e0697d160557e2d3822560ae (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# frozen_string_literal: true
module Types
module AlertManagement
class PrometheusIntegrationType < ::Types::BaseObject
include ::Gitlab::Routing
graphql_name 'AlertManagementPrometheusIntegration'
description 'An endpoint and credentials used to accept Prometheus alerts for a project'
implements(Types::AlertManagement::IntegrationType)
authorize :admin_project
alias_method :prometheus_integration, :object
def name
prometheus_integration.title
end
def type
:prometheus
end
def token
prometheus_integration.project&.alerting_setting&.token
end
def url
prometheus_integration.project && notify_project_prometheus_alerts_url(prometheus_integration.project, format: :json)
end
def active
prometheus_integration.manual_configuration?
end
end
end
end
|