diff --git a/docs/metal_gateway_create-bgp-dynamic-neighbors.md b/docs/metal_gateway_create-bgp-dynamic-neighbors.md index 104ba45d..e6f2cc96 100644 --- a/docs/metal_gateway_create-bgp-dynamic-neighbors.md +++ b/docs/metal_gateway_create-bgp-dynamic-neighbors.md @@ -22,7 +22,7 @@ metal gateway create-bgp-dynamic-neighbors [flags] ### Options ``` - --asn int32 ASN for the BGP Dynamic Neighbor IP range. + --asn int ASN for the BGP Dynamic Neighbor IP range. --bgp-neighbor-range string BGP Dynamic Neighbor IP Range from gateway. -h, --help help for create-bgp-dynamic-neighbors -i, --id string Metal Gateway ID for which the BGP Dynamic Neighbor to be created. diff --git a/docs/metal_vrf_create.md b/docs/metal_vrf_create.md index ec56e833..33e0f97a 100644 --- a/docs/metal_vrf_create.md +++ b/docs/metal_vrf_create.md @@ -24,7 +24,7 @@ metal vrf create [-p ] [-m ] [-n ] [- -d, --description string Description of the Virtual Routing and Forwarding. -h, --help help for create -r, --ipranges strings A list of CIDR network addresses. Like [10.0.0.0/16, 2001:d78::/56]. IPv4 blocks must be between /8 and /29 in size. IPv6 blocks must be between /56 and /64. - -a, --local-asn int32 Local ASN for the VRF + -a, --local-asn int Local ASN for the VRF -m, --metro string The UUID (or metro code) for the Metro in which to create this Virtual Routing and Forwarding -n, --name string Name of the Virtual Routing and Forwarding -p, --project-id string The project's UUID. This flag is required, unless specified in the config created by metal init or set as METAL_PROJECT_ID environment variable. diff --git a/go.mod b/go.mod index f7151f67..0ba00a56 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/equinix/metal-cli go 1.19 require ( - github.com/equinix/equinix-sdk-go v0.35.0 + github.com/equinix/equinix-sdk-go v0.39.1 github.com/olekukonko/tablewriter v0.0.5 github.com/pkg/errors v0.9.1 github.com/spf13/cobra v1.8.0 diff --git a/go.sum b/go.sum index 595fe10d..62ca5be2 100644 --- a/go.sum +++ b/go.sum @@ -8,6 +8,8 @@ github.com/equinix/equinix-sdk-go v0.32.0 h1:zUn0Em5FJe6f6bntftrDBpO9L+XhbpFMPuQ github.com/equinix/equinix-sdk-go v0.32.0/go.mod h1:qnpdRzVftHFNaJFk1VSIrAOTLrIoeDrxzUr3l8ARyvQ= github.com/equinix/equinix-sdk-go v0.35.0 h1:p/uwA8QPBAuNnKGc3mQkwjw+6++qUadLNnKFQ8jw+wg= github.com/equinix/equinix-sdk-go v0.35.0/go.mod h1:hEb3XLaedz7xhl/dpPIS6eOIiXNPeqNiVoyDrT6paIg= +github.com/equinix/equinix-sdk-go v0.39.1 h1:UyiNYqlK+Hn1W8DTjM3bp25Zzq8ITQHodhLhU6MZHqQ= +github.com/equinix/equinix-sdk-go v0.39.1/go.mod h1:hEb3XLaedz7xhl/dpPIS6eOIiXNPeqNiVoyDrT6paIg= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= diff --git a/internal/gateway/createbgpneighbours.go b/internal/gateway/createbgpneighbours.go index 3bec4bb0..c7e0b071 100644 --- a/internal/gateway/createbgpneighbours.go +++ b/internal/gateway/createbgpneighbours.go @@ -33,7 +33,7 @@ import ( func (c *Client) CreateBgpNeighbors() *cobra.Command { var gatewayId, bgpNeighborRange string - var asn int32 + var asn int64 // createGwBgpCmd represents the creation of gateway bgp dynamic neighbor command createGwBgpCmd := &cobra.Command{ @@ -79,7 +79,7 @@ func (c *Client) CreateBgpNeighbors() *cobra.Command { createGwBgpCmd.Flags().StringVarP(&gatewayId, "id", "i", "", "Metal Gateway ID for which the BGP Dynamic Neighbor to be created.") createGwBgpCmd.Flags().StringVar(&bgpNeighborRange, "bgp-neighbor-range", "", "BGP Dynamic Neighbor IP Range from gateway.") - createGwBgpCmd.Flags().Int32Var(&asn, "asn", 0, "ASN for the BGP Dynamic Neighbor IP range.") + createGwBgpCmd.Flags().Int64Var(&asn, "asn", 0, "ASN for the BGP Dynamic Neighbor IP range.") _ = createGwBgpCmd.MarkFlagRequired("id") return createGwBgpCmd diff --git a/internal/interconnections/create.go b/internal/interconnections/create.go index 5ac5f82a..d3aa9fa9 100644 --- a/internal/interconnections/create.go +++ b/internal/interconnections/create.go @@ -44,8 +44,8 @@ func (c *Client) Create() *cobra.Command { in := metal.NewVlanFabricVcCreateInput( metro, name, redundancy, metal.VlanFabricVcCreateInputServiceTokenType(svcTokenType), metal.VlanFabricVcCreateInputType(connType), + vlans, ) - in.Vlans = vlans // default speed in.SetSpeed(strconv.Itoa(int(speed))) diff --git a/internal/projects/bgpenable.go b/internal/projects/bgpenable.go index 2ace032f..d553153a 100644 --- a/internal/projects/bgpenable.go +++ b/internal/projects/bgpenable.go @@ -47,7 +47,7 @@ func (c *Client) BGPEnable() *cobra.Command { func enableBGP(c *Client, config *BgpConfig) error { req := metal.BgpConfigRequestInput{ UseCase: &config.UseCase, - Asn: int32(config.ASN), + Asn: int64(config.ASN), DeploymentType: metal.BgpConfigRequestInputDeploymentType(config.DeploymentType), Md5: &config.MD5, } diff --git a/internal/virtualcircuit/create.go b/internal/virtualcircuit/create.go index c4d6fb01..65685e7d 100644 --- a/internal/virtualcircuit/create.go +++ b/internal/virtualcircuit/create.go @@ -113,7 +113,7 @@ func (c *Client) Create() *cobra.Command { if err != nil { return fmt.Errorf("%w", err) } - vrfInput := metal.NewVrfVirtualCircuitCreateInput(int32(nnVlan), int32(peerAsn), projectID, subnet, vrf) + vrfInput := metal.NewVrfVirtualCircuitCreateInput(int32(nnVlan), int64(peerAsn), projectID, subnet, vrf) setParams(vrfInput, name, description, tags) createInput = createVrfVirtualCircuit(vrfInput, projectID, customerIP, metalIP, md5, speed) } else { diff --git a/internal/virtualcircuit/update.go b/internal/virtualcircuit/update.go index f0c53d09..d5b75869 100644 --- a/internal/virtualcircuit/update.go +++ b/internal/virtualcircuit/update.go @@ -54,7 +54,7 @@ func updateVrfVirtualCircuit(vrfUpdateInput *metal.VrfVirtualCircuitUpdateInput, vrfUpdateInput.SetCustomerIp(customerIP) if peerAsn > 0 { - vrfUpdateInput.SetPeerAsn(int32(peerAsn)) + vrfUpdateInput.SetPeerAsn(int64(peerAsn)) } return metal.VirtualCircuitUpdateInput{VrfVirtualCircuitUpdateInput: vrfUpdateInput} diff --git a/internal/vrf/create.go b/internal/vrf/create.go index 7d8f8277..4291e108 100644 --- a/internal/vrf/create.go +++ b/internal/vrf/create.go @@ -17,7 +17,7 @@ func (c *Client) Create() *cobra.Command { name string description string ipRanges []string - localASN int32 + localASN int64 tags []string ) @@ -63,7 +63,7 @@ func (c *Client) Create() *cobra.Command { createVRFCmd.Flags().StringVarP(&description, "description", "d", "", "Description of the Virtual Routing and Forwarding.") createVRFCmd.Flags().StringVarP(&metro, "metro", "m", "", "The UUID (or metro code) for the Metro in which to create this Virtual Routing and Forwarding") - createVRFCmd.Flags().Int32VarP(&localASN, "local-asn", "a", 0, "Local ASN for the VRF") + createVRFCmd.Flags().Int64VarP(&localASN, "local-asn", "a", 0, "Local ASN for the VRF") createVRFCmd.Flags().StringSliceVarP(&ipRanges, "ipranges", "r", []string{}, "A list of CIDR network addresses. Like [10.0.0.0/16, 2001:d78::/56]. IPv4 blocks must be between /8 and /29 in size. IPv6 blocks must be between /56 and /64.") // making them all required here diff --git a/test/e2e/gateways/bgp-dynamic-neighbour/create_test.go b/test/e2e/gateways/bgp-dynamic-neighbour/create_test.go index 87a8520e..3de53ba8 100644 --- a/test/e2e/gateways/bgp-dynamic-neighbour/create_test.go +++ b/test/e2e/gateways/bgp-dynamic-neighbour/create_test.go @@ -23,7 +23,7 @@ func TestBgpDynamicNeighbors_Create(t *testing.T) { project := helper.CreateTestProject(t, projectName) vlan := helper.CreateTestVLAN(t, project.GetId(), "da") - vrf := helper.CreateTestVrfs(t, project.GetId(), "test-vrf-"+randomStr, vlan.GetVxlan()) + vrf := helper.CreateTestVrfs(t, project.GetId(), "test-vrf-"+randomStr, 65100) vrfIpRes := helper.CreateTestVrfIpRequest(t, project.GetId(), vrf.GetId()) gway := helper.CreateTestVrfGateway(t, project.GetId(), vrfIpRes.VrfIpReservation.GetId(), vlan.GetId()) diff --git a/test/e2e/gateways/bgp-dynamic-neighbour/delete_test.go b/test/e2e/gateways/bgp-dynamic-neighbour/delete_test.go index 4b1393d2..3972a70a 100644 --- a/test/e2e/gateways/bgp-dynamic-neighbour/delete_test.go +++ b/test/e2e/gateways/bgp-dynamic-neighbour/delete_test.go @@ -21,7 +21,7 @@ func TestBgpDynamicNeighbors_Delete(t *testing.T) { project := helper.CreateTestProject(t, projectName) vlan := helper.CreateTestVLAN(t, project.GetId(), "da") - vrf := helper.CreateTestVrfs(t, project.GetId(), "test-vrf-"+randomStr, vlan.GetVxlan()) + vrf := helper.CreateTestVrfs(t, project.GetId(), "test-vrf-"+randomStr, 65100) vrfIpRes := helper.CreateTestVrfIpRequest(t, project.GetId(), vrf.GetId()) gway := helper.CreateTestVrfGateway(t, project.GetId(), vrfIpRes.VrfIpReservation.GetId(), vlan.GetId()) bgpDynamicNeighbor := helper.CreateTestBgpDynamicNeighbor(t, gway.GetId(), gway.IpReservation.GetAddress(), 65000) diff --git a/test/e2e/gateways/bgp-dynamic-neighbour/get_test.go b/test/e2e/gateways/bgp-dynamic-neighbour/get_test.go index dfad27fe..670c1bb6 100644 --- a/test/e2e/gateways/bgp-dynamic-neighbour/get_test.go +++ b/test/e2e/gateways/bgp-dynamic-neighbour/get_test.go @@ -19,7 +19,7 @@ func TestBgpDynamicNeighbors_Get(t *testing.T) { project := helper.CreateTestProject(t, projectName) vlan := helper.CreateTestVLAN(t, project.GetId(), "da") - vrf := helper.CreateTestVrfs(t, project.GetId(), "test-vrf-"+randomStr, vlan.GetVxlan()) + vrf := helper.CreateTestVrfs(t, project.GetId(), "test-vrf-"+randomStr, 65100) vrfIpRes := helper.CreateTestVrfIpRequest(t, project.GetId(), vrf.GetId()) gway := helper.CreateTestVrfGateway(t, project.GetId(), vrfIpRes.VrfIpReservation.GetId(), vlan.GetId()) bgpDynamicNeighbor := helper.CreateTestBgpDynamicNeighbor(t, gway.GetId(), gway.IpReservation.GetAddress(), 65000) diff --git a/test/e2e/gateways/bgp-dynamic-neighbour/list_test.go b/test/e2e/gateways/bgp-dynamic-neighbour/list_test.go index 5e71d9e7..afe7cf9e 100644 --- a/test/e2e/gateways/bgp-dynamic-neighbour/list_test.go +++ b/test/e2e/gateways/bgp-dynamic-neighbour/list_test.go @@ -19,7 +19,7 @@ func TestBgpDynamicNeighbors_List(t *testing.T) { project := helper.CreateTestProject(t, projectName) vlan := helper.CreateTestVLAN(t, project.GetId(), "da") - vrf := helper.CreateTestVrfs(t, project.GetId(), "test-vrf-"+randomStr, vlan.GetVxlan()) + vrf := helper.CreateTestVrfs(t, project.GetId(), "test-vrf-"+randomStr, 65100) vrfIpRes := helper.CreateTestVrfIpRequest(t, project.GetId(), vrf.GetId()) gway := helper.CreateTestVrfGateway(t, project.GetId(), vrfIpRes.VrfIpReservation.GetId(), vlan.GetId()) bgpDynamicNeighbor := helper.CreateTestBgpDynamicNeighbor(t, gway.GetId(), gway.IpReservation.GetAddress(), 65000) diff --git a/test/helper/helper.go b/test/helper/helper.go index 8f757350..0e81dbc0 100644 --- a/test/helper/helper.go +++ b/test/helper/helper.go @@ -536,7 +536,7 @@ func CleanTestOrganization(t *testing.T, orgId string) { func CreateTestBgpEnableTest(projId string) error { TestApiClient := TestClient() - bgpConfigRequestInput := *metalv1.NewBgpConfigRequestInput(int32(65000), metalv1.BgpConfigRequestInputDeploymentType("local")) + bgpConfigRequestInput := *metalv1.NewBgpConfigRequestInput(65000, metalv1.BgpConfigRequestInputDeploymentType("local")) _, err := TestApiClient.BGPApi.RequestBgpConfig(context.Background(), projId).BgpConfigRequestInput(bgpConfigRequestInput).Execute() if err != nil { @@ -654,14 +654,14 @@ func waitForInterconnectionDeleted(apiClient *metalv1.APIClient, connId string, } //nolint:staticcheck -func CreateTestVrfs(t *testing.T, projectId, name string, vlan int32) *metalv1.Vrf { +func CreateTestVrfs(t *testing.T, projectId, name string, asn int64) *metalv1.Vrf { t.Helper() TestApiClient := TestClient() var IpRanges []string vrfCreateInput := *metalv1.NewVrfCreateInput("da", name) - vrfCreateInput.SetLocalAsn(vlan) + vrfCreateInput.SetLocalAsn(asn) IpRanges = append(IpRanges, "10.10.1.0/24") vrfCreateInput.SetIpRanges(IpRanges) @@ -791,7 +791,7 @@ func CleanTestVrfGateway(t *testing.T, gatewayId string) { } } -func CreateTestBgpDynamicNeighbor(t *testing.T, gatewayId, iprange string, asn int32) *metalv1.BgpDynamicNeighbor { +func CreateTestBgpDynamicNeighbor(t *testing.T, gatewayId, iprange string, asn int64) *metalv1.BgpDynamicNeighbor { TestApiClient := TestClient() t.Helper()