[lxc-devel] [lxd/master] lxd/instances: Fix URLs to use /1.0/instances

stgraber on Github lxc-bot at linuxcontainers.org
Sat Feb 1 14:34:41 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 354 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20200201/6fcf5cd3/attachment.bin>
-------------- next part --------------
From 4e34b0870004466260ba4abecdf3ed75f27e8932 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Sat, 1 Feb 2020 15:32:20 +0100
Subject: [PATCH] lxd/instances: Fix URLs to use /1.0/instances
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: St├ęphane Graber <stgraber at ubuntu.com>
---
 lxd/container_backup.go   | 2 +-
 lxd/container_console.go  | 2 +-
 lxd/container_logs.go     | 2 +-
 lxd/container_snapshot.go | 4 ++--
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/lxd/container_backup.go b/lxd/container_backup.go
index f47ccca3de..d70fc3e9e0 100644
--- a/lxd/container_backup.go
+++ b/lxd/container_backup.go
@@ -56,7 +56,7 @@ func containerBackupsGet(d *Daemon, r *http.Request) response.Response {
 
 	for _, backup := range backups {
 		if !recursion {
-			url := fmt.Sprintf("/%s/containers/%s/backups/%s",
+			url := fmt.Sprintf("/%s/instances/%s/backups/%s",
 				version.APIVersion, cname, strings.Split(backup.Name(), "/")[1])
 			resultString = append(resultString, url)
 		} else {
diff --git a/lxd/container_console.go b/lxd/container_console.go
index bdb05013b9..e461a9f7ff 100644
--- a/lxd/container_console.go
+++ b/lxd/container_console.go
@@ -267,7 +267,7 @@ func containerConsolePost(d *Daemon, r *http.Request) response.Response {
 	}
 
 	if client != nil {
-		url := fmt.Sprintf("/containers/%s/console?project=%s", name, project)
+		url := fmt.Sprintf("/instances/%s/console?project=%s", name, project)
 		op, _, err := client.RawOperation("POST", url, post, "")
 		if err != nil {
 			return response.SmartError(err)
diff --git a/lxd/container_logs.go b/lxd/container_logs.go
index 3c7aef4b24..6b6e505429 100644
--- a/lxd/container_logs.go
+++ b/lxd/container_logs.go
@@ -82,7 +82,7 @@ func containerLogsGet(d *Daemon, r *http.Request) response.Response {
 			continue
 		}
 
-		result = append(result, fmt.Sprintf("/%s/containers/%s/logs/%s", version.APIVersion, name, f.Name()))
+		result = append(result, fmt.Sprintf("/%s/instances/%s/logs/%s", version.APIVersion, name, f.Name()))
 	}
 
 	return response.SyncResponse(true, result)
diff --git a/lxd/container_snapshot.go b/lxd/container_snapshot.go
index 374f319e4d..78b817b6dc 100644
--- a/lxd/container_snapshot.go
+++ b/lxd/container_snapshot.go
@@ -53,10 +53,10 @@ func containerSnapshotsGet(d *Daemon, r *http.Request) response.Response {
 		for _, snap := range snaps {
 			_, snapName, _ := shared.InstanceGetParentAndSnapshotName(snap)
 			if project == "default" {
-				url := fmt.Sprintf("/%s/containers/%s/snapshots/%s", version.APIVersion, cname, snapName)
+				url := fmt.Sprintf("/%s/instances/%s/snapshots/%s", version.APIVersion, cname, snapName)
 				resultString = append(resultString, url)
 			} else {
-				url := fmt.Sprintf("/%s/containers/%s/snapshots/%s?project=%s", version.APIVersion, cname, snapName, project)
+				url := fmt.Sprintf("/%s/instances/%s/snapshots/%s?project=%s", version.APIVersion, cname, snapName, project)
 				resultString = append(resultString, url)
 			}
 		}


More information about the lxc-devel mailing list