-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtraffic-director.yaml
219 lines (219 loc) · 6.63 KB
/
traffic-director.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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
---
swagger: "2.0"
info:
description: "Interface Definition Language (IDL) for Global Multicloud Traffic\
\ Direction. This provides an interface between a Control Plane for Traffic Direction\
\ and a Management Plane (API, User Interface and Command Line Interface)"
version: "0.1.0"
title: "Traffic Director"
contact:
name: "HomeAway Cloud Engineering"
email: "[email protected]"
paths:
/routes:
get:
summary: "Get Routes"
description: "Simple List of all Routes for demonstration purposes. A production-grade\
\ solution might use GraphQL instead: https://graphql.org/learn/serving-over-http/"
produces:
- "application/json"
parameters: []
responses:
200:
description: "Status 200"
schema:
type: "array"
items:
$ref: "#/definitions/Route"
post:
summary: "Create Route"
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- name: "body"
in: "body"
required: true
schema:
$ref: "#/definitions/Route"
responses:
200:
description: "Status 200"
schema:
$ref: "#/definitions/Route"
/routes/{id}:
get:
summary: "Get Route"
description: "Get a single Route by Route.id"
produces:
- "application/json"
parameters: []
responses:
200:
description: "Status 200"
schema:
$ref: "#/definitions/Route"
404:
description: "Route Not Found"
put:
summary: "Update Route"
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- name: "body"
in: "body"
required: true
schema:
$ref: "#/definitions/Route"
responses:
200:
description: "Status 200"
schema:
$ref: "#/definitions/Route"
delete:
summary: "Delete Route"
description: "Delete a Route record based on the provided Route.id value."
parameters: []
responses:
204:
description: "Route Deleted"
parameters:
- name: "id"
in: "path"
required: true
type: "string"
description: "Identifier for Route"
/routes/entries:
get:
description: "Read Only Resource for accessing RouteEntry records based on a\
\ provided set of filters as query parameters"
produces:
- "application/json"
parameters:
- name: "host"
in: "query"
required: false
type: "string"
description: "Host header value"
responses:
200:
description: "Status 200"
schema:
type: "array"
items:
$ref: "#/definitions/RouteEntry"
/regions:
get:
summary: "GET all regions"
description: "Read Only Array of all regions. This is configured within the\
\ service and cannot be updated via an API."
produces:
- "application/json"
parameters: []
responses:
200:
description: "Status 200"
schema:
type: "array"
items:
$ref: "#/definitions/Region"
definitions:
Region:
type: "object"
required:
- "alias"
- "uri"
properties:
id:
type: "string"
description: "UUID to locate a specific Region record. This is typically assigned\
\ by a Data Access Layer so it is not accepted during record creation and\
\ required for updates."
alias:
type: "string"
description: "Alias used to identify a Region for Upstream routing. This is\
\ necessary to decouple the specific details of the Regional Upstream when\
\ defining Routes. A lookup is required as part of the resolution to a region."
uri:
type: "string"
description: "Uniform Resource Identifier (URI) that defines the location\
\ of the region e.g. fully qualified URL"
description: "Regional Upstream"
Route:
type: "object"
required:
- "id"
- "path"
- "role"
- "upstream"
properties:
id:
type: "string"
description: "UUID to locate a specific Route record. This is typically assigned\
\ by a Data Access Layer so it is not accepted during Route record creation\
\ and required for updates"
host:
type: "string"
description: "HTTP Host header value that support this Route. If absent then\
\ this Route will map to any Host header value."
path:
type: "string"
description: "Route Matchers will assert whether an HTTP path starts with\
\ this value. A valid path String starts with \"/\". Typically matchers\
\ will be evaluated in reverse alphabetical order to ensure the most-specific\
\ match is found first."
upstream:
$ref: "#/definitions/Upstream"
role:
type: "string"
description: "Specifies the role of this Route. This is used to determine\
\ which Route should handle traffic when there are multiple Routes that\
\ map to the same combination of host and path."
enum:
- "primary"
- "fallback"
- "inactive"
- "variant"
Upstream:
type: "object"
required:
- "uri"
properties:
uri:
type: "string"
description: "Uniform Resource Identifier (URI) that defines the Service location\
\ e.g. fully qualified URL or a path that maps to a downstream Service Discovery\
\ solution."
locator:
$ref: "#/definitions/UpstreamLocator"
description: "Upstream destination, either derived from a URL or discoverable\
\ using a Service Discovery mechanism and a Service Mesh or Discovery-aware\
\ Load Balancer"
UpstreamLocator:
type: "object"
properties:
region:
type: "string"
description: "Regional Upstream Alias"
service:
type: "string"
description: "Service name used for Service Discovery"
tag:
type: "string"
description: "Service tag used for Service Discovery"
description: "Collection of attributes used to locate a remote upstream"
RouteEntry:
type: "object"
properties:
path:
type: "string"
description: "Concatenated path of a Route - must be unique and is derived\
\ from the Route model."
uri:
type: "string"
description: "Upstream uri"
description: "Pair of a Route concatenated path String and a Route Upstream uri\
\ String"