// Copyright 2016 Istio Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

// $title: Mixer
// $overview: API definitions to interact with Mixer
// $location: https://istio.io/docs/reference/api/istio.mixer.v1.html
// $front_matter: redirect_from: /docs/reference/api/mixer/mixer.html


// This package defines the Mixer API that the sidecar proxy uses to perform
// precondition checks, manage quotas, and report telemetry.
package istio.mixer.v1;

option go_package = "istio.io/api/mixer/v1";
option cc_generic_services = true;

import "mixer/v1/check.proto";
import "mixer/v1/report.proto";

// Mixer provides three core features:
// 
// - *Precondition Checking*. Enables callers to verify a number of preconditions
// before responding to an incoming request from a service consumer.
// Preconditions can include whether the service consumer is properly
// authenticated, is on the service’s whitelist, passes ACL checks, and more.
//
// - *Quota Management*. Enables services to allocate and free quota on a number
// of dimensions, Quotas are used as a relatively simple resource management tool
// to provide some fairness between service consumers when contending for limited
// resources. Rate limits are examples of quotas.
//
// - *Telemetry Reporting*. Enables services to report logging and monitoring.
// In the future, it will also enable tracing and billing streams intended for
// both the service operator as well as for service consumers.
service Mixer {
  // Checks preconditions and allocate quota before performing an operation.
  // The preconditions enforced depend on the set of supplied attributes and
  // the active configuration.
  rpc Check(CheckRequest) returns (CheckResponse) {}

  // Reports telemetry, such as logs and metrics.
  // The reported information depends on the set of supplied attributes and the
  // active configuration.
  rpc Report(ReportRequest) returns (ReportResponse) {}
}
