summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2025-05-29 14:29:45 +0200
committerGitHub <noreply@github.com>2025-05-29 14:29:45 +0200
commit6ef2db0fc061cb653db05520b08ffb502dedecd1 (patch)
treef768b2e3b91c5fb7041af562efa81c494235673a
parent86a282ecd049ce4aa25e5fd7b776423f96d7ce9c (diff)
parent24fdb086d81c63aa2ff47e1b17804e068ea75be6 (diff)
downloadvyos-documentation-6ef2db0fc061cb653db05520b08ffb502dedecd1.tar.gz
vyos-documentation-6ef2db0fc061cb653db05520b08ffb502dedecd1.zip
Merge pull request #1640 from jestabro/api-extend-load-merge
T7498: add example of merge and of passing config in body of request
-rw-r--r--docs/automation/vyos-api.rst31
1 files changed, 31 insertions, 0 deletions
diff --git a/docs/automation/vyos-api.rst b/docs/automation/vyos-api.rst
index a9518a00..0955cca1 100644
--- a/docs/automation/vyos-api.rst
+++ b/docs/automation/vyos-api.rst
@@ -517,3 +517,34 @@ To Load a configuration file.
"data": null,
"error": null
}
+
+To Merge a configuration file.
+
+.. code-block:: none
+
+ curl -k --location --request POST 'https://vyos/config-file' \
+ --form data='{"op": "merge", "file": "/config/test.config"}' \
+ --form key='MY-HTTPS-API-PLAINTEXT-KEY'
+
+ response:
+ {
+ "success": true,
+ "data": null,
+ "error": null
+ }
+
+In either of the last two cases, one can pass a string in the body of the
+request, for example:
+
+.. code-block:: none
+
+ curl -k --location --request POST 'https://vyos/config-file' \
+ --form data='{"op": "merge", "string": "interfaces {\nethernet eth1 {\naddress "192.168.2.137/24"\ndescription "test"\n}\n}\n"}' \
+ --form key='MY-HTTPS-API-PLAINTEXT-KEY'
+
+ response:
+ {
+ "success": true,
+ "data": null,
+ "error": null
+ }