Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commit confirmed extension proto #155

Merged
merged 4 commits into from
Nov 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions proto/gnmi_ext/gnmi_ext.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
}
}

Expand Down Expand Up @@ -89,3 +92,42 @@ message TimeRange {
int64 start = 1; // Nanoseconds since the epoch
int64 end = 2; // Nanoseconds since the epoch
}

// 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 {
// 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;
}
}
dplore marked this conversation as resolved.
Show resolved Hide resolved

// CommitRequest is used to create a new confirmed commit. It hold additional
// parameter requried for commit action.
message CommitRequest {
// Maximum duration to wait for a confirmaton before reverting the commit.
google.protobuf.Duration rollback_duration = 1;
}

// CommitConfirm is used to confirm an on-going commit. It hold additional
// parameter requried for confirm action.
message CommitConfirm {}

// CommitCancel is used to cancel an on-going commit. It hold additional
// parameter requried for cancel action.
message CommitCancel {}