syntax = "proto3";

package chef.automate.api.cfgmgmt.request;
option go_package = "github.com/chef/automate/api/external/cfgmgmt/request";

import "protoc-gen-swagger/options/annotations.proto";

message NodesCounts {
  option (grpc.gateway.protoc_gen_swagger.options.openapiv2_schema) = {
    json_schema: {
      required: ["filter"]
    },
    // Example from List Node Status Count: cfgmgmt/stats/node_counts?filter=name:mySO*&filter=platform:ubun*
    example: { value: '{"filter": ["name:mySO*","platform:ubun*"]}' }
  };
  // List of filters to be applied to the node count results.
  repeated string filter = 1;
  // Earliest node check-in.
  string start = 2;
  // Latest node check-in
  string end = 3;
}

message RunsCounts {
  option (grpc.gateway.protoc_gen_swagger.options.openapiv2_schema) = {
    json_schema: {
      required: ["node_id"]
    },
    // Example from List Run Status Totals: cfgmgmt/stats/run_counts?node_id=821fff07-abc9-4160-96b1-83d68ae5cfdd&start=2019-11-02
    example: { value: '{"node_id": "821fff07-abc9-4160-96b1-83d68ae5cfdd", "start": "2019-11-02"}' }
  };
  // List of filters to be applied to the run count results.
  repeated string filter = 1;
  // Earliest (in history) run information to return for the run counts.
  string start = 2;
  // Latest (in history) run information to return for the run counts.
  string end = 3;
  // Node id associated with the run.
  string node_id = 4;
}

message CheckInCountsTimeSeries {
  // List of filters to be applied to the time series.
  repeated string filter = 1;
  // Number of past days to create the time series
  int32 days_ago = 2;
}
