syntax = "proto3";
package proto;

option go_package = "sdk/plugin/eventsearcher/proto";

message FsEventsFilter {
    int64 start_timestamp = 1;
    int64 end_timestamp = 2;
    repeated string actions = 3;
    string username = 4;
    string ip = 5;
    string ssh_cmd = 6;
    repeated string protocols = 7;
    repeated int32 statuses = 8;
    repeated string instance_ids = 9;
    int32 limit = 10;
    repeated string exclude_ids = 11;
    enum Order {
        DESC = 0;
        ASC = 1;
    }
    Order order = 12;
}

message ProviderEventsFilter {
    int64 start_timestamp = 1;
    int64 end_timestamp = 2;
    repeated string actions = 3;
    string username = 4;
    string ip = 5;
    repeated string object_types = 6;
    string object_name = 7;
    repeated string instance_ids = 8;
    int32 limit = 9;
    enum Order {
        DESC = 0;
        ASC = 1;
    }
    Order order = 10;
    repeated string exclude_ids = 11;
}

message SearchResponse {
    bytes data = 1; // JSON serialized response to return
    repeated string same_ts_at_start = 2;
    repeated string same_ts_at_end = 3;
}

service Searcher {
    rpc SearchFsEvents(FsEventsFilter) returns (SearchResponse);
    rpc SearchProviderEvents(ProviderEventsFilter) returns (SearchResponse);
}