From c7f0e0b9e5fd5c44f8589380c7c4b6614ed000a1 Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Sun, 7 Jun 2020 12:14:44 -0500 Subject: http api: add section on image management --- docs/appendix/http-api.rst | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/docs/appendix/http-api.rst b/docs/appendix/http-api.rst index 86d8b394..49f2dbd9 100644 --- a/docs/appendix/http-api.rst +++ b/docs/appendix/http-api.rst @@ -99,8 +99,30 @@ 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 +Image management requests +------------------------- + +One may ``add`` or ``delete`` a system image using the endpoint ``/image``. Here are the respective examples: + +``add`` from ``url``. Here we use the URL of the latest rolling release: + +.. code-block:: none + + # curl -k -X POST -F data='{"op": "add", "url": "https://downloads.vyos.io/rolling/current/amd64/vyos-rolling-latest.iso"}' -F key=MY-HTTP-API-PLAINTEXT-KEY https://192.168.122.127/image + +``delete`` by image ``name``. For example: + +.. code-block:: none + + # curl -k -X POST -F data='{"op": "delete", "name": "1.3-rolling-202006070117"}' -F key=MY-HTTP-API-PLAINTEXT-KEY https://192.168.122.127/image + +To list the available system images by name, one may use the operational mode request ``show`` discussed in the next section; in this setting it would be: + +.. code-block:: none + + # curl -k -X POST -F data='{"op": "show", "path": ["system", "image"]}' -F key=MY-HTTP-API-PLAINTEXT-KEY https://192.168.122.127/show -Operational mode commands +Operational mode requests ------------------------- It is possible to run ``show`` and ``generate`` commands: -- cgit v1.2.3