Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/networktocode/ntc-rosetta-conf
Restconf interface for rosetta
https://github.com/networktocode/ntc-rosetta-conf
Last synced: 2 months ago
JSON representation
Restconf interface for rosetta
- Host: GitHub
- URL: https://github.com/networktocode/ntc-rosetta-conf
- Owner: networktocode
- License: apache-2.0
- Created: 2019-06-12T13:24:51.000Z (over 5 years ago)
- Default Branch: develop
- Last Pushed: 2021-09-16T15:04:24.000Z (over 3 years ago)
- Last Synced: 2024-05-30T01:17:55.169Z (7 months ago)
- Language: Python
- Size: 99.6 KB
- Stars: 5
- Watchers: 41
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.rst
- Contributing: CONTRIBUTING.rst
- License: LICENSE
Awesome Lists containing this project
README
# ntc-rosetta-conf
`ntc-rosetta-conf` is a RESTCONF interface for [ntc-rosetta](https://github.com/networktocode/ntc-rosetta). This RESTCONF interface allows you to manipulate a candidate and running databases using supported models by `ntc-rosetta` and it also exposes a few RPC endpoints to translate, parse and merge configurations.
## Installing
This python package is available through pip so you can install with the following command:
```
pip install ntc-rosetta-conf
```## Documentation
Documentation and tutorials are available in [rtd](https://ntc-rosetta-conf.readthedocs.io).
## Quick example
### Starting the restconf interface
```
$ ntc-rosetta-conf serve \
--datamodel openconfig \
--pid-file /tmp/ntc-rosetta-conf-demo.pid \
--log-level debug \
--data-file data.json \
--port 8443 \
--ssl-crt pki_auto_generated_dir/server_ca/certs/rtr00.lab.local.crt \
--ssl-key pki_auto_generated_dir/server_ca/keys/rtr00.lab.local.key \
--ca-crt pki_auto_generated_dir/client_ca/certs/client_ca.crt
```### Consuming the restconf interface
```
$ curl --http2 -k --cert-type PEM -E $USER_CERT \
-X GET \
https://localhost:8443/restconf/data/openconfig-interfaces:interfaces
{
"openconfig-interfaces:interfaces": {
"interface": [
{
"name": "eth0",
"config": {
"name": "eth0",
"description": "an interface description",
"type": "iana-if-type:ethernetCsmacd"
}
},
{
"name": "eth1",
"config": {
"name": "eth1",
"description": "another interface",
"type": "iana-if-type:ethernetCsmacd"
}
}
]
}
}
$ curl -s --http2 -k --cert-type PEM -E $USER_CERT \
-X POST \
-d @docs/tutorials/4_translate/translate_running.json \
$BASE_URL/restconf/operations/ntc-rosetta-conf:translate | jq -r ".native"interface eth0
description an interface description
exit
!
interface eth1
description another interface
exit
!
```