istio_mixer_v1_config

package
v0.0.0-...-a1f2fe4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package istio_mixer_v1_config is a generated protocol buffer package.

It is generated from these files:

mixer/v1/config/cfg.proto

It has these top-level messages:

ServiceConfig
AspectRule
Aspect
Adapter
GlobalConfig
AttributeManifest
Uri
IpAddress
DnsName
EmailAddress
Rule
Action
Instance
Handler

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	// Required. Fully qualified name of the handler to invoke.
	// Must match the `name` of a [Handler][istio.mixer.v1.config.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.mixer.v1.config.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" json:"instances,omitempty"`
}

Action describes which Handler[istio.mixer.v1.config.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

```

func (*Action) Descriptor

func (*Action) Descriptor() ([]byte, []int)

func (*Action) GetHandler

func (m *Action) GetHandler() string

func (*Action) GetInstances

func (m *Action) GetInstances() []string

func (*Action) ProtoMessage

func (*Action) ProtoMessage()

func (*Action) Reset

func (m *Action) Reset()

func (*Action) String

func (m *Action) String() string

type Adapter

type Adapter struct {
	// Required. must be unique per `kind`. Used by [Aspect][istio.mixer.v1.config.Aspect]
	// to refer to this adapter. The name "default" is special: when an Aspect does not
	// specify a name, the Adapter named "default" of the same `kind` is used to execute
	// the intention described by the [AspectRule][istio.mixer.v1.config.AspectRule]s.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Required. The aspect this implementation with these params will implement;
	// a single adapter implementation may implement many aspects, but an `Adapter`
	// entry is required per kind.
	Kind string `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty"`
	// Required. The name of a specific adapter implementation. An adapter's
	// implementation name is typically a constant in its code.
	Impl string `protobuf:"bytes,3,opt,name=impl,proto3" json:"impl,omitempty"`
	// Optional. depends on adapter implementation. Struct representation of a
	// proto defined by the implementation; this varies depending on `impl`.
	Params interface{} `protobuf:"bytes,4,opt,name=params" json:"params,omitempty"`
}

Adapter allows the operator to configure a specific adapter implementation. Each adapter implementation defines its own `params` proto. Note that unlike Aspect[istio.mixer.v1.config.Aspect], the type of `params` varies with `impl` and not with `kind`.

In the following example we define a `metrics` adapter using the Mixer's prepackaged prometheus adapter. This adapter doesn't require any parameters.

```yaml kind: metrics name: prometheus-adapter impl: prometheus params: ```

func (*Adapter) Descriptor

func (*Adapter) Descriptor() ([]byte, []int)

func (*Adapter) GetImpl

func (m *Adapter) GetImpl() string

func (*Adapter) GetKind

func (m *Adapter) GetKind() string

func (*Adapter) GetName

func (m *Adapter) GetName() string

func (*Adapter) GetParams

func (m *Adapter) GetParams() interface{}

func (*Adapter) ProtoMessage

func (*Adapter) ProtoMessage()

func (*Adapter) Reset

func (m *Adapter) Reset()

func (*Adapter) String

func (m *Adapter) String() string

type Aspect

type Aspect struct {
	// Required. The kind of aspect this intent is targeting.
	Kind string `protobuf:"bytes,1,opt,name=kind,proto3" json:"kind,omitempty"`
	// Optional. The name of the adapter this Aspect targets. If no name is provided,
	// Mixer will use the adapter of the target kind named "default".
	Adapter string `protobuf:"bytes,2,opt,name=adapter,proto3" json:"adapter,omitempty"`
	// Required. Struct representation of a proto defined by each aspect kind.
	Params interface{} `protobuf:"bytes,4,opt,name=params" json:"params,omitempty"`
}

Aspect describes how an adapter is intended to operate in the context of the rule it's embedded in. The value for `params` depends on the `kind` of this aspect: each kind of aspect defines its own `params` proto.

The following example instructs Mixer to populate a metric named "response_time" that was declared to have three labels: src_consumer_id, dst_response_status_code, and dst_service_name. For each label and the metric's `value` we provide an expression over Istio's attributes. Mixer evaluates these expressions for each request.

```yaml kind: metrics params:

metrics:
- descriptorName: response_time # tie this metric to a descriptor of the same name
  value: response.time  # from the set of canonical attributes
  labels:
    src_consumer_id: source.user | source.uid
    dst_response_status_code: response.code
    dst_service_name: destination.service

```

func (*Aspect) Descriptor

func (*Aspect) Descriptor() ([]byte, []int)

func (*Aspect) GetAdapter

func (m *Aspect) GetAdapter() string

func (*Aspect) GetKind

func (m *Aspect) GetKind() string

func (*Aspect) GetParams

