Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated storage_pool #6663

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/9229.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:new-resource
`google_netapp_storage_pool`
```
5 changes: 5 additions & 0 deletions .teamcity/components/generated/services.kt
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,11 @@ var services = mapOf(
"displayName" to "Monitoring",
"path" to "./google-beta/services/monitoring"
),
"netapp" to mapOf(
"name" to "netapp",
"displayName" to "Netapp",
"path" to "./google-beta/services/netapp"
),
"networkconnectivity" to mapOf(
"name" to "networkconnectivity",
"displayName" to "Networkconnectivity",
Expand Down
1 change: 1 addition & 0 deletions google-beta/fwmodels/provider_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ type ProviderModel struct {
MigrationCenterCustomEndpoint types.String `tfsdk:"migration_center_custom_endpoint"`
MLEngineCustomEndpoint types.String `tfsdk:"ml_engine_custom_endpoint"`
MonitoringCustomEndpoint types.String `tfsdk:"monitoring_custom_endpoint"`
NetappCustomEndpoint types.String `tfsdk:"netapp_custom_endpoint"`
NetworkConnectivityCustomEndpoint types.String `tfsdk:"network_connectivity_custom_endpoint"`
NetworkManagementCustomEndpoint types.String `tfsdk:"network_management_custom_endpoint"`
NetworkSecurityCustomEndpoint types.String `tfsdk:"network_security_custom_endpoint"`
Expand Down
6 changes: 6 additions & 0 deletions google-beta/fwprovider/framework_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,12 @@ func (p *FrameworkProvider) Schema(_ context.Context, _ provider.SchemaRequest,
transport_tpg.CustomEndpointValidator(),
},
},
"netapp_custom_endpoint": &schema.StringAttribute{
Optional: true,
Validators: []validator.String{
transport_tpg.CustomEndpointValidator(),
},
},
"network_connectivity_custom_endpoint": &schema.StringAttribute{
Optional: true,
Validators: []validator.String{
Expand Down
10 changes: 10 additions & 0 deletions google-beta/fwtransport/framework_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ type FrameworkProviderConfig struct {
MigrationCenterBasePath string
MLEngineBasePath string
MonitoringBasePath string
NetappBasePath string
NetworkConnectivityBasePath string
NetworkManagementBasePath string
NetworkSecurityBasePath string
Expand Down Expand Up @@ -287,6 +288,7 @@ func (p *FrameworkProviderConfig) LoadAndValidateFramework(ctx context.Context,
p.MigrationCenterBasePath = data.MigrationCenterCustomEndpoint.ValueString()
p.MLEngineBasePath = data.MLEngineCustomEndpoint.ValueString()
p.MonitoringBasePath = data.MonitoringCustomEndpoint.ValueString()
p.NetappBasePath = data.NetappCustomEndpoint.ValueString()
p.NetworkConnectivityBasePath = data.NetworkConnectivityCustomEndpoint.ValueString()
p.NetworkManagementBasePath = data.NetworkManagementCustomEndpoint.ValueString()
p.NetworkSecurityBasePath = data.NetworkSecurityCustomEndpoint.ValueString()
Expand Down Expand Up @@ -1097,6 +1099,14 @@ func (p *FrameworkProviderConfig) HandleDefaults(ctx context.Context, data *fwmo
data.MonitoringCustomEndpoint = types.StringValue(customEndpoint.(string))
}
}
if data.NetappCustomEndpoint.IsNull() {
customEndpoint := transport_tpg.MultiEnvDefault([]string{
"GOOGLE_NETAPP_CUSTOM_ENDPOINT",
}, transport_tpg.DefaultBasePaths[transport_tpg.NetappBasePathKey])
if customEndpoint != nil {
data.NetappCustomEndpoint = types.StringValue(customEndpoint.(string))
}
}
if data.NetworkConnectivityCustomEndpoint.IsNull() {
customEndpoint := transport_tpg.MultiEnvDefault([]string{
"GOOGLE_NETWORK_CONNECTIVITY_CUSTOM_ENDPOINT",
Expand Down
6 changes: 6 additions & 0 deletions google-beta/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,11 @@ func Provider() *schema.Provider {
Optional: true,
ValidateFunc: transport_tpg.ValidateCustomEndpoint,
},
"netapp_custom_endpoint": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: transport_tpg.ValidateCustomEndpoint,
},
"network_connectivity_custom_endpoint": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -997,6 +1002,7 @@ func ProviderConfigure(ctx context.Context, d *schema.ResourceData, p *schema.Pr
config.MigrationCenterBasePath = d.Get("migration_center_custom_endpoint").(string)
config.MLEngineBasePath = d.Get("ml_engine_custom_endpoint").(string)
config.MonitoringBasePath = d.Get("monitoring_custom_endpoint").(string)
config.NetappBasePath = d.Get("netapp_custom_endpoint").(string)
config.NetworkConnectivityBasePath = d.Get("network_connectivity_custom_endpoint").(string)
config.NetworkManagementBasePath = d.Get("network_management_custom_endpoint").(string)
config.NetworkSecurityBasePath = d.Get("network_security_custom_endpoint").(string)
Expand Down
6 changes: 4 additions & 2 deletions google-beta/provider/provider_mmv1_resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ import (
"github.com/hashicorp/terraform-provider-google-beta/google-beta/services/migrationcenter"
"github.com/hashicorp/terraform-provider-google-beta/google-beta/services/mlengine"
"github.com/hashicorp/terraform-provider-google-beta/google-beta/services/monitoring"
"github.com/hashicorp/terraform-provider-google-beta/google-beta/services/netapp"
"github.com/hashicorp/terraform-provider-google-beta/google-beta/services/networkconnectivity"
"github.com/hashicorp/terraform-provider-google-beta/google-beta/services/networkmanagement"
"github.com/hashicorp/terraform-provider-google-beta/google-beta/services/networksecurity"
Expand Down Expand Up @@ -401,9 +402,9 @@ var handwrittenIAMDatasources = map[string]*schema.Resource{
}

// Resources
// Generated resources: 397
// Generated resources: 398
// Generated IAM resources: 246
// Total generated resources: 643
// Total generated resources: 644
var generatedResources = map[string]*schema.Resource{
"google_folder_access_approval_settings": accessapproval.ResourceAccessApprovalFolderSettings(),
"google_organization_access_approval_settings": accessapproval.ResourceAccessApprovalOrganizationSettings(),
Expand Down Expand Up @@ -893,6 +894,7 @@ var generatedResources = map[string]*schema.Resource{
"google_monitoring_custom_service": monitoring.ResourceMonitoringService(),
"google_monitoring_slo": monitoring.ResourceMonitoringSlo(),
"google_monitoring_uptime_check_config": monitoring.ResourceMonitoringUptimeCheckConfig(),
"google_netapp_storage_pool": netapp.ResourceNetappstoragePool(),
"google_network_connectivity_policy_based_route": networkconnectivity.ResourceNetworkConnectivityPolicyBasedRoute(),
"google_network_connectivity_service_connection_policy": networkconnectivity.ResourceNetworkConnectivityServiceConnectionPolicy(),
"google_network_management_connectivity_test": networkmanagement.ResourceNetworkManagementConnectivityTest(),
Expand Down
92 changes: 92 additions & 0 deletions google-beta/services/netapp/netapp_operation.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

// ----------------------------------------------------------------------------
//
// *** AUTO GENERATED CODE *** Type: MMv1 ***
//
// ----------------------------------------------------------------------------
//
// This file is automatically generated by Magic Modules and manual
// changes will be clobbered when the file is regenerated.
//
// Please read more about how to change this file in
// .github/CONTRIBUTING.md.
//
// ----------------------------------------------------------------------------

package netapp

import (
"encoding/json"
"errors"
"fmt"
"time"

"github.com/hashicorp/terraform-provider-google-beta/google-beta/tpgresource"
transport_tpg "github.com/hashicorp/terraform-provider-google-beta/google-beta/transport"
)

type NetappOperationWaiter struct {
Config *transport_tpg.Config
UserAgent string
Project string
tpgresource.CommonOperationWaiter
}

func (w *NetappOperationWaiter) QueryOp() (interface{}, error) {
if w == nil {
return nil, fmt.Errorf("Cannot query operation, it's unset or nil.")
}
// Returns the proper get.
url := fmt.Sprintf("%s%s", w.Config.NetappBasePath, w.CommonOperationWaiter.Op.Name)

return transport_tpg.SendRequest(transport_tpg.SendRequestOptions{
Config: w.Config,
Method: "GET",
Project: w.Project,
RawURL: url,
UserAgent: w.UserAgent,
})
}

func createNetappWaiter(config *transport_tpg.Config, op map[string]interface{}, project, activity, userAgent string) (*NetappOperationWaiter, error) {
w := &NetappOperationWaiter{
Config: config,
UserAgent: userAgent,
Project: project,
}
if err := w.CommonOperationWaiter.SetOp(op); err != nil {
return nil, err
}
return w, nil
}

// nolint: deadcode,unused
func NetappOperationWaitTimeWithResponse(config *transport_tpg.Config, op map[string]interface{}, response *map[string]interface{}, project, activity, userAgent string, timeout time.Duration) error {
w, err := createNetappWaiter(config, op, project, activity, userAgent)
if err != nil {
return err
}
if err := tpgresource.OperationWait(w, activity, timeout, config.PollInterval); err != nil {
return err
}
rawResponse := []byte(w.CommonOperationWaiter.Op.Response)
if len(rawResponse) == 0 {
return errors.New("`resource` not set in operation response")
}
return json.Unmarshal(rawResponse, response)
}

func NetappOperationWaitTime(config *transport_tpg.Config, op map[string]interface{}, project, activity, userAgent string, timeout time.Duration) error {
if val, ok := op["name"]; !ok || val == "" {
// This was a synchronous call - there is no operation to wait for.
return nil
}
w, err := createNetappWaiter(config, op, project, activity, userAgent)
if err != nil {
// If w is nil, the op was synchronous.
return err
}
return tpgresource.OperationWait(w, activity, timeout, config.PollInterval)
}
Loading