Permalink
Browse files

availability_zone_hints for network(s) (#662)

* availability_zone_hints for network(s)

* Add missing commit for field AvailabilityZoneHints
  • Loading branch information...
stone authored and jtopjian committed Dec 7, 2017
1 parent 157d751 commit b63d2fd36f5dae9723e73696248abca95d6b8dc6
@@ -66,10 +66,11 @@ type CreateOptsBuilder interface {
// CreateOpts represents options used to create a network.
type CreateOpts struct {
AdminStateUp *bool `json:"admin_state_up,omitempty"`
Name string `json:"name,omitempty"`
Shared *bool `json:"shared,omitempty"`
TenantID string `json:"tenant_id,omitempty"`
AdminStateUp *bool `json:"admin_state_up,omitempty"`
Name string `json:"name,omitempty"`
Shared *bool `json:"shared,omitempty"`
TenantID string `json:"tenant_id,omitempty"`
AvailabilityZoneHints []string `json:"availability_zone_hints,omitempty"`
}
// ToNetworkCreateMap builds a request body from CreateOpts.
@@ -69,6 +69,10 @@ type Network struct {
// Specifies whether the network resource can be accessed by any tenant.
Shared bool `json:"shared"`
// Availability zone hints groups network nodes that run services like DHCP, L3, FW, and others.
// Used to make network resources highly available.
AvailabilityZoneHints []string `json:"availability_zone_hints"`
}
// NetworkPage is the page returned by a pager when traversing over a
@@ -92,7 +92,8 @@ const CreateOptionalFieldsRequest = `
"name": "public",
"admin_state_up": true,
"shared": true,
"tenant_id": "12345"
"tenant_id": "12345",
"availability_zone_hints": ["zone1", "zone2"]
}
}`
@@ -166,7 +166,13 @@ func TestCreateWithOptionalFields(t *testing.T) {
})
iTrue := true
options := networks.CreateOpts{Name: "public", AdminStateUp: &iTrue, Shared: &iTrue, TenantID: "12345"}
options := networks.CreateOpts{
Name: "public",
AdminStateUp: &iTrue,
Shared: &iTrue,
TenantID: "12345",
AvailabilityZoneHints: []string{"zone1", "zone2"},
}
_, err := networks.Create(fake.ServiceClient(), options).Extract()
th.AssertNoErr(t, err)
}

0 comments on commit b63d2fd

Please sign in to comment.