diff options
author | Daniil Baturin <daniil@vyos.io> | 2020-04-24 07:20:22 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-24 07:20:22 +0700 |
commit | 2b484548b0438394017118915e2f187de7886e6e (patch) | |
tree | 2d610d095cad5aaa54aaf4bf4102135a7c2e6545 | |
parent | 2ca6b4e611468ec91f97456348f2a33541c6c103 (diff) | |
parent | 79176896cd9673cfc947e7f08845a54cdd6afb2f (diff) | |
download | vyos-documentation-2b484548b0438394017118915e2f187de7886e6e.tar.gz vyos-documentation-2b484548b0438394017118915e2f187de7886e6e.zip |
Merge pull request #239 from robertoberto/patch-2
Example of how to retrieve raw configs
-rw-r--r-- | docs/appendix/http-api.rst | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/docs/appendix/http-api.rst b/docs/appendix/http-api.rst index 827bcd9e..fe990269 100644 --- a/docs/appendix/http-api.rst +++ b/docs/appendix/http-api.rst @@ -69,3 +69,16 @@ If you don't specify the file when saving, it saves to ``/config/config.boot``. # curl -k -X POST -F key=MY-HTTP-API-PLAINTEXT-KEY -Fdata='{"op": "save", "file": "/config/config.boot"}' https://192.168.122.127/config-file + + +Reading config +-------------- + +To retrieve raw configs: + + # curl -X POST -F data='{"op": "showConfig", "path": ["interfaces", "dummy"]}' -F key=MY-HTTP-API-PLAINTEXT-KEY https://192.168.122.127/retrieve + +It will returns: + {"success": true, "data": " /* So very dummy */\n dummy dum0 {\n address 192.168.168.1/32\n address 192.168.168.2/32\n /* That is a description */\n description \"Test interface\"\n }\n dummy dum1 {\n address 203.0.113.76/32\n address 203.0.113.79/32\n }\n", "error": null} + + |