Skip to content

Commit

Permalink
Merge pull request #995 from Juniper/bug/994-disable-dashboard-and-wi…
Browse files Browse the repository at this point in the history
…dget-code

disable widget and dashboard code
  • Loading branch information
rajagopalans authored Dec 15, 2024
2 parents f8744fb + 3a81b08 commit 4513764
Show file tree
Hide file tree
Showing 20 changed files with 53 additions and 445 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions apstra/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -516,9 +516,9 @@ func (p *Provider) DataSources(_ context.Context) []func() datasource.DataSource
func() datasource.DataSource { return &dataSourceBlueprintAnomalies{} },
func() datasource.DataSource { return &dataSourceBlueprintDeploy{} },
func() datasource.DataSource { return &dataSourceBlueprintIbaPredefinedProbe{} },
func() datasource.DataSource { return &dataSourceBlueprintIbaWidget{} },
func() datasource.DataSource { return &dataSourceBlueprintIbaWidgets{} },
func() datasource.DataSource { return &dataSourceBlueprintIbaDashboard{} },
// func() datasource.DataSource { return &dataSourceBlueprintIbaWidget{} },
// func() datasource.DataSource { return &dataSourceBlueprintIbaWidgets{} },
// func() datasource.DataSource { return &dataSourceBlueprintIbaDashboard{} },
func() datasource.DataSource { return &dataSourceBlueprintIbaDashboards{} },
func() datasource.DataSource { return &dataSourceBlueprintNodeConfig{} },
func() datasource.DataSource { return &dataSourceBlueprints{} },
Expand Down Expand Up @@ -598,9 +598,9 @@ func (p *Provider) Resources(_ context.Context) []func() resource.Resource {
func() resource.Resource { return &resourceAgentProfile{} },
func() resource.Resource { return &resourceAsnPool{} },
func() resource.Resource { return &resourceBlueprintDeploy{} },
func() resource.Resource { return &resourceBlueprintIbaDashboard{} },
// func() resource.Resource { return &resourceBlueprintIbaDashboard{} },
func() resource.Resource { return &resourceBlueprintIbaProbe{} },
func() resource.Resource { return &resourceBlueprintIbaWidget{} },
// func() resource.Resource { return &resourceBlueprintIbaWidget{} },
func() resource.Resource { return &resourceConfiglet{} },
func() resource.Resource { return &resourceDatacenterBlueprint{} },
func() resource.Resource { return &resourceDatacenterConfiglet{} },
Expand Down
File renamed without changes.
File renamed without changes.
89 changes: 44 additions & 45 deletions apstra/test_utils/blueprint_configlet.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"testing"

"github.com/Juniper/apstra-go-sdk/apstra"
"github.com/Juniper/apstra-go-sdk/apstra/enum"
"github.com/Juniper/terraform-provider-apstra/apstra/utils"
"github.com/stretchr/testify/require"
)
Expand Down Expand Up @@ -52,47 +51,47 @@ func BlueprintConfigletA(t testing.TB, ctx context.Context, client *apstra.TwoSt

// TestWidgetsAB instantiates two predefined probes and creates widgets from them,
// returning the widget Object Id and the IbaWidgetData object used for creation
func TestWidgetsAB(t testing.TB, ctx context.Context, bpClient *apstra.TwoStageL3ClosClient) (apstra.ObjectId, apstra.IbaWidgetData, apstra.ObjectId, apstra.IbaWidgetData) {
probeAId, err := bpClient.InstantiateIbaPredefinedProbe(ctx, &apstra.IbaPredefinedProbeRequest{
Name: "bgp_session",
Data: []byte(`{
"Label": "BGP Session Flapping",
"Duration": 300,
"Threshold": 40
}`),
})
require.NoError(t, err)
t.Cleanup(func() { require.NoError(t, bpClient.DeleteIbaProbe(ctx, probeAId)) })

probeBId, err := bpClient.InstantiateIbaPredefinedProbe(ctx, &apstra.IbaPredefinedProbeRequest{
Name: "drain_node_traffic_anomaly",
Data: []byte(`{
"Label": "Drain Traffic Anomaly",
"Threshold": 100000
}`),
})
require.NoError(t, err)
t.Cleanup(func() { require.NoError(t, bpClient.DeleteIbaProbe(ctx, probeBId)) })

widgetA := apstra.IbaWidgetData{
Type: enum.IbaWidgetTypeStage,
Label: "BGP Session Flapping",
ProbeId: probeAId,
StageName: "BGP Session",
}
widgetAId, err := bpClient.CreateIbaWidget(ctx, &widgetA)
require.NoError(t, err)
t.Cleanup(func() { require.NoError(t, bpClient.DeleteIbaWidget(ctx, widgetAId)) })

widgetB := apstra.IbaWidgetData{
Type: enum.IbaWidgetTypeStage,
Label: "Drain Traffic Anomaly",
ProbeId: probeBId,
StageName: "excess_range",
}
widgetBId, err := bpClient.CreateIbaWidget(ctx, &widgetB)
require.NoError(t, err)
t.Cleanup(func() { require.NoError(t, bpClient.DeleteIbaWidget(ctx, widgetBId)) })

return widgetAId, widgetA, widgetBId, widgetB
}
//func TestWidgetsAB(t testing.TB, ctx context.Context, bpClient *apstra.TwoStageL3ClosClient) (apstra.ObjectId, apstra.IbaWidgetData, apstra.ObjectId, apstra.IbaWidgetData) {
// probeAId, err := bpClient.InstantiateIbaPredefinedProbe(ctx, &apstra.IbaPredefinedProbeRequest{
// Name: "bgp_session",
// Data: []byte(`{
// "Label": "BGP Session Flapping",
// "Duration": 300,
// "Threshold": 40
// }`),
// })
// require.NoError(t, err)
// t.Cleanup(func() { require.NoError(t, bpClient.DeleteIbaProbe(ctx, probeAId)) })
//
// probeBId, err := bpClient.InstantiateIbaPredefinedProbe(ctx, &apstra.IbaPredefinedProbeRequest{
// Name: "drain_node_traffic_anomaly",
// Data: []byte(`{
// "Label": "Drain Traffic Anomaly",
// "Threshold": 100000
// }`),
// })
// require.NoError(t, err)
// t.Cleanup(func() { require.NoError(t, bpClient.DeleteIbaProbe(ctx, probeBId)) })
//
// widgetA := apstra.IbaWidgetData{
// Type: enum.IbaWidgetTypeStage,
// Label: "BGP Session Flapping",
// ProbeId: probeAId,
// StageName: "BGP Session",
// }
// widgetAId, err := bpClient.CreateIbaWidget(ctx, &widgetA)
// require.NoError(t, err)
// t.Cleanup(func() { require.NoError(t, bpClient.DeleteIbaWidget(ctx, widgetAId)) })
//
// widgetB := apstra.IbaWidgetData{
// Type: enum.IbaWidgetTypeStage,
// Label: "Drain Traffic Anomaly",
// ProbeId: probeBId,
// StageName: "excess_range",
// }
// widgetBId, err := bpClient.CreateIbaWidget(ctx, &widgetB)
// require.NoError(t, err)
// t.Cleanup(func() { require.NoError(t, bpClient.DeleteIbaWidget(ctx, widgetBId)) })
//
// return widgetAId, widgetA, widgetBId, widgetB
//}
76 changes: 0 additions & 76 deletions docs/data-sources/blueprint_iba_dashboard.md

This file was deleted.

61 changes: 0 additions & 61 deletions docs/data-sources/blueprint_iba_widget.md

This file was deleted.

62 changes: 0 additions & 62 deletions docs/data-sources/blueprint_iba_widgets.md

This file was deleted.

Loading

0 comments on commit 4513764

Please sign in to comment.