-
Notifications
You must be signed in to change notification settings - Fork 1
/
api.yml
157 lines (147 loc) · 3.76 KB
/
api.yml
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
openapi: 3.0.0
info:
title: PewView API
version: 1.0.0
servers:
- url: http://localhost:8080/api/v1
paths:
/buckets/latest:
get:
summary: Returns the latest bucket
tags:
- Bucket
responses:
'200':
description: A bucket containing connections, summarized in a given window of time
content:
application/json:
schema:
$ref: "#/components/schemas/Bucket"
/buckets/{timestamp}:
get:
summary: Returns a bucket for a specific timestamp
tags:
- Bucket
parameters:
- in: path
name: timestamp
schema:
type: string
format: date-time
required: true
description: The timestamp for which a bucket should be retrieved
responses:
'200':
description: A bucket containing connections, summarized in a given window of time
content:
application/json:
schema:
$ref: "#/components/schemas/Bucket"
"404":
$ref: "#/components/errors/404"
tags:
- name: Bucket
description: Bucket operations
components:
schemas:
Bucket:
type: object
required:
- origin
- duration
- connections
properties:
origin:
type: string
format: date-time
description: The origin of the window
example: "2021-01-30T08:30:00Z"
duration:
type: number
description: The duration of the window in seconds
example: 30
connections:
type: array
items:
$ref: "#/components/schemas/Connection"
Connection:
type: object
required:
- origin
- duration
- source
- destination
- metrics
properties:
origin:
type: number
description: The origin of the connection within the window as seconds from start
example: 13.7
duration:
type: number
description: The duration of the connection in seconds
example: 2.5
source:
$ref: "#/components/schemas/Coordinate"
destination:
$ref: "#/components/schemas/Coordinate"
metrics:
$ref: "#/components/schemas/Metrics"
Coordinate:
type: object
required:
- latitude
- longitude
properties:
latitude:
type: number
description: The latitude of the coordinate
example: 59.334591
longitude:
type: number
description: The longitude of the coordinate
example: 18.063240
Metrics:
type: object
properties:
sourceAddress:
type: string
description: Source IP address
example: 192.168.1.1
sourcePort:
type: number
description: Source port
example: 80
destinationAddress:
type: string
description: Destination IP address
example: ::ffff:c0a8:101
destinationPort:
type: number
description: Destination port
example: 8080
bytes:
type: number
description: The number of bytes sent in the connection
example: 3378032
ErrorResponse:
type: object
required:
- error
- code
properties:
error:
type: string
description: Error message
example: bucket not found
code:
type: number
description: HTTP status code
example: 404
errors:
"404":
description: Not found
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"