func (m *Aspect) GetParams() interface{}

func (*Aspect) ProtoMessage

func (*Aspect) ProtoMessage()

func (*Aspect) Reset

func (m *Aspect) Reset()

func (*Aspect) String

func (m *Aspect) String() string

type AspectRule

type AspectRule struct {
	// Required. Selector is an attribute based predicate. When Mixer receives a
	// request it evaluates all selectors in scope and executes the rules for all
	// selectors that evaluated to true.
	//
	// A few example selectors:
	//
	// * an empty selector evaluates to `true`
	// * `true`, a boolean literal; a rule with this selector will always be executed
	// * `destination.service == ratings*` selects any request targeting a service whose
	// name starts with "ratings"
	// * `attr1 == "20" && attr2 == "30"` logical AND, OR, and NOT are also available
	Selector string `protobuf:"bytes,1,opt,name=selector,proto3" json:"selector,omitempty"`
	// The aspects that apply when selector evaluates to `true`.
	Aspects []*Aspect `protobuf:"bytes,2,rep,name=aspects" json:"aspects,omitempty"`
	// Nested aspect rules; their selectors are evaluated if this selector
	// predicate evaluates to `true`.
	Rules []*AspectRule `protobuf:"bytes,3,rep,name=rules" json:"rules,omitempty"`
}

An AspectRule is a selector and a set of intentions to be executed when the selector is `true`. The selectors of the this rule's child AspectRules are only evaluated if this rule's selector is true.

func (*AspectRule) Descriptor

func (*AspectRule) Descriptor() ([]byte, []int)

func (*AspectRule) GetAspects

func (m *AspectRule) GetAspects() []*Aspect

func (*AspectRule) GetRules

func (m *AspectRule) GetRules() []*AspectRule

func (*AspectRule) GetSelector

func (m *AspectRule) GetSelector() string

func (*AspectRule) ProtoMessage

func (*AspectRule) ProtoMessage()

func (*AspectRule) Reset

func (m *AspectRule) Reset()

func (*AspectRule) String

func (m *AspectRule) String() string

type AttributeManifest

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 https://istio.io/docs/reference/attribute-vocabulary.html.
	// Attributes not in that list should be named with a component-specific suffix such as
	// request.count-my.component
	Attributes map[string]*AttributeManifest_AttributeInfo `` /* 147-byte string literal not displayed */
}

AttributeManifest describes a set of Attributes produced by some component of an Istio deployment.

func (*AttributeManifest) Descriptor

func (*AttributeManifest) Descriptor() ([]byte, []int)

func (*AttributeManifest) GetAttributes

func (*AttributeManifest) GetName

func (m *AttributeManifest) GetName() string

func (*AttributeManifest) GetRevision

func (m *AttributeManifest) GetRevision() string

func (*AttributeManifest) ProtoMessage

func (*AttributeManifest) ProtoMessage()

func (*AttributeManifest) Reset

func (m *AttributeManifest) Reset()

func (*AttributeManifest) String

func (m *AttributeManifest) String() string

type AttributeManifest_AttributeInfo

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 istio_mixer_v1_config_descriptor.ValueType `` /* 137-byte string literal not displayed */
}

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.mixer.v1.config] 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.

func (*AttributeManifest_AttributeInfo) Descriptor

func (*AttributeManifest_AttributeInfo) Descriptor() ([]byte, []int)

func (*AttributeManifest_AttributeInfo) GetDescription

func (m *AttributeManifest_AttributeInfo) GetDescription() string

func (*AttributeManifest_AttributeInfo) GetValueType

func (*AttributeManifest_AttributeInfo) ProtoMessage

func (*AttributeManifest_AttributeInfo) ProtoMessage()

func (*AttributeManifest_AttributeInfo) Reset

func (*AttributeManifest_AttributeInfo) String

type Combined

type Combined struct {
	Builder   *Adapter
	Aspect    *Aspect
	Instances []*Instance
}

Combined config is given to aspect managers.

func (*Combined) String

func (c *Combined) String() (ret string)

type DnsName

type DnsName struct {
	Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
}

DnsName holds a valid domain name.

func (*DnsName) Descriptor

func (*DnsName) Descriptor() ([]byte, []int)

func (*DnsName) GetValue

func (m *DnsName) GetValue() string

func (*DnsName) ProtoMessage

func (*DnsName) ProtoMessage()

func (*DnsName) Reset

func (m *DnsName) Reset()

func (*DnsName) String

func (m *DnsName) String() string

type EmailAddress

type EmailAddress struct {
	Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
}

EmailAddress holds a properly formatted email address.

func (*EmailAddress) Descriptor

func (*EmailAddress) Descriptor() ([]byte, []int)

func (*EmailAddress) GetValue

func (m *EmailAddress) GetValue() string

