blob: a29c2fae88a6bfe2b47d262e6bc679ccb13ec237 [file] [log] [blame]
Jamie Hannaford7db63f22014-09-29 11:18:45 +02001package external
2
3import "github.com/rackspace/gophercloud/openstack/networking/v2/networks"
4
Jamie Hannaforda241e312014-10-01 16:54:33 +02005type AdminState *bool
6
7// Convenience vars for AdminStateUp values.
8var (
9 iTrue = true
10 iFalse = false
11
12 Nothing AdminState = nil
13 Up AdminState = &iTrue
14 Down AdminState = &iFalse
15)
16
Jamie Hannaford7db63f22014-09-29 11:18:45 +020017type CreateOpts struct {
18 Parent networks.CreateOpts
19 External bool
20}
21
22func (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
30func (o CreateOpts) IsCreateOpts() bool { return true }
31
32type UpdateOpts struct {
33 Parent networks.UpdateOpts
34 External bool
35}
36
37func (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
45func (o UpdateOpts) IsUpdateOpts() bool { return true }