Skip to content

Commit

Permalink
sdk: migrating over to the renamed security sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
tombuildsstuff committed Apr 3, 2019
1 parent 0c55517 commit 6c7b47a
Show file tree
Hide file tree
Showing 26 changed files with 12,198 additions and 11 deletions.
2 changes: 1 addition & 1 deletion azurerm/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import (
"github.com/Azure/azure-sdk-for-go/services/preview/operationalinsights/mgmt/2015-11-01-preview/operationalinsights"
"github.com/Azure/azure-sdk-for-go/services/preview/operationsmanagement/mgmt/2015-11-01-preview/operationsmanagement"
"github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2018-03-01-preview/managementgroups"
"github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/2017-08-01-preview/security"
"github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security"
"github.com/Azure/azure-sdk-for-go/services/preview/signalr/mgmt/2018-03-01-preview/signalr"
"github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2015-05-01-preview/sql"
MsSql "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-10-01-preview/sql"
Expand Down
2 changes: 1 addition & 1 deletion azurerm/resource_arm_security_center_contact.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf"

"github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/2017-08-01-preview/security"
"github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security"
"github.com/hashicorp/terraform/helper/schema"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils"
Expand Down
8 changes: 4 additions & 4 deletions azurerm/resource_arm_security_center_subscription_pricing.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"log"

"github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/2017-08-01-preview/security"
"github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/helper/validation"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils"
Expand Down Expand Up @@ -53,11 +53,11 @@ func resourceArmSecurityCenterSubscriptionPricingUpdate(d *schema.ResourceData,
},
}

if _, err := client.UpdateSubscriptionPricing(ctx, name, pricing); err != nil {
if _, err := client.Update(ctx, name, pricing); err != nil {
return fmt.Errorf("Error creating/updating Security Center Subscription pricing: %+v", err)
}

resp, err := client.GetSubscriptionPricing(ctx, name)
resp, err := client.Get(ctx, name)
if err != nil {
return fmt.Errorf("Error reading Security Center Subscription pricing: %+v", err)
}
Expand All @@ -74,7 +74,7 @@ func resourceArmSecurityCenterSubscriptionPricingRead(d *schema.ResourceData, me
client := meta.(*ArmClient).securityCenterPricingClient
ctx := meta.(*ArmClient).StopContext

resp, err := client.GetSubscriptionPricing(ctx, securityCenterSubscriptionPricingName)
resp, err := client.Get(ctx, securityCenterSubscriptionPricingName)
if err != nil {
if utils.ResponseWasNotFound(resp.Response) {
log.Printf("[DEBUG] Security Center Subscription was not found: %v", err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func testCheckAzureRMSecurityCenterSubscriptionPricingExists(resourceName string

pricingName := rs.Primary.Attributes["pricings"]

resp, err := client.GetSubscriptionPricing(ctx, pricingName)
resp, err := client.Get(ctx, pricingName)
if err != nil {
if utils.ResponseWasNotFound(resp.Response) {
return fmt.Errorf("Security Center Subscription Pricing %q was not found: %+v", pricingName, err)
Expand Down
7 changes: 3 additions & 4 deletions azurerm/resource_arm_security_center_workspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ import (
"log"
"time"

"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf"

"github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/2017-08-01-preview/security"
"github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/helper/schema"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils"
)
Expand Down Expand Up @@ -68,7 +67,7 @@ func resourceArmSecurityCenterWorkspaceCreateUpdate(d *schema.ResourceData, meta

//get pricing tier, workspace can only be configured when tier is not Free.
//API does not error, it just doesn't set the workspace scope
price, err := priceClient.GetSubscriptionPricing(ctx, securityCenterSubscriptionPricingName)
price, err := priceClient.Get(ctx, securityCenterSubscriptionPricingName)
if err != nil {
return fmt.Errorf("Error reading Security Center Subscription pricing: %+v", err)
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6c7b47a

Please sign in to comment.