[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Difference between get and get-config
Andy Bierman <ietf@andybierman.com> wrote:
> Johan Rydberg wrote:
> > Martin Bjorklund skrev:
> >
> >> Each of these can be viewed as a separate XML document if you wish.
> >
> > In other words, a configuration datastore can store several documents?
> >
>
> A NETCONF configuration database is not an XML instance document.
> Only the NETCONF PDUs on the wire are XML instance documents.
>
> The data root is the <config> element or the <filter> element,
> which does not actually exist as part of the agent data model(s).
> That is why I called it a conceptual root.
>
> It is quite possible that different child nodes of <config> or <filter>
> could be defined in different XSDs. (The <netconf> node will be
> defined in NETCONF Notifications, and proprietary nodes will be
> defined elsewhere.)
>
> When the agent does a 'copy-config', a top-level element has to
> be created to hold the arbitrary number of data nodes (I call
> this element <config> in my code.) Otherwise the file written
> will not be well-formed XML.
I do that as well, but does the rfc mandate that the file has to be
valid XML?
> Otherwise you could not take
> the output of a <get-config> or <copy-config> and use it directly
> as the input to an <edit-config> operation.
So when you do a <copy-config> to a file you get something like:
<config xmlns="andys-namespace">
<interface xmlns="http://example.com/ns/interface">
...
</interface>
<system xmlns="http://example.com/ns/system">
...
</system>
<eventStreams xmlns="urn:ietf:params:xml:ns:netmod:notification">
...
</eventStreams>
</config xmlns="andys-namespace">
Correct? We do the same. But with out own namespace uri :(
And then you can pipe this into a <edit-config>:
<rpc message-id="101"
xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<edit-config>
<target>
<running/>
</target>
<source>
<config>
<config xmlns="andys-namespace">
<interface xmlns="http://example.com/ns/interface">
...
</interface>
<system xmlns="http://example.com/ns/system">
...
</system>
<eventStreams xmlns="urn:ietf:params:xml:ns:netmod:notification">
...
</eventStreams>
</config>
</config>
</source>
</edit-config>
Is this correct?
We don't do that. You'd have to remove the top-level <config> tag
from the file and do:
<rpc message-id="101"
xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<edit-config>
<target>
<running/>
</target>
<source>
<config>
<interface xmlns="http://example.com/ns/interface">
...
</interface>
<system xmlns="http://example.com/ns/system">
...
</system>
<eventStreams xmlns="urn:ietf:params:xml:ns:netmod:notification">
...
</eventStreams>
</config>
</source>
</edit-config>
IMO, it would have been nice if this top-level <config> element was in
the netconf namespace, and documented in the rfc, so that the file
content of a <copy-config> was well defined.
/martin
--
to unsubscribe send a message to netconf-request@ops.ietf.org with
the word 'unsubscribe' in a single line as the message text body.
archive: <http://ops.ietf.org/lists/netconf/>