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

add Tenant ID option to UpdateOpts #600

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion openstack/networking/v2/ports/requests.go
Expand Up @@ -179,6 +179,7 @@ type UpdateOpts struct {
DeviceOwner string
SecurityGroups []string
AllowedAddressPairs []AddressPair
TenantID string
}

// ToPortUpdateMap casts an UpdateOpts struct to a map.
Expand Down Expand Up @@ -206,7 +207,9 @@ func (opts UpdateOpts) ToPortUpdateMap() (map[string]interface{}, error) {
if opts.AllowedAddressPairs != nil {
p["allowed_address_pairs"] = opts.AllowedAddressPairs
}

if opts.TenantID != "" {
p["tenant_id"] = opts.TenantID
}
return map[string]interface{}{"port": p}, nil
}

Expand Down