-
Notifications
You must be signed in to change notification settings - Fork 0
/
swagger.yaml
159 lines (158 loc) · 4.08 KB
/
swagger.yaml
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
---
openapi: 3.0.3
info:
title: apprise-it-for-me API
description: >-
[apprise-it-for-me](https://github.com/mrtwnklr/apprise-it-for-me) is a
gateway for [Apprise](https://github.com/caronc/apprise).
It accepts HTTP POST data, transforms it into an Apprise notification
payload and sends it to an [Apprise API
server](https://github.com/caronc/apprise-api/).
version: 0.1.0
paths:
/health:
get:
operationId: Healthcheck
summary: Simple healthcheck
responses:
'200':
description: OK
/from_{source}/notify/{key}:
post:
operationId: Generic_SendNotification
summary: >-
Forwards a notification request to Apprise. Uses a custom source
converter to create the Apprise notification payload.
parameters:
- $ref: '#/components/parameters/source'
- $ref: '#/components/parameters/key'
requestBody:
content:
text/plain:
schema:
type: string
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/PersistentNotificationResponse'
'400':
description: Source key invalid
'404':
description: Source converter not found
'500':
description: Source converter failed
tags:
- notify
/from_grafana/notify/{key}:
post:
operationId: SendNotification_FromGrafana
summary: Forwards a Grafana alert notification to Apprise.
parameters:
- $ref: '#/components/parameters/key'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/NotificationRequestFromGrafana'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/PersistentNotificationResponse'
'500':
description: Source converter failed
tags:
- notify
components:
parameters:
source:
in: path
name: source
description: Notification source key (e.g. application name)
required: true
schema:
type: string
example: my-custom-source
key:
in: path
name: key
description: Apprise configuration key
required: true
schema:
type: string
minLength: 1
maxLength: 64
example: to-matrix
schemas:
NotificationType:
type: string
enum:
- info
- warning
- failure
- success
example: failure
NotificationFormat:
type: string
enum:
- text
- markdown
- html
example: markdown
PersistentNotificationResponse:
properties:
message:
type: string
example: Alert one is firing
title:
type: string
example: Alert one
notification_type:
$ref: '#/components/schemas/NotificationType'
format:
$ref: '#/components/schemas/NotificationFormat'
tag:
type: string
example: all
required:
- body
NotificationRequestFromGrafana:
properties:
body:
type: string
example: Alert one is firing
title:
type: string
example: Alert one
status:
type: string
enum:
- firing
- resolved
example: firing
commonLabels:
type: object
properties:
title:
type: string
description: Overrides top level title
example: Alert one
notification_type:
type: string
description: Overrides top level status
enum:
- firing
- resolved
example: firing
format:
$ref: '#/components/schemas/NotificationFormat'
tag:
type: string
example: all
required:
- body