DEVELOPMENT ENVIRONMENT

~liljamo/emerwen

ref: 37248b4bedc86278a2779dcd46f251f0864d0ecc emerwen/emerwen-protocol/proto/emerwen.proto -rw-r--r-- 723 bytes
37248b4bJonni Liljamo docs: LICENSE, NOTICE and README.md changes 12 days ago
                                                                                
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
syntax = "proto3";

import "google/protobuf/empty.proto";
package emerwen;

service EmerwenProtocol {
    rpc GetTargets (google.protobuf.Empty) returns (TargetsResponse);
    rpc SetTargetState (SetTargetStateRequest) returns (google.protobuf.Empty);
}

message Target {
    uint32 id = 1;
    string addr = 2;
    uint32 interval = 3;
    oneof method {
        MethodPing ping = 4;
        MethodGET get = 5;
    }

    message MethodPing {}
    message MethodGET {
        repeated uint32 ok_codes = 1;
    }
}

message TargetsResponse {
    repeated Target targets = 1;
}

enum TargetState {
    DOWN = 0;
    UP = 1;
    UNKNOWN = 2;
}

message SetTargetStateRequest {
    uint32 id = 1;
    TargetState state = 2;
}