--- title: Mixer - Southbound API overview: Generated documentation for Mixer's API that is used by Envoy. order: 20 layout: docs type: markdown --- ## Package istio.mixer.v1 ### Index * [Mixer](#istio.mixer.v1.Mixer) (interface) * [Attributes](#istio.mixer.v1.Attributes) (message) * [CheckRequest](#istio.mixer.v1.CheckRequest) (message) * [CheckResponse](#istio.mixer.v1.CheckResponse) (message) * [QuotaRequest](#istio.mixer.v1.QuotaRequest) (message) * [QuotaResponse](#istio.mixer.v1.QuotaResponse) (message) * [ReportRequest](#istio.mixer.v1.ReportRequest) (message) * [ReportResponse](#istio.mixer.v1.ReportResponse) (message) * [StringMap](#istio.mixer.v1.StringMap) (message) ### Mixer The Mixer API #### Check
rpc Check(CheckRequest) returns (CheckResponse)Checks preconditions before performing an operation. The preconditions enforced depend on the set of supplied attributes and the active configuration. #### Quota
rpc Quota(QuotaRequest) returns (QuotaResponse)Quota allocates and releases quota. #### Report
rpc Report(ReportRequest) returns (ReportResponse)Reports telemetry, such as logs and metrics. The reported information depends on the set of supplied attributes and the active configuration. ### Attributes An instance of this message is delivered to the mixer with every API call. The general idea is to leverage the stateful gRPC streams from the proxy to the mixer to keep to a minimum the 'attribute chatter'. Only delta attributes are sent over, multiple concurrent attribute contexts can be used to avoid thrashing, and attribute indices are used to keep the wire protocol maximally efficient. Producing this message is the responsibility of the mixer's client library which is linked into different proxy implementations. The processing order for this state in the mixer is: * Any new dictionary is applied * The requested attribute context is looked up. If no such context has been defined, a new context is automatically created and initialized to the empty state. When a gRPC stream is first created, there are no attribute contexts for the stream. * If reset_context is true, then the attribute context is reset to the empty state. * All attributes to deleted are removed from the attribute context. * All attribute changes are applied to the attribute context.
| Field | Type | Description |
|---|---|---|
dictionary |
repeated map<int32, string> | A dictionary that provides a mapping of shorthand index values to attribute names. This is intended to leverage the stateful gRPC stream from the proxy to the mixer. This dictionary is sent over only when a stream to the mixer is first established and when the proxy's configuration changes and different attributes may be produced. Once a dictionary has been sent over, it stays in effect until a new dictionary is sent to replace it. The first request sent on a stream must include a dictionary, otherwise the mixer can't process any attribute updates. Dictionaries are independent of the attribute context and are thus global to each gRPC stream. |
attribute_context |
int32 | The attribute context against which to operate. The mixer keeps different contexts live for any proxy gRPC stream. This allows the proxy to maintain multiple concurrent 'bags of attributes' within the mixer. If the proxy doesn't want to leverage multiple contexts, it just passes 0 here for every request. The proxy is configured to use a maximum number of attribute contexts in order to prevent an explosion of contexts in the mixer's memory space. |
reset_context |
bool | When true, resets the current attribute context to the empty state before applying any incoming attributes. Resetting contexts is useful to constrain the amount of resources used by the mixer. The proxy needs to intelligently manage a pool of contexts. It may be useful to reset a context when certain big events happen, such as when an HTTP2 connection into the proxy terminates. |
string_attributes |
repeated map<int32, string> | Attributes being updated within the specified attribute context. These maps add and/or overwrite the context's current set of attributes. |
int64_attributes |
repeated map<int32, int64> | |
double_attributes |
repeated map<int32, double> | |
bool_attributes |
repeated map<int32, bool> | |
timestamp_attributes |
repeated map<int32, Timestamp> | |
duration_attributes |
repeated map<int32, Duration> | |
bytes_attributes |
repeated map<int32, bytes> | |
stringMap_attributes |
repeated map<int32, StringMap> | |
deleted_attributes[] |
repeated int32 | Attributes that should be removed from the specified attribute context. Deleting attributes which aren't currently in the attribute context is not considered an error. |
timestamp_attributes_HACK |
repeated map<int32, Timestamp> | |
duration_attributes_HACK |
repeated map<int32, Duration> |
| Field | Type | Description |
|---|---|---|
request_index |
int64 | Index within the stream for this request, used to match to responses |
attribute_update |
Attributes | The attributes to use for this request |
| Field | Type | Description |
|---|---|---|
request_index |
int64 | Index of the request this response is associated with |
attribute_update |
Attributes | The attributes to use for this response |
result |
Status | Indicates whether or not the preconditions succeeded |
expiration |
Duration | The amount of time for which this result can be considered valid, given the same inputs |
| Field | Type | Description |
|---|---|---|
request_index |
int64 | Index within the stream for this request, used to match to responses |
attribute_update |
Attributes | The attributes to use for this request |
deduplication_id |
string | Used for deduplicating quota allocation/free calls in the case of failed RPCs and retries. This should be a UUID per call, where the same UUID is used for retries of the same quota allocation call. |
quota |
string | The quota to allocate from. |
amount |
int64 | The amount of quota to allocate. |
best_effort |
bool | If true, allows a response to return less quota than requested. When false, the exact requested amount is returned or 0 if not enough quota was available. |
| Field | Type | Description |
|---|---|---|
request_index |
int64 | Index of the request this response is associated with. |
attribute_update |
Attributes | The attributes to use for this response |
result |
Status | Indicates whether the quota request was successfully processed. |
expiration |
Duration | The amount of time the returned quota can be considered valid, this is 0 for non-expiring quotas. |
amount |
int64 | The total amount of quota returned, may be less than requested. |
| Field | Type | Description |
|---|---|---|
request_index |
int64 | Index within the stream for this request, used to match to responses |
attribute_update |
Attributes | The attributes to use for this request |
| Field | Type | Description |
|---|---|---|
request_index |
int64 | Index of the request this response is associated with |
attribute_update |
Attributes | The attributes to use for this response |
result |
Status | Indicates whether the report was processed or not |
| Field | Type | Description |
|---|---|---|
map |
repeated map<int32, string> |
| Field | Type | Description |
|---|---|---|
code |
int32 | The status code, which should be an enum value of google.rpc.Code. |
message |
string | A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client. |
details[] |
repeated Any | A list of messages that carry the error details. There will be a common set of message types for APIs to use. |