# Enabling REST & querying CDB in ConfD 8.0.4

**URL:** <https://dmap-community.ductus.global/t/enabling-rest-querying-cdb-in-confd-8-0-4/4458>\
**Category:** Core Engine and APIs\
**Created:** [May 26, 2023, 1:37pm UTC](https://dmap-community.ductus.global/t/enabling-rest-querying-cdb-in-confd-8-0-4/4458 "2023-05-26T13:37:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SriniT](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@SriniT](https://dmap-community.ductus.global/u/SriniT)\
**Post date:** [May 26, 2023, 1:37pm UTC](https://dmap-community.ductus.global/t/enabling-rest-querying-cdb-in-confd-8-0-4/4458/1 "2023-05-26T13:37:24Z")

</div>

Hi,

ConfD 6.6.1 supports `<rest>` under confd.conf file.

```auto
<confdConfig xmlns="http://tail-f.com/ns/confd_cfg/1.0">
...
	<rest>
		<enabled>true</enabled>
	</rest>

```

Along with this, by enabling below, we were able to query the CDB using the below REST calls,

```auto
<webui>
    <enabled>true</enabled>
    <docroot>../confd/var/confd/webui/dist/confd</docroot>
    <transport>
      <tcp>
        <enabled>true</enabled>
        <ip>0.0.0.0</ip>
        <port>8008</port>
      </tcp>

```

`curl -u admin:admin -X GET "http://localhost:8008/api/running/?deep"`

It seems `<rest>` within `<confdConfig>` is not supported in ConfD 8.0.4 and facing the below issue,

`confd[53368]: - Bad configuration: /etc/confd.conf:284: rest cannot occur here as a child to confdConfig.`

Is there any equivalent available in ConfD 8.0.4 to enable REST and query CDB?

Is RestConf also used to query CDB config data? If so, can someone provide the endpoint to query?

Regards,  
Srini

---

<div class="post-metadata">

**Author:** ![josephm](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@josephm](https://dmap-community.ductus.global/u/josephm)\
**Post date:** [May 29, 2023, 8:40am UTC](https://dmap-community.ductus.global/t/enabling-rest-querying-cdb-in-confd-8-0-4/4458/2 "2023-05-29T08:40:51Z")

</div>

Sure you can use RESTCONF as a REST successor - see ConD user guide chapter “The RESTCONF API” with description, examples, what’s different/new etc.

(There is also an alternative web-based API - “JSON-RPC API” that has a bit different approach- transactions, more features/methods you can invoke, etc.) Thus may require bigger changes to your pipeline (compared to RESTCONF) should you want to replace old REST implementation with this, but it’s worth mentioning imho.

---

<div class="post-metadata">

**Author:** ![SriniT](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@SriniT](https://dmap-community.ductus.global/u/SriniT)\
**Post date:** [May 29, 2023, 8:44am UTC](https://dmap-community.ductus.global/t/enabling-rest-querying-cdb-in-confd-8-0-4/4458/3 "2023-05-29T08:44:54Z")

</div>

Thanks josephm. Let me check and give a try.