func (*EmailAddress) ProtoMessage

func (*EmailAddress) ProtoMessage()

func (*EmailAddress) Reset

func (m *EmailAddress) Reset()

func (*EmailAddress) String

func (m *EmailAddress) String() string

type GlobalConfig

type GlobalConfig struct {
	// Optional.
	Revision  string               `protobuf:"bytes,1,opt,name=revision,proto3" json:"revision,omitempty"`
	Adapters  []*Adapter           `protobuf:"bytes,2,rep,name=adapters" json:"adapters,omitempty"`
	Manifests []*AttributeManifest `protobuf:"bytes,3,rep,name=manifests" json:"manifests,omitempty"`
	// TODO: remove these in https://github.com/istio/api/pull/45
	Logs               []*istio_mixer_v1_config_descriptor1.LogEntryDescriptor          `protobuf:"bytes,4,rep,name=logs" json:"logs,omitempty"`
	Metrics            []*istio_mixer_v1_config_descriptor2.MetricDescriptor            `protobuf:"bytes,5,rep,name=metrics" json:"metrics,omitempty"`
	MonitoredResources []*istio_mixer_v1_config_descriptor3.MonitoredResourceDescriptor `protobuf:"bytes,6,rep,name=monitored_resources,json=monitoredResources" json:"monitored_resources,omitempty"`
	Principals         []*istio_mixer_v1_config_descriptor4.PrincipalDescriptor         `protobuf:"bytes,7,rep,name=principals" json:"principals,omitempty"`
	Quotas             []*istio_mixer_v1_config_descriptor5.QuotaDescriptor             `protobuf:"bytes,8,rep,name=quotas" json:"quotas,omitempty"`
	// Under development, DO NOT USE
	// Optional. List of handlers that can be referenced from [actions][istio.mixer.v1.config.Action.handler]
	Handlers []*Handler `protobuf:"bytes,9,rep,name=handlers" json:"handlers,omitempty"`
}

GlobalConfig defines configuration elements that are available for the rest of the config. It is used to configure adapters and make them available in AspectRules.

(== deprecation_description GlobalConfig is deprecated, see the Config API's swagger spec. ==)

func (*GlobalConfig) Descriptor

func (*GlobalConfig) Descriptor() ([]byte, []int)

func (*GlobalConfig) GetAdapters

func (m *GlobalConfig) GetAdapters() []*Adapter

func (*GlobalConfig) GetHandlers

func (m *GlobalConfig) GetHandlers() []*Handler

func (*GlobalConfig) GetLogs

func (*GlobalConfig) GetManifests

func (m *GlobalConfig) GetManifests() []*AttributeManifest

func (*GlobalConfig) GetMetrics

func (*GlobalConfig) GetMonitoredResources

func (*GlobalConfig) GetPrincipals

func (*GlobalConfig) GetQuotas

func (*GlobalConfig) GetRevision

func (m *GlobalConfig) GetRevision() string

func (*GlobalConfig) ProtoMessage

func (*GlobalConfig) ProtoMessage()

func (*GlobalConfig) Reset

func (m *GlobalConfig) Reset()

func (*GlobalConfig) String

func (m *GlobalConfig) String() string

type Handler

type Handler struct {
	// Required. Must be unique in the entire mixer configuration. Used by [Actions][istio.mixer.v1.config.Action.handler]
	// to refer to this handler.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Required. The name of a specific adapter implementation. 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 interface{} `protobuf:"bytes,3,opt,name=params" json:"params,omitempty"`
}

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 using the Mixer's prepackaged prometheus adapter. This handler doesn't require any parameters.

```yaml name: prometheus-handler adapter: prometheus params: ```

func (*Handler) Descriptor

func (*Handler) Descriptor() ([]byte, []int)

func (*Handler) GetAdapter

func (m *Handler) GetAdapter() string

func (*Handler) GetName

func (m *Handler) GetName() string

func (*Handler) GetParams

func (m *Handler) GetParams() interface{}

func (*Handler) ProtoMessage

func (*Handler) ProtoMessage()

func (*Handler) Reset

func (m *Handler) Reset()

func (*Handler) String

func (m *Handler) String() string

type Instance

type Instance struct {
	// Required. The name of this instance
	//
	// Must be unique amongst other Instances in scope. Used by [Action][istio.mixer.v1.config.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 template this instance creates instances for.
	// 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 interface{} `protobuf:"bytes,3,opt,name=params" json:"params,omitempty"`
}

A 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.mixer.v1.config.Action] using name 'RequestCountByService'.

```yaml

  • name: RequestCountByService template: istio.mixer.adapter.metric.Metric params: value: 1 dimensions: source: source.service destination_ip: destination.ip

```

func (*Instance) Descriptor

