<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:14:02 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>OpenDaylight JIRA</title>
    <link>https://jira.opendaylight.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>8.20.10</version>
        <build-number>820010</build-number>
        <build-date>22-06-2022</build-date>
    </build-info>


<item>
            <title>[NETCONF-52] Using restconf rpc to edit the configuration of netconf enabled device, controller will remove the attribute of content</title>
                <link>https://jira.opendaylight.org/browse/NETCONF-52</link>
                <project id="10142" key="NETCONF">netconf</project>
                    <description>&lt;p&gt;ODL Version: Release/Helium-SR3&lt;br/&gt;
Netconf enabled device: OF-CONFIG server for Open vSwitch (&lt;a href=&quot;https://github.com/openvswitch/of-config&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/openvswitch/of-config&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;I mount a netconf enabled device (name:netconf-device-1), and use edit-config rpc by postman.&lt;br/&gt;
URL: &lt;a href=&quot;http://controller_ip:8181/restconf/operations/opendaylight-inventory:nodes/node/netconf-device-1/yang-ext:mount/ietf-netconf:edit-config&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://controller_ip:8181/restconf/operations/opendaylight-inventory:nodes/node/netconf-device-1/yang-ext:mount/ietf-netconf:edit-config&lt;/a&gt;&lt;br/&gt;
Method: POST&lt;br/&gt;
Accept: application/xml&lt;br/&gt;
Content-Type: application/xml&lt;/p&gt;

&lt;p&gt;&amp;lt;edit-config&amp;gt;&lt;br/&gt;
  &amp;lt;target&amp;gt;&lt;br/&gt;
    &amp;lt;candidate/&amp;gt;&lt;br/&gt;
  &amp;lt;/target&amp;gt;&lt;br/&gt;
  &amp;lt;default-operation&amp;gt;none&amp;lt;/default-operation&amp;gt;&lt;br/&gt;
  &amp;lt;error-option&amp;gt;rollback-on-error&amp;lt;/error-option&amp;gt;&lt;br/&gt;
  &amp;lt;config&amp;gt;&lt;br/&gt;
    &amp;lt;capable-switch xmlns=&quot;urn:onf:config:yang&quot;&amp;gt;&lt;br/&gt;
      &amp;lt;logical-switches&amp;gt;&lt;br/&gt;
        &amp;lt;switch&amp;gt;&lt;br/&gt;
          &amp;lt;id&amp;gt;ofc-bridge&amp;lt;/id&amp;gt;&lt;br/&gt;
          &amp;lt;controllers xmlns:a=&quot;urn:ietf:params:xml:ns:netconf:base:1.0&quot; a:operation=&quot;replace&quot;&amp;gt;&lt;br/&gt;
            &amp;lt;controller&amp;gt;&lt;br/&gt;
              &amp;lt;id&amp;gt;controller-1&amp;lt;/id&amp;gt;&lt;br/&gt;
              &amp;lt;ip-address&amp;gt;172.19.66.176&amp;lt;/ip-address&amp;gt;&lt;br/&gt;
              &amp;lt;protocol&amp;gt;tcp&amp;lt;/protocol&amp;gt;&lt;br/&gt;
              &amp;lt;port&amp;gt;6633&amp;lt;/port&amp;gt;&lt;br/&gt;
              &amp;lt;local-ip-address&amp;gt;0.0.0.0&amp;lt;/local-ip-address&amp;gt;&lt;br/&gt;
            &amp;lt;/controller&amp;gt;&lt;br/&gt;
          &amp;lt;/controllers&amp;gt;&lt;br/&gt;
        &amp;lt;/switch&amp;gt;&lt;br/&gt;
      &amp;lt;/logical-switches&amp;gt;&lt;br/&gt;
    &amp;lt;/capable-switch&amp;gt;&lt;br/&gt;
  &amp;lt;/config&amp;gt;&lt;br/&gt;
&amp;lt;/edit-config&amp;gt;&lt;/p&gt;

&lt;p&gt;But the controller removes all attributes of the xml and sends it to the entconf server.&lt;br/&gt;
The netconf server does not know how to process this operation.&lt;br/&gt;
The xml received by netconf server list as below:&lt;/p&gt;

&lt;p&gt;&amp;lt;rpc xmlns=&quot;urn:ietf:params:xml:ns:netconf:base:1.0&quot; message-id=&quot;m-76&quot;&amp;gt;&lt;br/&gt;
  &amp;lt;edit-config&amp;gt;&lt;br/&gt;
    &amp;lt;target&amp;gt;&lt;br/&gt;
      &amp;lt;candidate/&amp;gt;&lt;br/&gt;
    &amp;lt;/target&amp;gt;&lt;br/&gt;
    &amp;lt;default-operation&amp;gt;none&amp;lt;/default-operation&amp;gt;&lt;br/&gt;
    &amp;lt;error-option&amp;gt;rollback-on-error&amp;lt;/error-option&amp;gt;&lt;br/&gt;
    &amp;lt;config&amp;gt;&lt;br/&gt;
      &amp;lt;capable-switch&amp;gt;&lt;br/&gt;
        &amp;lt;logical-switches&amp;gt;&lt;br/&gt;
          &amp;lt;switch&amp;gt;&lt;br/&gt;
            &amp;lt;id&amp;gt;ofc-bridge&amp;lt;/id&amp;gt;&lt;br/&gt;
            &amp;lt;controllers&amp;gt;&lt;br/&gt;
              &amp;lt;controller&amp;gt;&lt;br/&gt;
                &amp;lt;id&amp;gt;controller-1&amp;lt;/id&amp;gt;&lt;br/&gt;
                &amp;lt;ip-address&amp;gt;172.19.66.176&amp;lt;/ip-address&amp;gt;&lt;br/&gt;
                &amp;lt;protocol&amp;gt;tcp&amp;lt;/protocol&amp;gt;&lt;br/&gt;
                &amp;lt;port&amp;gt;6633&amp;lt;/port&amp;gt;&lt;br/&gt;
                &amp;lt;local-ip-address&amp;gt;0.0.0.0&amp;lt;/local-ip-address&amp;gt;&lt;br/&gt;
              &amp;lt;/controller&amp;gt;&lt;br/&gt;
            &amp;lt;/controllers&amp;gt;&lt;br/&gt;
          &amp;lt;/switch&amp;gt;&lt;br/&gt;
        &amp;lt;/logical-switches&amp;gt;&lt;br/&gt;
      &amp;lt;/capable-switch&amp;gt;&lt;br/&gt;
    &amp;lt;/config&amp;gt;&lt;br/&gt;
  &amp;lt;/edit-config&amp;gt;&lt;br/&gt;
&amp;lt;/rpc&amp;gt;&lt;/p&gt;

&lt;p&gt;And ODL responses&lt;br/&gt;
&quot;error-type&quot;: &quot;application&quot;,&lt;br/&gt;
&quot;error-tag&quot;: &quot;operation-failed&quot;,&lt;br/&gt;
&quot;error-message&quot;: &quot;Request is not applicable to the data managed by the server&quot;&lt;/p&gt;

&lt;p&gt;There is other operation to use for editing controller configuration:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://controller_ip:8181/restconf/config/opendaylight-inventory:nodes/node/netconf-device-1/yang-ext:mount/of-config:capable-switch/logical-switches/switch/ofc-bridge/controllers&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://controller_ip:8181/restconf/config/opendaylight-inventory:nodes/node/netconf-device-1/yang-ext:mount/of-config:capable-switch/logical-switches/switch/ofc-bridge/controllers&lt;/a&gt;&lt;br/&gt;
Method: PUT &lt;br/&gt;
Accept: application/xml&lt;br/&gt;
Content-Type: application/xml&lt;br/&gt;
&amp;lt;controllers&amp;gt;&lt;br/&gt;
  &amp;lt;controller&amp;gt;&lt;br/&gt;
    &amp;lt;id&amp;gt;controller-1&amp;lt;/id&amp;gt;&lt;br/&gt;
    &amp;lt;ip-address&amp;gt;172.19.66.176&amp;lt;/ip-address&amp;gt;&lt;br/&gt;
    &amp;lt;protocol&amp;gt;tcp&amp;lt;/protocol&amp;gt;&lt;br/&gt;
    &amp;lt;port&amp;gt;6633&amp;lt;/port&amp;gt;&lt;br/&gt;
    &amp;lt;local-ip-address&amp;gt;0.0.0.0&amp;lt;/local-ip-address&amp;gt;&lt;br/&gt;
  &amp;lt;/controller&amp;gt;&lt;br/&gt;
 &amp;lt;/controllers&amp;gt;&lt;/p&gt;

&lt;p&gt;Yes, it can edit the controller ip for the entconf enabled switch.&lt;br/&gt;
But this approach will trigger the controller to do two actions continually, edit candidate configuration and then commit from candidate to running.&lt;/p&gt;

&lt;p&gt;If we want to operate the configuration step by step, not continuous actions. Like as &lt;br/&gt;
1. Edit candidate configuration&lt;br/&gt;
2. Verify candidate configuration&lt;br/&gt;
3. Commit&lt;/p&gt;

&lt;p&gt;For the first step, it should operate netconf rpc directly, the restconf api should like as below&lt;br/&gt;
POST &lt;a href=&quot;http://controller_ip:8181/restconf/operations/opendaylight-inventory:nodes/node/netconf-device-1/yang-ext:mount/ietf-netconf:edit-config&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://controller_ip:8181/restconf/operations/opendaylight-inventory:nodes/node/netconf-device-1/yang-ext:mount/ietf-netconf:edit-config&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If we want to modify running configuration directly not edit candidate first, it will also encounter the same issue.&lt;/p&gt;

&lt;p&gt;Best Regards&lt;/p&gt;</description>
                <environment>&lt;p&gt;Operating System: Linux&lt;br/&gt;
Platform: PC&lt;/p&gt;</environment>
        <key id="21065">NETCONF-52</key>
            <summary>Using restconf rpc to edit the configuration of netconf enabled device, controller will remove the attribute of content</summary>
                <type id="10104" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10303&amp;avatarType=issuetype">Bug</type>
                                                <status id="10003" iconUrl="https://jira.opendaylight.org/images/icons/status_generic.gif" description="">Confirmed</status>
                    <statusCategory id="2" key="new" colorName="blue-gray"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="ato_wu@yahoo.com.tw">dacheng wu</reporter>
                        <labels>
                    </labels>
                <created>Thu, 2 Jul 2015 09:19:46 +0000</created>
                <updated>Tue, 13 Aug 2019 07:38:39 +0000</updated>
                                                                            <component>restconf-nb</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="38880" author="mmarsale@cisco.com" created="Mon, 27 Jul 2015 13:01:18 +0000"  >&lt;p&gt;Thanks for the report.&lt;/p&gt;

&lt;p&gt;When editing configuration on a mounted Netconf device over Restconf, ODL hides the edit+commit rpcs to make Restconf behave as expected (you alse cannot choose which datastore to edit). And I dont think we should change that.&lt;/p&gt;

&lt;p&gt;You should be able to achieve what you need by invoking edit-config manually. But as you say, the attributes are gone. This is the behavior on Helium and we should test this also with Lithium.&lt;/p&gt;

&lt;p&gt;I think the best approach would be implementing a small handler in ODL (1 or more RPCs) that would change the configuration of the device step by step and commit when requested.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                            <customfield id="customfield_11400" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10208" key="com.atlassian.jira.plugin.system.customfieldtypes:textfield">
                        <customfieldname>External issue ID</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3930</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10201" key="com.atlassian.jira.plugin.system.customfieldtypes:url">
                        <customfieldname>External issue URL</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[https://bugs.opendaylight.org/show_bug.cgi?id=3930]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i01w5r:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                </customfields>
    </item>
</channel>
</rss>