|
|
# Jetconf
|
|
|
The target of Jetconf project is to provide an implementation of RESTCONF server written in Python. Most of the current Jetconf functionality should be compliant with RESTCONF specification, defined by IETF draft-ietf-netconf-restconf-18 (https://tools.ietf.org/html/draft-ietf-netconf-restconf-18). However, there are some differences and limitations, which will be described in this document.
|
|
|
|
|
|
|
|
|
## Features
|
|
|
- Written in pure Python 3.5
|
|
|
- Supports HTTP/2 over SSL/TLS exclusively (using hyper-h2 library)
|
|
|
- Uses SSL client certificates for user authentication
|
|
|
- Uses NACM for defining user access permissions
|
|
|
- Supports transactions
|
|
|
|
|
|
## Limitations
|
|
|
- No support for PATCH method
|
|
|
- No support for notifications
|
|
|
- Only "depth", "insert" and "point" query parameters are now supported
|
|
|
- Desired NACM behaviour is still a subject of discussion
|
|
|
|
|
|
## Jetconf-specific functionality:
|
|
|
All jetconf-specific extensions are implemented as an internal operations inside the `jetconf:` namespace.
|
|
|
|
|
|
### Transactions:
|
|
|
The main enhancement of the Jetconf server to the standard RESTCONF protocol is the support for transactions. This means that any user can start editing the datastore content and then commit his changes at once, atomically. The use of transactions is obligatorily required by Jetconf. The user must begin a new transaction before editing the data with POST, PUT or DELETE HTTP requests. However, reading data with GET method can be done directly without the need of starting a transaction.
|
|
|
|
|
|
#### Starting a new transaction
|
|
|
A new transaction is opened by calling a Jetconf internal operation `conf-start`.
|
|
|
|
|
|
Operation name: `conf-start`
|
|
|
Input parameters: `name: "any_transaction_name"`
|
|
|
|
|
|
Example:
|
|
|
```
|
|
|
POST https://server:port/restconf/operations/jetconf:conf-start
|
|
|
{
|
|
|
"jetconf:input": {
|
|
|
"name": "Transaction 1"
|
|
|
}
|
|
|
}
|
|
|
|
|
|
response:
|
|
|
{
|
|
|
"status": "OK"
|
|
|
}
|
|
|
```
|
|
|
|
|
|
#### Listing active transactions
|
|
|
The opened transactions with complete edit log can be previewed by calling a Jetconf internal operation `conf-list`.
|
|
|
|
|
|
Operation name: `conf-list`
|
|
|
Input parameters: (none)
|
|
|
|
|
|
Example:
|
|
|
```
|
|
|
POST https://server:port/restconf/operations/jetconf:conf-list
|
|
|
|
|
|
response:
|
|
|
{
|
|
|
"changelists": {
|
|
|
"Transaction 1": [
|
|
|
[
|
|
|
"CREATE",
|
|
|
"/dns-zones:zone-data"
|
|
|
],
|
|
|
[
|
|
|
"CREATE",
|
|
|
"/dns-zones:zone-data/zone=newzone.cz,IN"
|
|
|
],
|
|
|
[
|
|
|
"CREATE",
|
|
|
"/dns-zones:zone-data/zone=newzone.cz,IN/rrset=sub,iana-dns-parameters:A"
|
|
|
]
|
|
|
]
|
|
|
},
|
|
|
"status": "OK"
|
|
|
}
|
|
|
```
|
|
|
|
|
|
#### Aborting a transaction
|
|
|
The opened transaction can be aborted without committing by calling a Jetconf internal operation `conf-drop`.
|
|
|
|
|
|
Operation name: `conf-drop`
|
|
|
Input parameters: (none)
|
|
|
|
|
|
Example:
|
|
|
```
|
|
|
POST https://server:port/restconf/operations/jetconf:conf-drop
|
|
|
|
|
|
response:
|
|
|
{
|
|
|
"status": "OK"
|
|
|
}
|
|
|
```
|
|
|
|
|
|
#### Committing a transaction
|
|
|
The opened transaction can be committed to datastore by calling a Jetconf internal operation `conf-commit`.
|
|
|
|
|
|
Operation name: `conf-commit`
|
|
|
Input parameters: (none)
|
|
|
|
|
|
Example:
|
|
|
```
|
|
|
POST https://server:port/restconf/operations/jetconf:conf-commit
|
|
|
|
|
|
response:
|
|
|
{
|
|
|
"status": "OK"
|
|
|
}
|
|
|
```
|
|
|
|
|
|
### Schema digest:
|
|
|
Another notable feature of Jetconf is the ability of generating YANG schema digest. This can be useful i.e. as a hint for auto-generating the user User Interface of client application. The schema digest is returned in JSON format.
|
|
|
|
|
|
#### Retrieving the schema digest
|
|
|
|
|
|
Operation name: `get-schema-digest`
|
|
|
Input parameters: (none)
|
|
|
|
|
|
Example:
|
|
|
```
|
|
|
POST https://server:port/restconf/operations/jetconf:get-schema-digest
|
|
|
|
|
|
response:
|
|
|
{ ... schema_digest_in_json ... }
|
|
|
``` |