-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfrontend_api_spec.yaml
More file actions
155 lines (146 loc) · 4.65 KB
/
frontend_api_spec.yaml
File metadata and controls
155 lines (146 loc) · 4.65 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
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
openapi: "3.0.0"
info:
version: "0.0.1"
title: "Kilowatt Kojote Frontend API"
paths:
frontend_smartmeter:
get:
responses:
"200":
description: OK
content:
application/json:
example: '[{"uuid": "a3b639f1-1ea2-4eda-97d0-4ddd68b4514a", "type": 0, "latitude": 49.53691, "longitude": 8.75123, "supplier": "EnBW", "data": [{"timestamp": 1698934659, "actual_timestamp": 1698934900, "reading": 123456},{"timestamp": 1698934900, "actual_timestamp": 1698934900, "reading": 123457}]}]'
frontend_smartmeter_reading:
get:
parameters:
- in: query
schema: {
"type": "string",
"minLength": 1,
}
name: uuid
required: true
description: UUID of the smartmeter to get the reading of
responses:
"200":
description: OK
content:
application/json:
example: '[{"timestamp": 1698934659, "actual_timestamp": 1698934900, "reading": 123456},{"timestamp": 1698934900, "actual_timestamp": 1698934900, "reading": 123457}]'
frontend_smartmeter_revoke:
post:
parameters:
- in: query
name: uuid
schema: {
"type": "string",
"minLength": 1,
}
required: true
description: UUID of the smartmeter to get the reading of
description: Revoke Certificate of a smartmeter
responses:
"200":
description: OK
frontend_smartmeter_supplier:
get:
parameters:
- in: query
name: uuid
schema: {
"type": "string",
"minLength": 1,
}
required: true
description: UUID of the smartmeter to get the reading of
description: Get Supplier of a specific smartmeter
responses:
"200":
description: OK
content:
application/json:
example: '{"supplier": "EnBW"}'
frontend_supplier:
get:
responses:
"200":
description: OK
content:
application/json:
example: '[{"id": 1, "supplier": "EnBW"}]'
frontend_supplier_smartmeter:
get:
parameters:
- in: query
name: uuid
schema: {
"type": "string",
"minLength": 1,
}
required: true
description: ID of the supplier
description: Get Smartmeters of a specific supplier
responses:
"200":
description: OK
content:
application/json:
example: '[{"uuid": "a3b639f1-1ea2-4eda-97d0-4ddd68b4514a", "type": 0, "latitude": 49.53691, "longitude": 8.75123}]'
frontend_supplier_add:
post:
requestBody:
content:
application/json:
example: '{"name": "Naturstrom", "notes": "voll öko und so"}'
schema: {
"type": "object",
"properties": {
"name": {
"description": "Name of the supplier",
"type": "string",
"minLength": MIN_SUPPLIER_NAME_LEN,
"maxLength": MAX_SUPPLIER_NAME_LEN
},
"notes": {
"description": "Additional notes regarding the supplier",
"type": "string",
"maxLength": MAX_SUPPLIER_NOTES_LEN
}
},
"required": ["name", "notes"]
}
required: true
responses:
"200":
description: OK
content:
application/json:
example: '{"certificate": "base64-encoded pfx file"}'
summary: "Erstellt neuen Stromanbieter"
frontend_supplier_assign:
post:
requestBody:
content:
application/json:
example: '{"uuid": "dd26cc97-3ed4-4e2d-88f9-e20d68d7bf01", "smartmeter": "a3b639f1-1ea2-4eda-97d0-4ddd68b4514a"}'
schema: {
"type": "object",
"properties": {
"uuid": {
"type": "string",
"minLength": 1,
},
"smartmeter": {
"description": "The serial number of the smartmeter that should be added to the supplier",
"type": "string",
"minLength": 1
}
},
"required": ["uuid", "smartmeter"]
}
required: true
responses:
"200":
description: OK
summary: "Ein bestimmtes smartmeter einem supplier zuordnen"