-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAlertgroup.hs
More file actions
99 lines (78 loc) · 3.19 KB
/
Alertgroup.hs
File metadata and controls
99 lines (78 loc) · 3.19 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
{-
Alertmanager API
API of the Prometheus Alertmanager (https://github.com/prometheus/alertmanager)
OpenAPI Version: 3.0.1
Alertmanager API API version: 0.0.1
Generated by OpenAPI Generator (https://openapi-generator.tech)
-}
{-|
Module : Network.Alertmanager.OpenAPI.API.Alertgroup
-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MonoLocalBinds #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-}
module Network.Alertmanager.OpenAPI.API.Alertgroup where
import Network.Alertmanager.OpenAPI.Core
import Network.Alertmanager.OpenAPI.MimeTypes
import Network.Alertmanager.OpenAPI.Model as M
import qualified Data.Aeson as A
import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy as BL
import qualified Data.Data as P (Typeable, TypeRep, typeOf, typeRep)
import qualified Data.Foldable as P
import qualified Data.Map as Map
import qualified Data.Maybe as P
import qualified Data.Proxy as P (Proxy(..))
import qualified Data.Set as Set
import qualified Data.String as P
import qualified Data.Text as T
import qualified Data.Text.Encoding as T
import qualified Data.Text.Lazy as TL
import qualified Data.Text.Lazy.Encoding as TL
import qualified Data.Time as TI
import qualified Network.HTTP.Client.MultipartFormData as NH
import qualified Network.HTTP.Media as ME
import qualified Network.HTTP.Types as NH
import qualified Web.FormUrlEncoded as WH
import qualified Web.HttpApiData as WH
import Data.Text (Text)
import GHC.Base ((<|>))
import Prelude ((==),(/=),($), (.),(<$>),(<*>),(>>=),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor)
import qualified Prelude as P
-- * Operations
-- ** Alertgroup
-- *** getAlertGroups
-- | @GET \/alerts\/groups@
--
-- Get a list of alert groups
--
getAlertGroups
:: AlertmanagerRequest GetAlertGroups MimeNoContent [AlertGroup] MimeJSON
getAlertGroups =
_mkRequest "GET" ["/alerts/groups"]
data GetAlertGroups
-- | /Optional Param/ "active" - Show active alerts
instance HasOptionalParam GetAlertGroups Active where
applyOptionalParam req (Active xs) =
req `addQuery` toQuery ("active", Just xs)
-- | /Optional Param/ "silenced" - Show silenced alerts
instance HasOptionalParam GetAlertGroups Silenced where
applyOptionalParam req (Silenced xs) =
req `addQuery` toQuery ("silenced", Just xs)
-- | /Optional Param/ "inhibited" - Show inhibited alerts
instance HasOptionalParam GetAlertGroups Inhibited where
applyOptionalParam req (Inhibited xs) =
req `addQuery` toQuery ("inhibited", Just xs)
-- | /Optional Param/ "filter" - A list of matchers to filter alerts by
instance HasOptionalParam GetAlertGroups Filter where
applyOptionalParam req (Filter xs) =
req `addQuery` toQueryColl MultiParamArray ("filter", Just xs)
-- | /Optional Param/ "receiver" - A regex matching receivers to filter alerts by
instance HasOptionalParam GetAlertGroups Receiver2 where
applyOptionalParam req (Receiver2 xs) =
req `addQuery` toQuery ("receiver", Just xs)
-- | @application/json@
instance Produces GetAlertGroups MimeJSON