forked from istio/api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcfg.pb.go
7450 lines (7220 loc) · 186 KB
/
cfg.pb.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
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: policy/v1beta1/cfg.proto
package v1beta1
import (
fmt "fmt"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"
github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
types "github.com/gogo/protobuf/types"
io "io"
math "math"
reflect "reflect"
strconv "strconv"
strings "strings"
time "time"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
var _ = time.Kitchen
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
// Header operation type.
type Rule_HeaderOperationTemplate_Operation int32
const (
// Replace a header by name.
REPLACE Rule_HeaderOperationTemplate_Operation = 0
// Remove a header by name. Values are ignored.
REMOVE Rule_HeaderOperationTemplate_Operation = 1
// Append values to the existing header values.
APPEND Rule_HeaderOperationTemplate_Operation = 2
)
var Rule_HeaderOperationTemplate_Operation_name = map[int32]string{
0: "REPLACE",
1: "REMOVE",
2: "APPEND",
}
var Rule_HeaderOperationTemplate_Operation_value = map[string]int32{
"REPLACE": 0,
"REMOVE": 1,
"APPEND": 2,
}
func (Rule_HeaderOperationTemplate_Operation) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_dfb7777e81b6b919, []int{1, 0, 0}
}
// Fraction percentages support several fixed denominator values.
type FractionalPercent_DenominatorType int32
const (
// 100.
//
// **Example**: 1/100 = 1%.
HUNDRED FractionalPercent_DenominatorType = 0
// 10,000.
//
// **Example**: 1/10000 = 0.01%.
TEN_THOUSAND FractionalPercent_DenominatorType = 1
)
var FractionalPercent_DenominatorType_name = map[int32]string{
0: "HUNDRED",
1: "TEN_THOUSAND",
}
var FractionalPercent_DenominatorType_value = map[string]int32{
"HUNDRED": 0,
"TEN_THOUSAND": 1,
}
func (FractionalPercent_DenominatorType) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_dfb7777e81b6b919, []int{9, 0}
}
// AuthHeader specifies how to pass access token with authorization header.
type Tls_AuthHeader int32
const (
// Access token is passed in authorization header as what it is
// (authorization: some-token).
PLAIN Tls_AuthHeader = 0
// Access token is passed to adapter as bearer token (i.e. authorization:
// bearer some-token).
BEARER Tls_AuthHeader = 1
)
var Tls_AuthHeader_name = map[int32]string{
0: "PLAIN",
1: "BEARER",
}
var Tls_AuthHeader_value = map[string]int32{
"PLAIN": 0,
"BEARER": 1,
}
func (Tls_AuthHeader) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_dfb7777e81b6b919, []int{11, 0}
}
// AttributeManifest describes a set of Attributes produced by some component
// of an Istio deployment.
type AttributeManifest struct {
// Optional. The revision of this document. Assigned by server.
Revision string `protobuf:"bytes,1,opt,name=revision,proto3" json:"revision,omitempty"`
// Required. Name of the component producing these attributes. This can be
// the proxy (with the canonical name `istio-proxy`) or the name of an
// `attributes` kind adapter in Mixer.
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
// The set of attributes this Istio component will be responsible for producing at runtime.
// We map from attribute name to the attribute's specification. The name of an attribute,
// which is how attributes are referred to in aspect configuration, must conform to:
//
// Name = IDENT { SEPARATOR IDENT };
//
// Where `IDENT` must match the regular expression `[a-z][a-z0-9]+` and `SEPARATOR` must
// match the regular expression `[\.-]`.
//
// Attribute names must be unique within a single Istio deployment. The set of canonical
// attributes are described at [here](https://istio.io/docs/reference/config/policy-and-telemetry/attribute-vocabulary/).
// Attributes not in that list should be named with a component-specific suffix such as
// `request.count-my.component`.
Attributes map[string]*AttributeManifest_AttributeInfo `protobuf:"bytes,3,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
}
func (m *AttributeManifest) Reset() { *m = AttributeManifest{} }
func (*AttributeManifest) ProtoMessage() {}
func (*AttributeManifest) Descriptor() ([]byte, []int) {
return fileDescriptor_dfb7777e81b6b919, []int{0}
}
func (m *AttributeManifest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *AttributeManifest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_AttributeManifest.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *AttributeManifest) XXX_Merge(src proto.Message) {
xxx_messageInfo_AttributeManifest.Merge(m, src)
}
func (m *AttributeManifest) XXX_Size() int {
return m.Size()
}
func (m *AttributeManifest) XXX_DiscardUnknown() {
xxx_messageInfo_AttributeManifest.DiscardUnknown(m)
}
var xxx_messageInfo_AttributeManifest proto.InternalMessageInfo
func (m *AttributeManifest) GetRevision() string {
if m != nil {
return m.Revision
}
return ""
}
func (m *AttributeManifest) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *AttributeManifest) GetAttributes() map[string]*AttributeManifest_AttributeInfo {
if m != nil {
return m.Attributes
}
return nil
}
// AttributeInfo describes the schema of an Istio `Attribute`.
//
// # Istio Attributes
//
// Istio uses `attributes` to describe runtime activities of Istio services.
// An Istio attribute carries a specific piece of information about an activity,
// such as the error code of an API request, the latency of an API request, or the
// original IP address of a TCP connection. The attributes are often generated
// and consumed by different services. For example, a frontend service can
// generate an authenticated user attribute and pass it to a backend service for
// access control purpose.
//
// To simplify the system and improve developer experience, Istio uses
// shared attribute definitions across all components. For example, the same
// authenticated user attribute will be used for logging, monitoring, analytics,
// billing, access control, auditing. Many Istio components provide their
// functionality by collecting, generating, and operating on attributes.
// For example, the proxy collects the error code attribute, and the logging
// stores it into a log.
//
// # Design
//
// Each Istio attribute must conform to an `AttributeInfo` in an
// `AttributeManifest` in the current Istio deployment at runtime. An
// [`AttributeInfo`][istio.policy.v1beta1] is used to define an attribute's
// metadata: the type of its value and a detailed description that explains
// the semantics of the attribute type. Each attribute's name is globally unique;
// in other words an attribute name can only appear once across all manifests.
//
// The runtime presentation of an attribute is intentionally left out of this
// specification, because passing attribute using JSON, XML, or Protocol Buffers
// does not change the semantics of the attribute. Different implementations
// can choose different representations based on their needs.
//
// # HTTP Mapping
//
// Because many systems already have REST APIs, it makes sense to define a
// standard HTTP mapping for Istio attributes that are compatible with typical
// REST APIs. The design is to map one attribute to one HTTP header, the
// attribute name and value becomes the HTTP header name and value. The actual
// encoding scheme will be decided later.
type AttributeManifest_AttributeInfo struct {
// Optional. A human-readable description of the attribute's purpose.
Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"`
// Required. The type of data carried by this attribute.
ValueType ValueType `protobuf:"varint,2,opt,name=value_type,json=valueType,proto3,enum=istio.policy.v1beta1.ValueType" json:"value_type,omitempty"`
}
func (m *AttributeManifest_AttributeInfo) Reset() { *m = AttributeManifest_AttributeInfo{} }
func (*AttributeManifest_AttributeInfo) ProtoMessage() {}
func (*AttributeManifest_AttributeInfo) Descriptor() ([]byte, []int) {
return fileDescriptor_dfb7777e81b6b919, []int{0, 0}
}
func (m *AttributeManifest_AttributeInfo) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *AttributeManifest_AttributeInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_AttributeManifest_AttributeInfo.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *AttributeManifest_AttributeInfo) XXX_Merge(src proto.Message) {
xxx_messageInfo_AttributeManifest_AttributeInfo.Merge(m, src)
}
func (m *AttributeManifest_AttributeInfo) XXX_Size() int {
return m.Size()
}
func (m *AttributeManifest_AttributeInfo) XXX_DiscardUnknown() {
xxx_messageInfo_AttributeManifest_AttributeInfo.DiscardUnknown(m)
}
var xxx_messageInfo_AttributeManifest_AttributeInfo proto.InternalMessageInfo
func (m *AttributeManifest_AttributeInfo) GetDescription() string {
if m != nil {
return m.Description
}
return ""
}
func (m *AttributeManifest_AttributeInfo) GetValueType() ValueType {
if m != nil {
return m.ValueType
}
return VALUE_TYPE_UNSPECIFIED
}
// A Rule is a selector and a set of intentions to be executed when the
// selector is `true`
//
// The following example instructs Mixer to invoke `prometheus-handler` handler for all services and pass it the
// instance constructed using the 'RequestCountByService' instance.
//
// ```yaml
// - match: match(destination.service.host, "*")
// actions:
// - handler: prometheus-handler
// instances:
// - RequestCountByService
// ```
type Rule struct {
// Required. Match is an attribute based predicate. When Mixer receives a
// request it evaluates the match expression and executes all the associated `actions`
// if the match evaluates to true.
//
// A few example match:
//
// * an empty match evaluates to `true`
// * `true`, a boolean literal; a rule with this match will always be executed
// * `match(destination.service.host, "ratings.*")` selects any request targeting a service whose
// name starts with "ratings"
// * `attr1 == "20" && attr2 == "30"` logical AND, OR, and NOT are also available
Match string `protobuf:"bytes,1,opt,name=match,proto3" json:"match,omitempty"`
// Optional. The actions that will be executed when match evaluates to `true`.
Actions []*Action `protobuf:"bytes,2,rep,name=actions,proto3" json:"actions,omitempty"`
// Optional. Templatized operations on the request headers using values produced by the
// rule actions. Require the check action result to be OK.
RequestHeaderOperations []*Rule_HeaderOperationTemplate `protobuf:"bytes,3,rep,name=request_header_operations,json=requestHeaderOperations,proto3" json:"request_header_operations,omitempty"`
// Optional. Templatized operations on the response headers using values produced by the
// rule actions. Require the check action result to be OK.
ResponseHeaderOperations []*Rule_HeaderOperationTemplate `protobuf:"bytes,4,rep,name=response_header_operations,json=responseHeaderOperations,proto3" json:"response_header_operations,omitempty"`
// $hide_from_docs
// Optional. Provides the ability to add a sampling configuration for Mixer rules. This sampling
// will limit the scenarios in which the `actions` of the rule are executed. The sampling will
// only take place after a `match` predicate has evaluated to true.
//
// Default behavior is no sampling (the `actions` are executed for all requests).
Sampling *Sampling `protobuf:"bytes,5,opt,name=sampling,proto3" json:"sampling,omitempty"`
}
func (m *Rule) Reset() { *m = Rule{} }
func (*Rule) ProtoMessage() {}
func (*Rule) Descriptor() ([]byte, []int) {
return fileDescriptor_dfb7777e81b6b919, []int{1}
}
func (m *Rule) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *Rule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Rule.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *Rule) XXX_Merge(src proto.Message) {
xxx_messageInfo_Rule.Merge(m, src)
}
func (m *Rule) XXX_Size() int {
return m.Size()
}
func (m *Rule) XXX_DiscardUnknown() {
xxx_messageInfo_Rule.DiscardUnknown(m)
}
var xxx_messageInfo_Rule proto.InternalMessageInfo
func (m *Rule) GetMatch() string {
if m != nil {
return m.Match
}
return ""
}
func (m *Rule) GetActions() []*Action {
if m != nil {
return m.Actions
}
return nil
}
func (m *Rule) GetRequestHeaderOperations() []*Rule_HeaderOperationTemplate {
if m != nil {
return m.RequestHeaderOperations
}
return nil
}
func (m *Rule) GetResponseHeaderOperations() []*Rule_HeaderOperationTemplate {
if m != nil {
return m.ResponseHeaderOperations
}
return nil
}
func (m *Rule) GetSampling() *Sampling {
if m != nil {
return m.Sampling
}
return nil
}
// A template for an HTTP header manipulation. Values in the template are expressions
// that may reference action outputs by name. For example, if an action `x` produces an output
// with a field `f`, then the header value expressions may use attribute `x.output.f` to reference
// the field value:
//
// ```yaml
// request_header_operations:
// - name: x-istio-header
// values:
// - x.output.f
// ```
//
// If the header value expression evaluates to an empty string, and the operation is to either replace
// or append a header, then the operation is not applied. This permits conditional behavior on behalf of the
// adapter to optionally modify the headers.
type Rule_HeaderOperationTemplate struct {
// Required. Header name literal value.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// Optional. Header value expressions.
Values []string `protobuf:"bytes,2,rep,name=values,proto3" json:"values,omitempty"`
// Optional. Header operation type. Default operation is to replace the value of the header by name.
Operation Rule_HeaderOperationTemplate_Operation `protobuf:"varint,3,opt,name=operation,proto3,enum=istio.policy.v1beta1.Rule_HeaderOperationTemplate_Operation" json:"operation,omitempty"`
}
func (m *Rule_HeaderOperationTemplate) Reset() { *m = Rule_HeaderOperationTemplate{} }
func (*Rule_HeaderOperationTemplate) ProtoMessage() {}
func (*Rule_HeaderOperationTemplate) Descriptor() ([]byte, []int) {
return fileDescriptor_dfb7777e81b6b919, []int{1, 0}
}
func (m *Rule_HeaderOperationTemplate) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *Rule_HeaderOperationTemplate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Rule_HeaderOperationTemplate.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *Rule_HeaderOperationTemplate) XXX_Merge(src proto.Message) {
xxx_messageInfo_Rule_HeaderOperationTemplate.Merge(m, src)
}
func (m *Rule_HeaderOperationTemplate) XXX_Size() int {
return m.Size()
}
func (m *Rule_HeaderOperationTemplate) XXX_DiscardUnknown() {
xxx_messageInfo_Rule_HeaderOperationTemplate.DiscardUnknown(m)
}
var xxx_messageInfo_Rule_HeaderOperationTemplate proto.InternalMessageInfo
func (m *Rule_HeaderOperationTemplate) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *Rule_HeaderOperationTemplate) GetValues() []string {
if m != nil {
return m.Values
}
return nil
}
func (m *Rule_HeaderOperationTemplate) GetOperation() Rule_HeaderOperationTemplate_Operation {
if m != nil {
return m.Operation
}
return REPLACE
}
// Action describes which [Handler][istio.policy.v1beta1.Handler] to invoke and what data to pass to it for processing.
//
// The following example instructs Mixer to invoke 'prometheus-handler' handler and pass it the object
// constructed using the instance 'RequestCountByService'.
//
// ```yaml
// handler: prometheus-handler
// instances:
// - RequestCountByService
// ```
type Action struct {
// Required. Fully qualified name of the handler to invoke.
// Must match the `name` of a [Handler][istio.policy.v1beta1.Handler.name].
Handler string `protobuf:"bytes,2,opt,name=handler,proto3" json:"handler,omitempty"`
// Required. Each value must match the fully qualified name of the
// [Instance][istio.policy.v1beta1.Instance.name]s.
// Referenced instances are evaluated by resolving the attributes/literals for all the fields.
// The constructed objects are then passed to the `handler` referenced within this action.
Instances []string `protobuf:"bytes,3,rep,name=instances,proto3" json:"instances,omitempty"`
// Optional. A handle to refer to the results of the action.
Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"`
}
func (m *Action) Reset() { *m = Action{} }
func (*Action) ProtoMessage() {}
func (*Action) Descriptor() ([]byte, []int) {
return fileDescriptor_dfb7777e81b6b919, []int{2}
}
func (m *Action) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *Action) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Action.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *Action) XXX_Merge(src proto.Message) {
xxx_messageInfo_Action.Merge(m, src)
}
func (m *Action) XXX_Size() int {
return m.Size()
}
func (m *Action) XXX_DiscardUnknown() {
xxx_messageInfo_Action.DiscardUnknown(m)
}
var xxx_messageInfo_Action proto.InternalMessageInfo
func (m *Action) GetHandler() string {
if m != nil {
return m.Handler
}
return ""
}
func (m *Action) GetInstances() []string {
if m != nil {
return m.Instances
}
return nil
}
func (m *Action) GetName() string {
if m != nil {
return m.Name
}
return ""
}
// An Instance tells Mixer how to create instances for particular template.
//
// Instance is defined by the operator. Instance is defined relative to a known
// template. Their purpose is to tell Mixer how to use attributes or literals to produce
// instances of the specified template at runtime.
//
// The following example instructs Mixer to construct an instance associated with template
// 'istio.mixer.adapter.metric.Metric'. It provides a mapping from the template's fields to expressions.
// Instances produced with this instance can be referenced by [Actions][istio.policy.v1beta1.Action] using name
// 'RequestCountByService'
//
// ```yaml
// - name: RequestCountByService
// template: istio.mixer.adapter.metric.Metric
// params:
// value: 1
// dimensions:
// source: source.name
// destination_ip: destination.ip
// ```
type Instance struct {
// Required. The name of this instance
//
// Must be unique amongst other Instances in scope. Used by [Action][istio.policy.v1beta1.Action] to refer
// to an instance produced by this instance.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// Required. The name of the compiled in template this instance creates instances for. For referencing non compiled-in
// templates, use the `template` field instead.
//
// The value must match the name of the available template Mixer is built with.
CompiledTemplate string `protobuf:"bytes,67794676,opt,name=compiled_template,json=compiledTemplate,proto3" json:"compiled_template,omitempty"`
// Required. The name of the template this instance creates instances for. For referencing compiled-in
// templates, use the `compiled_template` field instead.
//
// The value must match the name of the available template in scope.
Template string `protobuf:"bytes,2,opt,name=template,proto3" json:"template,omitempty"`
// Required. Depends on referenced template. Struct representation of a
// proto defined by the template; this varies depending on the value of field `template`.
Params *types.Struct `protobuf:"bytes,3,opt,name=params,proto3" json:"params,omitempty"`
// Optional. Defines attribute bindings to map the output of attribute-producing adapters back into
// the attribute space. The variable `output` refers to the output template instance produced
// by the adapter.
// The following example derives `source.namespace` from `source.uid` in the context of Kubernetes:
// ```yaml
// params:
// # Pass the required attribute data to the adapter
// source_uid: source.uid | ""
// attribute_bindings:
// # Fill the new attributes from the adapter produced output
// source.namespace: output.source_namespace
// ```
AttributeBindings map[string]string `protobuf:"bytes,4,rep,name=attribute_bindings,json=attributeBindings,proto3" json:"attribute_bindings,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
}
func (m *Instance) Reset() { *m = Instance{} }
func (*Instance) ProtoMessage() {}
func (*Instance) Descriptor() ([]byte, []int) {
return fileDescriptor_dfb7777e81b6b919, []int{3}
}
func (m *Instance) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *Instance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Instance.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *Instance) XXX_Merge(src proto.Message) {
xxx_messageInfo_Instance.Merge(m, src)
}
func (m *Instance) XXX_Size() int {
return m.Size()
}
func (m *Instance) XXX_DiscardUnknown() {
xxx_messageInfo_Instance.DiscardUnknown(m)
}
var xxx_messageInfo_Instance proto.InternalMessageInfo
func (m *Instance) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *Instance) GetCompiledTemplate() string {
if m != nil {
return m.CompiledTemplate
}
return ""
}
func (m *Instance) GetTemplate() string {
if m != nil {
return m.Template
}
return ""
}
func (m *Instance) GetParams() *types.Struct {
if m != nil {
return m.Params
}
return nil
}
func (m *Instance) GetAttributeBindings() map[string]string {
if m != nil {
return m.AttributeBindings
}
return nil
}
// Handler allows the operator to configure a specific adapter implementation.
// Each adapter implementation defines its own `params` proto.
//
// In the following example we define a `metrics` handler for the `prometheus` adapter.
// The example is in the form of a Kubernetes resource:
// * The `metadata.name` is the name of the handler
// * The `kind` refers to the adapter name
// * The `spec` block represents adapter-specific configuration as well as the connection information
//
// ```yaml
// # Sample-1: No connection specified (for compiled in adapters)
// # Note: if connection information is not specified, the adapter configuration is directly inside
// # `spec` block. This is going to be DEPRECATED in favor of Sample-2
// apiVersion: "config.istio.io/v1alpha2"
// kind: prometheus
// metadata:
// name: handler
// namespace: istio-system
// spec:
// metrics:
// - name: request_count
// instance_name: requestcount.metric.istio-system
// kind: COUNTER
// label_names:
// - source_service
// - source_version
// - destination_service
// - destination_version
// ---
// # Sample-2: With connection information (for out-of-process adapters)
// # Note: Unlike sample-1, the adapter configuration is parallel to `connection` and is nested inside `param` block.
// apiVersion: "config.istio.io/v1alpha2"
// kind: prometheus
// metadata:
// name: handler
// namespace: istio-system
// spec:
// param:
// metrics:
// - name: request_count
// instance_name: requestcount.metric.istio-system
// kind: COUNTER
// label_names:
// - source_service
// - source_version
// - destination_service
// - destination_version
// connection:
// address: localhost:8090
// ---
// ```
type Handler struct {
// Required. Must be unique in the entire Mixer configuration. Used by [Actions][istio.policy.v1beta1.Action.handler]
// to refer to this handler.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// Required. The name of the compiled in adapter this handler instantiates. For referencing non compiled-in
// adapters, use the `adapter` field instead.
//
// The value must match the name of the available adapter Mixer is built with. An adapter's name is typically a
// constant in its code.
CompiledAdapter string `protobuf:"bytes,67794676,opt,name=compiled_adapter,json=compiledAdapter,proto3" json:"compiled_adapter,omitempty"`
// Required. The name of a specific adapter implementation. For referencing compiled-in
// adapters, use the `compiled_adapter` field instead.
//
// An adapter's implementation name is typically a constant in its code.
Adapter string `protobuf:"bytes,2,opt,name=adapter,proto3" json:"adapter,omitempty"`
// Optional. Depends on adapter implementation. Struct representation of a
// proto defined by the adapter implementation; this varies depending on the value of field `adapter`.
Params *types.Struct `protobuf:"bytes,3,opt,name=params,proto3" json:"params,omitempty"`
// Optional. Information on how to connect to the out-of-process adapter.
// This is used if the adapter is not compiled into Mixer binary and is running as a separate process.
Connection *Connection `protobuf:"bytes,4,opt,name=connection,proto3" json:"connection,omitempty"`
}
func (m *Handler) Reset() { *m = Handler{} }
func (*Handler) ProtoMessage() {}
func (*Handler) Descriptor() ([]byte, []int) {
return fileDescriptor_dfb7777e81b6b919, []int{4}
}
func (m *Handler) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *Handler) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Handler.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *Handler) XXX_Merge(src proto.Message) {
xxx_messageInfo_Handler.Merge(m, src)
}
func (m *Handler) XXX_Size() int {
return m.Size()
}
func (m *Handler) XXX_DiscardUnknown() {
xxx_messageInfo_Handler.DiscardUnknown(m)
}
var xxx_messageInfo_Handler proto.InternalMessageInfo
func (m *Handler) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *Handler) GetCompiledAdapter() string {
if m != nil {
return m.CompiledAdapter
}
return ""
}
func (m *Handler) GetAdapter() string {
if m != nil {
return m.Adapter
}
return ""
}
func (m *Handler) GetParams() *types.Struct {
if m != nil {
return m.Params
}
return nil
}
func (m *Handler) GetConnection() *Connection {
if m != nil {
return m.Connection
}
return nil
}
// Connection allows the operator to specify the endpoint for out-of-process infrastructure backend.
// Connection is part of the handler custom resource and is specified alongside adapter specific configuration.
type Connection struct {
// The address of the backend.
Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
// Timeout for remote calls to the backend.
Timeout *time.Duration `protobuf:"bytes,3,opt,name=timeout,proto3,stdduration" json:"timeout,omitempty"`
// Auth config for the connection to the backend. If omitted, plain text will
// be used.
Authentication *Authentication `protobuf:"bytes,4,opt,name=authentication,proto3" json:"authentication,omitempty"`
}
func (m *Connection) Reset() { *m = Connection{} }
func (*Connection) ProtoMessage() {}
func (*Connection) Descriptor() ([]byte, []int) {
return fileDescriptor_dfb7777e81b6b919, []int{5}
}
func (m *Connection) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *Connection) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Connection.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *Connection) XXX_Merge(src proto.Message) {
xxx_messageInfo_Connection.Merge(m, src)
}
func (m *Connection) XXX_Size() int {
return m.Size()
}
func (m *Connection) XXX_DiscardUnknown() {
xxx_messageInfo_Connection.DiscardUnknown(m)
}
var xxx_messageInfo_Connection proto.InternalMessageInfo
func (m *Connection) GetAddress() string {
if m != nil {
return m.Address
}
return ""
}
func (m *Connection) GetTimeout() *time.Duration {
if m != nil {
return m.Timeout
}
return nil
}
func (m *Connection) GetAuthentication() *Authentication {
if m != nil {
return m.Authentication
}
return nil
}
// $hide_from_docs
// Sampling provides configuration of sampling strategies for Rule actions.
// Multiple sampling strategies are supported. When multiple strategies are configured,
// a request must be selected by all configured sampling strategies.
type Sampling struct {
// Optional. Provides filtering of actions based on random selection per request.
Random *RandomSampling `protobuf:"bytes,1,opt,name=random,proto3" json:"random,omitempty"`
// Optional. Provides filtering of actions based on number of requests observed within
// a configured time window.
RateLimit *RateLimitSampling `protobuf:"bytes,2,opt,name=rate_limit,json=rateLimit,proto3" json:"rate_limit,omitempty"`
}
func (m *Sampling) Reset() { *m = Sampling{} }
func (*Sampling) ProtoMessage() {}
func (*Sampling) Descriptor() ([]byte, []int) {
return fileDescriptor_dfb7777e81b6b919, []int{6}
}
func (m *Sampling) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *Sampling) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Sampling.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *Sampling) XXX_Merge(src proto.Message) {
xxx_messageInfo_Sampling.Merge(m, src)
}
func (m *Sampling) XXX_Size() int {
return m.Size()
}
func (m *Sampling) XXX_DiscardUnknown() {
xxx_messageInfo_Sampling.DiscardUnknown(m)
}
var xxx_messageInfo_Sampling proto.InternalMessageInfo
func (m *Sampling) GetRandom() *RandomSampling {
if m != nil {
return m.Random
}
return nil
}
func (m *Sampling) GetRateLimit() *RateLimitSampling {
if m != nil {
return m.RateLimit
}
return nil
}
// $hide_from_docs
// RandomSampling will filter based on the comparison of a randomly-generated value
// against the threshold provided.
//
// Example: To restrict the execution of Rule actions to only 12.5% of requests, the
// `sampling_rate` would be set `12.5`.
//
// This sampling configuration is meant to closely match the access log RuntimeFilter configuration
// [supported by Envoy](https://github.com/envoyproxy/data-plane-api/blob/master/envoy/config/filter/accesslog/v2/accesslog.proto#L113)
type RandomSampling struct {
// Specifies an attribute expression to use to override the numerator in the `percent_sampled` field.
// If this value is set, but no value is found OR if that value is not a numeric value, then
// the derived sampling rate will be 0 (meaning no `Action`s are executed for a `Rule`).
AttributeExpression string `protobuf:"bytes,1,opt,name=attribute_expression,json=attributeExpression,proto3" json:"attribute_expression,omitempty"`
// The default sampling rate, expressed as a percentage. Defaults to 0% with a denominator
// of 100.
PercentSampled *FractionalPercent `protobuf:"bytes,2,opt,name=percent_sampled,json=percentSampled,proto3" json:"percent_sampled,omitempty"`
// By default sampling will be based on the value of the request header `x-request-id`.
// This behavior will cause consistent sampling across `Rule`s and for the full trace of a
// request through a mesh (across hosts). If that value is not present and/or
// `use_independent_randomness` is set to true, the sampling will be done based on the value of
// attribute specified in `attribute_epxression`. If that attribute does not exist, the system
// will behave as if the sampling rate was 0 (meaning no `Action`s are executed for a `Rule`).
UseIndependentRandomness bool `protobuf:"varint,3,opt,name=use_independent_randomness,json=useIndependentRandomness,proto3" json:"use_independent_randomness,omitempty"`
}
func (m *RandomSampling) Reset() { *m = RandomSampling{} }
func (*RandomSampling) ProtoMessage() {}
func (*RandomSampling) Descriptor() ([]byte, []int) {
return fileDescriptor_dfb7777e81b6b919, []int{7}
}
func (m *RandomSampling) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *RandomSampling) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_RandomSampling.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *RandomSampling) XXX_Merge(src proto.Message) {
xxx_messageInfo_RandomSampling.Merge(m, src)
}
func (m *RandomSampling) XXX_Size() int {
return m.Size()
}
func (m *RandomSampling) XXX_DiscardUnknown() {
xxx_messageInfo_RandomSampling.DiscardUnknown(m)
}
var xxx_messageInfo_RandomSampling proto.InternalMessageInfo
func (m *RandomSampling) GetAttributeExpression() string {
if m != nil {
return m.AttributeExpression
}
return ""
}
func (m *RandomSampling) GetPercentSampled() *FractionalPercent {