aboutsummaryrefslogtreecommitdiffstats
path: root/proto/configuration/rule.proto
blob: f963fde3a886f4a4e1f5c371582050e0a7888c6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
syntax = "proto3";

package configuration.rule;

import "google/protobuf/struct.proto";

message Timeframe {
  double threshold = 1;
}

message OutcomeResult {
  string sub_rule_ref = 1;
  string reason = 2;
}

message Band {
  string sub_rule_ref = 1;
  string reason = 2;
  optional double lower_limit = 3;
  optional double upper_limit = 4;
}

message Case {
  string sub_rule_ref = 1;
  string reason = 2;
  double value = 3;
}

message Config {
  optional google.protobuf.Value parameters = 1;
  repeated OutcomeResult exit_conditions = 2;
  repeated Band bands = 3;
  repeated Case cases = 4;
  repeated Timeframe time_frames = 5;
}

message RuleConfiguration {
  string id = 1;
  string version = 2;
  Config configuration = 3;
  string description = 4;
}

message RuleConfigurationRequest {
  string id = 1;
  string version = 2;
}

message DeleteRuleConfigurationRequest {
  string id = 1;
  string version = 2;
}

message UpdateRuleRequest {
  RuleConfiguration configuration = 1;
}

message GetRuleConfigResponse {
  optional RuleConfiguration configuration = 1;
}

service QueryRuleConfiguration {
  rpc GetRuleConfiguration (RuleConfigurationRequest) returns (GetRuleConfigResponse);
}

service MutateRuleConfiguration {
  rpc CreateRuleConfiguration (RuleConfiguration) returns (RuleConfiguration);
  rpc UpdateRuleConfiguration (UpdateRuleRequest) returns (RuleConfiguration);
  rpc DeleteRuleConfiguration (DeleteRuleConfigurationRequest) returns (RuleConfiguration);
}