[lxc-devel] [lxd/master] doc: Add links to REST API
monstermunchkin on Github
lxc-bot at linuxcontainers.org
Thu Jun 21 11:19:55 UTC 2018
A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 427 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20180621/d94034bf/attachment.bin>
-------------- next part --------------
From 8b9c88589b66e018bc939713e308323ec101bff4 Mon Sep 17 00:00:00 2001
From: Thomas Hipp <thomas.hipp at canonical.com>
Date: Thu, 21 Jun 2018 13:06:36 +0200
Subject: [PATCH] doc: Add links to REST API
This change adds links to each section, and fixes the section order.
Signed-off-by: Thomas Hipp <thomas.hipp at canonical.com>
---
doc/rest-api.md | 255 ++++++++++++++++++++++++++++----------------------------
1 file changed, 127 insertions(+), 128 deletions(-)
diff --git a/doc/rest-api.md b/doc/rest-api.md
index c9978e644..3519fe60e 100644
--- a/doc/rest-api.md
+++ b/doc/rest-api.md
@@ -179,50 +179,50 @@ it to empty will usually do the trick, but there are cases where PATCH
won't work and PUT needs to be used instead.
# API structure
- * `/`
- * `/1.0`
- * `/1.0/certificates`
- * `/1.0/certificates/<fingerprint>`
- * `/1.0/containers`
- * `/1.0/containers/<name>`
- * `/1.0/containers/<name>/console`
- * `/1.0/containers/<name>/exec`
- * `/1.0/containers/<name>/files`
- * `/1.0/containers/<name>/snapshots`
- * `/1.0/containers/<name>/snapshots/<name>`
- * `/1.0/containers/<name>/state`
- * `/1.0/containers/<name>/logs`
- * `/1.0/containers/<name>/logs/<logfile>`
- * `/1.0/containers/<name>/metadata`
- * `/1.0/containers/<name>/metadata/templates`
- * `/1.0/containers/<name>/backups`
- * `/1.0/containers/<name>/backups/<name>`
- * `/1.0/containers/<name>/backups/<name>/export`
- * `/1.0/events`
- * `/1.0/images`
- * `/1.0/images/<fingerprint>`
- * `/1.0/images/<fingerprint>/export`
- * `/1.0/images/<fingerprint>/refresh`
- * `/1.0/images/<fingerprint>/secret`
- * `/1.0/images/aliases`
- * `/1.0/images/aliases/<name>`
- * `/1.0/networks`
- * `/1.0/networks/<name>`
- * `/1.0/operations`
- * `/1.0/operations/<uuid>`
- * `/1.0/operations/<uuid>/wait`
- * `/1.0/operations/<uuid>/websocket`
- * `/1.0/profiles`
- * `/1.0/profiles/<name>`
- * `/1.0/storage-pools`
- * `/1.0/storage-pools/<name>`
- * `/1.0/storage-pools/<name>/resources`
- * `/1.0/storage-pools/<name>/volumes`
- * `/1.0/storage-pools/<name>/volumes/<volume type>/<volume>`
- * `/1.0/resources`
- * `/1.0/cluster`
- * `/1.0/cluster/members`
- * `/1.0/cluster/members/<name>`
+ * [`/`](#)
+ * [`/1.0`](#10)
+ * [`/1.0/certificates`](#10certificates)
+ * [`/1.0/certificates/<fingerprint>`](#10certificatesfingerprint)
+ * [`/1.0/containers`](#10containers)
+ * [`/1.0/containers/<name>`](#10containersname)
+ * [`/1.0/containers/<name>/console`](#10containersnameconsole)
+ * [`/1.0/containers/<name>/exec`](#10containersnameexec)
+ * [`/1.0/containers/<name>/files`](#10containersnamefiles)
+ * [`/1.0/containers/<name>/snapshots`](#10containersnamesnapshots)
+ * [`/1.0/containers/<name>/snapshots/<name>`](#10containersnamesnapshotsname)
+ * [`/1.0/containers/<name>/state`](#10containersnamestate)
+ * [`/1.0/containers/<name>/logs`](#10containersnamelogs)
+ * [`/1.0/containers/<name>/logs/<logfile>`](#10containersnamelogslogfile)
+ * [`/1.0/containers/<name>/metadata`](#10containersnamemetadata)
+ * [`/1.0/containers/<name>/metadata/templates`](#10containersnamemetadatatemplates)
+ * [`/1.0/containers/<name>/backups`](#10containersnamebackups)
+ * [`/1.0/containers/<name>/backups/<name>`](#10containersnamebackupsname)
+ * [`/1.0/containers/<name>/backups/<name>/export`](#10containersnamebackupsnameexport)
+ * [`/1.0/events`](#10events)
+ * [`/1.0/images`](#10images)
+ * [`/1.0/images/<fingerprint>`](#10imagesfingerprint)
+ * [`/1.0/images/<fingerprint>/export`](#10imagesfingerprintexport)
+ * [`/1.0/images/<fingerprint>/refresh`](#10imagesfingerprintrefresh)
+ * [`/1.0/images/<fingerprint>/secret`](#10imagesfingerprintsecret)
+ * [`/1.0/images/aliases`](#10imagesaliases)
+ * [`/1.0/images/aliases/<name>`](#10imagesaliasesname)
+ * [`/1.0/networks`](#10networks)
+ * [`/1.0/networks/<name>`](#10networksname)
+ * [`/1.0/operations`](#10operations)
+ * [`/1.0/operations/<uuid>`](#10operationsuuid)
+ * [`/1.0/operations/<uuid>/wait`](#10operationsuuidwait)
+ * [`/1.0/operations/<uuid>/websocket`](#10operationsuuidwebsocket)
+ * [`/1.0/profiles`](#10profiles)
+ * [`/1.0/profiles/<name>`](#10profilesname)
+ * [`/1.0/storage-pools`](#10storage-pools)
+ * [`/1.0/storage-pools/<name>`](#10storage-poolsname)
+ * [`/1.0/storage-pools/<name>/resources`](#10storage-poolsnameresources)
+ * [`/1.0/storage-pools/<name>/volumes`](#10storage-poolsnamevolumes)
+ * [`/1.0/storage-pools/<pool>/volumes/<type>/<name>`](#10storage-poolspoolvolumestypename)
+ * [`/1.0/resources`](#10resources)
+ * [`/1.0/cluster`](#10cluster)
+ * [`/1.0/cluster/members`](#10clustermembers)
+ * [`/1.0/cluster/members/<name>`](#10clustermembersname)
# API details
## `/`
@@ -771,89 +771,6 @@ Input (none at present):
HTTP code for this should be 202 (Accepted).
-## `/1.0/containers/<name>/backups`
-### GET
-* Description: List of backups for the container
-* Introduced: with API extension `container_backup`
-* Authentication: trusted
-* Operation: sync
-* Return: a list of backups for the container
-
-Return value:
-
- [
- "/1.0/containers/c1/backups/c1/backup0",
- "/1.0/containers/c1/backups/c1/backup1",
- ]
-
-### POST
-* Description: Create a new backup
-* Introduced: with API extension `container_backup`
-* Authentication: trusted
-* Operation: async
-* Returns: background operation or standard error
-
-Input:
-
- {
- "name": "backupName", # unique identifier for the backup
- "expiry": 3600, # when to delete the backup automatically
- "container_only": true, # if True, snapshots aren't included
- "optimized_storage": true # if True, btrfs send or zfs send is used for container and snapshots
- }
-
-## `/1.0/containers/<name>/backups/<name>`
-### GET
-* Description: Backup information
-* Introduced: with API extension `container_backup`
-* Authentication: trusted
-* Operation: sync
-* Returns: dict of the backup
-
-Output:
-
- {
- "name": "backupName",
- "creation_date": "2018-04-23T12:16:09+02:00",
- "expiry_date": "2018-04-23T12:16:09+02:00",
- "container_only": false,
- "optimized_storage": false
- }
-
-### DELETE
- * Description: remove the backup
- * Introduced: with API extension `container_backup`
- * Authentication: trusted
- * Operation: async
- * Return: background operation or standard error
-
-### POST
- * Description: used to rename the backup
- * Introduced: with API extension `container_backup`
- * Authentication: trusted
- * Operation: async
- * Return: background operation or standard error
-
-Input:
-
- {
- "name": "new-name"
- }
-
-## `/1.0/containers/<name>/backups/<name>/export`
-### GET
-* Description: fetch the backup tarball
-* Introduced: with API extension `container_backup`
-* Authentication: trusted
-* Operation: sync
-* Return: dict containing the backup tarball
-
-Output:
-
- {
- "data": <byte-stream>
- }
-
## `/1.0/containers/<name>/console`
### GET
* Description: returns the contents of the container's console log
@@ -1463,6 +1380,89 @@ Input:
* Operation: Sync
* Return: standard return value or standard error
+## `/1.0/containers/<name>/backups`
+### GET
+* Description: List of backups for the container
+* Introduced: with API extension `container_backup`
+* Authentication: trusted
+* Operation: sync
+* Return: a list of backups for the container
+
+Return value:
+
+ [
+ "/1.0/containers/c1/backups/c1/backup0",
+ "/1.0/containers/c1/backups/c1/backup1",
+ ]
+
+### POST
+* Description: Create a new backup
+* Introduced: with API extension `container_backup`
+* Authentication: trusted
+* Operation: async
+* Returns: background operation or standard error
+
+Input:
+
+ {
+ "name": "backupName", # unique identifier for the backup
+ "expiry": 3600, # when to delete the backup automatically
+ "container_only": true, # if True, snapshots aren't included
+ "optimized_storage": true # if True, btrfs send or zfs send is used for container and snapshots
+ }
+
+## `/1.0/containers/<name>/backups/<name>`
+### GET
+* Description: Backup information
+* Introduced: with API extension `container_backup`
+* Authentication: trusted
+* Operation: sync
+* Returns: dict of the backup
+
+Output:
+
+ {
+ "name": "backupName",
+ "creation_date": "2018-04-23T12:16:09+02:00",
+ "expiry_date": "2018-04-23T12:16:09+02:00",
+ "container_only": false,
+ "optimized_storage": false
+ }
+
+### DELETE
+ * Description: remove the backup
+ * Introduced: with API extension `container_backup`
+ * Authentication: trusted
+ * Operation: async
+ * Return: background operation or standard error
+
+### POST
+ * Description: used to rename the backup
+ * Introduced: with API extension `container_backup`
+ * Authentication: trusted
+ * Operation: async
+ * Return: background operation or standard error
+
+Input:
+
+ {
+ "name": "new-name"
+ }
+
+## `/1.0/containers/<name>/backups/<name>/export`
+### GET
+* Description: fetch the backup tarball
+* Introduced: with API extension `container_backup`
+* Authentication: trusted
+* Operation: sync
+* Return: dict containing the backup tarball
+
+Output:
+
+ {
+ "data": <byte-stream>
+ }
+
## `/1.0/events`
This URL isn't a real REST API endpoint, instead doing a GET query on it
will upgrade the connection to a websocket on which notifications will
@@ -2679,7 +2679,6 @@ Return:
"state": "Online"
}
-## `/1.0/cluster/members/<name>`
### POST
* Description: rename a cluster member
* Introduced: with API extension `clustering`
More information about the lxc-devel
mailing list