# URL Capability examples

**URL:** <https://dmap-community.ductus.global/t/url-capability-examples/1533>\
**Category:** NETCONF\
**Created:** [September 19, 2017, 4:50am UTC](https://dmap-community.ductus.global/t/url-capability-examples/1533 "2017-09-19T04:50:42Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hatim5253](https://avatars.discourse-cdn.com/v4/letter/h/7993a0/32.png) [@Hatim5253](https://dmap-community.ductus.global/u/Hatim5253)\
**Post date:** [September 19, 2017, 4:50am UTC](https://dmap-community.ductus.global/t/url-capability-examples/1533/1 "2017-09-19T04:50:42Z")

</div>

Hi.

I have ISIS and LDP configured on my device.  
Can anyone please give me examples of how i can test URL Capability with below operataions:

‘edit-config’  
‘delete-config’  
‘copy-config’  
‘validate’

---

<div class="post-metadata">

**Author:** ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)\
**Post date:** [September 19, 2017, 11:13am UTC](https://dmap-community.ductus.global/t/url-capability-examples/1533/2 "2017-09-19T11:13:52Z")

</div>

Not sure how this relates to what is configured on your device, but you can try something like this:

confd.conf example :url setting:

```
...
</capabilities>
...
  <url>
    <enabled>true</enabled>
    <file>
      <enabled>true</enabled>
      <rootDir>/my/dir</rootDir>
    </file>
    <ftp>
      <enabled>true</enabled>
    </ftp>
    <sftp>
      <enabled>true</enabled>
    </sftp>
  </url>
</capabilities>
...

```

edit-config from file to running:

```
<edit-config>
  <target>
    <running/>	
  </target>
  <url>file:///my-new-cfg.xml</url>
</edit-config>

```

edit-config from ftp server file to running:

```
<edit-config>
  <target>
    <running/>	
  </target>
  <url>ftp://myusr:mypass@localhost/my-new-cfg.xml</url>
</edit-config>

```

copy-config from running to file:

```
<copy-config>
  <target>
    <url>file:///my-backup.xml</url>
  </target>
  <source>
    <running/>	
  </source>
</copy-config>

```

copy-config from file to running:

```
<copy-config>
  <target>
    <running/>	
  </target>
  <source>
    <url>file:///my-new-config.xml</url>
  </source>
</copy-config>

```

copy-config from running to ftp server file

```
<copy-config>
  <target>
    <url>ftp://myusr:mypass@localhost/my-backup.xml</url>
  </target>
  <source>
    <running/>
  </source>
</copy-config>

```

copy-config from ftp server file to running:

```
<copy-config>
  <target>
    <running/>
  </target>
  <source>
    <url>ftp://myusr:mypass@localhost/my-new-config.xml</url>
  </source>
</copy-config>

```

delete-config file:

```
<delete-config>
  <target>
    <url>file:///my-config.xml</url>
  </target>
</delete-config>

```

delete-config ftp server file:

```
<delete-config>
  <target>
    <url>ftp://myusr:mypass@localhost/my-config.xml</url>
  </target>
</delete-config>

```

ConfD does not support validate from an URL. See “:url” in ConfD UG Chapter 15.2. Capabilities for details.

---

<div class="post-metadata">

**Author:** ![Hatim5253](https://avatars.discourse-cdn.com/v4/letter/h/7993a0/32.png) [@Hatim5253](https://dmap-community.ductus.global/u/Hatim5253)\
**Post date:** [October 4, 2017, 10:04am UTC](https://dmap-community.ductus.global/t/url-capability-examples/1533/3 "2017-10-04T10:04:19Z")

</div>

Thanks for the examples

---

<div class="post-metadata">

**Author:** ![Hatim5253](https://avatars.discourse-cdn.com/v4/letter/h/7993a0/32.png) [@Hatim5253](https://dmap-community.ductus.global/u/Hatim5253)\
**Post date:** [December 26, 2017, 12:11pm UTC](https://dmap-community.ductus.global/t/url-capability-examples/1533/4 "2017-12-26T12:11:57Z")

</div>

Hello Cohult,

I have done few configurations like ISIS,BGP on my device from NETCONF client.  
Now , i want to check Copy-config operation. Can you please help me what should be in my target parameter in below XML:  
my router ip is: 192.168.171.44 (to login i do ssh [root@192.168.171.44](mailto:root@192.168.171.44))  
CASE I: to copy on the same router  
CASE II: to copy on different server

Thanks in advance

---

<div class="post-metadata">

**Author:** ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)\
**Post date:** [January 5, 2018, 1:32pm UTC](https://dmap-community.ductus.global/t/url-capability-examples/1533/5 "2018-01-05T13:32:29Z")

</div>

Hi,

When referring to

- “copy on the same router” are you referring to the above example on “copy-config from running to file” or something else?
- “copy on different server” are you referring to the above example on “copy-config from running to ftp server file” or something different?

Note that file-to-file copying/transfers are not supported. For those scenarios there are multiple options you can use from [for example a NETCONF/YANG 1.1 action implementation](https://tools.ietf.org/html/rfc7950#section-7.15).

---

<div class="post-metadata">

**Author:** ![Hatim5253](https://avatars.discourse-cdn.com/v4/letter/h/7993a0/32.png) [@Hatim5253](https://dmap-community.ductus.global/u/Hatim5253)\
**Post date:** [January 8, 2018, 5:44am UTC](https://dmap-community.ductus.global/t/url-capability-examples/1533/6 "2018-01-08T05:44:09Z")

</div>

hi Cohult,

i am referring to the example you posted on sep17 reply.

copy-config from running to file:

---

<div class="post-metadata">

**Author:** ![Hatim5253](https://avatars.discourse-cdn.com/v4/letter/h/7993a0/32.png) [@Hatim5253](https://dmap-community.ductus.global/u/Hatim5253)\
**Post date:** [January 11, 2018, 6:22am UTC](https://dmap-community.ductus.global/t/url-capability-examples/1533/7 "2018-01-11T06:22:09Z")

</div>

hi Cohult ,

can you please reply:  
i am trying to copy from running to ftp server (in my case 192.168.171.44 at location sdboot/up)

---

<div class="post-metadata">

**Author:** ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)\
**Post date:** [January 13, 2018, 9:34am UTC](https://dmap-community.ductus.global/t/url-capability-examples/1533/8 "2018-01-13T09:34:00Z")

</div>

Are you looking for something like this?:

```auto
$ # We enable the netconf trace log
$ cat confd.conf | grep -B 2 -A 2 netconf.trace
    <netconfTraceLog>
      <enabled>true</enabled>
      <filename>./netconf.trace</filename>
      <format>pretty</format>
    </netconfTraceLog>

$ # Start ConfD
$ confd -c confd.conf --addloadpath $CONFD_DIR/etc/confd
$ cat copy-running-to-ftp-url.xml 
<copy-config>
  <target>
    <url>ftp://root:mypassword@192.168.171.44/my-running-config.xml</url>
  </target>
  <source>
    <running/>
  </source>
</copy-config>

$ # Now let's say ConfD is running on my local host and I have the user and password set to admin/admin
$ netconf-console --host=127.0.0.1 --user=admin --password=admin --rpc=copy-running-to-ftp-url.xml
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
  <ok/>
</rpc-reply>
$ # ConfD's running datastore has now copied to a my-running-config.xml file on the 192.168.171.44 FTP server home dir
$ # The NETCONF communication that was handled by the netconf-console tool (that comes with ConfD):
$ cat netconf.trace
**> sess:28 new session

13-Jan-2018::04:10:07.798 **< sess:28 write:
<hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <capabilities>
    <capability>urn:ietf:params:netconf:base:1.0</capability>
    <capability>urn:ietf:params:netconf:base:1.1</capability>
...
    <capability>urn:ietf:params:netconf:capability:url:1.0?scheme=ftp,sftp,file</capability>
...
  </capabilities>
  <session-id>28</session-id>
</hello>

13-Jan-2018::04:10:07.808 **> sess:28 read:
<hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <capabilities>
    <capability>urn:ietf:params:netconf:base:1.0</capability>
    <capability>urn:ietf:params:netconf:base:1.1</capability>
  </capabilities>
</hello>
]]>]]>
#144
<rpc message-id="1" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
#147
  <copy-config>
    <target>
      <url>ftp://root:mypassword@192.168.171.44/my-running-config.xml</url>
    </target>
    <source>
      <running/>
    </source>
  </copy-config>

#6
</rpc>

13-Jan-2018::04:10:07.904 **< sess:28 write:
<rpc-reply message-id="1" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <ok/>
</rpc-reply>

##

#147
<rpc message-id="0" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <close-session/>
</rpc>

13-Jan-2018::04:10:07.907 **< sess:28 write:
<rpc-reply message-id="0" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <ok/>
</rpc-reply>

**< sess:28 session closed 

```

---

<div class="post-metadata">

**Author:** ![ashutosh123](https://avatars.discourse-cdn.com/v4/letter/a/ea666f/32.png) [@ashutosh123](https://dmap-community.ductus.global/u/ashutosh123)\
**Post date:** [March 5, 2020, 3:31pm UTC](https://dmap-community.ductus.global/t/url-capability-examples/1533/9 "2020-03-05T15:31:55Z")

</div>

can anyone tell me from where ConfD Netconf server returns capabilities ??? is there any folder for storage all the capabilities???

---

<div class="post-metadata">

**Author:** ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)\
**Post date:** [March 8, 2020, 1:42pm UTC](https://dmap-community.ductus.global/t/url-capability-examples/1533/10 "2020-03-08T13:42:03Z")

</div>

You typically control the NETCONF capabilities from the ConfD configuration file, confd.conf, and the YANG models you add.  
See the confd.conf(5) man page under confdConfig/netconf/capabilities, confdc(1) man page export flag, and the tailf extensions man page under tailf:export
