// Copyright 2018 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";

package istio.testing.mixer.policybackend;

import "google/protobuf/any.proto";

option go_package="policy";

// ControllerService can be used to query and change the behavior of a fake policy backend.
service ControllerService {

    // Set changes settings of the fake policy backend.
    rpc  Set(SetRequest) returns (SetResponse);

    // Resets the internal state of the policy backend (i.e. all settings are reverted to the default values
    // and all accumulated state is cleared.
    rpc Reset(ResetRequest) returns (ResetResponse);

    // GetReports returns the accumulated set of reports from the service. The server clears out its
    // accumulated cache once the call completes.
    rpc GetReports(GetReportsRequest) returns (GetReportsResponse);
}

message SetRequest {
    // The settings to set on the service.
    map<string, string> settings = 1;
}

message SetResponse {
}

message ResetRequest {

}

message ResetResponse {

}

message GetReportsRequest {
}

message GetReportsResponse {
    repeated google.protobuf.Any instances = 1;
}
