1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package v3alpha1
21
22 import (
23 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
24 )
25
26
27 type MappingSpec struct {
28 AmbassadorID AmbassadorID `json:"ambassador_id,omitempty"`
29
30
31 Prefix string `json:"prefix,omitempty"`
32 PrefixRegex *bool `json:"prefix_regex,omitempty"`
33 PrefixExact *bool `json:"prefix_exact,omitempty"`
34
35 Service string `json:"service,omitempty"`
36 AddRequestHeaders *map[string]AddedHeader `json:"add_request_headers,omitempty"`
37 AddResponseHeaders *map[string]AddedHeader `json:"add_response_headers,omitempty"`
38 AddLinkerdHeaders *bool `json:"add_linkerd_headers,omitempty"`
39 AutoHostRewrite *bool `json:"auto_host_rewrite,omitempty"`
40 CaseSensitive *bool `json:"case_sensitive,omitempty"`
41 DNSType string `json:"dns_type,omitempty"`
42 Docs *DocsInfo `json:"docs,omitempty"`
43 EnableIPv4 *bool `json:"enable_ipv4,omitempty"`
44 EnableIPv6 *bool `json:"enable_ipv6,omitempty"`
45 CircuitBreakers []*CircuitBreaker `json:"circuit_breakers,omitempty"`
46 KeepAlive *KeepAlive `json:"keepalive,omitempty"`
47 CORS *CORS `json:"cors,omitempty"`
48 RetryPolicy *RetryPolicy `json:"retry_policy,omitempty"`
49 RespectDNSTTL *bool `json:"respect_dns_ttl,omitempty"`
50 GRPC *bool `json:"grpc,omitempty"`
51 HostRedirect *bool `json:"host_redirect,omitempty"`
52 HostRewrite string `json:"host_rewrite,omitempty"`
53 Method string `json:"method,omitempty"`
54 MethodRegex *bool `json:"method_regex,omitempty"`
55 OutlierDetection string `json:"outlier_detection,omitempty"`
56
57 PathRedirect string `json:"path_redirect,omitempty"`
58
59 PrefixRedirect string `json:"prefix_redirect,omitempty"`
60
61 RegexRedirect *RegexMap `json:"regex_redirect,omitempty"`
62
63
64
65 RedirectResponseCode *int `json:"redirect_response_code,omitempty"`
66 Priority string `json:"priority,omitempty"`
67 Precedence *int `json:"precedence,omitempty"`
68 ClusterTag string `json:"cluster_tag,omitempty"`
69 RemoveRequestHeaders *[]string `json:"remove_request_headers,omitempty"`
70 RemoveResponseHeaders *[]string `json:"remove_response_headers,omitempty"`
71 Resolver string `json:"resolver,omitempty"`
72 Rewrite *string `json:"rewrite,omitempty"`
73 RegexRewrite *RegexMap `json:"regex_rewrite,omitempty"`
74 Shadow *bool `json:"shadow,omitempty"`
75 ConnectTimeout *MillisecondDuration `json:"connect_timeout_ms,omitempty"`
76 ClusterIdleTimeout *MillisecondDuration `json:"cluster_idle_timeout_ms,omitempty"`
77 ClusterMaxConnectionLifetime *MillisecondDuration `json:"cluster_max_connection_lifetime_ms,omitempty"`
78
79 Timeout *MillisecondDuration `json:"timeout_ms,omitempty"`
80 IdleTimeout *MillisecondDuration `json:"idle_timeout_ms,omitempty"`
81 TLS string `json:"tls,omitempty"`
82
83 HealthChecks []HealthCheck `json:"health_checks,omitempty"`
84
85
86
87
88
89 DeprecatedUseWebsocket *bool `json:"use_websocket,omitempty"`
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111 AllowUpgrade []string `json:"allow_upgrade,omitempty"`
112
113 Weight *int `json:"weight,omitempty"`
114 BypassAuth *bool `json:"bypass_auth,omitempty"`
115 AuthContextExtensions map[string]string `json:"auth_context_extensions,omitempty"`
116
117 BypassErrorResponseOverrides *bool `json:"bypass_error_response_overrides,omitempty"`
118
119
120
121 ErrorResponseOverrides []ErrorResponseOverride `json:"error_response_overrides,omitempty"`
122 Modules []UntypedDict `json:"modules,omitempty"`
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138 DeprecatedHost string `json:"host,omitempty"`
139
140
141
142
143 DeprecatedHostRegex *bool `json:"host_regex,omitempty"`
144
145
146
147
148
149
150
151
152 Hostname string `json:"hostname,omitempty"`
153
154 Headers map[string]string `json:"headers,omitempty"`
155 RegexHeaders map[string]string `json:"regex_headers,omitempty"`
156 Labels DomainMap `json:"labels,omitempty"`
157 EnvoyOverride *UntypedDict `json:"envoy_override,omitempty"`
158 LoadBalancer *LoadBalancer `json:"load_balancer,omitempty"`
159 QueryParameters map[string]string `json:"query_parameters,omitempty"`
160 RegexQueryParameters map[string]string `json:"regex_query_parameters,omitempty"`
161 StatsName string `json:"stats_name,omitempty"`
162
163 V2ExplicitTLS *V2ExplicitTLS `json:"v2ExplicitTLS,omitempty"`
164 V2BoolHeaders []string `json:"v2BoolHeaders,omitempty"`
165 V2BoolQueryParameters []string `json:"v2BoolQueryParameters,omitempty"`
166 }
167
168 type RegexMap struct {
169 Pattern string `json:"pattern,omitempty"`
170 Substitution string `json:"substitution,omitempty"`
171 }
172
173
174
175 type DocsInfo struct {
176 Path string `json:"path,omitempty"`
177 URL string `json:"url,omitempty"`
178 Ignored *bool `json:"ignored,omitempty"`
179 DisplayName string `json:"display_name,omitempty"`
180 Timeout *MillisecondDuration `json:"timeout_ms,omitempty"`
181 }
182
183
184
185
186
187
188
189 type DomainMap map[string]MappingLabelGroupsArray
190
191
192 type MappingLabelGroupsArray []MappingLabelGroup
193
194
195
196
197
198
199 type MappingLabelGroup map[string]MappingLabelsArray
200
201
202
203 type MappingLabelsArray []MappingLabelSpecifier
204
205
206
207
208
209
210
211 type MappingLabelSpecifier struct {
212
213 SourceCluster *MappingLabelSpecifier_SourceCluster `json:"source_cluster,omitempty"`
214
215
216 DestinationCluster *MappingLabelSpecifier_DestinationCluster `json:"destination_cluster,omitempty"`
217
218
219
220 RequestHeaders *MappingLabelSpecifier_RequestHeaders `json:"request_headers,omitempty"`
221
222
223 RemoteAddress *MappingLabelSpecifier_RemoteAddress `json:"remote_address,omitempty"`
224
225
226
227 GenericKey *MappingLabelSpecifier_GenericKey `json:"generic_key,omitempty"`
228
229
230 }
231
232 type MappingLabelSpecifier_SourceCluster struct {
233
234
235 Key string `json:"key"`
236 }
237
238 type MappingLabelSpecifier_DestinationCluster struct {
239
240
241 Key string `json:"key"`
242 }
243
244 type MappingLabelSpecifier_RequestHeaders struct {
245
246 Key string `json:"key"`
247
248
249 HeaderName string `json:"header_name"`
250
251 OmitIfNotPresent *bool `json:"omit_if_not_present,omitempty"`
252 }
253
254 type MappingLabelSpecifier_RemoteAddress struct {
255
256
257 Key string `json:"key"`
258 }
259
260 type MappingLabelSpecifier_GenericKey struct {
261
262 Key string `json:"key,omitempty"`
263
264
265 Value string `json:"value"`
266
267 V2Shorthand bool `json:"v2Shorthand,omitempty"`
268 }
269
270 type AddedHeader struct {
271 Value string `json:"value,omitempty"`
272 Append *bool `json:"append,omitempty"`
273
274
275 V2Representation string `json:"v2Representation,omitempty"`
276 }
277
278 type KeepAlive struct {
279 Probes *int `json:"probes,omitempty"`
280 IdleTime *int `json:"idle_time,omitempty"`
281 Interval *int `json:"interval,omitempty"`
282 }
283
284 type CORS struct {
285
286 Origins []string `json:"origins,omitempty"`
287 Methods []string `json:"methods,omitempty"`
288 Headers []string `json:"headers,omitempty"`
289 Credentials *bool `json:"credentials,omitempty"`
290 ExposedHeaders []string `json:"exposed_headers,omitempty"`
291 MaxAge string `json:"max_age,omitempty"`
292
293 V2CommaSeparatedOrigins bool `json:"v2CommaSeparatedOrigins,omitempty"`
294 }
295
296 type RetryPolicy struct {
297
298 RetryOn string `json:"retry_on,omitempty"`
299 NumRetries *int `json:"num_retries,omitempty"`
300 PerTryTimeout string `json:"per_try_timeout,omitempty"`
301 }
302
303 type LoadBalancer struct {
304
305
306 Policy string `json:"policy,omitempty"`
307 Cookie *LoadBalancerCookie `json:"cookie,omitempty"`
308 Header string `json:"header,omitempty"`
309 SourceIp *bool `json:"source_ip,omitempty"`
310 }
311
312 type LoadBalancerCookie struct {
313
314 Name string `json:"name,omitempty"`
315 Path string `json:"path,omitempty"`
316 Ttl string `json:"ttl,omitempty"`
317 }
318
319
320 type MappingStatus struct {
321
322 State string `json:"state,omitempty"`
323
324 Reason string `json:"reason,omitempty"`
325 }
326
327
328
329
330
331
332
333
334
335
336 type Mapping struct {
337 metav1.TypeMeta `json:""`
338 metav1.ObjectMeta `json:"metadata,omitempty"`
339
340 Spec MappingSpec `json:"spec,omitempty"`
341 Status *MappingStatus `json:"status,omitempty"`
342 }
343
344
345
346
347 type MappingList struct {
348 metav1.TypeMeta `json:""`
349 metav1.ListMeta `json:"metadata,omitempty"`
350 Items []Mapping `json:"items"`
351 }
352
353 func init() {
354 SchemeBuilder.Register(&Mapping{}, &MappingList{})
355 }
356
View as plain text