From d13ad6a51a1b2c63a93ea78a2883c318302c7bfa Mon Sep 17 00:00:00 2001 From: Gautham V Kidiyoor Date: Wed, 11 Oct 2023 13:49:31 -0700 Subject: [PATCH 1/4] Commit confirmed extension proto --- proto/gnmi_ext/gnmi_ext.proto | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/proto/gnmi_ext/gnmi_ext.proto b/proto/gnmi_ext/gnmi_ext.proto index 142fe1d2..423243bd 100644 --- a/proto/gnmi_ext/gnmi_ext.proto +++ b/proto/gnmi_ext/gnmi_ext.proto @@ -21,6 +21,8 @@ syntax = "proto3"; // extensions defined outside of this package. package gnmi_ext; +import "google/protobuf/duration.proto"; + option go_package = "github.com/openconfig/gnmi/proto/gnmi_ext"; // The Extension message contains a single gNMI extension. @@ -30,6 +32,7 @@ message Extension { // Well known extensions. MasterArbitration master_arbitration = 2; // Master arbitration extension. History history = 3; // History extension. + Commit commit = 4; // Commit confirmed extension. } } @@ -89,3 +92,23 @@ message TimeRange { int64 start = 1; // Nanoseconds since the epoch int64 end = 2; // Nanoseconds since the epoch } + +// Commit confirmed extension allows automated revert of a configuration after +// certain duration if an explicit confirmation is not issued. This duration can +// be used for testing the network device to verify the configuration. +// It also allows explicit cancellation of the commit during the rollback duration +// time window if client determine that the configuration needs to be reverted. +// The document about gNMI commit confirmed can be found at +// https://github.com/openconfig/reference/blob/master/rpc/gnmi/gnmi-commit-confirmed.md +message Commit { + // Maximum duration to wait for a confirmaton before reverting the commit. + google.protobuf.Duration rollback_duration = 1; + oneof id { + // commit_id indicates that this is a new commit request with given ID. + string commit_id = 2; + // confirm_id indicates that this is a confirmaton request for the given ID. + string confirm_id = 3; + // cancel_id indicates that this is a cancellation request for the given ID. + string cancel_id = 4; + } +} From 4ac366b2f6745296223bf7115cb80975a57741a0 Mon Sep 17 00:00:00 2001 From: Gautham V Kidiyoor Date: Fri, 20 Oct 2023 11:27:49 -0700 Subject: [PATCH 2/4] Defining explicit actions for better readability --- proto/gnmi_ext/gnmi_ext.proto | 39 ++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/proto/gnmi_ext/gnmi_ext.proto b/proto/gnmi_ext/gnmi_ext.proto index 423243bd..585f37c8 100644 --- a/proto/gnmi_ext/gnmi_ext.proto +++ b/proto/gnmi_ext/gnmi_ext.proto @@ -95,20 +95,35 @@ message TimeRange { // Commit confirmed extension allows automated revert of a configuration after // certain duration if an explicit confirmation is not issued. This duration can -// be used for testing the network device to verify the configuration. -// It also allows explicit cancellation of the commit during the rollback duration -// time window if client determine that the configuration needs to be reverted. +// be used to verify the configuration. +// It also allows explicit cancellation of the commit during the time window of rollback +// duration if client determine that the configuration needs to be reverted. // The document about gNMI commit confirmed can be found at // https://github.com/openconfig/reference/blob/master/rpc/gnmi/gnmi-commit-confirmed.md message Commit { - // Maximum duration to wait for a confirmaton before reverting the commit. - google.protobuf.Duration rollback_duration = 1; - oneof id { - // commit_id indicates that this is a new commit request with given ID. - string commit_id = 2; - // confirm_id indicates that this is a confirmaton request for the given ID. - string confirm_id = 3; - // cancel_id indicates that this is a cancellation request for the given ID. - string cancel_id = 4; + oneof action { + CommitRequest commit = 1; + CommitConfirm confirm = 2; + CommitCancel cancel = 3; } } + +// Create a new commit request. +message CommitRequest { + // Commit id for the request. + string id = 1; + // Maximum duration to wait for a confirmaton before reverting the commit. + google.protobuf.Duration rollback_duration = 2; +} + +// Confirm an on-going commit. +message CommitConfirm { + // Commit id that requires confirmation. + string id = 1; +} + +// Cancel an on-going commit. +message CommitCancel { + // Commit id that requires cancellation. + string id = 1; +} From 2dbf8ad25ba74a3d9ef80b9eb9ed94a5f5762493 Mon Sep 17 00:00:00 2001 From: Gautham V Kidiyoor Date: Thu, 26 Oct 2023 10:58:59 -0700 Subject: [PATCH 3/4] Update gnmi_ext.proto --- proto/gnmi_ext/gnmi_ext.proto | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/proto/gnmi_ext/gnmi_ext.proto b/proto/gnmi_ext/gnmi_ext.proto index 585f37c8..e868ba8c 100644 --- a/proto/gnmi_ext/gnmi_ext.proto +++ b/proto/gnmi_ext/gnmi_ext.proto @@ -108,9 +108,10 @@ message Commit { } } -// Create a new commit request. +// Create a new commit confirmed request. message CommitRequest { - // Commit id for the request. + // Commit id for the request. ID must be generated at the client side, it can be used + // to confirm or cancel the request without the rollback_duration interval. string id = 1; // Maximum duration to wait for a confirmaton before reverting the commit. google.protobuf.Duration rollback_duration = 2; @@ -118,12 +119,12 @@ message CommitRequest { // Confirm an on-going commit. message CommitConfirm { - // Commit id that requires confirmation. + // Commit id of the on-going commit that requires confirmation. string id = 1; } // Cancel an on-going commit. message CommitCancel { - // Commit id that requires cancellation. + // Commit id of the on-going commit that requires cancellation. string id = 1; } From fef38db6469df58901d717a7583196f97fcacd92 Mon Sep 17 00:00:00 2001 From: Gautham V Kidiyoor Date: Thu, 2 Nov 2023 11:42:16 -0700 Subject: [PATCH 4/4] Update gnmi_ext.proto Updating after discussion during community meeting. Provide clarity in comments regarding- a. Client provided ID. b. No more than 1 commit can be active at a time. --- proto/gnmi_ext/gnmi_ext.proto | 49 +++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/proto/gnmi_ext/gnmi_ext.proto b/proto/gnmi_ext/gnmi_ext.proto index e868ba8c..ab70ee86 100644 --- a/proto/gnmi_ext/gnmi_ext.proto +++ b/proto/gnmi_ext/gnmi_ext.proto @@ -93,38 +93,41 @@ message TimeRange { int64 end = 2; // Nanoseconds since the epoch } -// Commit confirmed extension allows automated revert of a configuration after -// certain duration if an explicit confirmation is not issued. This duration can -// be used to verify the configuration. -// It also allows explicit cancellation of the commit during the time window of rollback -// duration if client determine that the configuration needs to be reverted. +// Commit confirmed extension allows automated revert of the configuration after +// certain duration if an explicit confirmation is not issued. It allows explicit +// cancellation of the commit during the rollback window. There cannot be more +// than one commit active at a given time. // The document about gNMI commit confirmed can be found at // https://github.com/openconfig/reference/blob/master/rpc/gnmi/gnmi-commit-confirmed.md message Commit { + // ID is provided by the client during the commit request. During confirm and cancel + // actions the provided ID should match the ID provided during commit. + // If ID is not passed in any actions server shall return error. + // Required. + string id = 1; oneof action { - CommitRequest commit = 1; - CommitConfirm confirm = 2; - CommitCancel cancel = 3; + // commit action creates a new commit. If a commit is on-going, server returns error. + CommitRequest commit = 2; + // confirm action will confirm an on-going commit, the ID provided during confirm + // should match the on-going commit ID. + CommitConfirm confirm = 3; + // cancel action will cancel an on-going commit, the ID provided during cancel + // should match the on-going commit ID. + CommitCancel cancel = 4; } } -// Create a new commit confirmed request. +// CommitRequest is used to create a new confirmed commit. It hold additional +// parameter requried for commit action. message CommitRequest { - // Commit id for the request. ID must be generated at the client side, it can be used - // to confirm or cancel the request without the rollback_duration interval. - string id = 1; // Maximum duration to wait for a confirmaton before reverting the commit. - google.protobuf.Duration rollback_duration = 2; + google.protobuf.Duration rollback_duration = 1; } -// Confirm an on-going commit. -message CommitConfirm { - // Commit id of the on-going commit that requires confirmation. - string id = 1; -} +// CommitConfirm is used to confirm an on-going commit. It hold additional +// parameter requried for confirm action. +message CommitConfirm {} -// Cancel an on-going commit. -message CommitCancel { - // Commit id of the on-going commit that requires cancellation. - string id = 1; -} +// CommitCancel is used to cancel an on-going commit. It hold additional +// parameter requried for cancel action. +message CommitCancel {}