-
Notifications
You must be signed in to change notification settings - Fork 88
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
Adjust gNMI SetRequest Update handling for list keys + value payloads #176
Open
earies
wants to merge
4
commits into
openconfig:master
Choose a base branch
from
earies:gnmi-update-list-keys
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,10 +4,10 @@ | |
Paul Borman, Marcus Hines, Carl Lebsack, Chris Morrow, Anees Shaikh, Rob Shakir, Wen Bo Li, Darren Loher | ||
|
||
**Date:** | ||
May 25, 2023 | ||
June 27, 2023 | ||
|
||
**Version:** | ||
0.10.0 | ||
0.10.1 | ||
|
||
**[gNMI service](https://github.com/openconfig/gnmi/blob/master/proto/gnmi/gnmi.proto) compatibility:** | ||
0.10.x | ||
|
@@ -1247,19 +1247,27 @@ root + | |
The path convention defined in [Section 2.2.2](#222-paths) allows nodes in the | ||
data tree to be identified by a unique set of node names (e.g.,`/a/b/c/d`) or | ||
paths that consist of node names coupled with attributes (e.g., `/a/e[key=10]`). | ||
In the case where where a node name plus attribute name is required to uniquely | ||
identify an element (i.e., the path within the schema represents a list, map, or | ||
array), the following considerations apply: | ||
In the case where a node name plus attribute name is required to uniquely | ||
identify an element (i.e., the path within the schema represents a list, map, | ||
or array), the following considerations apply: | ||
|
||
- In the case that multiple attribute values are required to uniquely address | ||
an element - e.g., `/a/f[k1=10][k2=20]`- and a replace or update | ||
operation's path specifies a subset of the attributes (e.g., `/a/f[k1=10]`) | ||
then this MUST be considered an error by the target system - and an status | ||
code of`InvalidArgument (3)` specified. | ||
an element - e.g., `/a/f[k1=10][k2=20]`- and a replace or update | ||
operation's path specifies a subset of the attributes (e.g., `/a/f[k1=10]`) | ||
then this MUST be considered an error by the target system - and an status | ||
code of` InvalidArgument (3)` specified. | ||
- In the case that key values are specified both as attributes of a node in the | ||
path, and as their own elements within the value, then this MUST be considered | ||
an error by the target system - and a status code of `InvalidArgument (3)` | ||
specified. Targeting a list member with update or replace operations that | ||
modify it's own keys in either conflicting or identical fashion is not | ||
permitted thus they must be omitted from the value payload. This holds true | ||
for the direct descendant list key nodes as well as the ultimate leafref'd | ||
nodes per OpenConfig [style guidelines](https://github.com/openconfig/public/blob/master/doc/openconfig_style_guide.md#list). | ||
- In the case that key values are specified both as attributes of a node, and | ||
as their own elements within the data tree, update or replace operations | ||
that modify instances of the key in conflicting ways MUST be considered an | ||
error. The target MUST return a status code of `InvalidArgument (3)`. | ||
as their own elements within the data tree, update or replace operations | ||
that modify instances of the key in conflicting ways MUST be considered an | ||
error. The target MUST return a status code of `InvalidArgument (3)`. | ||
|
||
For example, consider a tree corresponding to the examples above, as illustrated | ||
below. | ||
|
@@ -1283,8 +1291,8 @@ root + | |
In this case, nodes `k1` and `k2` are standalone nodes within the schema, but | ||
also correspond to attribute values for the node "`f`". In this case, an update | ||
or replace message specifying a path of `/a/f[k1=10][k2=20]` setting the value | ||
of `k1` to 100 MUST be considered erroneous, and a status code of | ||
`InvalidArgument (3)` specified. | ||
of `k1` to either the same value (10) or an alternate value (100) MUST be | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To support idempotent behavior, I believe setting a node which is also a list key to the same value it already has should be permitted. Only changing the node's value must be an error. |
||
considered erroneous, and a status code of `InvalidArgument (3)` specified. | ||
|
||
### 3.4.6 Deleting Configuration | ||
|
||
|
@@ -1767,6 +1775,10 @@ limitations under the License | |
|
||
# 7 Revision History | ||
|
||
- v0.10.1: June 27, 2023 | ||
- Clarify that for `Set`, that if targeting a path by list keys that the | ||
list keys cannot be included within the value payload | ||
|
||
- v0.10.0: May 25, 2023 | ||
- Add `union_replace` operation. Sync revision to gNMI proto revision. | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To support idempotent behavior, identical update/replace should be permitted. Agreed that conflicting node / list key values must return an error. I think that is already covered by the last bullet point in this stanza,