summaryrefslogtreecommitdiff
path: root/grpc
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2020-08-14 19:49:41 -0300
committerRenato Westphal <renato@opensourcerouting.org>2020-08-14 21:37:14 -0300
commit0fe5b904b76ee37ee0d6ad6230e1ea330694f2ea (patch)
tree201eab657120726aab76a520647f42295030d379 /grpc
parent2ed8d0249da4af0bd73cdc6907dd4e93cf8d970b (diff)
lib: don't ignore error messages generated during the commit apply phase
While a configuration transaction can't be rejected once it reaches the APPLY phase, we should allow NB callbacks to generate error or warning messages when a configuration change is being applied. That should be useful, for example, to return warnings back to the user informing that the applied configuration has some kind of inconsistency or is missing something in order to be effectively activated. The infrastructure for this was already present, but the northbound layer was ignoring all errors/warnings generated during the apply/abort phases instead of returning them to the user. This commit changes that. In the gRPC plugin, extend the Commit() RPC adding a new "error_message" field to the response type. This is necessary to allow errors/warnings to be returned even when the commit operation succeeds (since grpc::Status::OK doesn't support error messages like the other status codes). Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'grpc')
-rw-r--r--grpc/frr-northbound.proto3
1 files changed, 3 insertions, 0 deletions
diff --git a/grpc/frr-northbound.proto b/grpc/frr-northbound.proto
index d18554df27..32544ba694 100644
--- a/grpc/frr-northbound.proto
+++ b/grpc/frr-northbound.proto
@@ -287,6 +287,9 @@ message CommitResponse {
// ID of the created configuration transaction (when the phase is APPLY
// or ALL).
uint32 transaction_id = 1;
+
+ // Human-readable error or warning message(s).
+ string error_message = 2;
}
//