blob: b4bade8ee87a98306ade219b48bdfd1e4a0fc05f [file] [log] [blame]
Jamie Hannaford936a5472015-02-10 14:38:28 +01001package instances
2
3import (
4 "github.com/racker/perigee"
5 "github.com/rackspace/gophercloud"
Jamie Hannaford302c0b62015-02-16 14:12:34 +01006 "github.com/rackspace/gophercloud/pagination"
Jamie Hannaford936a5472015-02-10 14:38:28 +01007)
8
9func GetDefaultConfig(client *gophercloud.ServiceClient, id string) ConfigResult {
10 var res ConfigResult
11
12 resp, err := perigee.Request("GET", configURL(client, id), perigee.Options{
13 MoreHeaders: client.AuthenticatedHeaders(),
14 Results: &res.Body,
15 OkCodes: []int{200},
16 })
17
18 res.Header = resp.HttpResponse.Header
19 res.Err = err
20
21 return res
22}
Jamie Hannafordf77fc102015-02-10 14:56:02 +010023
24func AssociateWithConfigGroup(client *gophercloud.ServiceClient, instanceID, configGroupID string) UpdateResult {
25 reqBody := map[string]string{
26 "configuration": configGroupID,
27 }
28
29 var res UpdateResult
30
31 resp, err := perigee.Request("PUT", resourceURL(client, instanceID), perigee.Options{
32 MoreHeaders: client.AuthenticatedHeaders(),
33 ReqBody: map[string]map[string]string{"instance": reqBody},
34 OkCodes: []int{202},
35 })
36
37 res.Header = resp.HttpResponse.Header
38 res.Err = err
39
40 return res
41}
Jamie Hannaford302c0b62015-02-16 14:12:34 +010042
43func ListBackups(client *gophercloud.ServiceClient, instanceID string) pagination.Pager {
44
45}