Skip to content

Commit

Permalink
Merge pull request #280 from Juniper/feat/279-generic-system-loopbacks
Browse files Browse the repository at this point in the history
Add `generic_loopback_ips` and `generic_loopback_ips_ipv6` to existing iota
  • Loading branch information
chrismarget-j authored Jun 28, 2024
2 parents a481617 + e6a9f88 commit b6bb6c1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
16 changes: 16 additions & 0 deletions apstra/two_stage_l3_clos_resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ const (
ResourceGroupNameLeafIp4
ResourceGroupNameLeafIp6
ResourceGroupNameAccessIp4
ResourceGroupNameGenericIp4
ResourceGroupNameGenericIp6
ResourceGroupNameSuperspineSpineIp4
ResourceGroupNameSuperspineSpineIp6
ResourceGroupNameSpineLeafIp4
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 3 additions & 1 deletion apstra/two_stage_l3_clos_resources_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down Expand Up @@ -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},
Expand Down

0 comments on commit b6bb6c1

Please sign in to comment.