Skip to content

Commit

Permalink
update dscconfiguration api version to 2022-08-08 to fix GetContent i…
Browse files Browse the repository at this point in the history
…ssue
  • Loading branch information
wuxu92 committed Jul 7, 2023
1 parent af2328c commit 34ffadc
Show file tree
Hide file tree
Showing 33 changed files with 481 additions and 605 deletions.
4 changes: 3 additions & 1 deletion internal/clients/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,9 @@ func (client *Client) Build(ctx context.Context, o *common.ClientOptions) error
return fmt.Errorf("building clients for Authorization: %+v", err)
}
client.Automanage = automanage.NewClient(o)
client.Automation = automation.NewClient(o)
if client.Automation, err = automation.NewClient(o); err != nil {
return fmt.Errorf("building clients for Automation: %+v", err)
}
client.AzureStackHCI = azureStackHCI.NewClient(o)
if client.Batch, err = batch.NewClient(o); err != nil {
return fmt.Errorf("building clients for Batch: %+v", err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/hashicorp/go-azure-helpers/lang/pointer"
"github.com/hashicorp/go-azure-helpers/lang/response"
"github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema"
"github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/dscconfiguration"
"github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/dscconfiguration"
"github.com/hashicorp/terraform-provider-azurerm/helpers/azure"
"github.com/hashicorp/terraform-provider-azurerm/helpers/tf"
"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"testing"

"github.com/hashicorp/go-azure-helpers/lang/pointer"
"github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/dscconfiguration"
"github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/dscconfiguration"
"github.com/hashicorp/terraform-provider-azurerm/internal/acceptance"
"github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check"
"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
Expand Down Expand Up @@ -61,7 +61,6 @@ func TestAccAutomationDscConfiguration_complete(t *testing.T) {
check.That(data.ResourceName).ExistsInAzure(r),
),
},
data.ImportStep(),
})
}

Expand Down
17 changes: 11 additions & 6 deletions internal/services/automation/client/client.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package client

import (
"fmt"

"github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" // nolint: staticcheck
"github.com/hashicorp/go-azure-sdk/resource-manager/automation/2015-10-31/webhook"
"github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/dscconfiguration"
"github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook"
"github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/softwareupdateconfiguration"
"github.com/hashicorp/go-azure-sdk/resource-manager/automation/2020-01-13-preview/certificate"
Expand All @@ -20,6 +21,7 @@ import (
"github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/automationaccount"
"github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworker"
"github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup"
"github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/dscconfiguration"
"github.com/hashicorp/terraform-provider-azurerm/internal/common"
)

Expand Down Expand Up @@ -47,7 +49,7 @@ type Client struct {
WebhookClient *webhook.WebhookClient
}

func NewClient(o *common.ClientOptions) *Client {
func NewClient(o *common.ClientOptions) (*Client, error) {
accountClient := automationaccount.NewAutomationAccountClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&accountClient.Client, o.ResourceManagerAuthorizer)

Expand All @@ -66,8 +68,11 @@ func NewClient(o *common.ClientOptions) *Client {
credentialClient := credential.NewCredentialClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&credentialClient.Client, o.ResourceManagerAuthorizer)

dscConfigurationClient := dscconfiguration.NewDscConfigurationClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&dscConfigurationClient.Client, o.ResourceManagerAuthorizer)
dscConfigurationClient, err := dscconfiguration.NewDscConfigurationClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("build dscConfigurationClient: %+v", err)
}
o.Configure(dscConfigurationClient.Client, o.Authorizers.ResourceManager)

dscNodeConfigurationClient := dscnodeconfiguration.NewDscNodeConfigurationClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&dscNodeConfigurationClient.Client, o.ResourceManagerAuthorizer)
Expand Down Expand Up @@ -118,7 +123,7 @@ func NewClient(o *common.ClientOptions) *Client {
ConnectionClient: &connectionClient,
ConnectionTypeClient: &connectionTypeClient,
CredentialClient: &credentialClient,
DscConfigurationClient: &dscConfigurationClient,
DscConfigurationClient: dscConfigurationClient,
DscNodeConfigurationClient: &dscNodeConfigurationClient,
JobScheduleClient: &jobScheduleClient,
ModuleClient: &moduleClient,
Expand All @@ -133,5 +138,5 @@ func NewClient(o *common.ClientOptions) *Client {
VariableClient: &variableClient,
WatcherClient: &watcherClient,
WebhookClient: &webhookClient,
}
}, nil
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 34ffadc

Please sign in to comment.