Skip to content

Commit 12ec312

Browse files
committed
copy nokia protobuf files to proto/Juniper
1 parent b87f7e6 commit 12ec312

File tree

3 files changed

+75
-34
lines changed

3 files changed

+75
-34
lines changed

proto/Juniper/juniper_dialout.proto

+5-22
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,9 @@
1-
21
syntax = "proto3";
2+
import "gnmi.proto";
33

4-
import "juniper_gnmi.proto";
5-
6-
// new grpc service definition having DialOutSubscriber as the RPC name.
7-
service Subscriber {
8-
/*
9-
Phase1: Subscriber allows the target to send telemetry update:s (in the form of SubscribeResponse messages,
10-
which has the same semantics as in the gNMI Subscribe RPC, to a client. Target will stream the sensor
11-
configuration that are configured out of band for this client.
12-
13-
Phase2: Optionally the client may return the SubscribeRequest message in response to the dial-out connection from the target.
14-
In this case, the client may augment the set of subscriptions that are to be published by the target. This SubscribeRequest
15-
message has the same semantics as in the Subscribe gNMI RPC.
16-
17-
In the case that the client specifies neither option, then target waits indefinitely till the sensor subscription is made.
18-
19-
The configuration of subscriptions associated with the Subscriber RPC may be through the OpenConfig telemetry configuration and operational state model:
20-
https://github.com/openconfig/public/blob/master/release/models/telemetry/openconfig-telemetry.yang
21-
*/
22-
23-
rpc DialOutSubscriber(stream gnmi.SubscribeResponse) returns (stream gnmi.SubscribeRequest);
4+
package Nokia.SROS;
245

6+
service DialoutTelemetry {
7+
rpc Publish(stream gnmi.SubscribeResponse) returns (stream PublishResponse);
258
}
26-
9+
message PublishResponse {}

proto/Juniper/juniper_gnmi.proto

+53-9
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ syntax = "proto3";
1717

1818
import "google/protobuf/any.proto";
1919
import "google/protobuf/descriptor.proto";
20-
import "juniper_gnmi_ext.proto";
20+
import public "gnmi_ext.proto";
21+
//import "github.com/openconfig/gnmi/proto/gnmi_ext/gnmi_ext.proto";
22+
//import "github.com/openconfig/gnmi/proto/gnmi_ext/gnmi_ext.proto";
23+
//import "gnmi_ext.proto";
2124

2225
// Package gNMI defines a service specification for the gRPC Network Management
2326
// Interface. This interface is defined to be a standard interface via which
@@ -37,7 +40,13 @@ extend google.protobuf.FileOptions {
3740

3841
// gNMI_service is the current version of the gNMI service, returned through
3942
// the Capabilities RPC.
40-
option (gnmi_service) = "0.7.0";
43+
option (gnmi_service) = "0.8.0";
44+
45+
option go_package = "github.com/openconfig/gnmi/proto/gnmi";
46+
option java_multiple_files = true;
47+
option java_outer_classname = "GnmiProto";
48+
option java_package = "com.github.gnmi.proto";
49+
4150

4251
service gNMI {
4352
// Capabilities allows the client to retrieve the set of capabilities that
@@ -111,8 +120,9 @@ message TypedValue {
111120
uint64 uint_val = 3; // Unsigned integer value.
112121
bool bool_val = 4; // Bool value.
113122
bytes bytes_val = 5; // Arbitrary byte sequence value.
114-
float float_val = 6; // Floating point value.
115-
Decimal64 decimal_val = 7; // Decimal64 encoded value.
123+
float float_val = 6 [deprecated=true]; // Deprecated - use double_val.
124+
double double_val = 14; // Floating point value.
125+
Decimal64 decimal_val = 7 [deprecated=true]; // Deprecated - use double_val.
116126
ScalarArray leaflist_val = 8; // Mixed type scalar array value.
117127
google.protobuf.Any any_val = 9; // protobuf.Any encoded bytes.
118128
bytes json_val = 10; // JSON-encoded text.
@@ -121,7 +131,7 @@ message TypedValue {
121131
// Protobuf binary encoded bytes. The message type is not included.
122132
// See the specification at
123133
// github.com/openconfig/reference/blob/master/rpc/gnmi/protobuf-vals.md
124-
// for a complete specification.
134+
// for a complete specification. [Experimental]
125135
bytes proto_bytes = 13;
126136
}
127137
}
@@ -137,10 +147,10 @@ message Path {
137147
string origin = 2; // Label to disambiguate path.
138148
repeated PathElem elem = 3; // Elements of the path.
139149
string target = 4; // The name of the target
140-
// (Sec. 2.2.2.1)
150+
// (Sec. 2.2.2.1)
141151
}
142152

143-
// PathElem encodes an element of a gNMI path, along ith any attributes (keys)
153+
// PathElem encodes an element of a gNMI path, along with any attributes (keys)
144154
// that may be associated with it.
145155
// Reference: gNMI Specification Section 2.2.2.
146156
message PathElem {
@@ -165,7 +175,7 @@ message Value {
165175
enum Encoding {
166176
JSON = 0; // JSON encoded text.
167177
BYTES = 1; // Arbitrarily encoded bytes.
168-
PROTO = 2; // Encoded according to out-of-band agreed Protobuf.
178+
PROTO = 2; // Encoded according to scalar values of TypedValue.
169179
ASCII = 3; // ASCII text of an out-of-band agreed format.
170180
JSON_IETF = 4; // JSON encoded text as per RFC7951.
171181
}
@@ -285,7 +295,7 @@ message Subscription {
285295
Path path = 1; // The data tree path.
286296
SubscriptionMode mode = 2; // Subscription mode to be used.
287297
uint64 sample_interval = 3; // ns between samples in SAMPLE mode.
288-
// Indicates whether values that not changed should be sent in a SAMPLE
298+
// Indicates whether values that have not changed should be sent in a SAMPLE
289299
// subscription.
290300
bool suppress_redundant = 4;
291301
// Specifies the maximum allowable silent period in nanoseconds when
@@ -455,3 +465,37 @@ message ModelData {
455465
string version = 3; // Semantic version of the model.
456466
}
457467

468+
service gNMIDialOut {
469+
// Publish allows the target to send telemetry updates (in the form of
470+
// SubscribeResponse messages, which have the same semantics as in the
471+
// gNMI Subscribe RPC, to a client. The client may optionally return the
472+
// PublishResponse message in response to the dial-out connection from the
473+
// target. In this case, the client may modify the set of subscriptions
474+
// that are to be published by the target by:
475+
// - Specifying a client_id within the PublishResponse message. In this
476+
// case the target should match pre-configured subscriptions the specified
477+
// client_id, and send data only for the paths associated with the
478+
// specified client_id.
479+
// - Specifying a SubscribeRequest message within the subscriptions field of
480+
// the PublishResponse message. This message has the same semantics as
481+
// in the Subscribe gNMI RPC.
482+
// In the case that the client specifies neither option, a default set of
483+
// subscriptions (which should be configurable on the target) should be
484+
// published to the client (collector).
485+
//
486+
// The configuration of subscriptions associated with the publish RPC may
487+
// be through the OpenConfig telemetry configuration and operational state
488+
// model:
489+
// https://github.com/openconfig/public/blob/master/release/models/telemetry/openconfig-telemetry.yang
490+
rpc Publish(stream SubscribeResponse) returns (stream PublishResponse);
491+
}
492+
493+
// PublishResponse is the message sent within the Publish RPC of the gNMI
494+
// dial-out service by the client (collector) to the target. It is used to
495+
// modify the set of paths that are to be sent by the target to the collector.
496+
message PublishResponse {
497+
oneof request {
498+
string client_id = 1; // A string identifying the client to the target.
499+
SubscribeRequest subscriptions = 2; // Optional specification of the subscriptions.
500+
}
501+
}

proto/Juniper/juniper_gnmi_ext.proto

+17-3
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,15 @@ syntax = "proto3";
2121
// extensions defined outside of this package.
2222
package gnmi_ext;
2323

24+
option go_package = "github.com/openconfig/gnmi/proto/gnmi_ext";
25+
2426
// The Extension message contains a single gNMI extension.
2527
message Extension {
2628
oneof ext {
2729
RegisteredExtension registered_ext = 1; // A registered extension.
2830
// Well known extensions.
2931
MasterArbitration master_arbitration = 2; // Master arbitration extension.
32+
History history = 3; // History extension.
3033
}
3134
}
3235

@@ -44,9 +47,6 @@ enum ExtensionID {
4447
// New extensions are to be defined within this enumeration - their definition
4548
// MUST link to a reference describing their implementation.
4649

47-
// Juniper Telemetry header
48-
EID_JUNIPER_TELEMETRY_HEADER = 1;
49-
5050
// An experimental extension that may be used during prototyping of a new
5151
// extension.
5252
EID_EXPERIMENTAL = 999;
@@ -75,3 +75,17 @@ message Role {
7575
// role can read/write.
7676
}
7777

78+
// The History extension allows clients to request historical data. Its
79+
// spec can be found at
80+
// https://github.com/openconfig/reference/blob/master/rpc/gnmi/gnmi-history.md
81+
message History {
82+
oneof request {
83+
int64 snapshot_time = 1; // Nanoseconds since the epoch
84+
TimeRange range = 2;
85+
}
86+
}
87+
88+
message TimeRange {
89+
int64 start = 1; // Nanoseconds since the epoch
90+
int64 end = 2; // Nanoseconds since the epoch
91+
}

0 commit comments

Comments
 (0)