blob: f7e387f8f792468ce1d2e16d0a906a21a0844233 [file] [log] [blame]
Jon Perritt034ef072015-02-03 13:14:44 -07001package stacks
2
3import (
4 "github.com/rackspace/gophercloud"
5 os "github.com/rackspace/gophercloud/openstack/orchestration/v1/stacks"
Jon Perritt2870e042015-02-04 15:50:08 -07006 "github.com/rackspace/gophercloud/pagination"
Jon Perritt034ef072015-02-03 13:14:44 -07007)
8
9// Create accepts an os.CreateOpts struct and creates a new stack using the values
10// provided.
11func Create(c *gophercloud.ServiceClient, opts os.CreateOptsBuilder) os.CreateResult {
12 return os.Create(c, opts)
13}
Jon Perritt1d3bc4b2015-02-04 12:06:19 -070014
15// Adopt accepts an os.AdoptOpts struct and creates a new stack from existing stack
16// resources using the values provided.
17func Adopt(c *gophercloud.ServiceClient, opts os.AdoptOptsBuilder) os.AdoptResult {
18 return os.Adopt(c, opts)
19}
Jon Perritt2870e042015-02-04 15:50:08 -070020
21// List accepts an os.ListOpts struct and lists stacks based on the options provided.
22func List(c *gophercloud.ServiceClient, opts os.ListOptsBuilder) pagination.Pager {
23 return os.List(c, opts)
24}
Jon Perritta6346d92015-02-04 17:54:52 -070025
Jon Perritt9df3c482015-02-09 16:35:27 -070026// Get retreives a stack based on the stack name and stack ID.
27func Get(c *gophercloud.ServiceClient, stackName, stackID string) os.GetResult {
28 return os.Get(c, stackName, stackID)
29}
30
Jon Perritta6346d92015-02-04 17:54:52 -070031// Update accepts an os.UpdateOpts struct and updates a stack based on the options provided.
32func Update(c *gophercloud.ServiceClient, stackName, stackID string, opts os.UpdateOptsBuilder) os.UpdateResult {
33 return os.Update(c, stackName, stackID, opts)
34}
Jon Perritt27a0b3e2015-02-04 18:04:35 -070035
36// Delete deletes a stack based on the stack name and stack ID provided.
37func Delete(c *gophercloud.ServiceClient, stackName, stackID string) os.DeleteResult {
38 return os.Delete(c, stackName, stackID)
39}
Jon Perritt68c27172015-02-04 18:55:38 -070040
41// Preview provides a preview of a stack based on the options provided.
42func Preview(c *gophercloud.ServiceClient, opts os.PreviewOptsBuilder) os.PreviewResult {
43 return os.Preview(c, opts)
44}
Jon Perritt9b81b8c2015-02-05 12:55:53 -070045
46// Abandon abandons a stack, keeping the resources available.
47func Abandon(c *gophercloud.ServiceClient, stackName, stackID string) os.AbandonResult {
48 return os.Abandon(c, stackName, stackID)
49}