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

Replace operation #350

Closed
eduardpo opened this issue Aug 10, 2022 · 4 comments
Closed

Replace operation #350

eduardpo opened this issue Aug 10, 2022 · 4 comments

Comments

@eduardpo
Copy link

Hi Olof,

We are trying to classify two phenomenons that might have impact on our customers:

  1. The first RPC returns an error:

<edit-config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"> <target> <candidate/> </target> <default-operation>merge</default-operation> <config> <ip xmlns="http://siklu.com/yang/tg/ip"> <ipv4 nc:operation="delete"/> </ip> <ip xmlns="http://siklu.com/yang/tg/ip"> <ipv4> <address> <ip>10.60.137.3</ip> <prefix-length>24</prefix-length> </address> <default-gateway>10.60.137.1</default-gateway> </ipv4> </ip> </config> </edit-config>

Error:
<?xml version="1.0" encoding="utf-8"?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="51"> <rpc-error> <error-type>protocol</error-type> <error-tag>operation-failed</error-tag> <error-app-tag>too-many-elements</error-app-tag> <error-severity>error</error-severity> <error-path>/rpc/edit-config/config/ip</error-path> </rpc-error> </rpc-reply>

  1. The second RPC does not return any error but result is unexpected:

<edit-config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"> <target> <candidate/> </target> <default-operation>merge</default-operation> <config> <ip xmlns="http://siklu.com/yang/tg/ip"> <ipv4 nc:operation="delete"/> <ipv4> <address> <ip>10.60.137.3</ip> <prefix-length>24</prefix-length> </address> <default-gateway>10.60.137.1</default-gateway> </ipv4> </ip> </config> </edit-config>

Here is the valid RPC to replace IP settings:

<edit-config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"> <target> <candidate/> </target> <config> <ip xmlns="http://siklu.com/yang/tg/ip"> <ipv4 nc:operation="replace"> <address> <ip>10.60.137.3</ip> <prefix-length>24</prefix-length> </address> <default-gateway>10.60.137.1</default-gateway> </ipv4> </ip> </config> </edit-config>

While it's obviously not a proper way to use consequent delete and merge operations (instead of replace) in the same RPC to update IP settings, still our questions are:

  1. Whether the error described in the 1st bullet is correct?

  2. The absence of the error described in the second bullet is a normal behavior?

please comment

@olofhagsand
Copy link
Member

My reflections:
I assume "ip" is a container and "ipv4" is a list?

<ip><ipv4 nc:operation="delete"/></ip>
<ip><ipv4 nc:operation="merge"/></ip>

I think the above fails becauseI I think ip is a container (is it?) and more than one container is invalid.

   <ip> <ipv4 nc:operation="delete"/><ipv4 nc:operation="merge"/></ip>

I need to understand what YANG ipv4 is? If it is a list, the delete operation is kind of strange. What happens in this case: is a list instance deleted, all instances deleted, or none deleted?

@eduardpo
Copy link
Author

My reflections: I assume "ip" is a container and "ipv4" is a list?

<ip><ipv4 nc:operation="delete"/></ip>
<ip><ipv4 nc:operation="merge"/></ip>

I think the above fails becauseI I think ip is a container (is it?) and more than one container is invalid.

   <ip> <ipv4 nc:operation="delete"/><ipv4 nc:operation="merge"/></ip>

I need to understand what YANG ipv4 is? If it is a list, the delete operation is kind of strange. What happens in this case: is a list instance deleted, all instances deleted, or none deleted?

container ip {
	...
	container ipv4 {
		...
	}
}

Do you mean the above usage is invalid?
Thanks.

@olofhagsand
Copy link
Member

No, I just assumed it was a list. The expected behavior is different.
Will look at it again with the new info

@olofhagsand
Copy link
Member

I have looked at it again now.
After fixing some related problems, such as: 2eb9c6c the behavior has changed so that both the first and second edit-config cases return the same too-many-elements error status.
Please verify.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants