Page MenuHomeVyOS Platform

Define a high level HTTP API
Open, NormalPublic

Description

Right now we have a low level HTTP API that allows creating/deleting config nodes with given paths. The bad thing is that the user needs to know the config syntax.
Config syntax isn't exactly constant either—we sometimes change it between LTS releases.

This is bad for development of management tools. Our plan for the local web GUI is to provide a simplified interface for novice users and helpdesk personnel, for example. Other people may want to develop tools similar in spirit but different in their look or behaviour.

It would be handy to have a more high level API that is relatively abstract and doesn't depend on precise config syntax. For example: /firewall/rule/create/ with abstract POST data.

We need to first define endpoints, then actually implement them.

Details

Difficulty level
Unknown (require assessment)
Version
-
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Perfectly compatible
Issue type
Feature (new functionality)

Event Timeline

Coming with a syntax which is not ultimately going to be as complex as the cli may be an impossible challenge. Changing the API to include in the XML what is path vs payload may indeed lead to indeed a better API tho. The example given use the word create in the path when REST would use POST.

Another way to not break precious API code may be to version the API, and have the migration code able to convert a request to the latest syntax.

A simple experiment using GraphQL to configure a DHCP server is here:
https://github.com/vyos/vyos-1x/compare/current...jestabro:graphql

This requires support from:
https://github.com/jestabro/vyos-http-api-tools/tree/graphql

cf. README.graphql in vyos-1x.

erkin set Issue type to Feature (new functionality).Aug 29 2021, 1:33 PM
erkin removed a subscriber: Active contributors.

+1; versioning the API is also a best practice.

dmbaturin triaged this task as Normal priority.Jan 9 2024, 8:03 PM
dmbaturin edited projects, added VyOS 1.5 Circinus; removed VyOS 1.3 Equuleus (1.3.6).