-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathswagger.yml
More file actions
139 lines (138 loc) · 4.04 KB
/
swagger.yml
File metadata and controls
139 lines (138 loc) · 4.04 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
openapi: 3.0.3
info:
title: Mtx IP Logger
description: Store your visitor's ip addresses, then query analytics on them
version: 0.1.0-SNAPSHOT
servers:
- url: 'http://localhost:8080'
description: Local dev environment
paths:
/server-info:
get:
summary: Get info about this server instance
responses:
'200':
description: Server information
content:
application/json:
schema:
$ref: '#/components/schemas/ApiResponse'
'401':
description: Authorization header is missing or invalid
/ip/log:
post:
summary: Logs a single IPv4 address
parameters:
- name: address
in: query
required: true
description: IPv4 address to log
schema:
type: string
- name: app_id
in: query
required: true
description: Application ID
schema:
type: string
responses:
'201':
description: IP has been logged
content:
application/json:
schema:
$ref: '#/components/schemas/ApiResponse'
'400':
description: IP parameter (name='address') or App ID parameter (app_id) is missing
'401':
description: Authorization header is missing or invalid
'409':
description: Duplicate log
'422':
description: IP is malformed or invalid
/ip/list/unique:
get:
summary: Get a list of the 400 most recent unique IPs logged
parameters:
- name: app_id
in: query
required: true
description: Application ID
schema:
type: string
- name: max
in: query
required: false
description: Maximum number of results
schema:
type: number
format: int32
responses:
'200':
description: All unique IPs logged in order of most to least recent (max 400)
content:
application/json:
schema:
$ref: '#/components/schemas/ApiResponse'
'400':
description: App ID parameter (app_id) is missing or max results parameter (max) is invalid
'401':
description: Authorization header is missing or invalid
/ip/list/all:
get:
summary: Get a list of the 400 last IPs logged
parameters:
- name: app_id
in: query
required: true
description: Application ID
schema:
type: string
- name: max
in: query
required: false
description: Maximum number of results
schema:
type: number
format: int32
responses:
'200':
description: All IPs logged in the order they were logged in (max 400)
content:
application/json:
schema:
$ref: '#/components/schemas/ApiResponse'
'400':
description: App ID parameter (app_id) is missing or max results parameter (max) is invalid
'401':
description: Authorization header is missing or invalid
components:
schemas:
ApiResponse:
type: object
properties:
requestUri:
type: string
description: URI sent to the server that led you here
example: http://localhost:8080/ip/log?address=192.158.1.38&app_id=1248
response:
type: string
description: Message from the server in response
example: Created - IP has been logged
statusCode:
type: integer
format: int32
description: HTTP status code
example: 201
timestamp:
type: string
format: date-time
description: Timestamp of when this response was generated
content:
type: object
description: Response body if this was a GET request
required:
- requestUri
- response
- statusCode
- timestamp