Skip to content

Commit

Permalink
dependencies: updating to v0.20240315.1103122 of `github.com/hashic…
Browse files Browse the repository at this point in the history
…orp/go-azure-sdk` (#25166)

* update go-azure-sdk to v0.20240306.1111727

* update go-azure-sdk to v0.20240306.1111727

* update go-azure-sdk to v0.20240313.1132601

* update go-azure-sdk to v0.20240315.1103122

* go mod vendor
  • Loading branch information
catriona-m committed Mar 15, 2024
1 parent eddb603 commit 17fb688
Show file tree
Hide file tree
Showing 555 changed files with 18,918 additions and 20,911 deletions.
4 changes: 2 additions & 2 deletions go.mod
Expand Up @@ -17,8 +17,8 @@ require (
github.com/google/go-cmp v0.5.9
github.com/google/uuid v1.4.0
github.com/hashicorp/go-azure-helpers v0.66.2
github.com/hashicorp/go-azure-sdk/resource-manager v0.20240229.1102109
github.com/hashicorp/go-azure-sdk/sdk v0.20240314.1083835
github.com/hashicorp/go-azure-sdk/resource-manager v0.20240315.1103122
github.com/hashicorp/go-azure-sdk/sdk v0.20240315.1103122
github.com/hashicorp/go-hclog v1.5.0
github.com/hashicorp/go-multierror v1.1.1
github.com/hashicorp/go-uuid v1.0.3
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Expand Up @@ -95,10 +95,10 @@ github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/go-azure-helpers v0.66.2 h1:+Pzuo7pdKl0hBXXr5ymmhs4Q40tHAo2nAvHq4WgSjx8=
github.com/hashicorp/go-azure-helpers v0.66.2/go.mod h1:kJxXrFtJKJdOEqvad8pllAe7dhP4DbN8J6sqFZe47+4=
github.com/hashicorp/go-azure-sdk/resource-manager v0.20240229.1102109 h1:3e4ceMmTqM2upGPdGlEynSqx1tLbQ8qzRVdzVllxp0U=
github.com/hashicorp/go-azure-sdk/resource-manager v0.20240229.1102109/go.mod h1:SnoGTze4MqMaUcNRZVtWGXlUcP5lOd7bTR1IBwToJNQ=
github.com/hashicorp/go-azure-sdk/sdk v0.20240314.1083835 h1:KDewpfRBRnLGd0p6K9XYNQbv9syNFiek3hOPBxt3Gj4=
github.com/hashicorp/go-azure-sdk/sdk v0.20240314.1083835/go.mod h1:POOjeoqNp+mvlLBuibJTziUAkBZ7FxXGeGestwemL/w=
github.com/hashicorp/go-azure-sdk/resource-manager v0.20240315.1103122 h1:cBuhqUvm59V6Na2GvC2WhuW2exShMy7mlYfJq5RdiKo=
github.com/hashicorp/go-azure-sdk/resource-manager v0.20240315.1103122/go.mod h1:Bqyftfx+hmU/CAUixSsO6JG8iAnYZfZCsTplJxWVkVE=
github.com/hashicorp/go-azure-sdk/sdk v0.20240315.1103122 h1:Ufy2m3h4a0kAiVHzffpuqLEYNFiE+rFbTfOPXd6m7YI=
github.com/hashicorp/go-azure-sdk/sdk v0.20240315.1103122/go.mod h1:POOjeoqNp+mvlLBuibJTziUAkBZ7FxXGeGestwemL/w=
github.com/hashicorp/go-checkpoint v0.5.0 h1:MFYpPZCnQqQTE18jFwSII6eUQrD/oxMFp3mlgcqk5mU=
github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuDrwkBuEQsVcpCOgg=
github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
Expand Down
36 changes: 24 additions & 12 deletions internal/services/cosmos/client/client.go
Expand Up @@ -42,8 +42,11 @@ func NewClient(o *common.ClientOptions) (*Client, error) {
cassandraClient := documentdb.NewCassandraResourcesClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
o.ConfigureClient(&cassandraClient.Client, o.ResourceManagerAuthorizer)

managedCassandraClient := managedcassandras.NewManagedCassandrasClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&managedCassandraClient.Client, o.ResourceManagerAuthorizer)
managedCassandraClient, err := managedcassandras.NewManagedCassandrasClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("building Managed Cassandra client: %+v", err)
}
o.Configure(managedCassandraClient.Client, o.Authorizers.ResourceManager)

clustersClient, err := clusters.NewClustersClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
Expand All @@ -57,8 +60,11 @@ func NewClient(o *common.ClientOptions) (*Client, error) {
}
o.Configure(configurationsClient.Client, o.Authorizers.ResourceManager)

cosmosdbClient := cosmosdb.NewCosmosDBClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&cosmosdbClient.Client, o.ResourceManagerAuthorizer)
cosmosdbClient, err := cosmosdb.NewCosmosDBClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("building CosmosDB client: %+v", err)
}
o.Configure(cosmosdbClient.Client, o.Authorizers.ResourceManager)

databaseClient := documentdb.NewDatabaseAccountsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
o.ConfigureClient(&databaseClient.Client, o.ResourceManagerAuthorizer)
Expand All @@ -75,8 +81,11 @@ func NewClient(o *common.ClientOptions) (*Client, error) {
mongoDbClient := documentdb.NewMongoDBResourcesClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
o.ConfigureClient(&mongoDbClient.Client, o.ResourceManagerAuthorizer)

mongorbacsClient := mongorbacs.NewMongorbacsClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&mongorbacsClient.Client, o.ResourceManagerAuthorizer)
mongorbacsClient, err := mongorbacs.NewMongorbacsClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("building Mongorbacs client: %+v", err)
}
o.Configure(mongorbacsClient.Client, o.Authorizers.ResourceManager)

notebookWorkspaceClient := documentdb.NewNotebookWorkspacesClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
o.ConfigureClient(&notebookWorkspaceClient.Client, o.ResourceManagerAuthorizer)
Expand All @@ -90,8 +99,11 @@ func NewClient(o *common.ClientOptions) (*Client, error) {
}
o.Configure(rolesClient.Client, o.Authorizers.ResourceManager)

sqlDedicatedGatewayClient := sqldedicatedgateway.NewSqlDedicatedGatewayClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&sqlDedicatedGatewayClient.Client, o.ResourceManagerAuthorizer)
sqlDedicatedGatewayClient, err := sqldedicatedgateway.NewSqlDedicatedGatewayClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("building Sql Dedicated Gateway client: %+v", err)
}
o.Configure(sqlDedicatedGatewayClient.Client, o.Authorizers.ResourceManager)

sqlClient := documentdb.NewSQLResourcesClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
o.ConfigureClient(&sqlClient.Client, o.ResourceManagerAuthorizer)
Expand All @@ -104,19 +116,19 @@ func NewClient(o *common.ClientOptions) (*Client, error) {

return &Client{
CassandraClient: &cassandraClient,
ManagedCassandraClient: &managedCassandraClient,
ManagedCassandraClient: managedCassandraClient,
ClustersClient: clustersClient,
ConfigurationsClient: configurationsClient,
CosmosDBClient: &cosmosdbClient,
CosmosDBClient: cosmosdbClient,
DatabaseClient: &databaseClient,
FirewallRulesClient: firewallRulesClient,
GremlinClient: &gremlinClient,
MongoDbClient: &mongoDbClient,
MongoRBACClient: &mongorbacsClient,
MongoRBACClient: mongorbacsClient,
NotebookWorkspaceClient: &notebookWorkspaceClient,
RestorableDatabaseAccountsClient: &restorableDatabaseAccountsClient,
RolesClient: rolesClient,
SqlDedicatedGatewayClient: &sqlDedicatedGatewayClient,
SqlDedicatedGatewayClient: sqlDedicatedGatewayClient,
SqlClient: &sqlClient,
SqlResourceClient: &sqlResourceClient,
TableClient: &tableClient,
Expand Down
10 changes: 2 additions & 8 deletions internal/services/cosmos/cosmosdb_cassandra_cluster_resource.go
Expand Up @@ -347,15 +347,9 @@ func resourceCassandraClusterDelete(d *pluginsdk.ResourceData, meta interface{})
return err
}

future, err := client.CassandraClustersDelete(ctx, *id)
err = client.CassandraClustersDeleteThenPoll(ctx, *id)
if err != nil {
if !response.WasNotFound(future.HttpResponse) {
return fmt.Errorf("deleting %q: %+v", id, err)
}
}

if err := future.Poller.PollUntilDone(); err != nil {
return fmt.Errorf("waiting on delete future for %q: %+v", id, err)
return fmt.Errorf("deleting %q: %+v", id, err)
}

return nil
Expand Down
12 changes: 3 additions & 9 deletions internal/services/cosmos/cosmosdb_gremlin_database_resource.go
Expand Up @@ -160,7 +160,7 @@ func resourceCosmosGremlinDatabaseUpdate(d *pluginsdk.ResourceData, meta interfa
}
}

if err := throughputFuture.Poller.PollUntilDone(); err != nil {
if err := throughputFuture.Poller.PollUntilDone(ctx); err != nil {
return fmt.Errorf("waiting on ThroughputUpdate future for Cosmos Gremlin Database %q (Account: %q, Database %q): %+v", id.GremlinDatabaseName, id.DatabaseAccountName, id.GremlinDatabaseName, err)
}
}
Expand Down Expand Up @@ -236,15 +236,9 @@ func resourceCosmosGremlinDatabaseDelete(d *pluginsdk.ResourceData, meta interfa
return err
}

future, err := client.GremlinResourcesDeleteGremlinDatabase(ctx, *id)
err = client.GremlinResourcesDeleteGremlinDatabaseThenPoll(ctx, *id)
if err != nil {
if !response.WasNotFound(future.HttpResponse) {
return fmt.Errorf("deleting Cosmos Gremlin Database %q (Account: %q): %+v", id.GremlinDatabaseName, id.DatabaseAccountName, err)
}
}

if err := future.Poller.PollUntilDone(); err != nil {
return fmt.Errorf("waiting on delete future for Cosmos Gremlin Database %q (Account: %q): %+v", id.GremlinDatabaseName, id.DatabaseAccountName, err)
return fmt.Errorf("deleting Cosmos Gremlin Database %q (Account: %q): %+v", id.GremlinDatabaseName, id.DatabaseAccountName, err)
}

return nil
Expand Down
31 changes: 10 additions & 21 deletions internal/services/cosmos/cosmosdb_gremlin_graph_resource.go
Expand Up @@ -218,7 +218,7 @@ func resourceCosmosDbGremlinGraphCreate(d *pluginsdk.ResourceData, meta interfac
Properties: cosmosdb.GremlinGraphCreateUpdateProperties{
Resource: cosmosdb.GremlinGraphResource{
Id: id.GraphName,
IndexingPolicy: expandAzureRmCosmosDbGrelinGraphIndexingPolicy(d),
IndexingPolicy: expandAzureRmCosmosDbGremlinGraphIndexingPolicy(d),
ConflictResolutionPolicy: common.ExpandCosmosDbConflicResolutionPolicy(d.Get("conflict_resolution_policy").([]interface{})),
},
Options: &cosmosdb.CreateUpdateOptions{},
Expand Down Expand Up @@ -293,7 +293,7 @@ func resourceCosmosDbGremlinGraphUpdate(d *pluginsdk.ResourceData, meta interfac
Properties: cosmosdb.GremlinGraphCreateUpdateProperties{
Resource: cosmosdb.GremlinGraphResource{
Id: id.GraphName,
IndexingPolicy: expandAzureRmCosmosDbGrelinGraphIndexingPolicy(d),
IndexingPolicy: expandAzureRmCosmosDbGremlinGraphIndexingPolicy(d),
},
Options: &cosmosdb.CreateUpdateOptions{},
},
Expand Down Expand Up @@ -332,17 +332,12 @@ func resourceCosmosDbGremlinGraphUpdate(d *pluginsdk.ResourceData, meta interfac

if common.HasThroughputChange(d) {
throughputParameters := common.ExpandCosmosDBThroughputSettingsUpdateParameters(d)
throughputFuture, err := client.GremlinResourcesUpdateGremlinGraphThroughput(ctx, *id, *throughputParameters)
err = client.GremlinResourcesUpdateGremlinGraphThroughputThenPoll(ctx, *id, *throughputParameters)
if err != nil {
if response.WasNotFound(throughputFuture.HttpResponse) {
return fmt.Errorf("setting Throughput for Cosmos Gremlin Graph %q (Account: %q, Database: %q): %+v - "+
"If the graph has not been created with an initial throughput, you cannot configure it later", id.GraphName, id.DatabaseAccountName, id.GremlinDatabaseName, err)
}
return fmt.Errorf("setting Throughput for Cosmos Gremlin Graph %q (Account: %q, Database: %q): %+v - "+
"If the graph has not been created with an initial throughput, you cannot configure it later", id.GraphName, id.DatabaseAccountName, id.GremlinDatabaseName, err)
}

if err := throughputFuture.Poller.PollUntilDone(); err != nil {
return fmt.Errorf("waiting on ThroughputUpdate future for Cosmos Gremlin Graph %q (Account: %q, Database: %q): %+v", id.GraphName, id.DatabaseAccountName, id.GremlinDatabaseName, err)
}
}

return resourceCosmosDbGremlinGraphRead(d, meta)
Expand Down Expand Up @@ -454,21 +449,15 @@ func resourceCosmosDbGremlinGraphDelete(d *pluginsdk.ResourceData, meta interfac
return err
}

future, err := client.GremlinResourcesDeleteGremlinGraph(ctx, *id)
err = client.GremlinResourcesDeleteGremlinGraphThenPoll(ctx, *id)
if err != nil {
if !response.WasNotFound(future.HttpResponse) {
return fmt.Errorf("deleting Cosmos Gremlin Graph %q (Account: %q): %+v", id.GremlinDatabaseName, id.GraphName, err)
}
}

if err := future.Poller.PollUntilDone(); err != nil {
return fmt.Errorf("waiting on delete future for Comos Gremlin Graph %q (Account: %q): %+v", id.GremlinDatabaseName, id.DatabaseAccountName, err)
return fmt.Errorf("deleting Cosmos Gremlin Graph %q (Account: %q): %+v", id.GremlinDatabaseName, id.GraphName, err)
}

return nil
}

func expandAzureRmCosmosDbGrelinGraphIndexingPolicy(d *pluginsdk.ResourceData) *cosmosdb.IndexingPolicy {
func expandAzureRmCosmosDbGremlinGraphIndexingPolicy(d *pluginsdk.ResourceData) *cosmosdb.IndexingPolicy {
i := d.Get("index_policy").([]interface{})
if len(i) == 0 || i[0] == nil {
return nil
Expand All @@ -478,7 +467,7 @@ func expandAzureRmCosmosDbGrelinGraphIndexingPolicy(d *pluginsdk.ResourceData) *
indexingPolicy := cosmosdb.IndexingMode(strings.ToLower(input["indexing_mode"].(string)))
policy := &cosmosdb.IndexingPolicy{
IndexingMode: &indexingPolicy,
IncludedPaths: expandAzureRmCosmosDbGrelimGraphIncludedPath(input),
IncludedPaths: expandAzureRmCosmosDbGremlinGraphIncludedPath(input),
ExcludedPaths: expandAzureRmCosmosDbGremlinGraphExcludedPath(input),
}
if v, ok := input["composite_index"].([]interface{}); ok {
Expand All @@ -494,7 +483,7 @@ func expandAzureRmCosmosDbGrelinGraphIndexingPolicy(d *pluginsdk.ResourceData) *
return policy
}

func expandAzureRmCosmosDbGrelimGraphIncludedPath(input map[string]interface{}) *[]cosmosdb.IncludedPath {
func expandAzureRmCosmosDbGremlinGraphIncludedPath(input map[string]interface{}) *[]cosmosdb.IncludedPath {
includedPath := input["included_paths"].(*pluginsdk.Set).List()
paths := make([]cosmosdb.IncludedPath, len(includedPath))

Expand Down
19 changes: 4 additions & 15 deletions internal/services/cosmos/cosmosdb_sql_container_resource.go
Expand Up @@ -288,16 +288,11 @@ func resourceCosmosDbSQLContainerUpdate(d *pluginsdk.ResourceData, meta interfac

if common.HasThroughputChange(d) {
throughputParameters := common.ExpandCosmosDBThroughputSettingsUpdateParameters(d)
throughputFuture, err := client.SqlResourcesUpdateSqlContainerThroughput(ctx, *id, *throughputParameters)
err := client.SqlResourcesUpdateSqlContainerThroughputThenPoll(ctx, *id, *throughputParameters)
if err != nil {
if response.WasNotFound(throughputFuture.HttpResponse) {
return fmt.Errorf("setting Throughput for Cosmos SQL Container %q (Account: %q, Database: %q): %+v - "+
"If the collection has not been created with an initial throughput, you cannot configure it later", id.ContainerName, id.DatabaseAccountName, id.SqlDatabaseName, err)
}
}
return fmt.Errorf("setting Throughput for Cosmos SQL Container %q (Account: %q, Database: %q): %+v - "+
"If the collection has not been created with an initial throughput, you cannot configure it later", id.ContainerName, id.DatabaseAccountName, id.SqlDatabaseName, err)

if err := throughputFuture.Poller.PollUntilDone(); err != nil {
return fmt.Errorf("waiting on ThroughputUpdate future for Cosmos Container %q (Account: %q, Database: %q): %+v", id.ContainerName, id.DatabaseAccountName, id.SqlDatabaseName, err)
}
}

Expand Down Expand Up @@ -409,17 +404,11 @@ func resourceCosmosDbSQLContainerDelete(d *pluginsdk.ResourceData, meta interfac
return err
}

future, err := client.SqlResourcesDeleteSqlContainer(ctx, *id)
err = client.SqlResourcesDeleteSqlContainerThenPoll(ctx, *id)
if err != nil {
return fmt.Errorf("deleting Cosmos SQL Container %q (Account: %q): %+v", id.SqlDatabaseName, id.ContainerName, err)
}

if err := future.Poller.PollUntilDone(); err != nil {
if !response.WasNotFound(future.HttpResponse) {
return fmt.Errorf("deleting Cosmos SQL Container %q (Account: %q): %+v", id.SqlDatabaseName, id.ContainerName, err)
}
}

return nil
}

Expand Down

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

0 comments on commit 17fb688

Please sign in to comment.