Skip to content

Commit

Permalink
add missing VNI extraction in VN unmarshal
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismarget-j committed Oct 24, 2024
1 parent cce7d14 commit 6359852
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions apstra/two_stage_l3_clos_virtual_networks.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,14 @@ func (o *VirtualNetwork) UnmarshalJSON(bytes []byte) error {
o.Data.VirtualGatewayIpv6Enabled = raw.VirtualGatewayIpv6Enabled
o.Data.VnBindings = raw.VnBindings

if raw.VnId != "" {
vnId, err := strconv.Atoi(raw.VnId)
if err != nil {
return fmt.Errorf("while parsing virtual network data vn_id %q - %w", raw.VnId, err)
}
o.Data.VnId = (*VNI)(toPtr(uint32(vnId)))
}

err = o.Data.VnType.FromString(raw.VnType)
if err != nil {
return fmt.Errorf("while parsing virtual network data vn_type %q - %w", raw.VnType, err)
Expand Down

0 comments on commit 6359852

Please sign in to comment.