func (*Instance) Descriptor() ([]byte, []int)

func (*Instance) GetName

func (m *Instance) GetName() string

func (*Instance) GetParams

func (m *Instance) GetParams() interface{}

func (*Instance) GetTemplate

func (m *Instance) GetTemplate() string

func (*Instance) ProtoMessage

func (*Instance) ProtoMessage()

func (*Instance) Reset

func (m *Instance) Reset()

func (*Instance) String

func (m *Instance) String() string

type IpAddress

type IpAddress struct {
	Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
}

IpAddress holds an IPv4 or IPv6 address.

func (*IpAddress) Descriptor

func (*IpAddress) Descriptor() ([]byte, []int)

func (*IpAddress) GetValue

func (m *IpAddress) GetValue() []byte

func (*IpAddress) ProtoMessage

func (*IpAddress) ProtoMessage()

func (*IpAddress) Reset

func (m *IpAddress) Reset()

func (*IpAddress) String

func (m *IpAddress) String() string

type Rule

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
	// * `destination.service == 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" json:"actions,omitempty"`
}

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: destination.service == "*" actions:
  • handler: prometheus-handler instances:
  • RequestCountByService

```

func (*Rule) Descriptor

func (*Rule) Descriptor() ([]byte, []int)

func (*Rule) GetActions

func (m *Rule) GetActions() []*Action

func (*Rule) GetMatch

func (m *Rule) GetMatch() string

func (*Rule) ProtoMessage

func (*Rule) ProtoMessage()

func (*Rule) Reset

func (m *Rule) Reset()

func (*Rule) String

func (m *Rule) String() string

type ServiceConfig

type ServiceConfig struct {
	// Optional. Subject is unique for a config type.
	// 2 config with the same subject will overwrite each other
	Subject string `protobuf:"bytes,1,opt,name=subject,proto3" json:"subject,omitempty"`
	// Optional. revision of this config. This is assigned by the server
	Revision string        `protobuf:"bytes,2,opt,name=revision,proto3" json:"revision,omitempty"`
	Rules    []*AspectRule `protobuf:"bytes,3,rep,name=rules" json:"rules,omitempty"`
	// Under development, DO NOT USE
	// Optional. List of instances that can be referenced from [actions][istio.mixer.v1.config.Action.instances]
	Instances []*Instance `protobuf:"bytes,4,rep,name=instances" json:"instances,omitempty"`
	// Under development, DO NOT USE
	// Optional. List of actions that apply for this service
	// TODO: Rename this to rules once we delete the AspectRule field.
	ActionRules []*Rule `protobuf:"bytes,5,rep,name=action_rules,json=actionRules" json:"action_rules,omitempty"`
}

Configures a set of services.

The following example configures a metric that will be recorded for all services:

```yaml subject: "namespace:ns1" revision: "1011" rules:

  • selector: destination.service == "*" aspects:
  • kind: metrics params: metrics: # defines metric collection across the board.
  • descriptorName: response_time_by_status_code value: response.time labels: statusCode: response.code

actionRules:

  • selector: destination.service == "*" actions:
  • handler: prometheus-handler instances:
  • RequestCountByService

handlers:

  • name: prometheus-handler adapter: prometheus params:

instances:

  • name: RequestCountByService template: istio.mixer.adapter.metric.Metric params: value: 1 dimensions: source: source.service destination_ip: destination.ip

```

(== deprecation_description ServiceConfig is deprecated, see the Config API's swagger spec. ==)

func (*ServiceConfig) Descriptor

func (*ServiceConfig) Descriptor() ([]byte, []int)

func (*ServiceConfig) GetActionRules

func (m *ServiceConfig) GetActionRules() []*Rule

func (*ServiceConfig) GetInstances

func (m *ServiceConfig) GetInstances() []*Instance

func (*ServiceConfig) GetRevision

func (m *ServiceConfig) GetRevision() string

func (*ServiceConfig) GetRules

func (m *ServiceConfig) GetRules() []*AspectRule

func (*ServiceConfig) GetSubject

func (m *ServiceConfig) GetSubject() string

func (*ServiceConfig) ProtoMessage

func (*ServiceConfig) ProtoMessage()

func (*ServiceConfig) Reset

func (m *ServiceConfig) Reset()

func (*ServiceConfig) String

func (m *ServiceConfig) String() string

type Uri

type Uri struct {
	Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
}

Uri represents a properly formed URI.

func (*Uri) Descriptor

func (*Uri) Descriptor() ([]byte, []int)

func (*Uri) GetValue

func (m *Uri) GetValue() string

func (*Uri) ProtoMessage

func (*Uri) ProtoMessage()

func (*Uri) Reset

func (m *Uri) Reset()

func (*Uri) String

func (m *Uri) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL