mirror of
https://github.com/vyos/vyos-documentation.git
synced 2025-10-26 08:41:46 +01:00
T7498: add example of merge and of passing config in body of request
This commit is contained in:
parent
86a282ecd0
commit
24fdb086d8
@ -517,3 +517,34 @@ To Load a configuration file.
|
|||||||
"data": null,
|
"data": null,
|
||||||
"error": 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
|
||||||
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user