Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions samples/json/ip/ipblockcreate.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"cidrBlockSize": "/28",
"cidrBlockSize": "/64",
"ipVersion": "V6",
"location": "PHX",
"description": "Created from PNAPCTL"
"description": "Created V6 from PNAPCTL"
}
2 changes: 1 addition & 1 deletion samples/json/networks/bgppeergroupcreate.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"location": "PHX",
"asn": 98239,
"asn": 64000,
"password": "password",
"advertisedRoutes": "DEFAULT"
}
2 changes: 2 additions & 0 deletions samples/yaml/ip/ipblockcreate.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
cidrBlockSize: /28
ipVersion: V4
location: PHX
description: "Created V6 from PNAPCTL"
2 changes: 1 addition & 1 deletion samples/yaml/networks/bgppeergroupcreate.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
location: "PHX"
asn: 98239
asn: 64000
password: "password"
advertisedRoutes: "DEFAULT"
32 changes: 16 additions & 16 deletions src/common/models/tables/bgppeergrouptable.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ import (
)

type BgpPeerGroupTable struct {
Id string `header: "ID"`
Status string `header: "Status"`
Location string `header: "Location"`
Ipv4Prefixes []string `header: "Ipv4 Prefixes"`
TargetAsnDetails string `header: "Target Asn Details"`
ActiveAsnDetails string `header: "Active Asn Details"`
Password string `header: "Password"`
AdvertisedRoutes string `header: "Advertised Routes"`
RpkiRoaOriginAsn int64 `header: "RPKI ROA Origin ASN"`
EBgpMultiHop int32 `header: "EBGP Multi Hop"`
PeeringLoopbacksV4 []string `header: "Peering Loopbacks V4"`
KeepAliveTimerSeconds int32 `header: "Keep Alive Timer Seconds"`
HoldTimerSeconds int32 `header: "Hold Timer Seconds"`
CreatedOn string `header: "Created On"`
LastUpdatedOn string `header: "Last Updated On"`
Id string `header:"ID"`
Status string `header:"Status"`
Location string `header:"Location"`
Ipv4Prefixes []string `header:"Ipv4 Prefixes"`
TargetAsnDetails string `header:"Target Asn Details"`
ActiveAsnDetails string `header:"Active Asn Details"`
Password string `header:"Password"`
AdvertisedRoutes string `header:"Advertised Routes"`
RpkiRoaOriginAsn int32 `header:"RPKI ROA Origin ASN"`
EBgpMultiHop int32 `header:"EBGP Multi Hop"`
PeeringLoopbacksV4 []string `header:"Peering Loopbacks V4"`
KeepAliveTimerSeconds int32 `header:"Keep Alive Timer Seconds"`
HoldTimerSeconds int32 `header:"Hold Timer Seconds"`
CreatedOn string `header:"Created On"`
LastUpdatedOn string `header:"Last Updated On"`
}

func BgpPeerGroupFromSdk(sdk networkapi.BgpPeerGroup) BgpPeerGroupTable {
Expand All @@ -34,7 +34,7 @@ func BgpPeerGroupFromSdk(sdk networkapi.BgpPeerGroup) BgpPeerGroupTable {
ActiveAsnDetails: models.AsnDetailsToTableString(sdk.ActiveAsnDetails),
Password: sdk.Password,
AdvertisedRoutes: sdk.AdvertisedRoutes,
RpkiRoaOriginAsn: sdk.RpkiRoaOriginAsn,
RpkiRoaOriginAsn: int32(sdk.RpkiRoaOriginAsn),
EBgpMultiHop: sdk.EBgpMultiHop,
PeeringLoopbacksV4: sdk.PeeringLoopbacksV4,
KeepAliveTimerSeconds: sdk.KeepAliveTimerSeconds,
Expand Down
2 changes: 1 addition & 1 deletion src/common/models/tables/bgppeergrouptable_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func assertBgpPeerGroupsEqual(test_framework *testing.T, bgpPeerGroup networkapi
assert.Equal(test_framework, models.AsnDetailsToTableString(bgpPeerGroup.ActiveAsnDetails), table.ActiveAsnDetails)
assert.Equal(test_framework, bgpPeerGroup.Password, table.Password)
assert.Equal(test_framework, bgpPeerGroup.AdvertisedRoutes, table.AdvertisedRoutes)
assert.Equal(test_framework, bgpPeerGroup.RpkiRoaOriginAsn, table.RpkiRoaOriginAsn)
assert.Equal(test_framework, int32(bgpPeerGroup.RpkiRoaOriginAsn), table.RpkiRoaOriginAsn)
assert.Equal(test_framework, bgpPeerGroup.EBgpMultiHop, table.EBgpMultiHop)
assert.Equal(test_framework, bgpPeerGroup.PeeringLoopbacksV4, table.PeeringLoopbacksV4)
assert.Equal(test_framework, bgpPeerGroup.KeepAliveTimerSeconds, table.KeepAliveTimerSeconds)
Expand Down
4 changes: 2 additions & 2 deletions src/common/models/tablestrings.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@ var PrivateNetworkServerToTableString = toTableString(func(sdk networkapi.Privat
})

var BgpIpv4PrefixToTableString = toTableString(func(sdk networkapi.BgpIPv4Prefix) string {
return fmt.Sprintf("IPv4 Allocation Id: %s\nCidr: %s\nStatus: %s\nIn Use: %s", sdk.Ipv4AllocationId, sdk.Cidr, sdk.Status, sdk.InUse)
return fmt.Sprintf("IPv4 Allocation Id: %s\nCidr: %s\nStatus: %s\nIn Use: %v", sdk.Ipv4AllocationId, sdk.Cidr, sdk.Status, sdk.InUse)
})

var AsnDetailsToTableString = toTableString(func(sdk networkapi.AsnDetails) string {
return fmt.Sprintf("Asn: %s\n, Verification Status: %s\nVerification Reason: %s", sdk.Asn, sdk.VerificationStatus, processNil(sdk.VerificationReason))
return fmt.Sprintf("Asn: %v\nVerification Status: %s\nVerification Reason: %s", sdk.Asn, sdk.VerificationStatus, processNil(sdk.VerificationReason))
})

// ranchersolutionapi
Expand Down
Loading