From 00bcffbd35d92fba6d478e750b02e39d2032ade0 Mon Sep 17 00:00:00 2001 From: tangjjia Date: Mon, 13 Feb 2023 04:25:18 +0000 Subject: [PATCH] =?UTF-8?q?Update=20GRPC=C2=AE=20Protocol=20Models/grpc-di?= =?UTF-8?q?alin.proto,=20GRPC=C2=AE=20Protocol=20Models/grpc-dialout.proto?= =?UTF-8?q?,=20Data=20Header=20Models/telemetry.proto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Data Header Models/telemetry.proto | 27 +++++++ .../grpc-dialin.proto" | 77 +++++++++++++++++++ .../grpc-dialout.proto" | 12 +++ 3 files changed, 116 insertions(+) create mode 100644 Data Header Models/telemetry.proto create mode 100644 "GRPC\302\256 Protocol Models/grpc-dialin.proto" create mode 100644 "GRPC\302\256 Protocol Models/grpc-dialout.proto" diff --git a/Data Header Models/telemetry.proto b/Data Header Models/telemetry.proto new file mode 100644 index 0000000..cd8c97a --- /dev/null +++ b/Data Header Models/telemetry.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; //proto v3. +package telemetry; //package name + +message Telemetry { //telemetry message structure definition. + string node_id_str = 1; //The hostname of the device is the unique identifier of the device in the network, which can be configured and modified by the user. It is encoded as 1 in GPB encoding. + string subscription_id_str = 2; //Subscription name, the subscription name when the subscription is statically configured + string sensor_path = 3; //Subscription path + uint64 collection_id = 4; //Identify sampling rounds + uint64 collection_start_time = 5; //Identify the start time of the sampling round + uint64 msg_timestamp = 6; //Timestamp when this message was generated + TelemetryGPBTable data_gpb = 7; //data carried. + uint64 collection_end_time = 8; //Identify the end time of the sampling round + uint32 current_period = 9; //Sampling accuracy, in milliseconds + string except_desc = 10; //Exception description information, which is used to report exception information when sampling exceptions. + string product_name = 11; //Product name. + Encoding encoding = 12; //Data encoding. + enum Encoding { + Encoding_GPB = 0; + }; +} +message TelemetryGPBTable { //TelemetryGPBTable message structure definition + repeated TelemetryRowGPB row = 1; //Array definition, the identification data is the repetition of the TelemetryRowGPB structure. +} +message TelemetryRowGPB { + uint64 timestamp = 1; //Timestamp at which the current instance was sampled. +bytes content = 11; //The sampled instance data carried is encoded as 11 in GPB encoding. It is necessary to combine the sensor_path field to determine which proto file will be encoded here. +} diff --git "a/GRPC\302\256 Protocol Models/grpc-dialin.proto" "b/GRPC\302\256 Protocol Models/grpc-dialin.proto" new file mode 100644 index 0000000..3450933 --- /dev/null +++ "b/GRPC\302\256 Protocol Models/grpc-dialin.proto" @@ -0,0 +1,77 @@ +syntax = "proto3"; +package dialin; + +service gRPCConfigOper { + rpc Subscribe(SubsArgs) returns(stream SubsReply) {}; + rpc Cancel(CancelArgs) returns(CancelReply) {}; +} + +message Path { + string path = 1; +} + +message SubsArgs { + uint64 request_id = 1; + uint32 encoding = 2; + + repeated Destination destination = 3; + + //Path to a section of operational state of interest (the sensor). + repeated Path path = 5; + + //The accuracy of the collected data reported by the device + //to the collector + uint64 sample_interval = 6; + + //Maximum time interval in seconds that may pass + //between updates from a device to a telemetry collector. + //If this interval expires, but there is no updated data to + //send (such as if suppress_updates has been configured), the + //device must send a telemetry message to the collector. + uint64 heartbeat_interval = 7; + + //Boolean flag to control suppression of redundant + //telemetry updates to the collector platform. If this flag is + //set to TRUE, then the collector will only send an update at + //the configured interval if a subscribed data value has + //changed. Otherwise, the device will not send an update to + //the collector until expiration of the heartbeat interval. + bool suppress_redundant = 8; + + //range "0..63" + //The dscp type represents a Differentiated Services Code Point + //that may be used for marking packets in a traffic stream. + //In the value set and its semantics, this type is equivalent + //to the Dscp textual convention of the SMIv2. + uint32 originated_qos_marking = 9; +} + +message Destination { + // IP address of the telemetry stream destination + string destination_address = 1; + + // Protocol (udp or tcp) port number for the telemetry + // stream destination + uint32 destination_port = 2; +} + +message SubsReply { + uint32 subscription_id = 1; + uint64 request_id = 2; + string response_code = 3; + + //containing the data described by the Telemetry message + //defined in hw_telemetry.proto + bytes message = 4; +} + +message CancelArgs { + uint64 request_id = 1; + uint32 subscription_id = 2; +} + +message CancelReply { + uint64 request_id = 1; + string response_code = 2; + string message = 3; +} diff --git "a/GRPC\302\256 Protocol Models/grpc-dialout.proto" "b/GRPC\302\256 Protocol Models/grpc-dialout.proto" new file mode 100644 index 0000000..d5bb503 --- /dev/null +++ "b/GRPC\302\256 Protocol Models/grpc-dialout.proto" @@ -0,0 +1,12 @@ +syntax = "proto3"; +package dialout; + +service gRPCDataservice { + rpc dataPublish(stream serviceArgs) returns(stream serviceArgs) {}; +} + +message serviceArgs { + int64 ReqId = 1; + bytes data = 2; + string errors = 3; +} -- GitLab