From 48702fdf1afe42f8ffb92535fd5865aeccda0309 Mon Sep 17 00:00:00 2001 From: Caleb Geiger <48812321+ElodinLaarz@users.noreply.github.com> Date: Thu, 26 Sep 2024 17:04:38 -0400 Subject: [PATCH 1/2] add gnmirpc to oc paths --- proto/ocpaths.proto | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/proto/ocpaths.proto b/proto/ocpaths.proto index 46f3bd41717..f82ae120337 100644 --- a/proto/ocpaths.proto +++ b/proto/ocpaths.proto @@ -58,6 +58,10 @@ message OCPath { // A set of opaque tags that are used for this path. These tags can be used // to group paths according to use-case specific criteria. repeated string tags = 4; + + // GNMIRpc describes expected (or supported) behavior for a particular + // Openconfig path. + GNMIRpc gnmi_rpc = 5; } // OCPathConstraint enumerates platform_types that are required to be supported @@ -76,3 +80,37 @@ message OCPathConstraint { string platform_type = 1; } } + +// GNMIRpc describes expected (or supported) behavior for a particular +// Openconfig path. +message GNMIRpc { + bool get = 1; + bool set = 2; + bool subscribe = 3; + + // Mode, describes how updates are triggered for the request. + enum Mode { + NO_READ_SUPPORT = 0; // No requirement / support for path. + STREAM = 1; // Values streamed by the target (Sec. 3.5.1.5.2). + ONCE = 2; // Values sent once-off by the target (Sec. 3.5.1.5.1). + POLL = 3; // Values sent in response to a poll request (Sec. 3.5.1.5.3). + } + repeated Mode mode = 4; + + // SubscriptionMode is the mode of a streamed subscription, specifying how the + // target must return values for that subscription. + // Reference: gNMI Specification Section 3.5.1.3 + enum SubscriptionMode { + NO_STREAMING_SUPPORT = 0; // No requirement / support for streaming path. + TARGET_DEFINED = 1; // The target selects for each element. + ON_CHANGE = 2; // The target sends an update on element value change. + SAMPLE = 3; // The target samples values according to the interval. + } + repeated SubscriptionMode sub_mode = 5; + + // If listed as part of a requirement, sample_interval_nanoseconds is the + // maximum allowable interval between updates. + // If listed as part of the description of level of support, it should be the + // smallest, recommended value. + uint64 sample_interval_nanoseconds = 6; +} From 44e0b7d1a767e680c3c126e6aef3f6115be51531 Mon Sep 17 00:00:00 2001 From: Caleb Geiger <48812321+ElodinLaarz@users.noreply.github.com> Date: Fri, 27 Sep 2024 11:00:38 -0600 Subject: [PATCH 2/2] Update ocpaths.proto Change names of the enums to be a bit clearer and change default value to hold no information. --- proto/ocpaths.proto | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/proto/ocpaths.proto b/proto/ocpaths.proto index f82ae120337..ea7d21e6d57 100644 --- a/proto/ocpaths.proto +++ b/proto/ocpaths.proto @@ -88,25 +88,27 @@ message GNMIRpc { bool set = 2; bool subscribe = 3; - // Mode, describes how updates are triggered for the request. - enum Mode { - NO_READ_SUPPORT = 0; // No requirement / support for path. - STREAM = 1; // Values streamed by the target (Sec. 3.5.1.5.2). - ONCE = 2; // Values sent once-off by the target (Sec. 3.5.1.5.1). - POLL = 3; // Values sent in response to a poll request (Sec. 3.5.1.5.3). + // SubscribeMode, describes how updates are triggered for the request. + enum SubscribeMode { + UNSPECIFIED_SUBSCRIBE_MODE = 0; + NO_READ_SUPPORT = 1; // No requirement / support for path. + STREAM = 2; // Values streamed by the target (Sec. 3.5.1.5.2). + ONCE = 3; // Values sent once-off by the target (Sec. 3.5.1.5.1). + POLL = 4; // Values sent in response to a poll request (Sec. 3.5.1.5.3). } - repeated Mode mode = 4; + repeated SubscribeMode sub_mode = 4; - // SubscriptionMode is the mode of a streamed subscription, specifying how the + // StreamMode is the mode of a streamed subscription, specifying how the // target must return values for that subscription. // Reference: gNMI Specification Section 3.5.1.3 - enum SubscriptionMode { - NO_STREAMING_SUPPORT = 0; // No requirement / support for streaming path. - TARGET_DEFINED = 1; // The target selects for each element. - ON_CHANGE = 2; // The target sends an update on element value change. - SAMPLE = 3; // The target samples values according to the interval. + enum StreamMode { + UNSPECIFIED_STREAM_MODE = 0; + NO_STREAMING_SUPPORT = 1; // No requirement / support for streaming path. + TARGET_DEFINED = 2; // The target selects for each element. + ON_CHANGE = 3; // The target sends an update on element value change. + SAMPLE = 4; // The target samples values according to the interval. } - repeated SubscriptionMode sub_mode = 5; + repeated StreamMode stream_mode = 5; // If listed as part of a requirement, sample_interval_nanoseconds is the // maximum allowable interval between updates.