Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new resource group name iotas; #61

Merged
merged 2 commits into from
Jul 20, 2023
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
68 changes: 54 additions & 14 deletions apstra/two_stage_l3_clos_resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,27 @@ const (
ResourceGroupNameAccessAsn
ResourceGroupNameSuperspineIp4
ResourceGroupNameSpineIp4
ResourceGroupNameSpineIp6
ResourceGroupNameLeafIp4
ResourceGroupNameLeafIp6
ResourceGroupNameAccessIp4
ResourceGroupNameSuperspineSpineIp4
ResourceGroupNameSuperspineSpineIp6
ResourceGroupNameSpineLeafIp4
ResourceGroupNameSpineLeafIp6
ResourceGroupNameAccessAccessIp4
ResourceGroupNameLeafLeafIp4
ResourceGroupNameLeafL3PeerLinkLinkIps
ResourceGroupNameLeafL3PeerLinkLinkIp4
ResourceGroupNameLeafL3PeerLinkLinkIp6
ResourceGroupNameMlagDomainIp4
ResourceGroupNameMlagDomainIp6
ResourceGroupNameVtepIp4
ResourceGroupNameEvpnL3Vni
ResourceGroupNameVirtualNetworkSviIpv4
ResourceGroupNameVirtualNetworkSviIpv6
ResourceGroupNameVxlanVnIds
ResourceGroupNameToGenericLinkIps
ResourceGroupNameToGenericLinkIpv4
ResourceGroupNameToGenericLinkIpv6
ResourceGroupNameUnknown = "unknown group name %q"

resourceGroupNameNone = resourceGroupName("")
Expand All @@ -67,22 +72,27 @@ const (
resourceGroupNameAccessAsn = resourceGroupName("access_asns")
resourceGroupNameSuperspineIp4 = resourceGroupName("superspine_loopback_ips")
resourceGroupNameSpineIp4 = resourceGroupName("spine_loopback_ips")
resourceGroupNameSpineIp6 = resourceGroupName("spine_loopback_ips_ipv6")
resourceGroupNameLeafIp4 = resourceGroupName("leaf_loopback_ips")
resourceGroupNameLeafIp6 = resourceGroupName("leaf_loopback_ips_ipv6")
resourceGroupNameAccessIp4 = resourceGroupName("access_loopback_ips")
resourceGroupNameSuperspineSpineIp4 = resourceGroupName("spine_superspine_link_ips")
resourceGroupNameSuperspineSpineIp6 = resourceGroupName("ipv6_spine_superspine_link_ips")
resourceGroupNameSpineLeafIp4 = resourceGroupName("spine_leaf_link_ips")
resourceGroupNameSpineLeafIp6 = resourceGroupName("ipv6_spine_leaf_link_ips")
resourceGroupNameLeafLeafIp4 = resourceGroupName("leaf_leaf_link_ips")
resourceGroupNameLeafL3PeerLinkLinkIps = resourceGroupName("leaf_l3_peer_link_link_ips")
resourceGroupNameLeafL3PeerLinkLinkIp4 = resourceGroupName("leaf_l3_peer_link_link_ips")
resourceGroupNameLeafL3PeerLinkLinkIp6 = resourceGroupName("ipv6_leaf_l3_peer_link_link_ips")
resourceGroupNameMlagDomainSviIp4 = resourceGroupName("mlag_domain_svi_subnets")
resourceGroupNameMlagDomainSviIp6 = resourceGroupName("mlag_domain_svi_subnets_ipv6")
resourceGroupNameAccessAccessIp4 = resourceGroupName("access_l3_peer_link_link_ips")
resourceGroupNameVtepIp4 = resourceGroupName("vtep_ips")
resourceGroupNameEvpnL3Vni = resourceGroupName("evpn_l3_vnis")
resourceGroupNameVirtualNetworkSviIpv4 = resourceGroupName("virtual_network_svi_subnets")
resourceGroupNameVirtualNetworkSviIpv6 = resourceGroupName("virtual_network_svi_subnets_ipv6")
resourceGroupNameVxlanVnIds = resourceGroupName("vxlan_vn_ids")
resourceGroupNameToGenericLinkIps = resourceGroupName("to_generic_link_ips")
resourceGroupNameToGenericLinkIpv4 = resourceGroupName("to_generic_link_ips")
resourceGroupNameToGenericLinkIpv6 = resourceGroupName("ipv6_to_generic_link_ips")
resourceGroupNameUnknown = "group name %d unknown"
)

Expand Down Expand Up @@ -119,8 +129,12 @@ func (o *ResourceGroupName) Type() ResourceType {
return ResourceTypeIp4Pool
case ResourceGroupNameSpineIp4:
return ResourceTypeIp4Pool
case ResourceGroupNameSpineIp6:
return ResourceTypeIp6Pool
case ResourceGroupNameLeafIp4:
return ResourceTypeIp4Pool
case ResourceGroupNameLeafIp6:
return ResourceTypeIp6Pool
case ResourceGroupNameAccessIp4:
return ResourceTypeIp4Pool
case ResourceGroupNameSuperspineSpineIp4:
Expand All @@ -135,12 +149,18 @@ func (o *ResourceGroupName) Type() ResourceType {
return ResourceTypeIp4Pool
case ResourceGroupNameLeafLeafIp4:
return ResourceTypeIp4Pool
case ResourceGroupNameLeafL3PeerLinkLinkIps:
case ResourceGroupNameLeafL3PeerLinkLinkIp4:
return ResourceTypeIp4Pool
case ResourceGroupNameLeafL3PeerLinkLinkIp6:
return ResourceTypeIp6Pool
case ResourceGroupNameMlagDomainIp4:
return ResourceTypeIp4Pool
case ResourceGroupNameToGenericLinkIps:
case ResourceGroupNameMlagDomainIp6:
return ResourceTypeIp6Pool
case ResourceGroupNameToGenericLinkIpv4:
return ResourceTypeIp4Pool
case ResourceGroupNameToGenericLinkIpv6:
return ResourceTypeIp6Pool
case ResourceGroupNameVtepIp4:
return ResourceTypeIp4Pool
case ResourceGroupNameEvpnL3Vni:
Expand Down Expand Up @@ -187,8 +207,12 @@ func (o ResourceGroupName) raw() resourceGroupName {
return resourceGroupNameSuperspineIp4
case ResourceGroupNameSpineIp4:
return resourceGroupNameSpineIp4
case ResourceGroupNameSpineIp6:
return resourceGroupNameSpineIp6
case ResourceGroupNameLeafIp4:
return resourceGroupNameLeafIp4
case ResourceGroupNameLeafIp6:
return resourceGroupNameLeafIp6
case ResourceGroupNameAccessIp4:
return resourceGroupNameAccessIp4
case ResourceGroupNameSuperspineSpineIp4:
Expand All @@ -203,10 +227,14 @@ func (o ResourceGroupName) raw() resourceGroupName {
return resourceGroupNameAccessAccessIp4
case ResourceGroupNameLeafLeafIp4:
return resourceGroupNameLeafLeafIp4
case ResourceGroupNameLeafL3PeerLinkLinkIps:
return resourceGroupNameLeafL3PeerLinkLinkIps
case ResourceGroupNameLeafL3PeerLinkLinkIp4:
return resourceGroupNameLeafL3PeerLinkLinkIp4
case ResourceGroupNameLeafL3PeerLinkLinkIp6:
return resourceGroupNameLeafL3PeerLinkLinkIp6
case ResourceGroupNameMlagDomainIp4:
return resourceGroupNameMlagDomainSviIp4
case ResourceGroupNameMlagDomainIp6:
return resourceGroupNameMlagDomainSviIp6
case ResourceGroupNameVtepIp4:
return resourceGroupNameVtepIp4
case ResourceGroupNameEvpnL3Vni:
Expand All @@ -217,8 +245,10 @@ func (o ResourceGroupName) raw() resourceGroupName {
return resourceGroupNameVirtualNetworkSviIpv6
case ResourceGroupNameVxlanVnIds:
return resourceGroupNameVxlanVnIds
case ResourceGroupNameToGenericLinkIps:
return resourceGroupNameToGenericLinkIps
case ResourceGroupNameToGenericLinkIpv4:
return resourceGroupNameToGenericLinkIpv4
case ResourceGroupNameToGenericLinkIpv6:
return resourceGroupNameToGenericLinkIpv6
default:
return resourceGroupName(fmt.Sprintf(resourceGroupNameUnknown, o))
}
Expand All @@ -242,8 +272,12 @@ func (o resourceGroupName) parse() (int, error) {
return int(ResourceGroupNameSuperspineIp4), nil
case resourceGroupNameSpineIp4:
return int(ResourceGroupNameSpineIp4), nil
case resourceGroupNameSpineIp6:
return int(ResourceGroupNameSpineIp6), nil
case resourceGroupNameLeafIp4:
return int(ResourceGroupNameLeafIp4), nil
case resourceGroupNameLeafIp6:
return int(ResourceGroupNameLeafIp6), nil
case resourceGroupNameAccessIp4:
return int(ResourceGroupNameAccessIp4), nil
case resourceGroupNameSuperspineSpineIp4:
Expand All @@ -258,10 +292,14 @@ func (o resourceGroupName) parse() (int, error) {
return int(ResourceGroupNameAccessAccessIp4), nil
case resourceGroupNameLeafLeafIp4:
return int(ResourceGroupNameLeafLeafIp4), nil
case resourceGroupNameLeafL3PeerLinkLinkIps:
return int(ResourceGroupNameLeafL3PeerLinkLinkIps), nil
case resourceGroupNameLeafL3PeerLinkLinkIp4:
return int(ResourceGroupNameLeafL3PeerLinkLinkIp4), nil
case resourceGroupNameLeafL3PeerLinkLinkIp6:
return int(ResourceGroupNameLeafL3PeerLinkLinkIp6), nil
case resourceGroupNameMlagDomainSviIp4:
return int(ResourceGroupNameMlagDomainIp4), nil
case resourceGroupNameMlagDomainSviIp6:
return int(ResourceGroupNameMlagDomainIp6), nil
case resourceGroupNameVtepIp4:
return int(ResourceGroupNameVtepIp4), nil
case resourceGroupNameEvpnL3Vni:
Expand All @@ -272,8 +310,10 @@ func (o resourceGroupName) parse() (int, error) {
return int(ResourceGroupNameVirtualNetworkSviIpv6), nil
case resourceGroupNameVxlanVnIds:
return int(ResourceGroupNameVxlanVnIds), nil
case resourceGroupNameToGenericLinkIps:
return int(ResourceGroupNameToGenericLinkIps), nil
case resourceGroupNameToGenericLinkIpv4:
return int(ResourceGroupNameToGenericLinkIpv4), nil
case resourceGroupNameToGenericLinkIpv6:
return int(ResourceGroupNameToGenericLinkIpv6), nil
default:
return 0, fmt.Errorf(ResourceGroupNameUnknown, o)
}
Expand Down
9 changes: 7 additions & 2 deletions apstra/two_stage_l3_clos_resources_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,22 +143,27 @@ func TestTwoStageL3ClosResourceStrings(t *testing.T) {
{stringVal: "access_asns", intType: ResourceGroupNameAccessAsn, stringType: resourceGroupNameAccessAsn},
{stringVal: "superspine_loopback_ips", intType: ResourceGroupNameSuperspineIp4, stringType: resourceGroupNameSuperspineIp4},
{stringVal: "spine_loopback_ips", intType: ResourceGroupNameSpineIp4, stringType: resourceGroupNameSpineIp4},
{stringVal: "spine_loopback_ips_ipv6", intType: ResourceGroupNameSpineIp6, stringType: resourceGroupNameSpineIp6},
{stringVal: "leaf_loopback_ips", intType: ResourceGroupNameLeafIp4, stringType: resourceGroupNameLeafIp4},
{stringVal: "leaf_loopback_ips_ipv6", intType: ResourceGroupNameLeafIp6, stringType: resourceGroupNameLeafIp6},
{stringVal: "access_loopback_ips", intType: ResourceGroupNameAccessIp4, stringType: resourceGroupNameAccessIp4},
{stringVal: "spine_superspine_link_ips", intType: ResourceGroupNameSuperspineSpineIp4, stringType: resourceGroupNameSuperspineSpineIp4},
{stringVal: "ipv6_spine_superspine_link_ips", intType: ResourceGroupNameSuperspineSpineIp6, stringType: resourceGroupNameSuperspineSpineIp6},
{stringVal: "spine_leaf_link_ips", intType: ResourceGroupNameSpineLeafIp4, stringType: resourceGroupNameSpineLeafIp4},
{stringVal: "ipv6_spine_leaf_link_ips", intType: ResourceGroupNameSpineLeafIp6, stringType: resourceGroupNameSpineLeafIp6},
{stringVal: "access_l3_peer_link_link_ips", intType: ResourceGroupNameAccessAccessIp4, stringType: resourceGroupNameAccessAccessIp4},
{stringVal: "leaf_leaf_link_ips", intType: ResourceGroupNameLeafLeafIp4, stringType: resourceGroupNameLeafLeafIp4},
{stringVal: "leaf_l3_peer_link_link_ips", intType: ResourceGroupNameLeafL3PeerLinkLinkIps, stringType: resourceGroupNameLeafL3PeerLinkLinkIps},
{stringVal: "leaf_l3_peer_link_link_ips", intType: ResourceGroupNameLeafL3PeerLinkLinkIp4, stringType: resourceGroupNameLeafL3PeerLinkLinkIp4},
{stringVal: "ipv6_leaf_l3_peer_link_link_ips", intType: ResourceGroupNameLeafL3PeerLinkLinkIp6, stringType: resourceGroupNameLeafL3PeerLinkLinkIp6},
{stringVal: "mlag_domain_svi_subnets", intType: ResourceGroupNameMlagDomainIp4, stringType: resourceGroupNameMlagDomainSviIp4},
{stringVal: "mlag_domain_svi_subnets_ipv6", intType: ResourceGroupNameMlagDomainIp6, stringType: resourceGroupNameMlagDomainSviIp6},
{stringVal: "vtep_ips", intType: ResourceGroupNameVtepIp4, stringType: resourceGroupNameVtepIp4},
{stringVal: "evpn_l3_vnis", intType: ResourceGroupNameEvpnL3Vni, stringType: resourceGroupNameEvpnL3Vni},
{stringVal: "virtual_network_svi_subnets", intType: ResourceGroupNameVirtualNetworkSviIpv4, stringType: resourceGroupNameVirtualNetworkSviIpv4},
{stringVal: "virtual_network_svi_subnets_ipv6", intType: ResourceGroupNameVirtualNetworkSviIpv6, stringType: resourceGroupNameVirtualNetworkSviIpv6},
{stringVal: "vxlan_vn_ids", intType: ResourceGroupNameVxlanVnIds, stringType: resourceGroupNameVxlanVnIds},
{stringVal: "to_generic_link_ips", intType: ResourceGroupNameToGenericLinkIps, stringType: resourceGroupNameToGenericLinkIps},
{stringVal: "to_generic_link_ips", intType: ResourceGroupNameToGenericLinkIpv4, stringType: resourceGroupNameToGenericLinkIpv4},
{stringVal: "ipv6_to_generic_link_ips", intType: ResourceGroupNameToGenericLinkIpv6, stringType: resourceGroupNameToGenericLinkIpv6},
}

for i, td := range testData {
Expand Down