summaryrefslogtreecommitdiff
path: root/docs/automation
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2024-03-18 14:06:58 -0500
committerJohn Estabrook <jestabro@vyos.io>2024-03-18 14:06:58 -0500
commit72c4b47d4d9803fd376b8f510c7e3f08a2b60d19 (patch)
tree5e0fe491e5db1b187d14eae4afdeb0630617d294 /docs/automation
parent64be488c727d8d0a3a72a006aefd4eceef867545 (diff)
downloadvyos-documentation-72c4b47d4d9803fd376b8f510c7e3f08a2b60d19.tar.gz
vyos-documentation-72c4b47d4d9803fd376b8f510c7e3f08a2b60d19.zip
http-api: T6135: add details on op 'exists' for retrieve endpoint
Diffstat (limited to 'docs/automation')
-rw-r--r--docs/automation/vyos-api.rst32
1 files changed, 32 insertions, 0 deletions
diff --git a/docs/automation/vyos-api.rst b/docs/automation/vyos-api.rst
index 8fad05ca..60247fae 100644
--- a/docs/automation/vyos-api.rst
+++ b/docs/automation/vyos-api.rst
@@ -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
======