Skip to content

Commit

Permalink
sentinel/alert_rule - switching to use github.com/hashicorp/go-azure-…
Browse files Browse the repository at this point in the history
…sdk (#20680)
  • Loading branch information
mbfrahry authored Feb 28, 2023
1 parent f1331ed commit f888db8
Show file tree
Hide file tree
Showing 57 changed files with 2,532 additions and 1,023 deletions.
5 changes: 3 additions & 2 deletions internal/services/sentinel/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ package client

import (
alertruletemplates "github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/2021-09-01-preview/securityinsight" // nolint: staticcheck
"github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-10-01-preview/alertrules"
"github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-11-01/sentinelonboardingstates"
"github.com/hashicorp/terraform-provider-azurerm/internal/common"
securityinsight "github.com/tombuildsstuff/kermit/sdk/securityinsights/2022-10-01-preview/securityinsights"
)

type Client struct {
AlertRulesClient *securityinsight.AlertRulesClient
AlertRulesClient *alertrules.AlertRulesClient
AlertRuleTemplatesClient *alertruletemplates.AlertRuleTemplatesClient
AutomationRulesClient *securityinsight.AutomationRulesClient
DataConnectorsClient *securityinsight.DataConnectorsClient
Expand All @@ -18,7 +19,7 @@ type Client struct {
}

func NewClient(o *common.ClientOptions) *Client {
alertRulesClient := securityinsight.NewAlertRulesClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
alertRulesClient := alertrules.NewAlertRulesClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&alertRulesClient.Client, o.ResourceManagerAuthorizer)

alertRuleTemplatesClient := alertruletemplates.NewAlertRuleTemplatesClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
Expand Down
75 changes: 0 additions & 75 deletions internal/services/sentinel/parse/alert_rule.go

This file was deleted.

128 changes: 0 additions & 128 deletions internal/services/sentinel/parse/alert_rule_test.go

This file was deleted.

1 change: 0 additions & 1 deletion internal/services/sentinel/resourceids.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package sentinel

//go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=AlertRule -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.OperationalInsights/workspaces/workspace1/providers/Microsoft.SecurityInsights/alertRules/rule1
//go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=SentinelAlertRuleTemplate -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.OperationalInsights/workspaces/workspace1/providers/Microsoft.SecurityInsights/alertRuleTemplates/template1 -rewrite=true
//go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=DataConnector -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.OperationalInsights/workspaces/workspace1/providers/Microsoft.SecurityInsights/dataConnectors/dc1
//go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=AutomationRule -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.OperationalInsights/workspaces/workspace1/providers/Microsoft.SecurityInsights/automationRules/rule1 -rewrite=true
Expand Down
Loading

0 comments on commit f888db8

Please sign in to comment.