Jon Perritt | 35e27e4 | 2014-12-05 11:10:46 -0700 | [diff] [blame^] | 1 | package stacks |
| 2 | |
| 3 | import "github.com/rackspace/gophercloud" |
| 4 | |
| 5 | func createURL(c *gophercloud.ServiceClient) string { |
| 6 | return c.ServiceURL("stacks") |
| 7 | } |
| 8 | |
| 9 | func adoptURL(c *gophercloud.ServiceClient) string { |
| 10 | return createURL(c) |
| 11 | } |
| 12 | |
| 13 | func listURL(c *gophercloud.ServiceClient) string { |
| 14 | return createURL(c) |
| 15 | } |
| 16 | |
| 17 | func getURL(c *gophercloud.ServiceClient, name, id string) string { |
| 18 | return c.ServiceURL("stacks", name, id) |
| 19 | } |
| 20 | |
| 21 | func updateURL(c *gophercloud.ServiceClient, name, id string) string { |
| 22 | return getURL(c, name, id) |
| 23 | } |
| 24 | |
| 25 | func deleteURL(c *gophercloud.ServiceClient, name, id string) string { |
| 26 | return getURL(c, name, id) |
| 27 | } |
| 28 | |
| 29 | func previewURL(c *gophercloud.ServiceClient) string { |
| 30 | return c.ServiceURL("stacks", "preview") |
| 31 | } |
| 32 | |
| 33 | func abandonURL(c *gophercloud.ServiceClient, name, id string) string { |
| 34 | return c.ServiceURL("stacks", name, id, "abandon") |
| 35 | } |
| 36 | |
| 37 | func createSnapshotURL(c *gophercloud.ServiceClient, stackName, stackID string) string { |
| 38 | return c.ServiceURL("stacks", stackName, stackID, "snapshots") |
| 39 | } |
| 40 | |
| 41 | func listSnapshotsURL(c *gophercloud.ServiceClient, stackName, stackID string) string { |
| 42 | return createSnapshotURL(c, stackName, stackID) |
| 43 | } |
| 44 | |
| 45 | func getSnapshotURL(c *gophercloud.ServiceClient, stackName, stackID, snapshotID string) string { |
| 46 | return c.ServiceURL("stacks", stackName, stackID, "snapshots", snapshotID) |
| 47 | } |
| 48 | |
| 49 | func restoreSnapshotURL(c *gophercloud.ServiceClient, stackName, stackID, snapshotID string) string { |
| 50 | return getSnapshotURL(c, stackName, stackID, snapshotID) |
| 51 | } |
| 52 | |
| 53 | func deleteSnapshotURL(c *gophercloud.ServiceClient, stackName, stackID, snapshotID string) string { |
| 54 | return getSnapshotURL(c, stackName, stackID, snapshotID) |
| 55 | } |