This repository has been archived by the owner on Oct 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathswagger.yml
178 lines (178 loc) · 5.79 KB
/
swagger.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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
openapi: 3.0.0
info:
title: Fast Purge URLs
description: Invalidate URLs from Akamai's cache using the Fast Purge API
license:
name: MIT
url: https://github.com/nhsuk/cache-flush/blob/master/LICENSE.md
version: 0.1.0
servers:
- url: https://api.nhs.uk/
description: Production server, requires API key
paths:
/utils/cache-flush:
post:
summary: Invalidate a set of URLs from Akamai's cache
description: Request a set of URLs to be invalidated for the given environment
from Akamai's cache using Fast Purge API
operationId: FastPurgeURLs
requestBody:
description: Set of URLs to invalidate in the given environment
content:
application/json:
schema:
$ref: '#/components/schemas/FastPurgeRequest'
required: true
responses:
201:
description: Request accepted
content:
application/json:
schema:
$ref: '#/components/schemas/201Response'
400:
description: Object invalid
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/MissingPropertiesResponse'
- $ref: '#/components/schemas/InvalidEnvironmentResponse'
- $ref: '#/components/schemas/InvalidObjectsResponse'
403:
description: URL contains a domain not under our control
content:
application/json:
schema:
$ref: '#/components/schemas/403Response'
500:
description: Error occurred during request to Akamai
content:
application/json:
schema:
$ref: '#/components/schemas/500Response'
components:
schemas:
FastPurgeRequest:
required:
- environment
- objects
type: object
properties:
objects:
type: array
description: The set of URLs to be invalidated from cache
example:
- https://sub.domain.nhs.uk/cached/page/path
- http://nhs.uk/another/cached/resource.ext
items:
type: string
environment:
type: string
description: Akamai environment against which the purge operation should
execute
example: production
enum:
- staging
- production
debug:
type: boolean
description: A boolean flag indicating if the request should include debug
information. Useful for debugging
default: false
201Response:
type: object
properties:
detail:
type: string
description: Additional detail on the response
example: Request accepted
estimatedSeconds:
type: integer
description: The estimated number of seconds the request will take to complete
example: 5
httpStatus:
type: integer
description: The http status code of the response from Akamai
example: 201
purgeID:
type: string
description: Akamai purge id
example: e535071c-26b2-11e7-94d7-276f2f54d938
supportId:
type: string
description: Akamai support id
example: 17PY1492793544958045-219026624
urls:
type: array
description: The set of URLs the request was made for
example:
- https://sub.domain.nhs.uk/cached/page/path
- http://nhs.uk/another/cached/resource.ext
items:
type: string
MissingPropertiesResponse:
type: object
properties:
message:
type: string
description: Informative message about why the request was rejected
example: 'Request must contain a body with required properties: ''environment'', ''objects''.'
403Response:
type: object
properties:
message:
type: string
description: Informative message about why the request was rejected
example: Some URLs can not be flushed from cache as they are not for the
domain 'nhs.uk'.
urls:
type: array
description: The set of URLs that do not match the allowed domain
example:
- https://not.nhs.uk.domain/cached/page/path
items:
type: string
InvalidObjectsResponse:
type: object
properties:
message:
type: string
description: Informative message about why the request was rejected
example: Some URLs are invalid as they are not parseable into a valid URL.
urls:
type: array
description: The set of URLs that were unable to be parsed into a valid
URL
example:
- not.a.valid.url
items:
type: string
InvalidEnvironmentResponse:
type: object
properties:
message:
type: string
description: Informative message about why the request was rejected
example: '''unknown'' environment is not a valid option for environment.
It must be one of: ''staging'', ''production''.'
500Response:
type: object
properties:
message:
type: string
description: Informative message about why the request was rejected
example: An error has occurred during cache flush.
error:
$ref: '#/components/schemas/500Response_error'
500Response_error:
type: object
properties:
message:
type: string
description: The error message
example: 'SyntaxError: Unexpected token a in JSON at position 0'
name:
type: string
description: The name of the error
example: SyntaxError