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
84
85
86
87 DeprecatedUseWebsocket *bool `json:"use_websocket,omitempty"`
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109 AllowUpgrade []string `json:"allow_upgrade,omitempty"`
110
111 Weight *int `json:"weight,omitempty"`
112 BypassAuth *bool `json:"bypass_auth,omitempty"`
113 AuthContextExtensions map[string]string `json:"auth_context_extensions,omitempty"`
114
115 BypassErrorResponseOverrides *bool `json:"bypass_error_response_overrides,omitempty"`
116
117
118
119 ErrorResponseOverrides []ErrorResponseOverride `json:"error_response_overrides,omitempty"`
120 Modules []UntypedDict `json:"modules,omitempty"`
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136 DeprecatedHost string `json:"host,omitempty"`
137
138
139
140
141 DeprecatedHostRegex *bool `json:"host_regex,omitempty"`
142
143
144
145
146
147
148
149
150 Hostname string `json:"hostname,omitempty"`
151
152 Headers map[string]string `json:"headers,omitempty"`
153 RegexHeaders map[string]string `json:"regex_headers,omitempty"`
154 Labels DomainMap `json:"labels,omitempty"`
155 EnvoyOverride *UntypedDict `json:"envoy_override,omitempty"`
156 LoadBalancer *LoadBalancer `json:"load_balancer,omitempty"`
157 QueryParameters map[string]string `json:"query_parameters,omitempty"`
158 RegexQueryParameters map[string]string `json:"regex_query_parameters,omitempty"`
159 StatsName string `json:"stats_name,omitempty"`
160
161 V2ExplicitTLS *V2ExplicitTLS `json:"v2ExplicitTLS,omitempty"`
162 V2BoolHeaders []string `json:"v2BoolHeaders,omitempty"`
163 V2BoolQueryParameters []string `json:"v2BoolQueryParameters,omitempty"`
164 }
165
166 type RegexMap struct {
167 Pattern string `json:"pattern,omitempty"`
168 Substitution string `json:"substitution,omitempty"`
169 }
170
171
172
173 type DocsInfo struct {
174 Path string `json:"path,omitempty"`
175 URL string `json:"url,omitempty"`
176 Ignored *bool `json:"ignored,omitempty"`
177 DisplayName string `json:"display_name,omitempty"`
178 Timeout *MillisecondDuration `json:"timeout_ms,omitempty"`
179 }
180
181
182
183
184
185
186
187 type DomainMap map[string]MappingLabelGroupsArray
188
189
190 type MappingLabelGroupsArray []MappingLabelGroup
191
192
193
194
195
196
197 type MappingLabelGroup map[string]MappingLabelsArray
198
199
200
201 type MappingLabelsArray []MappingLabelSpecifier
202
203
204
205
206
207
208
209 type MappingLabelSpecifier struct {
210
211 SourceCluster *MappingLabelSpecifier_SourceCluster `json:"source_cluster,omitempty"`
212
213
214 DestinationCluster *MappingLabelSpecifier_DestinationCluster `json:"destination_cluster,omitempty"`
215
216
217
218 RequestHeaders *MappingLabelSpecifier_RequestHeaders `json:"request_headers,omitempty"`
219
220
221 RemoteAddress *MappingLabelSpecifier_RemoteAddress `json:"remote_address,omitempty"`
222
223
224
225 GenericKey *MappingLabelSpecifier_GenericKey `json:"generic_key,omitempty"`
226
227
228 }
229
230 type MappingLabelSpecifier_SourceCluster struct {
231
232
233 Key string `json:"key"`
234 }
235
236 type MappingLabelSpecifier_DestinationCluster struct {
237
238
239 Key string `json:"key"`
240 }
241
242 type MappingLabelSpecifier_RequestHeaders struct {
243
244 Key string `json:"key"`
245
246
247 HeaderName string `json:"header_name"`
248
249 OmitIfNotPresent *bool `json:"omit_if_not_present,omitempty"`
250 }
251
252 type MappingLabelSpecifier_RemoteAddress struct {
253
254
255 Key string `json:"key"`
256 }
257
258 type MappingLabelSpecifier_GenericKey struct {
259
260 Key string `json:"key,omitempty"`
261
262
263 Value string `json:"value"`
264
265 V2Shorthand bool `json:"v2Shorthand,omitempty"`
266 }
267
268 type AddedHeader struct {
269 Value string `json:"value,omitempty"`
270 Append *bool `json:"append,omitempty"`
271
272
273 V2Representation string `json:"v2Representation,omitempty"`
274 }
275
276 type KeepAlive struct {
277 Probes *int `json:"probes,omitempty"`
278 IdleTime *int `json:"idle_time,omitempty"`
279 Interval *int `json:"interval,omitempty"`
280 }
281
282 type CORS struct {
283
284 Origins []string `json:"origins,omitempty"`
285 Methods []string `json:"methods,omitempty"`
286 Headers []string `json:"headers,omitempty"`
287 Credentials *bool `json:"credentials,omitempty"`
288 ExposedHeaders []string `json:"exposed_headers,omitempty"`
289 MaxAge string `json:"max_age,omitempty"`
290
291 V2CommaSeparatedOrigins bool `json:"v2CommaSeparatedOrigins,omitempty"`
292 }
293
294 type RetryPolicy struct {
295
296 RetryOn string `json:"retry_on,omitempty"`
297 NumRetries *int `json:"num_retries,omitempty"`
298 PerTryTimeout string `json:"per_try_timeout,omitempty"`
299 }
300
301 type LoadBalancer struct {
302
303
304 Policy string `json:"policy,omitempty"`
305 Cookie *LoadBalancerCookie `json:"cookie,omitempty"`
306 Header string `json:"header,omitempty"`
307 SourceIp *bool `json:"source_ip,omitempty"`
308 }
309
310 type LoadBalancerCookie struct {
311
312 Name string `json:"name,omitempty"`
313 Path string `json:"path,omitempty"`
314 Ttl string `json:"ttl,omitempty"`
315 }
316
317
318 type MappingStatus struct {
319
320 State string `json:"state,omitempty"`
321
322 Reason string `json:"reason,omitempty"`
323 }
324
325
326
327
328
329
330
331
332
333
334 type Mapping struct {
335 metav1.TypeMeta `json:""`
336 metav1.ObjectMeta `json:"metadata,omitempty"`
337
338 Spec MappingSpec `json:"spec,omitempty"`
339 Status *MappingStatus `json:"status,omitempty"`
340 }
341
342
343
344
345 type MappingList struct {
346 metav1.TypeMeta `json:""`
347 metav1.ListMeta `json:"metadata,omitempty"`
348 Items []Mapping `json:"items"`
349 }
350
351 func init() {
352 SchemeBuilder.Register(&Mapping{}, &MappingList{})
353 }
354
View as plain text