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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
# frozen_string_literal: true
module Types
module AlertManagement
module IntegrationType
include Types::BaseInterface
graphql_name 'AlertManagementIntegration'
field :id,
GraphQL::Types::ID,
null: false,
description: 'ID of the integration.'
field :type,
AlertManagement::IntegrationTypeEnum,
null: false,
description: 'Type of integration.'
field :name,
GraphQL::Types::String,
null: true,
description: 'Name of the integration.'
field :active,
GraphQL::Types::Boolean,
null: true,
description: 'Whether the endpoint is currently accepting alerts.'
field :token,
GraphQL::Types::String,
null: true,
description: 'Token used to authenticate alert notification requests.'
field :url,
GraphQL::Types::String,
null: true,
description: 'Endpoint which accepts alert notifications.'
field :api_url,
GraphQL::Types::String,
null: true,
description: 'URL at which Prometheus metrics can be queried to populate the metrics dashboard.'
definition_methods do
def resolve_type(object, context)
if object.is_a?(::Integrations::Prometheus)
Types::AlertManagement::PrometheusIntegrationType
else
Types::AlertManagement::HttpIntegrationType
end
end
end
orphan_types Types::AlertManagement::PrometheusIntegrationType,
Types::AlertManagement::HttpIntegrationType
end
end
end
|