forked from kiali/kiali
-
Notifications
You must be signed in to change notification settings - Fork 0
/
doc.go
747 lines (657 loc) · 19.6 KB
/
doc.go
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
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
package main
import (
jaegerModels "github.com/jaegertracing/jaeger/model/json"
"github.com/kiali/kiali/business"
"github.com/kiali/kiali/graph/config/cytoscape"
"github.com/kiali/kiali/handlers"
"github.com/kiali/kiali/jaeger"
"github.com/kiali/kiali/models"
"github.com/kiali/kiali/status"
)
/////////////////////
// SWAGGER PARAMETERS - GENERAL
// - keep this alphabetized
/////////////////////
// swagger:parameters aggregateMetrics graphAggregate graphAggregateByService
type AggregateParam struct {
// The aggregate name (label).
//
// in: path
// required: true
Name string `json:"aggregate"`
}
// swagger:parameters aggregateMetrics graphAggregate graphAggregateByService
type AggregateValueParam struct {
// The aggregate value (label value).
//
// in: path
// required: true
Name string `json:"aggregateValue"`
}
// swagger:parameters appMetrics appDetails graphApp graphAppVersion appDashboard appSpans appTraces errorTraces
type AppParam struct {
// The app name (label value).
//
// in: path
// required: true
Name string `json:"app"`
}
// swagger:parameters graphAppVersion
type AppVersionParam struct {
// The app version (label value).
//
// in: path
// required: false
Name string `json:"version"`
}
// swagger:parameters podLogs
type ContainerParam struct {
// The pod container name. Optional for single-container pod. Otherwise required.
//
// in: query
// required: false
Name string `json:"container"`
}
// swagger:parameters istioConfigList workloadList workloadDetails workloadUpdate serviceDetails appSpans serviceSpans workloadSpans appTraces serviceTraces workloadTraces errorTraces workloadValidations appList serviceMetrics aggregateMetrics appMetrics workloadMetrics istioConfigDetails istioConfigDetailsSubtype istioConfigDelete istioConfigDeleteSubtype istioConfigUpdate istioConfigUpdateSubtype serviceList appDetails graphAggregate graphAggregateByService graphApp graphAppVersion graphNamespace graphService graphWorkload namespaceMetrics customDashboard appDashboard serviceDashboard workloadDashboard istioConfigCreate istioConfigCreateSubtype namespaceUpdate namespaceTls podDetails podLogs namespaceValidations getIter8Experiments postIter8Experiments patchIter8Experiments deleteIter8Experiments podProxyDump podProxyResource
type NamespaceParam struct {
// The namespace name.
//
// in: path
// required: true
Name string `json:"namespace"`
}
// swagger:parameters getIter8Experiments patchIter8Experiments deleteIter8Experiments
type NameParam struct {
// The name param
//
// in: path
// required: true
Name string `json:"name"`
}
// swagger:parameters istioConfigDetails istioConfigDetailsSubtype istioConfigDelete istioConfigDeleteSubtype istioConfigUpdate istioConfigUpdateSubtype
type ObjectNameParam struct {
// The Istio object name.
//
// in: path
// required: true
Name string `json:"object"`
}
// swagger:parameters istioConfigDetails istioConfigDetailsSubtype istioConfigDelete istioConfigDeleteSubtype istioConfigUpdate istioConfigUpdateSubtype istioConfigCreate istioConfigCreateSubtype
type ObjectTypeParam struct {
// The Istio object type.
//
// in: path
// required: true
// pattern: ^(gateways|virtualservices|destinationrules|serviceentries|rules|quotaspecs|quotaspecbindings)$
Name string `json:"object_type"`
}
// swagger:parameters podDetails podLogs podProxyDump podProxyResource
type PodParam struct {
// The pod name.
//
// in: path
// required: true
Name string `json:"pod"`
}
// swagger:parameters podProxyResource
type ResourceParam struct {
// The discovery service resource
//
// in: path
// required: true
Name string `json:"resource"`
}
// swagger:parameters serviceDetails serviceMetrics graphService graphAggregateByService serviceDashboard serviceSpans serviceTraces
type ServiceParam struct {
// The service name.
//
// in: path
// required: true
Name string `json:"service"`
}
// swagger:parameters podLogs
type SinceTimeParam struct {
// The start time for fetching logs. UNIX time in seconds. Default is all logs.
//
// in: query
// required: false
Name string `json:"sinceTime"`
}
// swagger:parameters podLogs
type DurationLogParam struct {
// Query time-range duration (Golang string duration). Duration starts on
// `sinceTime` if set, or the time for the first log message if not set.
//
// in: query
// required: false
Name string `json:"duration"`
}
// swagger:parameters traceDetails
type TraceIDParam struct {
// The trace ID.
//
// in: path
// required: true
Name string `json:"traceID"`
}
// swagger:parameters customDashboard
type DashboardParam struct {
// The dashboard resource name.
//
// in: path
// required: true
Name string `json:"dashboard"`
}
// swagger:parameters workloadDetails workloadUpdate workloadValidations workloadMetrics graphWorkload workloadDashboard workloadSpans workloadTraces
type WorkloadParam struct {
// The workload name.
//
// in: path
// required: true
Name string `json:"workload"`
}
/////////////////////
// SWAGGER PARAMETERS - GRAPH
// - keep this alphabetized
/////////////////////
// swagger:parameters graphApp graphAppVersion graphNamespaces graphService graphWorkload
type AppendersParam struct {
// Comma-separated list of Appenders to run. Available appenders: [deadNode, istio, aggregateNode, responseTime, securityPolicy, serviceEntry, sidecarsCheck, unusedNode].
//
// in: query
// required: false
// default: run all appenders
Name string `json:"appenders"`
}
// swagger:parameters graphApp graphAppVersion graphNamespaces graphService graphWorkload
type DurationGraphParam struct {
// Query time-range duration (Golang string duration).
//
// in: query
// required: false
// default: 10m
Name string `json:"duration"`
}
// swagger:parameters graphApp graphAppVersion graphNamespaces graphService graphWorkload
type GraphTypeParam struct {
// Graph type. Available graph types: [app, service, versionedApp, workload].
//
// in: query
// required: false
// default: workload
Name string `json:"graphType"`
}
// swagger:parameters graphApp graphAppVersion graphNamespaces graphService graphWorkload
type GroupByParam struct {
// App box grouping characteristic. Available groupings: [app, none, version].
//
// in: query
// required: false
// default: none
Name string `json:"groupBy"`
}
// swagger:parameters graphApp graphAppVersion graphNamespaces graphWorkload
type InjectServiceNodes struct {
// Flag for injecting the requested service node between source and destination nodes.
//
// in: query
// required: false
// default: false
Name string `json:"injectServiceNodes"`
}
// swagger:parameters graphNamespaces
type NamespacesParam struct {
// Comma-separated list of namespaces to include in the graph. The namespaces must be accessible to the client.
//
// in: query
// required: true
Name string `json:"namespaces"`
}
// swagger:parameters graphApp graphAppVersion graphNamespaces graphService graphWorkload
type QueryTimeParam struct {
// Unix time (seconds) for query such that time range is [queryTime-duration..queryTime]. Default is now.
//
// in: query
// required: false
// default: now
Name string `json:"queryTime"`
}
/////////////////////
// SWAGGER PARAMETERS - METRICS
// - keep this alphabetized
/////////////////////
// swagger:parameters customDashboard
type AdditionalLabelsParam struct {
// In custom dashboards, additional labels that are made available for grouping in the UI, regardless which aggregations are defined in the MonitoringDashboard CR
//
// in: query
// required: false
Name string `json:"additionalLabels"`
}
// swagger:parameters serviceMetrics aggregateMetrics appMetrics workloadMetrics customDashboard appDashboard serviceDashboard workloadDashboard
type AvgParam struct {
// Flag for fetching histogram average. Default is true.
//
// in: query
// required: false
// default: true
Name bool `json:"avg"`
}
// swagger:parameters serviceMetrics aggregateMetrics appMetrics workloadMetrics customDashboard appDashboard serviceDashboard workloadDashboard
type ByLabelsParam struct {
// List of labels to use for grouping metrics (via Prometheus 'by' clause).
//
// in: query
// required: false
// default: []
Name []string `json:"byLabels[]"`
}
// swagger:parameters serviceMetrics aggregateMetrics appMetrics workloadMetrics appDashboard serviceDashboard workloadDashboard
type DirectionParam struct {
// Traffic direction: 'inbound' or 'outbound'.
//
// in: query
// required: false
// default: outbound
Name string `json:"direction"`
}
// swagger:parameters serviceMetrics aggregateMetrics appMetrics workloadMetrics customDashboard appDashboard serviceDashboard workloadDashboard
type DurationParam struct {
// Duration of the query period, in seconds.
//
// in: query
// required: false
// default: 1800
Name int `json:"duration"`
}
// swagger:parameters serviceMetrics aggregateMetrics appMetrics workloadMetrics
type FiltersParam struct {
// List of metrics to fetch. Fetch all metrics when empty. List entries are Kiali internal metric names.
//
// in: query
// required: false
// default: []
Name []string `json:"filters[]"`
}
// swagger:parameters customDashboard
type LabelsFiltersParam struct {
// In custom dashboards, labels filters to use when fetching metrics, formatted as key:value pairs. Ex: "app:foo,version:bar".
//
// in: query
// required: false
//
Name string `json:"labelsFilters"`
}
// swagger:parameters serviceMetrics aggregateMetrics appMetrics workloadMetrics customDashboard appDashboard serviceDashboard workloadDashboard
type QuantilesParam struct {
// List of quantiles to fetch. Fetch no quantiles when empty. Ex: [0.5, 0.95, 0.99].
//
// in: query
// required: false
// default: []
Name []string `json:"quantiles[]"`
}
// swagger:parameters serviceMetrics aggregateMetrics appMetrics workloadMetrics customDashboard appDashboard serviceDashboard workloadDashboard
type RateFuncParam struct {
// Prometheus function used to calculate rate: 'rate' or 'irate'.
//
// in: query
// required: false
// default: rate
Name string `json:"rateFunc"`
}
// swagger:parameters serviceMetrics aggregateMetrics appMetrics workloadMetrics customDashboard appDashboard serviceDashboard workloadDashboard
type RateIntervalParam struct {
// Interval used for rate and histogram calculation.
//
// in: query
// required: false
// default: 1m
Name string `json:"rateInterval"`
}
// swagger:parameters serviceMetrics aggregateMetrics appMetrics workloadMetrics appDashboard serviceDashboard workloadDashboard
type RequestProtocolParam struct {
// Desired request protocol for the telemetry: For example, 'http' or 'grpc'.
//
// in: query
// required: false
// default: all protocols
Name string `json:"requestProtocol"`
}
// swagger:parameters serviceMetrics aggregateMetrics appMetrics workloadMetrics appDashboard serviceDashboard workloadDashboard
type ReporterParam struct {
// Istio telemetry reporter: 'source' or 'destination'.
//
// in: query
// required: false
// default: source
Name string `json:"reporter"`
}
// swagger:parameters serviceMetrics aggregateMetrics appMetrics workloadMetrics customDashboard appDashboard serviceDashboard workloadDashboard
type StepParam struct {
// Step between [graph] datapoints, in seconds.
//
// in: query
// required: false
// default: 15
Name int `json:"step"`
}
// swagger:parameters serviceMetrics aggregateMetrics appMetrics workloadMetrics
type VersionParam struct {
// Filters metrics by the specified version.
//
// in: query
// required: false
Name string `json:"version"`
}
/////////////////////
// SWAGGER RESPONSES
/////////////////////
// NoContent: the response is empty
// swagger:response noContent
type NoContent struct {
// in: body
Body struct {
// HTTP status code
// example: 204
// default: 204
Code int32 `json:"code"`
Message error `json:"message"`
} `json:"body"`
}
// BadRequestError: the client request is incorrect
//
// swagger:response badRequestError
type BadRequestError struct {
// in: body
Body struct {
// HTTP status code
// example: 400
// default: 400
Code int32 `json:"code"`
Message error `json:"message"`
} `json:"body"`
}
// A NotFoundError is the error message that is generated when server could not find what was requested.
//
// swagger:response notFoundError
type NotFoundError struct {
// in: body
Body struct {
// HTTP status code
// example: 404
// default: 404
Code int32 `json:"code"`
Message error `json:"message"`
} `json:"body"`
}
// A NotAcceptable is the error message that means request can't be accepted
//
// swagger:response notAcceptableError
type NotAcceptableError struct {
// in: body
Body struct {
// HTTP status code
// example: 404
// default: 404
Code int32 `json:"code"`
Message error `json:"message"`
} `json:"body"`
}
// A Internal is the error message that means something has gone wrong
//
// swagger:response internalError
type InternalError struct {
// in: body
Body struct {
// HTTP status code
// example: 500
// default: 500
Code int32 `json:"code"`
Message error `json:"message"`
} `json:"body"`
}
// A Internal is the error message that means something has gone wrong
//
// swagger:response serviceUnavailableError
type serviceUnavailableError struct {
// in: body
Body struct {
// HTTP status code
// example: 503
// default: 503
Code int32 `json:"code"`
Message error `json:"message"`
} `json:"body"`
}
// HTTP status code 200 and statusInfo model in data
// swagger:response statusInfo
type swaggStatusInfoResp struct {
// in:body
Body status.StatusInfo
}
// HTTP status code 200 and tokenGenerated model in data
// swagger:response tokenResponse
type swaggTokenGeneratedResp struct {
// in:body
Body handlers.TokenResponse
}
// HTTP status code 200 and cytoscapejs Config in data
// swagger:response graphResponse
type GraphResponse struct {
// in:body
Body cytoscape.Config
}
// HTTP status code 200 and IstioConfigList model in data
// swagger:response istioConfigList
type IstioConfigResponse struct {
// in:body
Body models.IstioConfigList
}
// Listing all services in the namespace
// swagger:response serviceListResponse
type ServiceListResponse struct {
// in:body
Body models.ServiceList
}
// Listing all workloads in the namespace
// swagger:response workloadListResponse
type WorkloadListResponse struct {
// in:body
Body models.WorkloadList
}
// Listing all apps in the namespace
// swagger:response appListResponse
type AppListResponse struct {
// in:body
Body models.AppList
}
// serviceHealthResponse contains aggregated health from various sources, for a given service
// swagger:response serviceHealthResponse
type serviceHealthResponse struct {
// in:body
Body models.ServiceHealth
}
// appHealthResponse contains aggregated health from various sources, for a given app
// swagger:response appHealthResponse
type appHealthResponse struct {
// in:body
Body models.AppHealth
}
// workloadHealthResponse contains aggregated health from various sources, for a given workload
// swagger:response workloadHealthResponse
type workloadHealthResponse struct {
// in:body
Body models.WorkloadHealth
}
// namespaceAppHealthResponse is a map of app name x health
// swagger:response namespaceAppHealthResponse
type namespaceAppHealthResponse struct {
// in:body
Body models.NamespaceAppHealth
}
// namespaceResponse is a basic namespace
// swagger:response namespaceResponse
type namespaceResponse struct {
// in:body
Body models.Namespace
}
// Listing all the information related to a workload
// swagger:response serviceDetailsResponse
type ServiceDetailsResponse struct {
// in:body
Body models.ServiceDetails
}
// Listing all the information related to a Trace
// swagger:response traceDetailsResponse
type TraceDetailsResponse struct {
// in:body
Body []jaegerModels.Trace
}
// Number of traces in error
// swagger:response errorTracesResponse
type ErrorTracesResponse struct {
// in:body
Body int
}
// Listing all the information related to a Span
// swagger:response spansResponse
type SpansResponse struct {
// in:body
Body []jaeger.JaegerSpan
}
// Listing all the information related to a workload
// swagger:response workloadDetails
type WorkloadDetailsResponse struct {
// in:body
Body models.Workload
}
// Metrics response model
// swagger:response metricsResponse
type MetricsResponse struct {
// in:body
Body models.MetricsMap
}
// Dashboard response model
// swagger:response dashboardResponse
type DashboardResponse struct {
// in:body
Body models.MonitoringDashboard
}
// IstioConfig details of an specific Istio Object
// swagger:response istioConfigDetailsResponse
type IstioConfigDetailsResponse struct {
// in:body
Body models.IstioConfigDetails
}
// Detailed information of an specific app
// swagger:response appDetails
type AppDetailsResponse struct {
// in:body
Body models.App
}
// List of Namespaces
// swagger:response namespaceList
type NamespaceListResponse struct {
// in:body
Body []models.Namespace
}
// Return all the descriptor data related to Grafana
// swagger:response grafanaInfoResponse
type GrafanaInfoResponse struct {
// in: body
Body models.GrafanaInfo
}
// Return all the descriptor data related to Jaeger
// swagger:response jaegerInfoResponse
type JaegerInfoResponse struct {
// in: body
Body models.JaegerInfo
}
// Return the information necessary to handle login
// swagger:response authenticationInfo
type AuthenticationInfoResponse struct {
Strategy string
AuthorizationEndpoint string
}
// Return the mTLS status of the whole Mesh
// swagger:response meshTlsResponse
type MeshTlsResponse struct {
// in:body
Body models.MTLSStatus
}
// Return the mTLS status of a specific Namespace
// swagger:response namespaceTlsResponse
type NamespaceTlsResponse struct {
// in:body
Body models.MTLSStatus
}
// Return the validation status of a specific Namespace
// swagger:response namespaceValidationSummaryResponse
type NamespaceValidationSummaryResponse struct {
// in:body
Body models.IstioValidationSummary
}
// Return a dump of the configuration of a given envoy proxy
// swagger:response configDump
type ConfigDumpResponse struct {
// in:body
Body models.EnvoyProxyDump
}
// Return a dump of the configuration of a given envoy proxy
// swagger:response configDumpResource
type ConfigDumpResourceResponse struct {
// in:body
Body map[string]interface{}
}
//////////////////
// SWAGGER MODELS
//////////////////
// List of validations grouped by object type
// swagger:model
type TypedIstioValidations map[string]NameIstioValidation
// List of validations grouped by object name
// swagger:model
type NameIstioValidation map[string]models.IstioValidation
// Return caller permissions per namespace and Istio Config type
// swagger:response istioConfigPermissions
type swaggIstioConfigPermissions struct {
// in:body
Body models.IstioConfigPermissions
}
// Return Iter8 Info
// swagger:response iter8StatusResponse
type Iter8StatusResponse struct {
// in: body
Body models.Iter8Info
}
// Return a Iter8 Experiment detail
// swagger:response iter8ExperimentGetDetailResponse
type Iter8ExperimentsGetDetailResponse struct {
// in: body
Body models.Iter8ExperimentDetail
}
// Return a list of Iter8 Experiment Items
// swagger:response iter8ExperimentsResponse
type Iter8ExperimentsResponnse struct {
// in: body
Body []models.Iter8ExperimentItem
}
// Return a list of Istio components along its status
// swagger:response istioStatusResponse
type IstioStatusResponse struct {
// in: body
Body business.IstioComponentStatus
}
// Posted parameters for a metrics stats query
// swagger:parameters metricsStats
type MetricsStatsQueryBody struct {
// in: body
Body models.MetricsStatsQueries
}
// Response of the metrics stats query
// swagger:response metricsStatsResponse
type MetricsStatsResponse struct {
// in: body
Body models.MetricsStats
}