Skip to content

Commit 7a7206e

Browse files
ITD27M01Igor Tiunov
authored andcommitted
Added availability zones support for Octavia LoadBalancers
1 parent b1ee3a6 commit 7a7206e

3 files changed

Lines changed: 11 additions & 0 deletions

File tree

openstack/loadbalancer/v2/loadbalancers/requests.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ type ListOpts struct {
2929
OperatingStatus string `q:"operating_status"`
3030
Name string `q:"name"`
3131
FlavorID string `q:"flavor_id"`
32+
AvailabilityZone string `q:"availability_zone"`
3233
Provider string `q:"provider"`
3334
Limit int `q:"limit"`
3435
Marker string `q:"marker"`
@@ -111,6 +112,10 @@ type CreateOpts struct {
111112
// The UUID of a flavor.
112113
FlavorID string `json:"flavor_id,omitempty"`
113114

115+
// The name of an Octavia availability zone.
116+
// Requires Octavia API version 2.14 or later.
117+
AvailabilityZone string `json:"availability_zone,omitempty"`
118+
114119
// The name of the provider.
115120
Provider string `json:"provider,omitempty"`
116121

openstack/loadbalancer/v2/loadbalancers/results.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ type LoadBalancer struct {
5959
// The UUID of a flavor if set.
6060
FlavorID string `json:"flavor_id"`
6161

62+
// The name of an Octavia availability zone if set.
63+
AvailabilityZone string `json:"availability_zone"`
64+
6265
// The name of the provider.
6366
Provider string `json:"provider"`
6467

openstack/loadbalancer/v2/loadbalancers/testing/fixtures.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ const LoadbalancersListBody = `
4646
"vip_address": "10.30.176.48",
4747
"vip_port_id": "2bf413c8-41a9-4477-b505-333d5cbe8b55",
4848
"flavor_id": "bba40eb2-ee8c-11e9-81b4-2a2ae2dbcce4",
49+
"availability_zone": "db_az",
4950
"provider": "haproxy",
5051
"admin_state_up": true,
5152
"provisioning_status": "PENDING_CREATE",
@@ -70,6 +71,7 @@ const SingleLoadbalancerBody = `
7071
"vip_address": "10.30.176.48",
7172
"vip_port_id": "2bf413c8-41a9-4477-b505-333d5cbe8b55",
7273
"flavor_id": "bba40eb2-ee8c-11e9-81b4-2a2ae2dbcce4",
74+
"availability_zone": "db_az",
7375
"provider": "haproxy",
7476
"admin_state_up": true,
7577
"provisioning_status": "PENDING_CREATE",
@@ -184,6 +186,7 @@ var (
184186
VipAddress: "10.30.176.48",
185187
VipPortID: "2bf413c8-41a9-4477-b505-333d5cbe8b55",
186188
FlavorID: "bba40eb2-ee8c-11e9-81b4-2a2ae2dbcce4",
189+
AvailabilityZone: "db_az",
187190
Provider: "haproxy",
188191
AdminStateUp: true,
189192
ProvisioningStatus: "PENDING_CREATE",

0 commit comments

Comments
 (0)