Class: Types::AlertManagement::PrometheusIntegrationType

Inherits:
BaseObject
  • Object
show all
Includes:
Gitlab::Routing
Defined in:
app/graphql/types/alert_management/prometheus_integration_type.rb

Instance Method Summary collapse

Methods included from Gitlab::Routing

includes_helpers, redirect_legacy_paths, url_helpers

Methods inherited from BaseObject

accepts, assignable?, authorization, authorization_scopes, authorize, authorized?, #current_user, #id

Methods included from Gitlab::Graphql::Present

#present, #unpresented

Instance Method Details

#activeObject



33
34
35
# File 'app/graphql/types/alert_management/prometheus_integration_type.rb', line 33

def active
  prometheus_integration.manual_configuration?
end

#nameObject



17
18
19
# File 'app/graphql/types/alert_management/prometheus_integration_type.rb', line 17

def name
  prometheus_integration.title
end

#tokenObject



25
26
27
# File 'app/graphql/types/alert_management/prometheus_integration_type.rb', line 25

def token
  prometheus_integration.project&.alerting_setting&.token
end

#typeObject



21
22
23
# File 'app/graphql/types/alert_management/prometheus_integration_type.rb', line 21

def type
  :prometheus
end

#urlObject



29
30
31
# File 'app/graphql/types/alert_management/prometheus_integration_type.rb', line 29

def url
  prometheus_integration.project && notify_project_prometheus_alerts_url(prometheus_integration.project, format: :json)
end