Jamie Hannaford | 7db63f2 | 2014-09-29 11:18:45 +0200 | [diff] [blame] | 1 | package external |
| 2 | |
| 3 | import "github.com/rackspace/gophercloud/openstack/networking/v2/networks" |
| 4 | |
Jamie Hannaford | a241e31 | 2014-10-01 16:54:33 +0200 | [diff] [blame] | 5 | type AdminState *bool |
| 6 | |
| 7 | // Convenience vars for AdminStateUp values. |
| 8 | var ( |
| 9 | iTrue = true |
| 10 | iFalse = false |
| 11 | |
| 12 | Nothing AdminState = nil |
| 13 | Up AdminState = &iTrue |
| 14 | Down AdminState = &iFalse |
| 15 | ) |
| 16 | |
Jamie Hannaford | 7db63f2 | 2014-09-29 11:18:45 +0200 | [diff] [blame] | 17 | type CreateOpts struct { |
| 18 | Parent networks.CreateOpts |
| 19 | External bool |
| 20 | } |
| 21 | |
| 22 | func (o CreateOpts) ToMap() map[string]map[string]interface{} { |
| 23 | outer := o.Parent.ToMap() |
| 24 | |
| 25 | outer["network"]["router:external"] = o.External |
| 26 | |
| 27 | return outer |
| 28 | } |
| 29 | |
| 30 | func (o CreateOpts) IsCreateOpts() bool { return true } |
| 31 | |
| 32 | type UpdateOpts struct { |
| 33 | Parent networks.UpdateOpts |
| 34 | External bool |
| 35 | } |
| 36 | |
| 37 | func (o UpdateOpts) ToMap() map[string]map[string]interface{} { |
| 38 | outer := o.Parent.ToMap() |
| 39 | |
| 40 | outer["network"]["router:external"] = o.External |
| 41 | |
| 42 | return outer |
| 43 | } |
| 44 | |
| 45 | func (o UpdateOpts) IsUpdateOpts() bool { return true } |