Skip to content
This repository was archived by the owner on Aug 1, 2023. It is now read-only.

Commit b38e241

Browse files
andrewandrew
andrew
authored and
andrew
committed
add Tenant ID option to UpdateOpts
1 parent 985a863 commit b38e241

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

openstack/networking/v2/ports/requests.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ type UpdateOpts struct {
179179
DeviceOwner string
180180
SecurityGroups []string
181181
AllowedAddressPairs []AddressPair
182+
TenantID string
182183
}
183184

184185
// ToPortUpdateMap casts an UpdateOpts struct to a map.
@@ -206,7 +207,9 @@ func (opts UpdateOpts) ToPortUpdateMap() (map[string]interface{}, error) {
206207
if opts.AllowedAddressPairs != nil {
207208
p["allowed_address_pairs"] = opts.AllowedAddressPairs
208209
}
209-
210+
if opts.TenantID != "" {
211+
p["tenant_id"] = opts.TenantID
212+
}
210213
return map[string]interface{}{"port": p}, nil
211214
}
212215

0 commit comments

Comments
 (0)