diff --git a/apstra/api_design_templates.go b/apstra/api_design_templates.go index 37ce7554..8e4c373a 100644 --- a/apstra/api_design_templates.go +++ b/apstra/api_design_templates.go @@ -518,27 +518,19 @@ type RackBasedTemplateCount struct { } type Spine struct { - Count int - ExternalLinkSpeed LogicalDevicePortSpeed - LinkPerSuperspineSpeed LogicalDevicePortSpeed - LogicalDevice LogicalDeviceData - LinkPerSuperspineCount int - Tags []DesignTagData - ExternalLinksPerNode int - ExternalFacingNodeCount int - ExternalLinkCount int + Count int + LinkPerSuperspineSpeed LogicalDevicePortSpeed + LogicalDevice LogicalDeviceData + LinkPerSuperspineCount int + Tags []DesignTagData } type TemplateElementSpineRequest struct { - Count int - ExternalLinkSpeed LogicalDevicePortSpeed - LinkPerSuperspineSpeed LogicalDevicePortSpeed - LogicalDevice ObjectId - LinkPerSuperspineCount int - Tags []ObjectId - ExternalLinksPerNode int - ExternalFacingNodeCount int - ExternalLinkCount int + Count int + LinkPerSuperspineSpeed LogicalDevicePortSpeed + LogicalDevice ObjectId + LinkPerSuperspineCount int + Tags []ObjectId } func (o *TemplateElementSpineRequest) raw(ctx context.Context, client *Client) (*rawSpine, error) { @@ -557,38 +549,25 @@ func (o *TemplateElementSpineRequest) raw(ctx context.Context, client *Client) ( } return &rawSpine{ - Count: o.Count, - ExternalLinkSpeed: o.ExternalLinkSpeed.raw(), - LinkPerSuperspineSpeed: o.LinkPerSuperspineSpeed.raw(), - LogicalDevice: *logicalDevice, - LinkPerSuperspineCount: o.LinkPerSuperspineCount, - Tags: tags, - ExternalLinksPerNode: o.ExternalLinksPerNode, - ExternalFacingNodeCount: o.ExternalFacingNodeCount, - ExternalLinkCount: o.ExternalLinkCount, + Count: o.Count, + LinkPerSuperspineSpeed: o.LinkPerSuperspineSpeed.raw(), + LogicalDevice: *logicalDevice, + LinkPerSuperspineCount: o.LinkPerSuperspineCount, + Tags: tags, }, nil } type rawSpine struct { - Count int `json:"count"` - ExternalLinkSpeed *rawLogicalDevicePortSpeed `json:"external_link_speed,omitempty"` - LinkPerSuperspineSpeed *rawLogicalDevicePortSpeed `json:"link_per_superspine_speed"` - LogicalDevice rawLogicalDevice `json:"logical_device"` - LinkPerSuperspineCount int `json:"link_per_superspine_count"` - Tags []DesignTagData `json:"tags"` - ExternalLinksPerNode int `json:"external_links_per_node,omitempty"` - ExternalFacingNodeCount int `json:"external_facing_node_count,omitempty"` - ExternalLinkCount int `json:"external_link_count,omitempty"` + Count int `json:"count"` + LinkPerSuperspineSpeed *rawLogicalDevicePortSpeed `json:"link_per_superspine_speed"` + LogicalDevice rawLogicalDevice `json:"logical_device"` + LinkPerSuperspineCount int `json:"link_per_superspine_count"` + Tags []DesignTagData `json:"tags"` } func (o rawSpine) polish() (*Spine, error) { ld, err := o.LogicalDevice.polish() - var externalLinkSpeed LogicalDevicePortSpeed - if o.ExternalLinkSpeed != nil { - externalLinkSpeed = o.ExternalLinkSpeed.parse() - } - var linkPerSuperspineSpeed LogicalDevicePortSpeed if o.LinkPerSuperspineSpeed != nil { linkPerSuperspineSpeed = o.LinkPerSuperspineSpeed.parse() @@ -596,24 +575,18 @@ func (o rawSpine) polish() (*Spine, error) { return &Spine{ Count: o.Count, - ExternalLinkSpeed: externalLinkSpeed, LinkPerSuperspineSpeed: linkPerSuperspineSpeed, LogicalDevice: LogicalDeviceData{ DisplayName: ld.Data.DisplayName, Panels: ld.Data.Panels, }, - LinkPerSuperspineCount: o.LinkPerSuperspineCount, - Tags: o.Tags, - ExternalLinksPerNode: o.ExternalLinksPerNode, - ExternalFacingNodeCount: o.ExternalFacingNodeCount, - ExternalLinkCount: o.ExternalLinkCount, + LinkPerSuperspineCount: o.LinkPerSuperspineCount, + Tags: o.Tags, }, err } type Superspine struct { PlaneCount int - ExternalLinkCount int - ExternalLinkSpeed LogicalDevicePortSpeed Tags []DesignTagData SuperspinePerPlane int LogicalDevice LogicalDeviceData @@ -621,8 +594,6 @@ type Superspine struct { type TemplateElementSuperspineRequest struct { PlaneCount int - ExternalLinkCount int - ExternalLinkSpeed LogicalDevicePortSpeed Tags []ObjectId SuperspinePerPlane int LogicalDeviceId ObjectId @@ -645,8 +616,6 @@ func (o *TemplateElementSuperspineRequest) raw(ctx context.Context, client *Clie return &rawSuperspine{ PlaneCount: o.PlaneCount, - ExternalLinkCount: o.ExternalLinkCount, - ExternalLinkSpeed: o.ExternalLinkSpeed.raw(), Tags: tags, SuperspinePerPlane: o.SuperspinePerPlane, LogicalDevice: *logicalDevice, @@ -654,12 +623,10 @@ func (o *TemplateElementSuperspineRequest) raw(ctx context.Context, client *Clie } type rawSuperspine struct { - PlaneCount int `json:"plane_count"` - ExternalLinkCount int `json:"external_link_count"` - ExternalLinkSpeed *rawLogicalDevicePortSpeed `json:"external_link_speed"` - Tags []DesignTagData `json:"tags"` - SuperspinePerPlane int `json:"superspine_per_plane"` - LogicalDevice rawLogicalDevice `json:"logical_device"` + PlaneCount int `json:"plane_count"` + Tags []DesignTagData `json:"tags"` + SuperspinePerPlane int `json:"superspine_per_plane"` + LogicalDevice rawLogicalDevice `json:"logical_device"` } func (o rawSuperspine) polish() (*Superspine, error) { @@ -667,14 +634,8 @@ func (o rawSuperspine) polish() (*Superspine, error) { if err != nil { return nil, err } - var externalLinkSpeed LogicalDevicePortSpeed - if o.ExternalLinkSpeed != nil { - externalLinkSpeed = o.ExternalLinkSpeed.parse() - } return &Superspine{ PlaneCount: o.PlaneCount, - ExternalLinkCount: o.ExternalLinkCount, - ExternalLinkSpeed: externalLinkSpeed, Tags: o.Tags, SuperspinePerPlane: o.SuperspinePerPlane, LogicalDevice: LogicalDeviceData{ diff --git a/apstra/api_design_templates_test.go b/apstra/api_design_templates_test.go index b0aa40b8..8da7e1f3 100644 --- a/apstra/api_design_templates_test.go +++ b/apstra/api_design_templates_test.go @@ -523,15 +523,11 @@ func TestCreateGetDeleteRackBasedTemplate(t *testing.T) { DisplayName: dn, Capability: TemplateCapabilityBlueprint, Spine: &TemplateElementSpineRequest{ - Count: 2, - ExternalLinkSpeed: "10G", - LinkPerSuperspineSpeed: "10G", - LogicalDevice: "AOS-7x10-Spine", - LinkPerSuperspineCount: 1, - Tags: []ObjectId{"firewall", "hypervisor"}, - ExternalLinksPerNode: 0, - ExternalFacingNodeCount: 0, - ExternalLinkCount: 0, + Count: 2, + LinkPerSuperspineSpeed: "10G", + LogicalDevice: "AOS-7x10-Spine", + LinkPerSuperspineCount: 1, + Tags: []ObjectId{"firewall", "hypervisor"}, }, RackInfos: map[ObjectId]TemplateRackBasedRackInfo{ "access_switch": { @@ -582,14 +578,11 @@ func TestCreateGetDeletePodBasedTemplate(t *testing.T) { DisplayName: rbtdn, Capability: TemplateCapabilityBlueprint, Spine: &TemplateElementSpineRequest{ - Count: 2, - LinkPerSuperspineSpeed: "10G", - LogicalDevice: "AOS-7x10-Spine", - LinkPerSuperspineCount: 1, - Tags: nil, - ExternalLinksPerNode: 0, - ExternalFacingNodeCount: 0, - ExternalLinkCount: 0, + Count: 2, + LinkPerSuperspineSpeed: "10G", + LogicalDevice: "AOS-7x10-Spine", + LinkPerSuperspineCount: 1, + Tags: nil, }, RackInfos: map[ObjectId]TemplateRackBasedRackInfo{ "access_switch": { @@ -616,8 +609,6 @@ func TestCreateGetDeletePodBasedTemplate(t *testing.T) { Capability: TemplateCapabilityPod, Superspine: &TemplateElementSuperspineRequest{ PlaneCount: 1, - ExternalLinkCount: 0, - ExternalLinkSpeed: "10G", Tags: nil, SuperspinePerPlane: 4, LogicalDeviceId: "AOS-4x40_8x10-1", diff --git a/apstra/helpers_test.go b/apstra/helpers_test.go index c2b56df9..b3ba7858 100644 --- a/apstra/helpers_test.go +++ b/apstra/helpers_test.go @@ -595,14 +595,10 @@ func testTemplateB(ctx context.Context, t *testing.T, client *Client) (ObjectId, DisplayName: rbt.Data.DisplayName, Capability: rbt.Data.Capability, Spine: &TemplateElementSpineRequest{ - Count: rbt.Data.Spine.Count, - ExternalLinkSpeed: rbt.Data.Spine.ExternalLinkSpeed, - LinkPerSuperspineSpeed: rbt.Data.Spine.LinkPerSuperspineSpeed, - LogicalDevice: "AOS-7x10-Spine", - LinkPerSuperspineCount: rbt.Data.Spine.LinkPerSuperspineCount, - ExternalLinksPerNode: rbt.Data.Spine.ExternalLinksPerNode, - ExternalFacingNodeCount: rbt.Data.Spine.ExternalFacingNodeCount, - ExternalLinkCount: rbt.Data.Spine.ExternalLinkCount, + Count: rbt.Data.Spine.Count, + LinkPerSuperspineSpeed: rbt.Data.Spine.LinkPerSuperspineSpeed, + LogicalDevice: "AOS-7x10-Spine", + LinkPerSuperspineCount: rbt.Data.Spine.LinkPerSuperspineCount, }, RackInfos: rbt.Data.RackInfo, DhcpServiceIntent: &rbt.Data.DhcpServiceIntent,