-
Notifications
You must be signed in to change notification settings - Fork 1
/
swagger.yaml
185 lines (182 loc) · 5.57 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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
swagger: "2.0"
basePath: /v1
info:
title: "dp-search-scrubber-api"
description: "Allows users to identify Output Areas (OA) and Industry Classification (SIC) associated with a given location."
version: 1.0.0
license:
name: "MIT License"
schemes:
- http
paths:
/scrubber:
get:
summary: Identifies OA and Industry Classification associated with a given OAC or SIC
description: Returns information associated with those codes, like Name, Region Name/Code, OAC for areas and Name and SIC for industries.
produces:
- application/json
parameters:
- in: query
name: query_string
description: "The query string to search data by"
required: true
type: "string"
responses:
200:
description: OK
schema:
$ref: "#/definitions/ScrubberResp"
examples:
application/json:
time: "33µs"
query: "dentists in E00000014 01140"
results:
areas:
- name: "City of London"
region: "London"
region_code: "E12000007"
codes:
E00000014: "E00000014"
industries:
- code: "01140"
name: "Growing of sugar cane"
500:
$ref: '#/responses/InternalError'
/health:
get:
tags:
- private
summary: "Returns API's health status"
description: "Returns health status of the API and checks on dependent services"
produces:
- application/json
responses:
200:
description: "Successfully returns OK status with checks of dependent services"
schema:
$ref: "#/definitions/Health"
429:
description: "Services warming up or degraded (at least one check in WARNING or CRITICAL status)"
500:
$ref: "#/responses/InternalError"
responses:
InternalError:
description: "Failed to process the request due to an internal error"
definitions:
ScrubberResp:
type: "object"
properties:
time:
type: "string"
description: "The timestamp of the response"
query:
type: "string"
description: "The query string that the search was made by"
results:
$ref: "#/definitions/Results"
Results:
type: "object"
properties:
areas:
type: "array"
items:
$ref: "#/definitions/AreaResp"
description: "A list of areas related to the query"
industries:
type: "array"
items:
$ref: "#/definitions/IndustryResp"
description: "A list of industries related to the query"
AreaResp:
type: "object"
properties:
name:
type: "string"
description: "The name of the area"
region:
type: "string"
description: "The region of the area"
region_code:
type: "string"
description: "The region code of the area"
codes:
type: "object"
description: "A map of codes associated with the area"
IndustryResp:
type: "object"
properties:
code:
type: "string"
description: "The code for the industry"
name:
type: "string"
description: "The name of the industry"
Health:
type: object
properties:
status:
type: string
description: "The status of the API"
enum: ["OK", "WARNING", "CRITICAL"]
version:
type: object
properties:
build_time:
type: string
description: "The build date and time of the API"
example: "2020-06-11T12:49:20+01:00"
git_commit:
type: string
description: "The git commit hash of the API"
example: "7c2febbf2b818175112478d4ffbadbee1b654f63"
language:
type: string
description: "The programming language used to implement API"
example: "go"
language_version:
type: string
description: "The version of the programming language used to implement API"
example: "go1.14.3"
version:
type: string
description: "The version of API"
example: "1.0.0"
uptime:
type: string
description: "The uptime of API"
example: "34516"
start_time:
type: string
description: "The start date and time of API running"
example: "2020-06-11T11:49:21.520922Z"
checks:
type: array
items:
$ref: '#/definitions/HealthChecker'
HealthChecker:
type: object
properties:
name:
type: string
description: "The name of external service used by API"
enum: ["mongodb"]
status:
type: string
description: "The status of the external service"
enum: ["OK", "WARNING", "CRITICAL"]
message:
type: string
description: "The message status of the external service"
example: "mongodb is OK"
last_checked:
type: string
description: "The last health check date and time of the external service"
example: "2020-06-11T11:49:50.330089Z"
last_success:
type: string
description: "The last successful health check date and time of the external service"
example: "2020-06-11T11:49:50.330089Z"
last_failure:
type: string
description: "The last failed health check date and time of the external service"
example: "2019-09-22T11:48:51.0000001Z"