From eab524ca83acbb7ee8a1f75d4fa311392e43ffab Mon Sep 17 00:00:00 2001 From: "insanity@loafle.com" Date: Sat, 20 May 2017 17:01:21 +0900 Subject: [PATCH] proto --- data/data.proto | 16 +++++++++ grpc/grpc.proto => event/event.proto | 52 +--------------------------- initialize/initialize.proto | 15 ++++++++ task/task.proto | 17 +++++++++ 4 files changed, 49 insertions(+), 51 deletions(-) create mode 100644 data/data.proto rename grpc/grpc.proto => event/event.proto (68%) create mode 100644 initialize/initialize.proto create mode 100644 task/task.proto diff --git a/data/data.proto b/data/data.proto new file mode 100644 index 0000000..165cdeb --- /dev/null +++ b/data/data.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; + +message Empty {} + +message CollectedData { + string agentId = 1; + string sensorId = 2; + map data = 3; + int64 startDate = 4; + int64 finishDate = 5; +} + +service Data { + rpc sendMetric(CollectedData) returns (Empty) {} + rpc sendMeta(CollectedData) returns (Empty) {} +} diff --git a/grpc/grpc.proto b/event/event.proto similarity index 68% rename from grpc/grpc.proto rename to event/event.proto index ed32d8c..ae9127f 100644 --- a/grpc/grpc.proto +++ b/event/event.proto @@ -1,10 +1,8 @@ syntax = "proto3"; - message Empty {} //Event-relative area - message DiscoveryEvent { string agentId = 1; string taskId = 2; @@ -83,52 +81,4 @@ message AgentEvent { service Event { rpc event(AgentEvent) returns (Empty){} } -//Event-relative area - - -//Data-relative area -message CollectedData { - string agentId = 1; - string sensorId = 2; - map data = 3; - int64 startDate = 4; - int64 finishDate = 5; -} - -service Data { - rpc sendMetric(CollectedData) returns (Empty) {} - rpc sendMeta(CollectedData) returns (Empty) {} -} -//Data-relative area - - -//Task polling-relative area -message TaskInfo { - string command = 1; - string taskId = 2; - map data = 3; -} - -message TaskList { - repeated TaskInfo taskList = 1; -} - -service Task { - rpc requestTask(Empty) returns (TaskList) {} -} -//Task polling-relative area - - -//Init-relative area -message AgentInfo { - string agentId = 1; -} - -message InitResponse { - string secretKey = 1; -} - -service Initializer { - rpc agentStarting(AgentInfo) returns (InitResponse) {} -} -//Init-relative area \ No newline at end of file +//Event-relative area \ No newline at end of file diff --git a/initialize/initialize.proto b/initialize/initialize.proto new file mode 100644 index 0000000..533328a --- /dev/null +++ b/initialize/initialize.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; + +message Empty {} + +message AgentInfo { + string agentId = 1; +} + +message InitResponse { + string secretKey = 1; +} + +service Initializer { + rpc agentStarting(AgentInfo) returns (InitResponse) {} +} \ No newline at end of file diff --git a/task/task.proto b/task/task.proto new file mode 100644 index 0000000..2e6a86a --- /dev/null +++ b/task/task.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; + +message Empty {} + +message TaskInfo { + string command = 1; + string taskId = 2; + map data = 3; +} + +message TaskList { + repeated TaskInfo taskList = 1; +} + +service Task { + rpc requestTask(Empty) returns (TaskList) {} +} \ No newline at end of file