From 2e9ca914d941231a8cec6d021a6e35ae834dce0e Mon Sep 17 00:00:00 2001 From: Chris Marget Date: Thu, 27 Jun 2024 19:15:42 -0400 Subject: [PATCH 1/2] add `generic_loopback_ips` and `generic_loopback_ips_ipv6` to iota --- apstra/two_stage_l3_clos_resources.go | 16 ++++++++++++++++ apstra/two_stage_l3_clos_resources_test.go | 2 ++ 2 files changed, 18 insertions(+) diff --git a/apstra/two_stage_l3_clos_resources.go b/apstra/two_stage_l3_clos_resources.go index 02120727..8d1701db 100644 --- a/apstra/two_stage_l3_clos_resources.go +++ b/apstra/two_stage_l3_clos_resources.go @@ -48,6 +48,8 @@ const ( ResourceGroupNameLeafIp4 ResourceGroupNameLeafIp6 ResourceGroupNameAccessIp4 + ResourceGroupNameGenericIp4 + ResourceGroupNameGenericIp6 ResourceGroupNameSuperspineSpineIp4 ResourceGroupNameSuperspineSpineIp6 ResourceGroupNameSpineLeafIp4 @@ -80,6 +82,8 @@ const ( resourceGroupNameLeafIp4 = resourceGroupName("leaf_loopback_ips") resourceGroupNameLeafIp6 = resourceGroupName("leaf_loopback_ips_ipv6") resourceGroupNameAccessIp4 = resourceGroupName("access_loopback_ips") + resourceGroupNameGenericIp4 = resourceGroupName("generic_loopback_ips") + resourceGroupNameGenericIp6 = resourceGroupName("generic_loopback_ips_ipv6") resourceGroupNameSuperspineSpineIp4 = resourceGroupName("spine_superspine_link_ips") resourceGroupNameSuperspineSpineIp6 = resourceGroupName("ipv6_spine_superspine_link_ips") resourceGroupNameSpineLeafIp4 = resourceGroupName("spine_leaf_link_ips") @@ -145,6 +149,10 @@ func (o *ResourceGroupName) Type() ResourceType { return ResourceTypeIp6Pool case ResourceGroupNameAccessIp4: return ResourceTypeIp4Pool + case ResourceGroupNameGenericIp4: + return ResourceTypeIp4Pool + case ResourceGroupNameGenericIp6: + return ResourceTypeIp6Pool case ResourceGroupNameSuperspineSpineIp4: return ResourceTypeIp4Pool case ResourceGroupNameSuperspineSpineIp6: @@ -227,6 +235,10 @@ func (o ResourceGroupName) raw() resourceGroupName { return resourceGroupNameLeafIp6 case ResourceGroupNameAccessIp4: return resourceGroupNameAccessIp4 + case ResourceGroupNameGenericIp4: + return resourceGroupNameGenericIp4 + case ResourceGroupNameGenericIp6: + return resourceGroupNameGenericIp6 case ResourceGroupNameSuperspineSpineIp4: return resourceGroupNameSuperspineSpineIp4 case ResourceGroupNameSuperspineSpineIp6: @@ -296,6 +308,10 @@ func (o resourceGroupName) parse() (int, error) { return int(ResourceGroupNameLeafIp6), nil case resourceGroupNameAccessIp4: return int(ResourceGroupNameAccessIp4), nil + case resourceGroupNameGenericIp4: + return int(ResourceGroupNameGenericIp4), nil + case resourceGroupNameGenericIp6: + return int(ResourceGroupNameGenericIp6), nil case resourceGroupNameSuperspineSpineIp4: return int(ResourceGroupNameSuperspineSpineIp4), nil case resourceGroupNameSuperspineSpineIp6: diff --git a/apstra/two_stage_l3_clos_resources_test.go b/apstra/two_stage_l3_clos_resources_test.go index ab4ccde6..d21c6c61 100644 --- a/apstra/two_stage_l3_clos_resources_test.go +++ b/apstra/two_stage_l3_clos_resources_test.go @@ -145,6 +145,8 @@ func TestTwoStageL3ClosResourceStrings(t *testing.T) { {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: "generic_loopback_ips", intType: ResourceGroupNameGenericIp4, stringType: resourceGroupNameGenericIp4}, + {stringVal: "generic_loopback_ips_ipv6", intType: ResourceGroupNameGenericIp6, stringType: resourceGroupNameGenericIp6}, {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}, From e6a9f88427c968b875e26436f053b1398ea0d3e1 Mon Sep 17 00:00:00 2001 From: Chris Marget Date: Thu, 27 Jun 2024 19:18:42 -0400 Subject: [PATCH 2/2] update expected iota count in test function --- apstra/two_stage_l3_clos_resources_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apstra/two_stage_l3_clos_resources_test.go b/apstra/two_stage_l3_clos_resources_test.go index d21c6c61..b5a5d708 100644 --- a/apstra/two_stage_l3_clos_resources_test.go +++ b/apstra/two_stage_l3_clos_resources_test.go @@ -95,7 +95,7 @@ func TestSetGetResourceAllocation(t *testing.T) { func TestAllResourceGroupNames(t *testing.T) { all := AllResourceGroupNames() - expected := 30 + expected := 32 if len(all) != expected { t.Fatalf("expected %d resource group names, got %d", expected, len(all)) }