Edit-config
Edit-config using API-DOCS
Under the mounted resources of API-DOCS, all the APIs show the possible RESTCON operations which can be performed on the node. In the snippet below, different RESTCONF operations are displayed under ipi-interface API.
Edit-config using Terminal
$ curl -user "admin":"admin" -H "Content-type: application/xml" -X PUT http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/ocnos3/yang-ext:mount/ipi-interface:interfaces/interface/eth1/ipi-if-ip:ipv4 -d '@interface_config.xml'
The interface_config.xml file contents are:
interface_config.xml:
<ipv4 xmlns="https://www.ipinfusion.com/yang/ocnos/ipi-if-ip">
<config>
<primary-ip-addr>1.1.1.1/24</primary-ip-addr>
</config>
</ipv4>
Edit-config using POSTMAN
Similar to edit-config in NetConf, RESTCONF PUT method is sent by the client to create or replace the target data resource. RESTCONF PUT operation is shown in below attached snippet. Authentication should be selected as 'basic authentication' as shown before.
In the snippet above, the URL of interface eth1 of node-is = ocnos-3 is set to receive configuration file.
The body of the request contains the configuration data. POSTMAN supports different formats for data configuration as well.
As shown in the snippet above, after sending this request for the configuration, it returns a "201 created" http response. This means that target datastore has created the data resource as per the request.
Last modified date: 08/17/2023