syntax = "proto3";

option go_package = "storage";
option java_package = "io.stackrox.proto.storage";

import "google/protobuf/timestamp.proto";

package storage;

message BenchmarkResult {
    string id                            = 1;
    string benchmark_id                  = 2;
    repeated BenchmarkCheckResult results         = 3;
    google.protobuf.Timestamp start_time = 4;
    google.protobuf.Timestamp end_time   = 5;
    string host                          = 6;
    string scan_id                       = 7;
    string cluster_id                    = 8;
    BenchmarkReason reason               = 9;
}

message BenchmarkScan {
    string id = 1;
    message Check {
        BenchmarkCheckDefinition   definition         = 1;
        map<string, int32> aggregated_results = 2;
    }
    repeated Check checks = 2;
}

message BenchmarkScanMetadata {
    string                    scan_id       = 1;
    string                    benchmark_id  = 2;
    repeated string           cluster_ids   = 3;
    repeated string           checks        = 4;
    google.protobuf.Timestamp time          = 5;
    BenchmarkReason           reason        = 6;
}

message BenchmarkCheckResult {
    string id                  = 1;
    string host                = 2;
    string cluster_id          = 3;
    BenchmarkCheckDefinition definition = 4;
    BenchmarkCheckStatus result         = 5;
    repeated string notes      = 6;
}

enum BenchmarkCheckStatus {
    INFO           = 0;
    WARN           = 1;
    NOTE           = 2;
    PASS           = 3;
    NOT_APPLICABLE = 4;
}

message BenchmarkCheckDefinition {
    string name        = 1;
    string description = 2;
}

enum BenchmarkReason {
    SCHEDULED = 0;
    TRIGGERED = 1;
}
