Samuel A. Falvo II | 0262e97 | 2014-01-24 16:06:56 -0800 | [diff] [blame] | 1 | package notificationPlans |
| 2 | |
| 3 | import ( |
| 4 | "fmt" |
Samuel A. Falvo II | 0262e97 | 2014-01-24 16:06:56 -0800 | [diff] [blame] | 5 | "github.com/racker/perigee" |
Samuel A. Falvo II | d7aa3bd | 2014-01-24 16:11:10 -0800 | [diff] [blame^] | 6 | "github.com/rackspace/gophercloud/rackspace/monitoring" |
Samuel A. Falvo II | 0262e97 | 2014-01-24 16:06:56 -0800 | [diff] [blame] | 7 | ) |
| 8 | |
| 9 | var ErrNotImplemented = fmt.Errorf("notificationPlans feature not yet implemented") |
| 10 | |
| 11 | type Client struct { |
| 12 | options monitoring.Options |
| 13 | } |
| 14 | |
| 15 | type DeleteResults map[string]interface{} |
| 16 | |
| 17 | func NewClient(mo monitoring.Options) *Client { |
| 18 | return &Client{ |
| 19 | options: mo, |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | func (c *Client) Delete(id string) (DeleteResults, error) { |
| 24 | var dr DeleteResults |
| 25 | |
| 26 | url := fmt.Sprintf("%s/notification_plans/%s", c.options.Endpoint, id) |
| 27 | err := perigee.Delete(url, perigee.Options{ |
| 28 | Results: &dr, |
| 29 | OkCodes: []int{204}, |
| 30 | }) |
| 31 | return dr, err |
| 32 | } |