mirror of
https://github.com/vyos/vyos-documentation.git
synced 2025-11-02 20:02:05 +01:00
http-api: T6135: add details on op 'exists' for retrieve endpoint
(cherry picked from commit 72c4b47d4d9803fd376b8f510c7e3f08a2b60d19)
This commit is contained in:
parent
d21e78c233
commit
45a9ed9668
@ -125,6 +125,38 @@ For example, get the addresses of a ``dum0`` interface.
|
||||
"error": null
|
||||
}
|
||||
|
||||
To check existence of a configuration path, use the ``exists`` operation.
|
||||
|
||||
For example, check an existing path:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
curl -k --location --request POST 'https://vyos/retrieve' \
|
||||
--form data='{"op": "exists", "path": ["service","https","api"]}' \
|
||||
--form key='MY-HTTPS-API-PLAINTEXT-KEY'
|
||||
|
||||
response:
|
||||
{
|
||||
"success": true,
|
||||
"data": true,
|
||||
"error": null
|
||||
}
|
||||
|
||||
versus a non-existent path:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
curl -k --location --request POST 'https://vyos/retrieve' \
|
||||
--form data='{"op": "exists", "path": ["service","non","existent","path"]}' \
|
||||
--form key='MY-HTTPS-API-PLAINTEXT-KEY'
|
||||
|
||||
response:
|
||||
{
|
||||
"success": true,
|
||||
"data": false,
|
||||
"error": null
|
||||
}
|
||||
|
||||
/reset
|
||||
======
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user