From ad0df9912f7b0ab5415d0ce46e5edf07e10b52a1 Mon Sep 17 00:00:00 2001 From: Paulo Date: Fri, 8 Jul 2022 16:06:13 -0700 Subject: [PATCH 01/83] WIP --- internal/services/netapp/client/client.go | 6 + .../netapp/netapp_volume_group_resource.go | 395 ++++++++++++++++++ internal/services/netapp/registration.go | 4 - 3 files changed, 401 insertions(+), 4 deletions(-) create mode 100644 internal/services/netapp/netapp_volume_group_resource.go diff --git a/internal/services/netapp/client/client.go b/internal/services/netapp/client/client.go index 8ff393abbfa9..6bc48e8f2b12 100644 --- a/internal/services/netapp/client/client.go +++ b/internal/services/netapp/client/client.go @@ -5,6 +5,7 @@ import ( "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts" "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy" "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups" "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes" "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication" "github.com/hashicorp/terraform-provider-azurerm/internal/common" @@ -14,6 +15,7 @@ type Client struct { AccountClient *netappaccounts.NetAppAccountsClient PoolClient *capacitypools.CapacityPoolsClient VolumeClient *volumes.VolumesClient + VolumeGroupClient *volumegroups.VolumeGroupsClient VolumeReplicationClient *volumesreplication.VolumesReplicationClient SnapshotClient *snapshots.SnapshotsClient SnapshotPoliciesClient *snapshotpolicy.SnapshotPolicyClient @@ -29,6 +31,9 @@ func NewClient(o *common.ClientOptions) *Client { volumeClient := volumes.NewVolumesClientWithBaseURI(o.ResourceManagerEndpoint) o.ConfigureClient(&volumeClient.Client, o.ResourceManagerAuthorizer) + volumeGroupClient := volumegroups.NewVolumeGroupsClientWithBaseURI(o.ResourceManagerEndpoint) + o.ConfigureClient(&volumeClient.Client, o.ResourceManagerAuthorizer) + volumeReplicationClient := volumesreplication.NewVolumesReplicationClientWithBaseURI(o.ResourceManagerEndpoint) o.ConfigureClient(&volumeReplicationClient.Client, o.ResourceManagerAuthorizer) @@ -42,6 +47,7 @@ func NewClient(o *common.ClientOptions) *Client { AccountClient: &accountClient, PoolClient: &poolClient, VolumeClient: &volumeClient, + VolumeGroupClient: &volumeGroupClient, VolumeReplicationClient: &volumeReplicationClient, SnapshotClient: &snapshotClient, SnapshotPoliciesClient: &snapshotPoliciesClient, diff --git a/internal/services/netapp/netapp_volume_group_resource.go b/internal/services/netapp/netapp_volume_group_resource.go new file mode 100644 index 000000000000..e39f012265f9 --- /dev/null +++ b/internal/services/netapp/netapp_volume_group_resource.go @@ -0,0 +1,395 @@ +package netapp + +import ( + "context" + "time" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes" + "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" + "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" + "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" + netAppValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/netapp/validate" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/suppress" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" +) + +type NetappVolumeGroupResource struct{} + +type NetappVolumeGroupModel struct { +} + +var _ sdk.ResourceWithUpdate = NetappVolumeGroupResource{} + +func (r NetappVolumeGroupResource) ModelObject() interface{} { + return &NetappVolumeGroupModel{} +} + +func (r NetappVolumeGroupResource) ResourceType() string { + return "azurerm_netapp_volume_group" +} + +func (r NetappVolumeGroupResource) IDValidationFunc() pluginsdk.SchemaValidateFunc { + panic("Implement me") // TODO - Add Validation func return here +} + +func (r NetappVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { + return map[string]*pluginsdk.Schema{ + + "name": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: netAppValidate.VolumeGroupName, + }, + + "resource_group_name": azure.SchemaResourceGroupName(), + + "location": azure.SchemaLocation(), + + "account_name": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: netAppValidate.AccountName, + }, + + "group_description": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + }, + + "application_type": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.StringInSlice([]string{ + string(netapp.ApplicationTypeSAPHANA), + }, false), + }, + + "application_identifier": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.StringLenBetween(1, 3), + }, + + "deployment_spec_id": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.IsUUID, + }, + + "volume": { + Type: pluginsdk.TypeList, + Required: true, + ForceNew: true, + MinItems: 5, + MaxItems: 5, + Elem: &pluginsdk.Resource{ + Schema: map[string]*pluginsdk.Schema{ + "name": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: netAppValidate.VolumeName, + }, + + "volume_path": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: netAppValidate.VolumePath, + }, + + "service_level": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.StringInSlice([]string{ + string(volumes.ServiceLevelPremium), + string(volumes.ServiceLevelStandard), + string(volumes.ServiceLevelUltra), + }, false), + }, + + "subnet_id": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: azure.ValidateResourceID, + }, + + "create_from_snapshot_resource_id": { + Type: pluginsdk.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + ValidateFunc: snapshots.ValidateSnapshotID, + }, + + "network_features": { + Type: pluginsdk.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + ValidateFunc: validation.StringInSlice([]string{ + string(volumes.NetworkFeaturesBasic), + string(volumes.NetworkFeaturesStandard), + }, false), + }, + + "protocols": { + Type: pluginsdk.TypeSet, + ForceNew: true, + Optional: true, + Computed: true, + MaxItems: 2, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeString, + ValidateFunc: validation.StringInSlice([]string{ + "NFSv3", + "NFSv4.1", + "CIFS", + }, false), + }, + }, + + "security_style": { + Type: pluginsdk.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + ValidateFunc: validation.StringInSlice([]string{ + "Unix", // Using hardcoded values instead of SDK enum since no matter what case is passed, + "Ntfs", // ANF changes casing to Pascal case in the backend. Please refer to https://github.com/Azure/azure-sdk-for-go/issues/14684 + }, false), + }, + + "storage_quota_in_gb": { + Type: pluginsdk.TypeInt, + Required: true, + ValidateFunc: validation.IntBetween(100, 102400), + }, + + "throughput_in_mibps": { + Type: pluginsdk.TypeFloat, + Optional: true, + Computed: true, + }, + + "capacity_pool_id": { + Type: pluginsdk.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + DiffSuppressFunc: suppress.CaseDifference, + ValidateFunc: azure.ValidateResourceID, + }, + + "proximity_placement_group_id": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + DiffSuppressFunc: suppress.CaseDifference, + ValidateFunc: azure.ValidateResourceID, + }, + + "volume_spec_name": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + }, + + "export_policy_rule": { + Type: pluginsdk.TypeList, + Optional: true, + MaxItems: 5, + Elem: &pluginsdk.Resource{ + Schema: map[string]*pluginsdk.Schema{ + "rule_index": { + Type: pluginsdk.TypeInt, + Required: true, + ValidateFunc: validation.IntBetween(1, 5), + }, + + "allowed_clients": { + Type: pluginsdk.TypeSet, + Required: true, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeString, + ValidateFunc: validate.CIDR, + }, + }, + + "protocols_enabled": { + Type: pluginsdk.TypeList, + Optional: true, + Computed: true, + MaxItems: 1, + MinItems: 1, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeString, + ValidateFunc: validation.StringInSlice([]string{ + "NFSv3", + "NFSv4.1", + "CIFS", + }, false), + }, + }, + + "unix_read_only": { + Type: pluginsdk.TypeBool, + Optional: true, + }, + + "unix_read_write": { + Type: pluginsdk.TypeBool, + Optional: true, + }, + + "root_access_enabled": { + Type: pluginsdk.TypeBool, + Optional: true, + }, + }, + }, + }, + + "tags": commonschema.Tags(), + + "mount_ip_addresses": { + Type: pluginsdk.TypeList, + Computed: true, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeString, + }, + }, + + "snapshot_directory_visible": { + Type: pluginsdk.TypeBool, + Optional: true, + Computed: true, + }, + + "data_protection_replication": { + Type: pluginsdk.TypeList, + Optional: true, + MaxItems: 1, + ForceNew: true, + Elem: &pluginsdk.Resource{ + Schema: map[string]*pluginsdk.Schema{ + "endpoint_type": { + Type: pluginsdk.TypeString, + Optional: true, + Default: "dst", + ValidateFunc: validation.StringInSlice([]string{ + "dst", + }, false), + }, + + "remote_volume_location": azure.SchemaLocation(), + + "remote_volume_resource_id": { + Type: pluginsdk.TypeString, + Required: true, + ValidateFunc: azure.ValidateResourceID, + }, + + "replication_frequency": { + Type: pluginsdk.TypeString, + Required: true, + ValidateFunc: validation.StringInSlice([]string{ + "10minutes", + "daily", + "hourly", + }, false), + }, + }, + }, + }, + + "data_protection_snapshot_policy": { + Type: pluginsdk.TypeList, + Optional: true, + MaxItems: 1, + Elem: &pluginsdk.Resource{ + Schema: map[string]*pluginsdk.Schema{ + "snapshot_policy_id": { + Type: pluginsdk.TypeString, + Required: true, + ValidateFunc: azure.ValidateResourceID, + }, + }, + }, + }, + }, + }, + }, + + // Can't use tags.Schema since there is no patch available + "tags": { + Type: pluginsdk.TypeMap, + Optional: true, + ForceNew: true, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeString, + }, + }, + } +} + +func (r NetappVolumeGroupResource) Attributes() map[string]*pluginsdk.Schema { + return map[string]*pluginsdk.Schema{ + /* + TODO - This section is for `Computed: true` only items, i.e. useful values that are returned by the + datasource that can be used as outputs or passed programmatically to other resources or data sources. + */ + } +} + +func (r NetappVolumeGroupResource) Create() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 30 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + // TODO - Create Func + // TODO - Don't forget to set the ID! e.g. metadata.SetID(id) + return nil + }, + } +} + +func (r NetappVolumeGroupResource) Read() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 5 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + // TODO - Read Func + return nil + }, + } +} + +func (r NetappVolumeGroupResource) Delete() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 5 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + // TODO - Delete Func + return nil + }, + } +} + +func (r NetappVolumeGroupResource) Update() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 30 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + // TODO - Update Func + return nil + }, + } +} diff --git a/internal/services/netapp/registration.go b/internal/services/netapp/registration.go index 2dedd47759d7..e92aa38508b0 100644 --- a/internal/services/netapp/registration.go +++ b/internal/services/netapp/registration.go @@ -13,19 +13,16 @@ func (r Registration) AssociatedGitHubLabel() string { return "service/netapp" } -// Name is the name of this Service func (r Registration) Name() string { return "NetApp" } -// WebsiteCategories returns a list of categories which can be used for the sidebar func (r Registration) WebsiteCategories() []string { return []string{ "NetApp", } } -// SupportedDataSources returns the supported Data Sources supported by this Service func (r Registration) SupportedDataSources() map[string]*pluginsdk.Resource { return map[string]*pluginsdk.Resource{ "azurerm_netapp_account": dataSourceNetAppAccount(), @@ -36,7 +33,6 @@ func (r Registration) SupportedDataSources() map[string]*pluginsdk.Resource { } } -// SupportedResources returns the supported Resources supported by this Service func (r Registration) SupportedResources() map[string]*pluginsdk.Resource { return map[string]*pluginsdk.Resource{ "azurerm_netapp_account": resourceNetAppAccount(), From c561fdcaf7063075cfd0cf9e99cd602a94f9bf59 Mon Sep 17 00:00:00 2001 From: Paulo Date: Tue, 12 Jul 2022 11:01:10 -0700 Subject: [PATCH 02/83] WIP: AVG support --- internal/provider/services.go | 1 + internal/services/netapp/netapp_volume.go | 518 ++++++++++++++++++ .../netapp/netapp_volume_group_resource.go | 479 +++++++--------- .../netapp_volume_group_resource_test.go | 390 +++++++++++++ .../services/netapp/netapp_volume_resource.go | 239 +------- .../netapp/netapp_volume_resource_test.go | 2 +- internal/services/netapp/registration.go | 21 +- 7 files changed, 1133 insertions(+), 517 deletions(-) create mode 100644 internal/services/netapp/netapp_volume.go create mode 100644 internal/services/netapp/netapp_volume_group_resource_test.go diff --git a/internal/provider/services.go b/internal/provider/services.go index a0a52d2c40d3..539fd57af634 100644 --- a/internal/provider/services.go +++ b/internal/provider/services.go @@ -130,6 +130,7 @@ func SupportedTypedServices() []sdk.TypedServiceRegistration { loadbalancer.Registration{}, loadtest.Registration{}, mssql.Registration{}, + netapp.Registration{}, policy.Registration{}, resource.Registration{}, sentinel.Registration{}, diff --git a/internal/services/netapp/netapp_volume.go b/internal/services/netapp/netapp_volume.go new file mode 100644 index 000000000000..68b80a9d2ef7 --- /dev/null +++ b/internal/services/netapp/netapp_volume.go @@ -0,0 +1,518 @@ +package netapp + +import ( + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes" + "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" + "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" + netAppValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/netapp/validate" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/suppress" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" + "github.com/hashicorp/terraform-provider-azurerm/utils" +) + +func netAppVolumeCommonSchema() map[string]*pluginsdk.Schema { + return map[string]*pluginsdk.Schema{ + "name": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: netAppValidate.VolumeName, + }, + + "volume_path": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: netAppValidate.VolumePath, + }, + + "service_level": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.StringInSlice([]string{ + string(volumes.ServiceLevelPremium), + string(volumes.ServiceLevelStandard), + string(volumes.ServiceLevelUltra), + }, false), + }, + + "subnet_id": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: azure.ValidateResourceID, + }, + + "create_from_snapshot_resource_id": { + Type: pluginsdk.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + ValidateFunc: snapshots.ValidateSnapshotID, + }, + + "network_features": { + Type: pluginsdk.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + ValidateFunc: validation.StringInSlice([]string{ + string(volumes.NetworkFeaturesBasic), + string(volumes.NetworkFeaturesStandard), + }, false), + }, + + "protocols": { + Type: pluginsdk.TypeSet, + ForceNew: true, + Optional: true, + Computed: true, + MaxItems: 2, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeString, + ValidateFunc: validation.StringInSlice([]string{ + "NFSv3", + "NFSv4.1", + "CIFS", + }, false), + }, + }, + + "security_style": { + Type: pluginsdk.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + ValidateFunc: validation.StringInSlice([]string{ + "Unix", // Using hardcoded values instead of SDK enum since no matter what case is passed, + "Ntfs", // ANF changes casing to Pascal case in the backend. Please refer to https://github.com/Azure/azure-sdk-for-go/issues/14684 + }, false), + }, + + "storage_quota_in_gb": { + Type: pluginsdk.TypeInt, + Required: true, + ValidateFunc: validation.IntBetween(100, 102400), + }, + + "throughput_in_mibps": { + Type: pluginsdk.TypeFloat, + Optional: true, + Computed: true, + }, + + "export_policy_rule": { + Type: pluginsdk.TypeList, + Optional: true, + MaxItems: 5, + Elem: &pluginsdk.Resource{ + Schema: map[string]*pluginsdk.Schema{ + "rule_index": { + Type: pluginsdk.TypeInt, + Required: true, + ValidateFunc: validation.IntBetween(1, 5), + }, + + "allowed_clients": { + Type: pluginsdk.TypeSet, + Required: true, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeString, + ValidateFunc: validate.CIDR, + }, + }, + + "protocols_enabled": { + Type: pluginsdk.TypeList, + Optional: true, + Computed: true, + MaxItems: 1, + MinItems: 1, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeString, + ValidateFunc: validation.StringInSlice([]string{ + "NFSv3", + "NFSv4.1", + "CIFS", + }, false), + }, + }, + + "unix_read_only": { + Type: pluginsdk.TypeBool, + Optional: true, + }, + + "unix_read_write": { + Type: pluginsdk.TypeBool, + Optional: true, + }, + + "root_access_enabled": { + Type: pluginsdk.TypeBool, + Optional: true, + }, + + "kerberos5_read_only": { + Type: pluginsdk.TypeBool, + Optional: true, + }, + + "kerberos5_read_write": { + Type: pluginsdk.TypeBool, + Optional: true, + }, + + "kerberos5i_read_only": { + Type: pluginsdk.TypeBool, + Optional: true, + }, + + "kerberos5i_read_write": { + Type: pluginsdk.TypeBool, + Optional: true, + }, + + "kerberos5p_read_only": { + Type: pluginsdk.TypeBool, + Optional: true, + }, + + "kerberos5p_read_write": { + Type: pluginsdk.TypeBool, + Optional: true, + }, + }, + }, + }, + + "tags": commonschema.Tags(), + + "mount_ip_addresses": { + Type: pluginsdk.TypeList, + Computed: true, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeString, + }, + }, + + "snapshot_directory_visible": { + Type: pluginsdk.TypeBool, + Optional: true, + Computed: true, + }, + + "data_protection_replication": { + Type: pluginsdk.TypeList, + Optional: true, + MaxItems: 1, + ForceNew: true, + Elem: &pluginsdk.Resource{ + Schema: map[string]*pluginsdk.Schema{ + "endpoint_type": { + Type: pluginsdk.TypeString, + Optional: true, + Default: "dst", + ValidateFunc: validation.StringInSlice([]string{ + "dst", + }, false), + }, + + "remote_volume_location": azure.SchemaLocation(), + + "remote_volume_resource_id": { + Type: pluginsdk.TypeString, + Required: true, + ValidateFunc: azure.ValidateResourceID, + }, + + "replication_frequency": { + Type: pluginsdk.TypeString, + Required: true, + ValidateFunc: validation.StringInSlice([]string{ + "10minutes", + "daily", + "hourly", + }, false), + }, + }, + }, + }, + + "data_protection_snapshot_policy": { + Type: pluginsdk.TypeList, + Optional: true, + MaxItems: 1, + Elem: &pluginsdk.Resource{ + Schema: map[string]*pluginsdk.Schema{ + "snapshot_policy_id": { + Type: pluginsdk.TypeString, + Required: true, + ValidateFunc: azure.ValidateResourceID, + }, + }, + }, + }, + } +} + +func netAppVolumeSchema() map[string]*pluginsdk.Schema { + return mergeSchemas(netAppVolumeCommonSchema(), map[string]*pluginsdk.Schema{ + "resource_group_name": azure.SchemaResourceGroupName(), + + "location": azure.SchemaLocation(), + + "account_name": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: netAppValidate.AccountName, + }, + + "pool_name": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: netAppValidate.PoolName, + }, + }) +} + +func netAppVolumeGroupVolumeSchema() map[string]*pluginsdk.Schema { + return mergeSchemas(netAppVolumeCommonSchema(), map[string]*pluginsdk.Schema{ + "capacity_pool_id": { + Type: pluginsdk.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + DiffSuppressFunc: suppress.CaseDifference, + ValidateFunc: azure.ValidateResourceID, + }, + + "proximity_placement_group_id": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + DiffSuppressFunc: suppress.CaseDifference, + ValidateFunc: azure.ValidateResourceID, + }, + + "volume_spec_name": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + }, + }) +} + +func mergeSchemas(schemas ...map[string]*pluginsdk.Schema) map[string]*pluginsdk.Schema { + + result := map[string]*pluginsdk.Schema{} + + for _, schema := range schemas { + for k, v := range schema { + if result[k] == nil { + result[k] = v + } + } + } + + return result +} + +type NetAppVolumeGroupVolume struct { + Name string `tfschema:"name"` + VolumePath string `tfschema:"volume_path"` + ServiceLevel string `tfschema:"service_level"` + SubnetId string `tfschema:"subnet_id"` + CreateFromSnapshotResourceId string `tfschema:"create_from_snapshot_resource_id"` + NetworkFeatures string `tfschema:"network_features"` + Protocols []string `tfschema:"protocols"` + SecurityStyle string `tfschema:"security_style"` + StorageQuotaInGB int `tfschema:"storage_quota_in_gb"` + ThroughputInMibps float32 `tfschema:"throughput_in_mibps"` + Tags map[string]string `tfschema:"tags"` + MountIpAddresses []string `tfschema:"mount_ip_addresses"` + SnapshotDirectoryVisible string `tfschema:"snapshot_directory_visible"` + CapacityPoolId string `tfschema:"capacity_pool_id"` + ProximityPlacementGroupId string `tfschema:"proximity_placement_group_id"` + VolumeSpecName string `tfschema:"volume_spec_name"` + ExportPolicy []ExportPolicyRule `tfschema:"export_policy_rule"` + DataProtectionReplication []DataProtectionReplication `tfschema:"data_protection_replication"` + DataProtectionSnapshotPolicy []DataProtectionSnapshotPolicy `tfschema:"data_protection_snapshot_policy"` +} + +type ExportPolicyRule struct { + RuleIndex int `tfschema:"rule_index"` + AllowedClients string `tfschema:"allowed_clients"` + ProtocolsEnabled []string `tfschema:"protocols_enabled"` + UnixReadOnly bool `tfschema:"unix_read_only"` + UnixReadWrite bool `tfschema:"unix_read_write"` + RootAccessEnabled bool `tfschema:"root_access_enabled"` + Kerberos5ReadOnly bool `tfschema:"kerberos5_read_only"` + Kerberos5ReadWrite bool `tfschema:"kerberos5_read_write"` + Kerberos5iReadOnly bool `tfschema:"kerberos5i_read_only"` + Kerberos5iReadWrite bool `tfschema:"kerberos5i_read_write"` + Kerberos5pReadOnly bool `tfschema:"kerberos5p_read_only"` + Kerberos5pReadWrite bool `tfschema:"kerberos5p_read_write"` +} + +type DataProtectionReplication struct { + EndpointType string `tfschema:"endpoint_type"` + RemoteVolumeLocation string `tfschema:"remote_volume_location"` + RemoteVolumeResourceId string `tfschema:"remote_volume_resource_id"` + ReplicationFrequency string `tfschema:"replication_frequency"` +} + +type DataProtectionSnapshotPolicy struct { + DataProtectionSnapshotPolicy string `tfschema:"data_protection_snapshot_policy"` +} + +func convertExportPolicyToInterface(exportPolicyList []ExportPolicyRule) []interface{} { + items := make([]interface{}, len(exportPolicyList)) + for i, v := range exportPolicyList { + items[i] = v + } + + return items +} + +type SupportedObjects interface { + ExportPolicyRule | DataProtectionReplication | DataProtectionSnapshotPolicy +} + +func convertSliceToInterface[T SupportedObjects](slice []T) []interface{} { + + items := make([]interface{}, len(slice)) + for i, v := range slice { + items[i] = v + } + + return items +} + +func expandNetAppVolumeGroupExportPolicyRule(input []interface{}) *volumegroups.VolumePropertiesExportPolicy { + + if len(input) == 0 || input[0] == nil { + return &volumegroups.VolumePropertiesExportPolicy{} + } + + results := make([]volumegroups.ExportPolicyRule, 0) + + for _, item := range input { + if item != nil { + v := item.(map[string]interface{}) + ruleIndex := int32(v["rule_index"].(int)) + allowedClients := strings.Join(*utils.ExpandStringSlice(v["allowed_clients"].(*pluginsdk.Set).List()), ",") + + cifsEnabled := false + nfsv3Enabled := false + nfsv41Enabled := false + + if vpe := v["protocols_enabled"]; vpe != nil { + protocolsEnabled := vpe.([]interface{}) + if len(protocolsEnabled) != 0 { + for _, protocol := range protocolsEnabled { + if protocol != nil { + switch strings.ToLower(protocol.(string)) { + case "cifs": + cifsEnabled = true + case "nfsv3": + nfsv3Enabled = true + case "nfsv4.1": + nfsv41Enabled = true + } + } + } + } + } + + unixReadOnly := v["unix_read_only"].(bool) + unixReadWrite := v["unix_read_write"].(bool) + rootAccessEnabled := v["root_access_enabled"].(bool) + kerberos5ReadOnly := v["kerberos5_read_only"].(bool) + kerberos5ReadWrite := v["kerberos5_read_write"].(bool) + kerberos5iReadOnly := v["kerberos5i_read_only"].(bool) + kerberos5iReadWrite := v["kerberos5i_read_write"].(bool) + kerberos5pReadOnly := v["kerberos5p_read_only"].(bool) + kerberos5pReadWrite := v["kerberos5p_read_write"].(bool) + + result := volumegroups.ExportPolicyRule{ + AllowedClients: utils.String(allowedClients), + Cifs: utils.Bool(cifsEnabled), + Nfsv3: utils.Bool(nfsv3Enabled), + Nfsv41: utils.Bool(nfsv41Enabled), + RuleIndex: utils.Int64(int64(ruleIndex)), + UnixReadOnly: utils.Bool(unixReadOnly), + UnixReadWrite: utils.Bool(unixReadWrite), + HasRootAccess: utils.Bool(rootAccessEnabled), + Kerberos5ReadOnly: utils.Bool(kerberos5ReadOnly), + Kerberos5ReadWrite: utils.Bool(kerberos5ReadWrite), + Kerberos5iReadOnly: utils.Bool(kerberos5iReadOnly), + Kerberos5iReadWrite: utils.Bool(kerberos5iReadWrite), + Kerberos5pReadOnly: utils.Bool(kerberos5pReadOnly), + Kerberos5pReadWrite: utils.Bool(kerberos5pReadWrite), + } + + results = append(results, result) + } + } + + return &volumegroups.VolumePropertiesExportPolicy{ + Rules: &results, + } +} + +func expandNetAppVolumeGroupDataProtectionReplication(input []interface{}) *volumegroups.VolumePropertiesDataProtection { + if len(input) == 0 || input[0] == nil { + return &volumegroups.VolumePropertiesDataProtection{} + } + + replicationObject := volumegroups.ReplicationObject{} + + replicationRaw := input[0].(map[string]interface{}) + + if v, ok := replicationRaw["endpoint_type"]; ok { + endpointType := volumegroups.EndpointType(v.(string)) + replicationObject.EndpointType = &endpointType + } + if v, ok := replicationRaw["remote_volume_location"]; ok { + replicationObject.RemoteVolumeRegion = utils.String(v.(string)) + } + if v, ok := replicationRaw["remote_volume_resource_id"]; ok { + replicationObject.RemoteVolumeResourceId = v.(string) + } + if v, ok := replicationRaw["replication_frequency"]; ok { + replicationSchedule := volumegroups.ReplicationSchedule(translateTFSchedule(v.(string))) + replicationObject.ReplicationSchedule = &replicationSchedule + } + + return &volumegroups.VolumePropertiesDataProtection{ + Replication: &replicationObject, + } +} + +func expandNetAppVolumeGroupDataProtectionSnapshotPolicy(input []interface{}) *volumegroups.VolumePropertiesDataProtection { + if len(input) == 0 || input[0] == nil { + return &volumegroups.VolumePropertiesDataProtection{} + } + + snapshotObject := volumegroups.VolumeSnapshotProperties{} + + snapshotRaw := input[0].(map[string]interface{}) + + if v, ok := snapshotRaw["snapshot_policy_id"]; ok { + snapshotObject.SnapshotPolicyId = utils.String(v.(string)) + } + + return &volumegroups.VolumePropertiesDataProtection{ + Snapshot: &snapshotObject, + } +} diff --git a/internal/services/netapp/netapp_volume_group_resource.go b/internal/services/netapp/netapp_volume_group_resource.go index e39f012265f9..f3723c7f233b 100644 --- a/internal/services/netapp/netapp_volume_group_resource.go +++ b/internal/services/netapp/netapp_volume_group_resource.go @@ -2,47 +2,57 @@ package netapp import ( "context" + "fmt" + "net/http" + "strconv" + "strings" "time" - "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes" + "github.com/hashicorp/go-azure-helpers/resourcemanager/location" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" - "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" netAppValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/netapp/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" - "github.com/hashicorp/terraform-provider-azurerm/internal/tf/suppress" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" + "github.com/hashicorp/terraform-provider-azurerm/utils" ) -type NetappVolumeGroupResource struct{} - -type NetappVolumeGroupModel struct { +type NetAppVolumeGroupResource struct{} + +type NetAppVolumeGroupModel struct { + Name string `tfschema:"name"` + ResourceGroupName string `tfschema:"resource_group_name"` + Location string `tfschema:"location"` + AccountName string `tfschema:"account_name"` + GroupDescription string `tfschema:"group_description"` + ApplicationType string `tfschema:"application_type"` + ApplicationIdentifier string `tfschema:"application_identifier"` + DeploymentSpecId string `tfschema:"deployment_spec_id"` + Tags map[string]string `tfschema:"tags"` + Volumes []NetAppVolumeGroupVolume `tfschema:"volume"` } -var _ sdk.ResourceWithUpdate = NetappVolumeGroupResource{} +var _ sdk.Resource = NetAppVolumeGroupResource{} -func (r NetappVolumeGroupResource) ModelObject() interface{} { - return &NetappVolumeGroupModel{} +func (r NetAppVolumeGroupResource) ModelObject() interface{} { + return &NetAppVolumeGroupModel{} } -func (r NetappVolumeGroupResource) ResourceType() string { +func (r NetAppVolumeGroupResource) ResourceType() string { return "azurerm_netapp_volume_group" } -func (r NetappVolumeGroupResource) IDValidationFunc() pluginsdk.SchemaValidateFunc { - panic("Implement me") // TODO - Add Validation func return here +func (r NetAppVolumeGroupResource) IDValidationFunc() pluginsdk.SchemaValidateFunc { + return volumegroups.ValidateVolumeGroupID } -func (r NetappVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { +func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { return map[string]*pluginsdk.Schema{ - "name": { - Type: pluginsdk.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: netAppValidate.VolumeGroupName, + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, }, "resource_group_name": azure.SchemaResourceGroupName(), @@ -67,7 +77,7 @@ func (r NetappVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { Required: true, ForceNew: true, ValidateFunc: validation.StringInSlice([]string{ - string(netapp.ApplicationTypeSAPHANA), + string(volumegroups.ApplicationTypeSAPNegativeHANA), }, false), }, @@ -92,243 +102,7 @@ func (r NetappVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { MinItems: 5, MaxItems: 5, Elem: &pluginsdk.Resource{ - Schema: map[string]*pluginsdk.Schema{ - "name": { - Type: pluginsdk.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: netAppValidate.VolumeName, - }, - - "volume_path": { - Type: pluginsdk.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: netAppValidate.VolumePath, - }, - - "service_level": { - Type: pluginsdk.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validation.StringInSlice([]string{ - string(volumes.ServiceLevelPremium), - string(volumes.ServiceLevelStandard), - string(volumes.ServiceLevelUltra), - }, false), - }, - - "subnet_id": { - Type: pluginsdk.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: azure.ValidateResourceID, - }, - - "create_from_snapshot_resource_id": { - Type: pluginsdk.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ValidateFunc: snapshots.ValidateSnapshotID, - }, - - "network_features": { - Type: pluginsdk.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ValidateFunc: validation.StringInSlice([]string{ - string(volumes.NetworkFeaturesBasic), - string(volumes.NetworkFeaturesStandard), - }, false), - }, - - "protocols": { - Type: pluginsdk.TypeSet, - ForceNew: true, - Optional: true, - Computed: true, - MaxItems: 2, - Elem: &pluginsdk.Schema{ - Type: pluginsdk.TypeString, - ValidateFunc: validation.StringInSlice([]string{ - "NFSv3", - "NFSv4.1", - "CIFS", - }, false), - }, - }, - - "security_style": { - Type: pluginsdk.TypeString, - Optional: true, - ForceNew: true, - Computed: true, - ValidateFunc: validation.StringInSlice([]string{ - "Unix", // Using hardcoded values instead of SDK enum since no matter what case is passed, - "Ntfs", // ANF changes casing to Pascal case in the backend. Please refer to https://github.com/Azure/azure-sdk-for-go/issues/14684 - }, false), - }, - - "storage_quota_in_gb": { - Type: pluginsdk.TypeInt, - Required: true, - ValidateFunc: validation.IntBetween(100, 102400), - }, - - "throughput_in_mibps": { - Type: pluginsdk.TypeFloat, - Optional: true, - Computed: true, - }, - - "capacity_pool_id": { - Type: pluginsdk.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - DiffSuppressFunc: suppress.CaseDifference, - ValidateFunc: azure.ValidateResourceID, - }, - - "proximity_placement_group_id": { - Type: pluginsdk.TypeString, - Required: true, - ForceNew: true, - DiffSuppressFunc: suppress.CaseDifference, - ValidateFunc: azure.ValidateResourceID, - }, - - "volume_spec_name": { - Type: pluginsdk.TypeString, - Required: true, - ForceNew: true, - }, - - "export_policy_rule": { - Type: pluginsdk.TypeList, - Optional: true, - MaxItems: 5, - Elem: &pluginsdk.Resource{ - Schema: map[string]*pluginsdk.Schema{ - "rule_index": { - Type: pluginsdk.TypeInt, - Required: true, - ValidateFunc: validation.IntBetween(1, 5), - }, - - "allowed_clients": { - Type: pluginsdk.TypeSet, - Required: true, - Elem: &pluginsdk.Schema{ - Type: pluginsdk.TypeString, - ValidateFunc: validate.CIDR, - }, - }, - - "protocols_enabled": { - Type: pluginsdk.TypeList, - Optional: true, - Computed: true, - MaxItems: 1, - MinItems: 1, - Elem: &pluginsdk.Schema{ - Type: pluginsdk.TypeString, - ValidateFunc: validation.StringInSlice([]string{ - "NFSv3", - "NFSv4.1", - "CIFS", - }, false), - }, - }, - - "unix_read_only": { - Type: pluginsdk.TypeBool, - Optional: true, - }, - - "unix_read_write": { - Type: pluginsdk.TypeBool, - Optional: true, - }, - - "root_access_enabled": { - Type: pluginsdk.TypeBool, - Optional: true, - }, - }, - }, - }, - - "tags": commonschema.Tags(), - - "mount_ip_addresses": { - Type: pluginsdk.TypeList, - Computed: true, - Elem: &pluginsdk.Schema{ - Type: pluginsdk.TypeString, - }, - }, - - "snapshot_directory_visible": { - Type: pluginsdk.TypeBool, - Optional: true, - Computed: true, - }, - - "data_protection_replication": { - Type: pluginsdk.TypeList, - Optional: true, - MaxItems: 1, - ForceNew: true, - Elem: &pluginsdk.Resource{ - Schema: map[string]*pluginsdk.Schema{ - "endpoint_type": { - Type: pluginsdk.TypeString, - Optional: true, - Default: "dst", - ValidateFunc: validation.StringInSlice([]string{ - "dst", - }, false), - }, - - "remote_volume_location": azure.SchemaLocation(), - - "remote_volume_resource_id": { - Type: pluginsdk.TypeString, - Required: true, - ValidateFunc: azure.ValidateResourceID, - }, - - "replication_frequency": { - Type: pluginsdk.TypeString, - Required: true, - ValidateFunc: validation.StringInSlice([]string{ - "10minutes", - "daily", - "hourly", - }, false), - }, - }, - }, - }, - - "data_protection_snapshot_policy": { - Type: pluginsdk.TypeList, - Optional: true, - MaxItems: 1, - Elem: &pluginsdk.Resource{ - Schema: map[string]*pluginsdk.Schema{ - "snapshot_policy_id": { - Type: pluginsdk.TypeString, - Required: true, - ValidateFunc: azure.ValidateResourceID, - }, - }, - }, - }, - }, + Schema: netAppVolumeGroupVolumeSchema(), }, }, @@ -344,37 +118,200 @@ func (r NetappVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { } } -func (r NetappVolumeGroupResource) Attributes() map[string]*pluginsdk.Schema { +func (r NetAppVolumeGroupResource) Attributes() map[string]*pluginsdk.Schema { return map[string]*pluginsdk.Schema{ /* TODO - This section is for `Computed: true` only items, i.e. useful values that are returned by the datasource that can be used as outputs or passed programmatically to other resources or data sources. + + TODO (pmarques) - use this for first level attributes when Volume resource gets migrated to tfschema */ } } -func (r NetappVolumeGroupResource) Create() sdk.ResourceFunc { +func (r NetAppVolumeGroupResource) Create() sdk.ResourceFunc { return sdk.ResourceFunc{ - Timeout: 30 * time.Minute, + Timeout: 90 * time.Minute, Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { - // TODO - Create Func - // TODO - Don't forget to set the ID! e.g. metadata.SetID(id) + client := metadata.Client.NetApp.VolumeGroupClient + subscriptionId := metadata.Client.Account.SubscriptionId + + var model NetAppVolumeGroupModel + if err := metadata.Decode(&model); err != nil { + return fmt.Errorf("decoding: %+v", err) + } + + id := volumegroups.NewVolumeGroupID(subscriptionId, model.ResourceGroupName, model.AccountName, model.Name) + + metadata.Logger.Infof("Import check for %s", id) + existing, err := client.VolumeGroupsGet(ctx, id) + if err != nil && existing.HttpResponse.StatusCode != http.StatusNotFound { + return fmt.Errorf("checking for presence of existing %s: %+v", id, err) + } + + if existing.Model != nil && existing.Model.Id != nil && *existing.Model.Id != "" { + return metadata.ResourceRequiresImport(r.ResourceType(), id) + } + + applicationType := volumegroups.ApplicationType(model.ApplicationType) + + volumeList := make([]volumegroups.VolumeGroupVolumeProperties, 0) + for _, item := range model.Volumes { + name := item.Name + volumePath := item.VolumePath + serviceLevel := volumegroups.ServiceLevel(item.ServiceLevel) + subnetID := item.SubnetId + capacityPoolID := item.CapacityPoolId + + networkFeatures := volumegroups.NetworkFeatures(item.NetworkFeatures) + if networkFeatures == "" { + networkFeatures = volumegroups.NetworkFeaturesBasic + } + + protocols := item.Protocols + if len(protocols) == 0 { + protocols = append(protocols, "NFSv3") + } + + // Handling security style property + securityStyle := volumegroups.SecurityStyle(item.SecurityStyle) + if strings.EqualFold(string(securityStyle), "unix") && len(protocols) == 1 && strings.EqualFold(protocols[0], "cifs") { + return fmt.Errorf("unix security style cannot be used in a CIFS enabled volume for %s", id) + + } + if strings.EqualFold(string(securityStyle), "ntfs") && len(protocols) == 1 && (strings.EqualFold(protocols[0], "nfsv3") || strings.EqualFold(protocols[0], "nfsv4.1")) { + return fmt.Errorf("ntfs security style cannot be used in a NFSv3/NFSv4.1 enabled volume for %s", id) + } + + storageQuotaInGB := int64(item.StorageQuotaInGB * 1073741824) + exportPolicyRule := expandNetAppVolumeGroupExportPolicyRule(convertSliceToInterface(item.ExportPolicy)) + dataProtectionReplication := expandNetAppVolumeGroupDataProtectionReplication(convertSliceToInterface(item.DataProtectionReplication)) + dataProtectionSnapshotPolicy := expandNetAppVolumeGroupDataProtectionSnapshotPolicy(convertSliceToInterface(item.DataProtectionSnapshotPolicy)) + + volumeType := "" + if dataProtectionReplication != nil && dataProtectionReplication.Replication != nil && strings.ToLower(string(*dataProtectionReplication.Replication.EndpointType)) == "dst" { + volumeType = "DataProtection" + } + + // Validating that snapshot policies are not being created in a data protection volume + if dataProtectionSnapshotPolicy != nil && volumeType != "" { + return fmt.Errorf("snapshot policy cannot be enabled on a data protection volume for %s", id) + } + + snapshotDirectoryVisible, err := strconv.ParseBool(item.SnapshotDirectoryVisible) + if err != nil { + return fmt.Errorf("could not convert SnapshotDirectoryVisible string to bool: %+v", err) + } + + volumeProperties := &volumegroups.VolumeGroupVolumeProperties{ + Name: utils.String(name), + Properties: volumegroups.VolumeProperties{ + CapacityPoolResourceId: utils.String(capacityPoolID), + CreationToken: volumePath, + ServiceLevel: &serviceLevel, + SubnetId: subnetID, + NetworkFeatures: &networkFeatures, + ProtocolTypes: &protocols, + SecurityStyle: &securityStyle, + UsageThreshold: storageQuotaInGB, + ExportPolicy: exportPolicyRule, + VolumeType: utils.String(volumeType), + DataProtection: &volumegroups.VolumePropertiesDataProtection{ + Replication: dataProtectionReplication.Replication, + Snapshot: dataProtectionSnapshotPolicy.Snapshot, + }, + SnapshotDirectoryVisible: &snapshotDirectoryVisible, + }, + Tags: &item.Tags, + } + + if _, ok := metadata.ResourceData.GetOk("throughput_in_mibps"); ok { + volumeProperties.Properties.ThroughputMibps = utils.Float(float64(item.ThroughputInMibps)) + } + + volumeProperties.Properties.ProximityPlacementGroup = utils.String(item.ProximityPlacementGroupId) + volumeProperties.Properties.VolumeSpecName = utils.String(item.VolumeSpecName) + + volumeList = append(volumeList, *volumeProperties) + } + + parameters := volumegroups.VolumeGroupDetails{ + Location: utils.String(location.Normalize(model.Location)), + Properties: &volumegroups.VolumeGroupProperties{ + GroupMetaData: &volumegroups.VolumeGroupMetaData{ + GroupDescription: utils.String(model.GroupDescription), + ApplicationType: &applicationType, + ApplicationIdentifier: utils.String(model.ApplicationIdentifier), + DeploymentSpecId: utils.String(model.DeploymentSpecId), + }, + Volumes: &volumeList, + }, + Tags: &model.Tags, + } + + err = client.VolumeGroupsCreateThenPoll(ctx, id, parameters) + if err != nil { + return fmt.Errorf("creating %s: %+v", id, err) + } + + // // Waiting for volume be completely provisioned + // if err := waitForVolumeCreateOrUpdate(ctx, client, id); err != nil { + // return err + // } + + metadata.SetID(id) + return nil }, } } -func (r NetappVolumeGroupResource) Read() sdk.ResourceFunc { +func (r NetAppVolumeGroupResource) Read() sdk.ResourceFunc { return sdk.ResourceFunc{ Timeout: 5 * time.Minute, Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { - // TODO - Read Func + + client := metadata.Client.NetApp.VolumeGroupClient + + id, err := volumegroups.ParseVolumeGroupID(metadata.ResourceData.Id()) + if err != nil { + return err + } + + metadata.Logger.Infof("Decoding state for %s", id) + var state NetAppVolumeGroupModel + if err := metadata.Decode(&state); err != nil { + return err + } + + existing, err := client.VolumeGroupsGet(ctx, *id) + if err != nil { + if existing.HttpResponse.StatusCode == http.StatusNotFound { + return metadata.MarkAsGone(id) + } + return fmt.Errorf("retrieving %s: %v", id, err) + } + + model := NetAppVolumeGroupModel{ + Name: id.VolumeGroupName, + AccountName: id.AccountName, + Location: location.NormalizeNilable(existing.Model.Location), + ResourceGroupName: id.ResourceGroupName, + Tags: *existing.Model.Tags, + } + + if props := existing.Model.Properties; props != nil { + model.GroupDescription = *props.GroupMetaData.GroupDescription + model.ApplicationIdentifier = *props.GroupMetaData.ApplicationIdentifier + model.DeploymentSpecId = *props.GroupMetaData.DeploymentSpecId + } + return nil }, } } -func (r NetappVolumeGroupResource) Delete() sdk.ResourceFunc { +func (r NetAppVolumeGroupResource) Delete() sdk.ResourceFunc { return sdk.ResourceFunc{ Timeout: 5 * time.Minute, Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { @@ -383,13 +320,3 @@ func (r NetappVolumeGroupResource) Delete() sdk.ResourceFunc { }, } } - -func (r NetappVolumeGroupResource) Update() sdk.ResourceFunc { - return sdk.ResourceFunc{ - Timeout: 30 * time.Minute, - Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { - // TODO - Update Func - return nil - }, - } -} diff --git a/internal/services/netapp/netapp_volume_group_resource_test.go b/internal/services/netapp/netapp_volume_group_resource_test.go new file mode 100644 index 000000000000..24cc446c9877 --- /dev/null +++ b/internal/services/netapp/netapp_volume_group_resource_test.go @@ -0,0 +1,390 @@ +package netapp_test + +import ( + "context" + "fmt" + "net/http" + "testing" + + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "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" + "github.com/hashicorp/terraform-provider-azurerm/utils" +) + +type NetAppVolumeGroupResource struct{} + +func TestAccNetAppVolumeGroup_basic(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_netapp_volume_group", "test") + r := NetAppVolumeGroupResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + }) +} + +func (t NetAppVolumeGroupResource) Exists(ctx context.Context, clients *clients.Client, state *terraform.InstanceState) (*bool, error) { + id, err := volumegroups.ParseVolumeGroupID(state.ID) + if err != nil { + return nil, err + } + + resp, err := clients.NetApp.VolumeGroupClient.VolumeGroupsGet(ctx, *id) + + if err != nil { + if resp.HttpResponse.StatusCode == http.StatusNotFound { + return utils.Bool(false), nil + } + return nil, fmt.Errorf("retrieving %s: %+v", id, err) + } + + return utils.Bool(true), nil +} + +func (NetAppVolumeGroupResource) basic(data acceptance.TestData) string { + template := NetAppVolumeGroupResource{}.templatePPG(data) + return fmt.Sprintf(` +%[1]s + +resource "azurerm_netapp_volume_group" "test" { + name = "acctest-NetAppVolumeGroup-%[2]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + account_name = azurerm_netapp_account.test.name + group_description = "Test volume group" + application_type = "SAP-HANA" + application_identifier = "TST" + deployment_spec_id = "20542149-bfca-5618-1879-9863dc6767f1" + + volume { + name = "acctest-NetAppVolume-1-%[2]d" + volume_path = "my-unique-file-path-1-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + proximity_placement_group_id = azurerm_proximity_placement_group.test.id + volume_spec_name = "data" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + + export_policy_rule { + rule_index = 1 + allowed_clients = ["0.0.0.0/0"] + protocols_enabled = ["NFSv3"] + unix_read_only = false + unix_read_write = true + kerberos5_read_only = false + kerberos5_read_write = false + kerberos5i_read_only = false + kerberos5i_read_write = false + kerberos5p_read_only = false + kerberos5p_read_write = false + } + + tags = { + "SkipASMAzSecPack" = "true" + } + } + + volume { + name = "acctest-NetAppVolume-2-%[2]d" + volume_path = "my-unique-file-path-2-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + proximity_placement_group_id = azurerm_proximity_placement_group.test.id + volume_spec_name = "log" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + + export_policy_rule { + rule_index = 1 + allowed_clients = ["0.0.0.0/0"] + protocols_enabled = ["NFSv3"] + unix_read_only = false + unix_read_write = true + kerberos5_read_only = false + kerberos5_read_write = false + kerberos5i_read_only = false + kerberos5i_read_write = false + kerberos5p_read_only = false + kerberos5p_read_write = false + } + + tags = { + "SkipASMAzSecPack" = "true" + } + } + + volume { + name = "acctest-NetAppVolume-3-%[2]d" + volume_path = "my-unique-file-path-3-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + proximity_placement_group_id = azurerm_proximity_placement_group.test.id + volume_spec_name = "shared" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + + export_policy_rule { + rule_index = 1 + allowed_clients = ["0.0.0.0/0"] + protocols_enabled = ["NFSv3"] + unix_read_only = false + unix_read_write = true + kerberos5_read_only = false + kerberos5_read_write = false + kerberos5i_read_only = false + kerberos5i_read_write = false + kerberos5p_read_only = false + kerberos5p_read_write = false + } + + tags = { + "SkipASMAzSecPack" = "true" + } + } + + volume { + name = "acctest-NetAppVolume-4-%[2]d" + volume_path = "my-unique-file-path-4-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + proximity_placement_group_id = azurerm_proximity_placement_group.test.id + volume_spec_name = "data-backup" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + + export_policy_rule { + rule_index = 1 + allowed_clients = ["0.0.0.0/0"] + protocols_enabled = ["NFSv3"] + unix_read_only = false + unix_read_write = true + kerberos5_read_only = false + kerberos5_read_write = false + kerberos5i_read_only = false + kerberos5i_read_write = false + kerberos5p_read_only = false + kerberos5p_read_write = false + } + + tags = { + "SkipASMAzSecPack" = "true" + } + } + + volume { + name = "acctest-NetAppVolume-5-%[2]d" + volume_path = "my-unique-file-path-5-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + proximity_placement_group_id = azurerm_proximity_placement_group.test.id + volume_spec_name = "log-backup" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + + export_policy_rule { + rule_index = 1 + allowed_clients = ["0.0.0.0/0"] + protocols_enabled = ["NFSv3"] + unix_read_only = false + unix_read_write = true + kerberos5_read_only = false + kerberos5_read_write = false + kerberos5i_read_only = false + kerberos5i_read_write = false + kerberos5p_read_only = false + kerberos5p_read_write = false + } + + tags = { + "SkipASMAzSecPack" = "true" + } + } + + tags = { + "SkipASMAzSecPack" = "true" + } + + depends_on = [ + azurerm_linux_virtual_machine.test, + azurerm_proximity_placement_group.test + ] +} +`, template, data.RandomInteger) +} + +func (NetAppVolumeGroupResource) templatePPG(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + alias = "all2" + features { + resource_group { + prevent_deletion_if_contains_resources = false + } + } +} + +locals { + admin_username = "testadmin%[1]d" + admin_password = "Password1234!%[1]d" +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-netapp-%[1]d" + location = "%[2]s" + + tags = { + "SkipASMAzSecPack" = "true" + } +} + +resource "azurerm_network_security_group" "test" { + name = "acctest-NSG-%[1]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + + tags = { + environment = "Production", + "SkipASMAzSecPack" = "true" + } +} + +resource "azurerm_virtual_network" "test" { + name = "acctest-VirtualNetwork-%[1]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + address_space = ["10.6.0.0/16"] + + tags = { + "SkipASMAzSecPack" = "true" + } +} + +resource "azurerm_subnet" "test" { + name = "acctest-DelegatedSubnet-%[1]d" + resource_group_name = azurerm_resource_group.test.name + virtual_network_name = azurerm_virtual_network.test.name + address_prefixes = ["10.6.2.0/24"] + + delegation { + name = "testdelegation" + + service_delegation { + name = "Microsoft.Netapp/volumes" + actions = ["Microsoft.Network/networkinterfaces/*", "Microsoft.Network/virtualNetworks/subnets/join/action"] + } + } +} + +resource "azurerm_subnet" "test1" { + name = "acctest-HostsSubnet-%[1]d" + resource_group_name = azurerm_resource_group.test.name + virtual_network_name = azurerm_virtual_network.test.name + address_prefixes = ["10.6.1.0/24"] +} + +resource "azurerm_subnet_network_security_group_association" "public" { + subnet_id = azurerm_subnet.test.id + network_security_group_id = azurerm_network_security_group.test.id +} + +resource "azurerm_proximity_placement_group" "test" { + name = "acctest-PPG-%[1]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name +} + +resource "azurerm_availability_set" "test" { + name = "acctest-avset-%[1]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + + proximity_placement_group_id = azurerm_proximity_placement_group.test.id +} + +resource "azurerm_network_interface" "test" { + name = "acctest-nic-%[1]d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + + ip_configuration { + name = "internal" + subnet_id = azurerm_subnet.test1.id + private_ip_address_allocation = "Dynamic" + } +} + +resource "azurerm_linux_virtual_machine" "test" { + name = "acctest-vm-%[1]d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + size = "Standard_M8ms" + admin_username = local.admin_username + admin_password = local.admin_password + disable_password_authentication = false + proximity_placement_group_id = azurerm_proximity_placement_group.test.id + availability_set_id = azurerm_availability_set.test.id + network_interface_ids = [ + azurerm_network_interface.test.id + ] + + source_image_reference { + publisher = "Canonical" + offer = "UbuntuServer" + sku = "18.04-LTS" + version = "latest" + } + + os_disk { + storage_account_type = "Standard_LRS" + caching = "ReadWrite" + } + + tags = { + "Owner" = "pmarques" + } +} + +resource "azurerm_netapp_account" "test" { + name = "acctest-NetAppAccount-%[1]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + + depends_on = [ + azurerm_subnet.test, + azurerm_subnet.test1 + ] + + tags = { + "SkipASMAzSecPack" = "true" + } +} + +resource "azurerm_netapp_pool" "test" { + name = "acctest-NetAppPool-%[1]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + account_name = azurerm_netapp_account.test.name + service_level = "Standard" + size_in_tb = 8 + qos_type = "Manual" + + tags = { + "SkipASMAzSecPack" = "true" + } +} +`, data.RandomInteger, "westus") +} diff --git a/internal/services/netapp/netapp_volume_resource.go b/internal/services/netapp/netapp_volume_resource.go index 1dbe6bec3111..ac73fb5960a7 100644 --- a/internal/services/netapp/netapp_volume_resource.go +++ b/internal/services/netapp/netapp_volume_resource.go @@ -9,7 +9,6 @@ import ( "time" "github.com/hashicorp/go-azure-helpers/lang/response" - "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots" @@ -17,11 +16,8 @@ import ( "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" - "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - netAppValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/netapp/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" - "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" "github.com/hashicorp/terraform-provider-azurerm/utils" ) @@ -44,238 +40,7 @@ func resourceNetAppVolume() *pluginsdk.Resource { return err }), - Schema: map[string]*pluginsdk.Schema{ - "name": { - Type: pluginsdk.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: netAppValidate.VolumeName, - }, - - "resource_group_name": azure.SchemaResourceGroupName(), - - "location": azure.SchemaLocation(), - - "account_name": { - Type: pluginsdk.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: netAppValidate.AccountName, - }, - - "pool_name": { - Type: pluginsdk.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: netAppValidate.PoolName, - }, - - "volume_path": { - Type: pluginsdk.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: netAppValidate.VolumePath, - }, - - "service_level": { - Type: pluginsdk.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validation.StringInSlice([]string{ - string(volumes.ServiceLevelPremium), - string(volumes.ServiceLevelStandard), - string(volumes.ServiceLevelUltra), - }, false), - }, - - "subnet_id": { - Type: pluginsdk.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: azure.ValidateResourceID, - }, - - "create_from_snapshot_resource_id": { - Type: pluginsdk.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ValidateFunc: snapshots.ValidateSnapshotID, - }, - - "network_features": { - Type: pluginsdk.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ValidateFunc: validation.StringInSlice([]string{ - string(volumes.NetworkFeaturesBasic), - string(volumes.NetworkFeaturesStandard), - }, false), - }, - - "protocols": { - Type: pluginsdk.TypeSet, - ForceNew: true, - Optional: true, - Computed: true, - MaxItems: 2, - Elem: &pluginsdk.Schema{ - Type: pluginsdk.TypeString, - ValidateFunc: validation.StringInSlice([]string{ - "NFSv3", - "NFSv4.1", - "CIFS", - }, false), - }, - }, - - "security_style": { - Type: pluginsdk.TypeString, - Optional: true, - ForceNew: true, - Computed: true, - ValidateFunc: validation.StringInSlice([]string{ - "Unix", // Using hardcoded values instead of SDK enum since no matter what case is passed, - "Ntfs", // ANF changes casing to Pascal case in the backend. Please refer to https://github.com/Azure/azure-sdk-for-go/issues/14684 - }, false), - }, - - "storage_quota_in_gb": { - Type: pluginsdk.TypeInt, - Required: true, - ValidateFunc: validation.IntBetween(100, 102400), - }, - - "throughput_in_mibps": { - Type: pluginsdk.TypeFloat, - Optional: true, - Computed: true, - }, - - "export_policy_rule": { - Type: pluginsdk.TypeList, - Optional: true, - MaxItems: 5, - Elem: &pluginsdk.Resource{ - Schema: map[string]*pluginsdk.Schema{ - "rule_index": { - Type: pluginsdk.TypeInt, - Required: true, - ValidateFunc: validation.IntBetween(1, 5), - }, - - "allowed_clients": { - Type: pluginsdk.TypeSet, - Required: true, - Elem: &pluginsdk.Schema{ - Type: pluginsdk.TypeString, - ValidateFunc: validate.CIDR, - }, - }, - - "protocols_enabled": { - Type: pluginsdk.TypeList, - Optional: true, - Computed: true, - MaxItems: 1, - MinItems: 1, - Elem: &pluginsdk.Schema{ - Type: pluginsdk.TypeString, - ValidateFunc: validation.StringInSlice([]string{ - "NFSv3", - "NFSv4.1", - "CIFS", - }, false), - }, - }, - - "unix_read_only": { - Type: pluginsdk.TypeBool, - Optional: true, - }, - - "unix_read_write": { - Type: pluginsdk.TypeBool, - Optional: true, - }, - - "root_access_enabled": { - Type: pluginsdk.TypeBool, - Optional: true, - }, - }, - }, - }, - - "tags": commonschema.Tags(), - - "mount_ip_addresses": { - Type: pluginsdk.TypeList, - Computed: true, - Elem: &pluginsdk.Schema{ - Type: pluginsdk.TypeString, - }, - }, - - "snapshot_directory_visible": { - Type: pluginsdk.TypeBool, - Optional: true, - Computed: true, - }, - - "data_protection_replication": { - Type: pluginsdk.TypeList, - Optional: true, - MaxItems: 1, - ForceNew: true, - Elem: &pluginsdk.Resource{ - Schema: map[string]*pluginsdk.Schema{ - "endpoint_type": { - Type: pluginsdk.TypeString, - Optional: true, - Default: "dst", - ValidateFunc: validation.StringInSlice([]string{ - "dst", - }, false), - }, - - "remote_volume_location": azure.SchemaLocation(), - - "remote_volume_resource_id": { - Type: pluginsdk.TypeString, - Required: true, - ValidateFunc: azure.ValidateResourceID, - }, - - "replication_frequency": { - Type: pluginsdk.TypeString, - Required: true, - ValidateFunc: validation.StringInSlice([]string{ - "10minutes", - "daily", - "hourly", - }, false), - }, - }, - }, - }, - - "data_protection_snapshot_policy": { - Type: pluginsdk.TypeList, - Optional: true, - MaxItems: 1, - Elem: &pluginsdk.Resource{ - Schema: map[string]*pluginsdk.Schema{ - "snapshot_policy_id": { - Type: pluginsdk.TypeString, - Required: true, - ValidateFunc: azure.ValidateResourceID, - }, - }, - }, - }, - }, + Schema: netAppVolumeSchema(), } } @@ -805,7 +570,7 @@ func netappVolumeReplicationMirrorStateRefreshFunc(ctx context.Context, client * // Possible Mirror States to be used as desiredStates: // mirrored, broken or uninitialized if !utils.SliceContainsValue(validStates, strings.ToLower(desiredState)) { - return nil, "", fmt.Errorf("Invalid desired mirror state was passed to check mirror replication state (%s), possible values: (%+v)", desiredState, volumesreplication.PossibleValuesForMirrorState()) + return nil, "", fmt.Errorf("invalid desired mirror state was passed to check mirror replication state (%s), possible values: (%+v)", desiredState, volumesreplication.PossibleValuesForMirrorState()) } res, err := client.VolumesReplicationStatus(ctx, id) diff --git a/internal/services/netapp/netapp_volume_resource_test.go b/internal/services/netapp/netapp_volume_resource_test.go index e6c971498a91..539cf40d746c 100644 --- a/internal/services/netapp/netapp_volume_resource_test.go +++ b/internal/services/netapp/netapp_volume_resource_test.go @@ -522,7 +522,7 @@ resource "azurerm_netapp_volume" "test_snapshot_vol" { protocols = ["NFSv3"] storage_quota_in_gb = 200 create_from_snapshot_resource_id = azurerm_netapp_snapshot.test.id - throughput_in_mibps = 3.2 + throughput_in_mibps = 3.125 export_policy_rule { rule_index = 1 diff --git a/internal/services/netapp/registration.go b/internal/services/netapp/registration.go index e92aa38508b0..866af01c08ff 100644 --- a/internal/services/netapp/registration.go +++ b/internal/services/netapp/registration.go @@ -7,19 +7,22 @@ import ( type Registration struct{} -var _ sdk.UntypedServiceRegistrationWithAGitHubLabel = Registration{} +var ( + _ sdk.TypedServiceRegistration = Registration{} + _ sdk.UntypedServiceRegistrationWithAGitHubLabel = Registration{} +) func (r Registration) AssociatedGitHubLabel() string { return "service/netapp" } func (r Registration) Name() string { - return "NetApp" + return "netapp" } func (r Registration) WebsiteCategories() []string { return []string{ - "NetApp", + "netapp", } } @@ -42,3 +45,15 @@ func (r Registration) SupportedResources() map[string]*pluginsdk.Resource { "azurerm_netapp_snapshot_policy": resourceNetAppSnapshotPolicy(), } } + +// DataSources returns the typed DataSources supported by this service +func (r Registration) DataSources() []sdk.DataSource { + return []sdk.DataSource{} +} + +// Resources returns the typed Resources supported by this service +func (r Registration) Resources() []sdk.Resource { + return []sdk.Resource{ + NetAppVolumeGroupResource{}, + } +} From 7a5cb1be75c5fbfebe6752ae018804bf2a405e30 Mon Sep 17 00:00:00 2001 From: Paulo Date: Thu, 14 Jul 2022 16:16:38 -0700 Subject: [PATCH 03/83] AVG WIP --- internal/services/netapp/client/client.go | 2 +- internal/services/netapp/netapp_volume.go | 387 +++++++++++++----- .../netapp/netapp_volume_group_resource.go | 110 +---- .../netapp_volume_group_resource_test.go | 38 +- .../services/netapp/netapp_volume_resource.go | 98 ++++- 5 files changed, 414 insertions(+), 221 deletions(-) diff --git a/internal/services/netapp/client/client.go b/internal/services/netapp/client/client.go index 6bc48e8f2b12..4c640edc193a 100644 --- a/internal/services/netapp/client/client.go +++ b/internal/services/netapp/client/client.go @@ -32,7 +32,7 @@ func NewClient(o *common.ClientOptions) *Client { o.ConfigureClient(&volumeClient.Client, o.ResourceManagerAuthorizer) volumeGroupClient := volumegroups.NewVolumeGroupsClientWithBaseURI(o.ResourceManagerEndpoint) - o.ConfigureClient(&volumeClient.Client, o.ResourceManagerAuthorizer) + o.ConfigureClient(&volumeGroupClient.Client, o.ResourceManagerAuthorizer) volumeReplicationClient := volumesreplication.NewVolumesReplicationClientWithBaseURI(o.ResourceManagerEndpoint) o.ConfigureClient(&volumeReplicationClient.Client, o.ResourceManagerAuthorizer) diff --git a/internal/services/netapp/netapp_volume.go b/internal/services/netapp/netapp_volume.go index 68b80a9d2ef7..9c395fc1d068 100644 --- a/internal/services/netapp/netapp_volume.go +++ b/internal/services/netapp/netapp_volume.go @@ -1,6 +1,7 @@ package netapp import ( + "fmt" "strings" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" @@ -148,46 +149,55 @@ func netAppVolumeCommonSchema() map[string]*pluginsdk.Schema { "unix_read_only": { Type: pluginsdk.TypeBool, Optional: true, + Computed: true, }, "unix_read_write": { Type: pluginsdk.TypeBool, Optional: true, + Computed: true, }, "root_access_enabled": { Type: pluginsdk.TypeBool, Optional: true, + Computed: true, }, "kerberos5_read_only": { Type: pluginsdk.TypeBool, Optional: true, + Computed: true, }, "kerberos5_read_write": { Type: pluginsdk.TypeBool, Optional: true, + Computed: true, }, "kerberos5i_read_only": { Type: pluginsdk.TypeBool, Optional: true, + Computed: true, }, "kerberos5i_read_write": { Type: pluginsdk.TypeBool, Optional: true, + Computed: true, }, "kerberos5p_read_only": { Type: pluginsdk.TypeBool, Optional: true, + Computed: true, }, "kerberos5p_read_write": { Type: pluginsdk.TypeBool, Optional: true, + Computed: true, }, }, }, @@ -336,11 +346,11 @@ type NetAppVolumeGroupVolume struct { NetworkFeatures string `tfschema:"network_features"` Protocols []string `tfschema:"protocols"` SecurityStyle string `tfschema:"security_style"` - StorageQuotaInGB int `tfschema:"storage_quota_in_gb"` - ThroughputInMibps float32 `tfschema:"throughput_in_mibps"` + StorageQuotaInGB int64 `tfschema:"storage_quota_in_gb"` + ThroughputInMibps float64 `tfschema:"throughput_in_mibps"` Tags map[string]string `tfschema:"tags"` MountIpAddresses []string `tfschema:"mount_ip_addresses"` - SnapshotDirectoryVisible string `tfschema:"snapshot_directory_visible"` + SnapshotDirectoryVisible bool `tfschema:"snapshot_directory_visible"` CapacityPoolId string `tfschema:"capacity_pool_id"` ProximityPlacementGroupId string `tfschema:"proximity_placement_group_id"` VolumeSpecName string `tfschema:"volume_spec_name"` @@ -351,7 +361,7 @@ type NetAppVolumeGroupVolume struct { type ExportPolicyRule struct { RuleIndex int `tfschema:"rule_index"` - AllowedClients string `tfschema:"allowed_clients"` + AllowedClients []string `tfschema:"allowed_clients"` ProtocolsEnabled []string `tfschema:"protocols_enabled"` UnixReadOnly bool `tfschema:"unix_read_only"` UnixReadWrite bool `tfschema:"unix_read_write"` @@ -375,144 +385,315 @@ type DataProtectionSnapshotPolicy struct { DataProtectionSnapshotPolicy string `tfschema:"data_protection_snapshot_policy"` } -func convertExportPolicyToInterface(exportPolicyList []ExportPolicyRule) []interface{} { - items := make([]interface{}, len(exportPolicyList)) - for i, v := range exportPolicyList { - items[i] = v +func expandNetAppVolumeGroupExportPolicyRule(input []ExportPolicyRule) *volumegroups.VolumePropertiesExportPolicy { + + if len(input) == 0 || input == nil { + return &volumegroups.VolumePropertiesExportPolicy{} } - return items -} + results := make([]volumegroups.ExportPolicyRule, 0) -type SupportedObjects interface { - ExportPolicyRule | DataProtectionReplication | DataProtectionSnapshotPolicy + for _, item := range input { + cifsEnabled := false + nfsv3Enabled := false + nfsv41Enabled := false + + if len(item.ProtocolsEnabled) != 0 { + for _, protocol := range item.ProtocolsEnabled { + if protocol != "" { + switch strings.ToLower(protocol) { + case "cifs": + cifsEnabled = true + case "nfsv3": + nfsv3Enabled = true + case "nfsv4.1": + nfsv41Enabled = true + } + } + } + } + + result := volumegroups.ExportPolicyRule{ + AllowedClients: utils.String(strings.Join(item.AllowedClients, ",")), + Cifs: utils.Bool(cifsEnabled), + Nfsv3: utils.Bool(nfsv3Enabled), + Nfsv41: utils.Bool(nfsv41Enabled), + RuleIndex: utils.Int64(int64(item.RuleIndex)), + UnixReadOnly: utils.Bool(item.UnixReadOnly), + UnixReadWrite: utils.Bool(item.UnixReadWrite), + HasRootAccess: utils.Bool(item.RootAccessEnabled), + Kerberos5ReadOnly: utils.Bool(item.Kerberos5ReadOnly), + Kerberos5ReadWrite: utils.Bool(item.Kerberos5ReadWrite), + Kerberos5iReadOnly: utils.Bool(item.Kerberos5iReadOnly), + Kerberos5iReadWrite: utils.Bool(item.Kerberos5iReadWrite), + Kerberos5pReadOnly: utils.Bool(item.Kerberos5pReadOnly), + Kerberos5pReadWrite: utils.Bool(item.Kerberos5ReadWrite), + } + + results = append(results, result) + } + + return &volumegroups.VolumePropertiesExportPolicy{ + Rules: &results, + } } -func convertSliceToInterface[T SupportedObjects](slice []T) []interface{} { +func expandNetAppVolumeGroupDataProtectionReplication(input []DataProtectionReplication) *volumegroups.VolumePropertiesDataProtection { + if len(input) == 0 || input == nil { + return &volumegroups.VolumePropertiesDataProtection{} + } + + replicationObject := volumegroups.ReplicationObject{} + + endpointType := volumegroups.EndpointType(input[0].EndpointType) + replicationObject.EndpointType = &endpointType + + replicationObject.RemoteVolumeRegion = &input[0].RemoteVolumeLocation + replicationObject.RemoteVolumeResourceId = input[0].RemoteVolumeResourceId + + replicationSchedule := volumegroups.ReplicationSchedule(translateTFSchedule(input[0].ReplicationFrequency)) + replicationObject.ReplicationSchedule = &replicationSchedule - items := make([]interface{}, len(slice)) - for i, v := range slice { - items[i] = v + return &volumegroups.VolumePropertiesDataProtection{ + Replication: &replicationObject, } +} - return items +func expandNetAppVolumeGroupDataProtectionSnapshotPolicy(input []DataProtectionSnapshotPolicy) *volumegroups.VolumePropertiesDataProtection { + if len(input) == 0 || input == nil { + return &volumegroups.VolumePropertiesDataProtection{} + } + + snapshotObject := volumegroups.VolumeSnapshotProperties{} + snapshotObject.SnapshotPolicyId = &input[0].DataProtectionSnapshotPolicy + + return &volumegroups.VolumePropertiesDataProtection{ + Snapshot: &snapshotObject, + } } -func expandNetAppVolumeGroupExportPolicyRule(input []interface{}) *volumegroups.VolumePropertiesExportPolicy { +func expandNetAppVolumeGroupVolumes(input []NetAppVolumeGroupVolume, id volumegroups.VolumeGroupId) (*[]volumegroups.VolumeGroupVolumeProperties, error) { - if len(input) == 0 || input[0] == nil { - return &volumegroups.VolumePropertiesExportPolicy{} + if len(input) == 0 || input == nil { + return &[]volumegroups.VolumeGroupVolumeProperties{}, fmt.Errorf("received empty NetAppVolumeGroupVolume slice") } - results := make([]volumegroups.ExportPolicyRule, 0) + results := make([]volumegroups.VolumeGroupVolumeProperties, 0) for _, item := range input { - if item != nil { - v := item.(map[string]interface{}) - ruleIndex := int32(v["rule_index"].(int)) - allowedClients := strings.Join(*utils.ExpandStringSlice(v["allowed_clients"].(*pluginsdk.Set).List()), ",") - - cifsEnabled := false - nfsv3Enabled := false - nfsv41Enabled := false - - if vpe := v["protocols_enabled"]; vpe != nil { - protocolsEnabled := vpe.([]interface{}) - if len(protocolsEnabled) != 0 { - for _, protocol := range protocolsEnabled { - if protocol != nil { - switch strings.ToLower(protocol.(string)) { - case "cifs": - cifsEnabled = true - case "nfsv3": - nfsv3Enabled = true - case "nfsv4.1": - nfsv41Enabled = true - } - } - } - } - } + name := item.Name + volumePath := item.VolumePath + serviceLevel := volumegroups.ServiceLevel(item.ServiceLevel) + subnetID := item.SubnetId + capacityPoolID := item.CapacityPoolId + + networkFeatures := volumegroups.NetworkFeatures(item.NetworkFeatures) + if networkFeatures == "" { + networkFeatures = volumegroups.NetworkFeaturesBasic + } - unixReadOnly := v["unix_read_only"].(bool) - unixReadWrite := v["unix_read_write"].(bool) - rootAccessEnabled := v["root_access_enabled"].(bool) - kerberos5ReadOnly := v["kerberos5_read_only"].(bool) - kerberos5ReadWrite := v["kerberos5_read_write"].(bool) - kerberos5iReadOnly := v["kerberos5i_read_only"].(bool) - kerberos5iReadWrite := v["kerberos5i_read_write"].(bool) - kerberos5pReadOnly := v["kerberos5p_read_only"].(bool) - kerberos5pReadWrite := v["kerberos5p_read_write"].(bool) - - result := volumegroups.ExportPolicyRule{ - AllowedClients: utils.String(allowedClients), - Cifs: utils.Bool(cifsEnabled), - Nfsv3: utils.Bool(nfsv3Enabled), - Nfsv41: utils.Bool(nfsv41Enabled), - RuleIndex: utils.Int64(int64(ruleIndex)), - UnixReadOnly: utils.Bool(unixReadOnly), - UnixReadWrite: utils.Bool(unixReadWrite), - HasRootAccess: utils.Bool(rootAccessEnabled), - Kerberos5ReadOnly: utils.Bool(kerberos5ReadOnly), - Kerberos5ReadWrite: utils.Bool(kerberos5ReadWrite), - Kerberos5iReadOnly: utils.Bool(kerberos5iReadOnly), - Kerberos5iReadWrite: utils.Bool(kerberos5iReadWrite), - Kerberos5pReadOnly: utils.Bool(kerberos5pReadOnly), - Kerberos5pReadWrite: utils.Bool(kerberos5pReadWrite), - } + protocols := item.Protocols + if len(protocols) == 0 { + protocols = append(protocols, "NFSv3") + } + + // Handling security style property + securityStyle := volumegroups.SecurityStyle(item.SecurityStyle) + if strings.EqualFold(string(securityStyle), "unix") && len(protocols) == 1 && strings.EqualFold(protocols[0], "cifs") { + return &[]volumegroups.VolumeGroupVolumeProperties{}, fmt.Errorf("unix security style cannot be used in a CIFS enabled volume for %s", id) - results = append(results, result) } - } + if strings.EqualFold(string(securityStyle), "ntfs") && len(protocols) == 1 && (strings.EqualFold(protocols[0], "nfsv3") || strings.EqualFold(protocols[0], "nfsv4.1")) { + return &[]volumegroups.VolumeGroupVolumeProperties{}, fmt.Errorf("ntfs security style cannot be used in a NFSv3/NFSv4.1 enabled volume for %s", id) + } - return &volumegroups.VolumePropertiesExportPolicy{ - Rules: &results, + storageQuotaInGB := int64(item.StorageQuotaInGB * 1073741824) + exportPolicyRule := expandNetAppVolumeGroupExportPolicyRule(item.ExportPolicy) + dataProtectionReplication := expandNetAppVolumeGroupDataProtectionReplication(item.DataProtectionReplication) + dataProtectionSnapshotPolicy := expandNetAppVolumeGroupDataProtectionSnapshotPolicy(item.DataProtectionSnapshotPolicy) + + volumeType := "" + if dataProtectionReplication != nil && dataProtectionReplication.Replication != nil && strings.ToLower(string(*dataProtectionReplication.Replication.EndpointType)) == "dst" { + volumeType = "DataProtection" + } + + // Validating that snapshot policies are not being created in a data protection volume + if dataProtectionSnapshotPolicy != nil && volumeType != "" { + return &[]volumegroups.VolumeGroupVolumeProperties{}, fmt.Errorf("snapshot policy cannot be enabled on a data protection volume for %s", id) + } + + volumeProperties := &volumegroups.VolumeGroupVolumeProperties{ + Name: utils.String(name), + Properties: volumegroups.VolumeProperties{ + CapacityPoolResourceId: utils.String(capacityPoolID), + CreationToken: volumePath, + ServiceLevel: &serviceLevel, + SubnetId: subnetID, + NetworkFeatures: &networkFeatures, + ProtocolTypes: &protocols, + SecurityStyle: &securityStyle, + UsageThreshold: storageQuotaInGB, + ExportPolicy: exportPolicyRule, + VolumeType: utils.String(volumeType), + ThroughputMibps: utils.Float(float64(item.ThroughputInMibps)), + ProximityPlacementGroup: utils.String(item.ProximityPlacementGroupId), + VolumeSpecName: utils.String(item.VolumeSpecName), + DataProtection: &volumegroups.VolumePropertiesDataProtection{ + Replication: dataProtectionReplication.Replication, + Snapshot: dataProtectionSnapshotPolicy.Snapshot, + }, + SnapshotDirectoryVisible: &item.SnapshotDirectoryVisible, + }, + Tags: &item.Tags, + } + + results = append(results, *volumeProperties) } + + return &results, nil } -func expandNetAppVolumeGroupDataProtectionReplication(input []interface{}) *volumegroups.VolumePropertiesDataProtection { - if len(input) == 0 || input[0] == nil { - return &volumegroups.VolumePropertiesDataProtection{} +func flattenNetAppVolumeGroupVolumes(input *[]volumegroups.VolumeGroupVolumeProperties) ([]NetAppVolumeGroupVolume, error) { + results := make([]NetAppVolumeGroupVolume, 0) + + if len(*input) == 0 || input == nil { + return results, fmt.Errorf("received empty volumegroups.VolumeGroupVolumeProperties slice") } - replicationObject := volumegroups.ReplicationObject{} + for _, item := range *input { + props := item.Properties - replicationRaw := input[0].(map[string]interface{}) + volumeGroupVolume := NetAppVolumeGroupVolume{} + + volumeGroupVolume.VolumePath = props.CreationToken + volumeGroupVolume.ServiceLevel = string(*props.ServiceLevel) + volumeGroupVolume.SubnetId = props.SubnetId + volumeGroupVolume.NetworkFeatures = getNetworkFeaturesString(props.NetworkFeatures) + volumeGroupVolume.Protocols = *props.ProtocolTypes + volumeGroupVolume.SecurityStyle = string(*props.SecurityStyle) + volumeGroupVolume.SnapshotDirectoryVisible = *props.SnapshotDirectoryVisible + volumeGroupVolume.ThroughputInMibps = float64(*props.ThroughputMibps) + + if int64(props.UsageThreshold) > 0 { + usageThreshold := int64(props.UsageThreshold) / 1073741824 + volumeGroupVolume.StorageQuotaInGB = usageThreshold + } - if v, ok := replicationRaw["endpoint_type"]; ok { - endpointType := volumegroups.EndpointType(v.(string)) - replicationObject.EndpointType = &endpointType + if props.ExportPolicy != nil && len(*props.ExportPolicy.Rules) > 0 { + volumeGroupVolume.ExportPolicy = flattenNetAppVolumeGroupVolumesExportPolicies(props.ExportPolicy.Rules) + } + + if props.MountTargets != nil && len(*props.MountTargets) > 0 { + volumeGroupVolume.MountIpAddresses = flattenNetAppVolumeGroupVolumesMountIpAddresses(props.MountTargets) + } + + if props.DataProtection != nil && props.DataProtection.Replication != nil { + volumeGroupVolume.DataProtectionReplication = flattenNetAppVolumeGroupVolumesDPReplication(props.DataProtection.Replication) + } + + if props.DataProtection != nil && props.DataProtection.Snapshot != nil { + volumeGroupVolume.DataProtectionSnapshotPolicy = flattenNetAppVolumeGroupVolumesDPSnapshotPolicy(props.DataProtection.Snapshot) + } + + results = append(results, volumeGroupVolume) } - if v, ok := replicationRaw["remote_volume_location"]; ok { - replicationObject.RemoteVolumeRegion = utils.String(v.(string)) + + return results, nil +} + +func flattenNetAppVolumeGroupVolumesExportPolicies(input *[]volumegroups.ExportPolicyRule) []ExportPolicyRule { + results := make([]ExportPolicyRule, 0) + + if len(*input) == 0 || input == nil { + return results } - if v, ok := replicationRaw["remote_volume_resource_id"]; ok { - replicationObject.RemoteVolumeResourceId = v.(string) + + for _, item := range *input { + rule := ExportPolicyRule{} + + rule.RuleIndex = int(*item.RuleIndex) + rule.AllowedClients = strings.Split(*item.AllowedClients, ",") + + protocolsEnabled := []string{} + if *item.Cifs { + protocolsEnabled = append(protocolsEnabled, "CIFS") + } + if *item.Nfsv3 { + protocolsEnabled = append(protocolsEnabled, "NFSv3") + } + if *item.Nfsv41 { + protocolsEnabled = append(protocolsEnabled, "NFSv4.1") + } + rule.ProtocolsEnabled = protocolsEnabled + + rule.UnixReadOnly = *item.UnixReadOnly + rule.UnixReadWrite = *item.UnixReadWrite + rule.Kerberos5ReadOnly = *item.Kerberos5ReadOnly + rule.Kerberos5ReadWrite = *item.Kerberos5ReadWrite + rule.Kerberos5iReadOnly = *item.Kerberos5iReadOnly + rule.Kerberos5iReadWrite = *item.Kerberos5iReadWrite + rule.Kerberos5pReadOnly = *item.Kerberos5pReadOnly + rule.Kerberos5pReadWrite = *item.Kerberos5pReadWrite + + rule.RootAccessEnabled = *item.HasRootAccess + + results = append(results, rule) } - if v, ok := replicationRaw["replication_frequency"]; ok { - replicationSchedule := volumegroups.ReplicationSchedule(translateTFSchedule(v.(string))) - replicationObject.ReplicationSchedule = &replicationSchedule + + return results +} + +func flattenNetAppVolumeGroupVolumesMountIpAddresses(input *[]volumegroups.MountTargetProperties) []string { + results := make([]string, 0) + + if len(*input) == 0 || input == nil { + return results } - return &volumegroups.VolumePropertiesDataProtection{ - Replication: &replicationObject, + for _, item := range *input { + if item.IpAddress != nil { + results = append(results, *item.IpAddress) + } } + + return results } -func expandNetAppVolumeGroupDataProtectionSnapshotPolicy(input []interface{}) *volumegroups.VolumePropertiesDataProtection { - if len(input) == 0 || input[0] == nil { - return &volumegroups.VolumePropertiesDataProtection{} +func flattenNetAppVolumeGroupVolumesDPReplication(input *volumegroups.ReplicationObject) []DataProtectionReplication { + if input == nil { + return []DataProtectionReplication{} } - snapshotObject := volumegroups.VolumeSnapshotProperties{} + if strings.ToLower(string(*input.EndpointType)) == "" || strings.ToLower(string(*input.EndpointType)) != "dst" { + return []DataProtectionReplication{} + } + + return []DataProtectionReplication{ + { + EndpointType: string(*input.EndpointType), + RemoteVolumeLocation: *input.RemoteVolumeRegion, + RemoteVolumeResourceId: input.RemoteVolumeResourceId, + ReplicationFrequency: string(*input.ReplicationSchedule), + }, + } +} - snapshotRaw := input[0].(map[string]interface{}) +func flattenNetAppVolumeGroupVolumesDPSnapshotPolicy(input *volumegroups.VolumeSnapshotProperties) []DataProtectionSnapshotPolicy { + if input == nil { + return []DataProtectionSnapshotPolicy{} + } - if v, ok := snapshotRaw["snapshot_policy_id"]; ok { - snapshotObject.SnapshotPolicyId = utils.String(v.(string)) + return []DataProtectionSnapshotPolicy{ + { + DataProtectionSnapshotPolicy: *input.SnapshotPolicyId, + }, } +} - return &volumegroups.VolumePropertiesDataProtection{ - Snapshot: &snapshotObject, +func getNetworkFeaturesString(input *volumegroups.NetworkFeatures) string { + if input == nil { + return string(volumegroups.NetworkFeaturesBasic) } + + return string(*input) } diff --git a/internal/services/netapp/netapp_volume_group_resource.go b/internal/services/netapp/netapp_volume_group_resource.go index f3723c7f233b..ab10cf5d5a76 100644 --- a/internal/services/netapp/netapp_volume_group_resource.go +++ b/internal/services/netapp/netapp_volume_group_resource.go @@ -4,11 +4,10 @@ import ( "context" "fmt" "net/http" - "strconv" - "strings" "time" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" + "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" @@ -29,7 +28,7 @@ type NetAppVolumeGroupModel struct { ApplicationType string `tfschema:"application_type"` ApplicationIdentifier string `tfschema:"application_identifier"` DeploymentSpecId string `tfschema:"deployment_spec_id"` - Tags map[string]string `tfschema:"tags"` + Tags map[string]interface{} `tfschema:"tags"` Volumes []NetAppVolumeGroupVolume `tfschema:"volume"` } @@ -115,6 +114,8 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { Type: pluginsdk.TypeString, }, }, + + //"tags": commonschema.Tags(), } } @@ -155,84 +156,9 @@ func (r NetAppVolumeGroupResource) Create() sdk.ResourceFunc { applicationType := volumegroups.ApplicationType(model.ApplicationType) - volumeList := make([]volumegroups.VolumeGroupVolumeProperties, 0) - for _, item := range model.Volumes { - name := item.Name - volumePath := item.VolumePath - serviceLevel := volumegroups.ServiceLevel(item.ServiceLevel) - subnetID := item.SubnetId - capacityPoolID := item.CapacityPoolId - - networkFeatures := volumegroups.NetworkFeatures(item.NetworkFeatures) - if networkFeatures == "" { - networkFeatures = volumegroups.NetworkFeaturesBasic - } - - protocols := item.Protocols - if len(protocols) == 0 { - protocols = append(protocols, "NFSv3") - } - - // Handling security style property - securityStyle := volumegroups.SecurityStyle(item.SecurityStyle) - if strings.EqualFold(string(securityStyle), "unix") && len(protocols) == 1 && strings.EqualFold(protocols[0], "cifs") { - return fmt.Errorf("unix security style cannot be used in a CIFS enabled volume for %s", id) - - } - if strings.EqualFold(string(securityStyle), "ntfs") && len(protocols) == 1 && (strings.EqualFold(protocols[0], "nfsv3") || strings.EqualFold(protocols[0], "nfsv4.1")) { - return fmt.Errorf("ntfs security style cannot be used in a NFSv3/NFSv4.1 enabled volume for %s", id) - } - - storageQuotaInGB := int64(item.StorageQuotaInGB * 1073741824) - exportPolicyRule := expandNetAppVolumeGroupExportPolicyRule(convertSliceToInterface(item.ExportPolicy)) - dataProtectionReplication := expandNetAppVolumeGroupDataProtectionReplication(convertSliceToInterface(item.DataProtectionReplication)) - dataProtectionSnapshotPolicy := expandNetAppVolumeGroupDataProtectionSnapshotPolicy(convertSliceToInterface(item.DataProtectionSnapshotPolicy)) - - volumeType := "" - if dataProtectionReplication != nil && dataProtectionReplication.Replication != nil && strings.ToLower(string(*dataProtectionReplication.Replication.EndpointType)) == "dst" { - volumeType = "DataProtection" - } - - // Validating that snapshot policies are not being created in a data protection volume - if dataProtectionSnapshotPolicy != nil && volumeType != "" { - return fmt.Errorf("snapshot policy cannot be enabled on a data protection volume for %s", id) - } - - snapshotDirectoryVisible, err := strconv.ParseBool(item.SnapshotDirectoryVisible) - if err != nil { - return fmt.Errorf("could not convert SnapshotDirectoryVisible string to bool: %+v", err) - } - - volumeProperties := &volumegroups.VolumeGroupVolumeProperties{ - Name: utils.String(name), - Properties: volumegroups.VolumeProperties{ - CapacityPoolResourceId: utils.String(capacityPoolID), - CreationToken: volumePath, - ServiceLevel: &serviceLevel, - SubnetId: subnetID, - NetworkFeatures: &networkFeatures, - ProtocolTypes: &protocols, - SecurityStyle: &securityStyle, - UsageThreshold: storageQuotaInGB, - ExportPolicy: exportPolicyRule, - VolumeType: utils.String(volumeType), - DataProtection: &volumegroups.VolumePropertiesDataProtection{ - Replication: dataProtectionReplication.Replication, - Snapshot: dataProtectionSnapshotPolicy.Snapshot, - }, - SnapshotDirectoryVisible: &snapshotDirectoryVisible, - }, - Tags: &item.Tags, - } - - if _, ok := metadata.ResourceData.GetOk("throughput_in_mibps"); ok { - volumeProperties.Properties.ThroughputMibps = utils.Float(float64(item.ThroughputInMibps)) - } - - volumeProperties.Properties.ProximityPlacementGroup = utils.String(item.ProximityPlacementGroupId) - volumeProperties.Properties.VolumeSpecName = utils.String(item.VolumeSpecName) - - volumeList = append(volumeList, *volumeProperties) + volumeList, err := expandNetAppVolumeGroupVolumes(model.Volumes, id) + if err != nil { + return err } parameters := volumegroups.VolumeGroupDetails{ @@ -244,9 +170,9 @@ func (r NetAppVolumeGroupResource) Create() sdk.ResourceFunc { ApplicationIdentifier: utils.String(model.ApplicationIdentifier), DeploymentSpecId: utils.String(model.DeploymentSpecId), }, - Volumes: &volumeList, + Volumes: volumeList, }, - Tags: &model.Tags, + Tags: tags.Expand(model.Tags), } err = client.VolumeGroupsCreateThenPoll(ctx, id, parameters) @@ -254,6 +180,7 @@ func (r NetAppVolumeGroupResource) Create() sdk.ResourceFunc { return fmt.Errorf("creating %s: %+v", id, err) } + // TODO: Check if this is necessary for volume groups // // Waiting for volume be completely provisioned // if err := waitForVolumeCreateOrUpdate(ctx, client, id); err != nil { // return err @@ -297,16 +224,23 @@ func (r NetAppVolumeGroupResource) Read() sdk.ResourceFunc { AccountName: id.AccountName, Location: location.NormalizeNilable(existing.Model.Location), ResourceGroupName: id.ResourceGroupName, - Tags: *existing.Model.Tags, + Tags: tags.Flatten(existing.Model.Tags), } if props := existing.Model.Properties; props != nil { - model.GroupDescription = *props.GroupMetaData.GroupDescription - model.ApplicationIdentifier = *props.GroupMetaData.ApplicationIdentifier - model.DeploymentSpecId = *props.GroupMetaData.DeploymentSpecId + model.GroupDescription = utils.NormalizeNilableString(props.GroupMetaData.GroupDescription) + model.ApplicationIdentifier = utils.NormalizeNilableString(props.GroupMetaData.ApplicationIdentifier) + model.DeploymentSpecId = utils.NormalizeNilableString(props.GroupMetaData.DeploymentSpecId) + + volumes, err := flattenNetAppVolumeGroupVolumes(props.Volumes) + if err != nil { + return fmt.Errorf("setting `volume`: %+v", err) + } + + model.Volumes = volumes } - return nil + return metadata.Encode(&model) }, } } diff --git a/internal/services/netapp/netapp_volume_group_resource_test.go b/internal/services/netapp/netapp_volume_group_resource_test.go index 24cc446c9877..1b9b48529a72 100644 --- a/internal/services/netapp/netapp_volume_group_resource_test.go +++ b/internal/services/netapp/netapp_volume_group_resource_test.go @@ -90,6 +90,7 @@ resource "azurerm_netapp_volume_group" "test" { } tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", "SkipASMAzSecPack" = "true" } } @@ -120,6 +121,7 @@ resource "azurerm_netapp_volume_group" "test" { } tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", "SkipASMAzSecPack" = "true" } } @@ -150,6 +152,7 @@ resource "azurerm_netapp_volume_group" "test" { } tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", "SkipASMAzSecPack" = "true" } } @@ -180,6 +183,7 @@ resource "azurerm_netapp_volume_group" "test" { } tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", "SkipASMAzSecPack" = "true" } } @@ -210,14 +214,11 @@ resource "azurerm_netapp_volume_group" "test" { } tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", "SkipASMAzSecPack" = "true" } } - tags = { - "SkipASMAzSecPack" = "true" - } - depends_on = [ azurerm_linux_virtual_machine.test, azurerm_proximity_placement_group.test @@ -247,7 +248,9 @@ resource "azurerm_resource_group" "test" { location = "%[2]s" tags = { - "SkipASMAzSecPack" = "true" + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true", + "SkipNRMSNSG" = "true" } } @@ -257,7 +260,7 @@ resource "azurerm_network_security_group" "test" { resource_group_name = azurerm_resource_group.test.name tags = { - environment = "Production", + "CreatedOnDate" = "2022-07-08T23:50:21Z", "SkipASMAzSecPack" = "true" } } @@ -269,6 +272,7 @@ resource "azurerm_virtual_network" "test" { address_space = ["10.6.0.0/16"] tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", "SkipASMAzSecPack" = "true" } } @@ -305,6 +309,11 @@ resource "azurerm_proximity_placement_group" "test" { name = "acctest-PPG-%[1]d" location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } } resource "azurerm_availability_set" "test" { @@ -313,6 +322,11 @@ resource "azurerm_availability_set" "test" { resource_group_name = azurerm_resource_group.test.name proximity_placement_group_id = azurerm_proximity_placement_group.test.id + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } } resource "azurerm_network_interface" "test" { @@ -325,6 +339,11 @@ resource "azurerm_network_interface" "test" { subnet_id = azurerm_subnet.test1.id private_ip_address_allocation = "Dynamic" } + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } } resource "azurerm_linux_virtual_machine" "test" { @@ -354,7 +373,10 @@ resource "azurerm_linux_virtual_machine" "test" { } tags = { - "Owner" = "pmarques" + "platformsettings.host_environment.service.platform_optedin_for_rootcerts" = "true", + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true", + "Owner" = "pmarques" } } @@ -369,6 +391,7 @@ resource "azurerm_netapp_account" "test" { ] tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", "SkipASMAzSecPack" = "true" } } @@ -383,6 +406,7 @@ resource "azurerm_netapp_pool" "test" { qos_type = "Manual" tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", "SkipASMAzSecPack" = "true" } } diff --git a/internal/services/netapp/netapp_volume_resource.go b/internal/services/netapp/netapp_volume_resource.go index ac73fb5960a7..4c8f60454fc4 100644 --- a/internal/services/netapp/netapp_volume_resource.go +++ b/internal/services/netapp/netapp_volume_resource.go @@ -643,16 +643,28 @@ func expandNetAppVolumeExportPolicyRule(input []interface{}) *volumes.VolumeProp unixReadOnly := v["unix_read_only"].(bool) unixReadWrite := v["unix_read_write"].(bool) rootAccessEnabled := v["root_access_enabled"].(bool) + kerberos5ReadOnly := v["kerberos5_read_only"].(bool) + kerberos5ReadWrite := v["kerberos5_read_write"].(bool) + kerberos5iReadOnly := v["kerberos5i_read_only"].(bool) + kerberos5iReadWrite := v["kerberos5i_read_write"].(bool) + kerberos5pReadOnly := v["kerberos5p_read_only"].(bool) + kerberos5pReadWrite := v["kerberos5p_read_write"].(bool) result := volumes.ExportPolicyRule{ - AllowedClients: utils.String(allowedClients), - Cifs: utils.Bool(cifsEnabled), - Nfsv3: utils.Bool(nfsv3Enabled), - Nfsv41: utils.Bool(nfsv41Enabled), - RuleIndex: utils.Int64(ruleIndex), - UnixReadOnly: utils.Bool(unixReadOnly), - UnixReadWrite: utils.Bool(unixReadWrite), - HasRootAccess: utils.Bool(rootAccessEnabled), + AllowedClients: utils.String(allowedClients), + Cifs: utils.Bool(cifsEnabled), + Nfsv3: utils.Bool(nfsv3Enabled), + Nfsv41: utils.Bool(nfsv41Enabled), + RuleIndex: utils.Int64(ruleIndex), + UnixReadOnly: utils.Bool(unixReadOnly), + UnixReadWrite: utils.Bool(unixReadWrite), + HasRootAccess: utils.Bool(rootAccessEnabled), + Kerberos5ReadOnly: utils.Bool(kerberos5ReadOnly), + Kerberos5ReadWrite: utils.Bool(kerberos5ReadWrite), + Kerberos5iReadOnly: utils.Bool(kerberos5iReadOnly), + Kerberos5iReadWrite: utils.Bool(kerberos5iReadWrite), + Kerberos5pReadOnly: utils.Bool(kerberos5pReadOnly), + Kerberos5pReadWrite: utils.Bool(kerberos5pReadWrite), } results = append(results, result) @@ -697,16 +709,28 @@ func expandNetAppVolumeExportPolicyRulePatch(input []interface{}) *volumes.Volum unixReadOnly := v["unix_read_only"].(bool) unixReadWrite := v["unix_read_write"].(bool) rootAccessEnabled := v["root_access_enabled"].(bool) + kerberos5ReadOnly := v["kerberos5_read_only"].(bool) + kerberos5ReadWrite := v["kerberos5_read_write"].(bool) + kerberos5iReadOnly := v["kerberos5i_read_only"].(bool) + kerberos5iReadWrite := v["kerberos5i_read_write"].(bool) + kerberos5pReadOnly := v["kerberos5p_read_only"].(bool) + kerberos5pReadWrite := v["kerberos5p_read_write"].(bool) result := volumes.ExportPolicyRule{ - AllowedClients: utils.String(allowedClients), - Cifs: utils.Bool(cifsEnabled), - Nfsv3: utils.Bool(nfsv3Enabled), - Nfsv41: utils.Bool(nfsv41Enabled), - RuleIndex: utils.Int64(ruleIndex), - UnixReadOnly: utils.Bool(unixReadOnly), - UnixReadWrite: utils.Bool(unixReadWrite), - HasRootAccess: utils.Bool(rootAccessEnabled), + AllowedClients: utils.String(allowedClients), + Cifs: utils.Bool(cifsEnabled), + Nfsv3: utils.Bool(nfsv3Enabled), + Nfsv41: utils.Bool(nfsv41Enabled), + RuleIndex: utils.Int64(ruleIndex), + UnixReadOnly: utils.Bool(unixReadOnly), + UnixReadWrite: utils.Bool(unixReadWrite), + HasRootAccess: utils.Bool(rootAccessEnabled), + Kerberos5ReadOnly: utils.Bool(kerberos5ReadOnly), + Kerberos5ReadWrite: utils.Bool(kerberos5ReadWrite), + Kerberos5iReadOnly: utils.Bool(kerberos5iReadOnly), + Kerberos5iReadWrite: utils.Bool(kerberos5iReadWrite), + Kerberos5pReadOnly: utils.Bool(kerberos5pReadOnly), + Kerberos5pReadWrite: utils.Bool(kerberos5pReadWrite), } results = append(results, result) @@ -827,14 +851,44 @@ func flattenNetAppVolumeExportPolicyRule(input *volumes.VolumePropertiesExportPo if v := item.HasRootAccess; v != nil { rootAccessEnabled = *v } + kerberos5ReadOnly := false + if v := item.Kerberos5ReadOnly; v != nil { + kerberos5ReadOnly = *v + } + kerberos5ReadWrite := false + if v := item.Kerberos5ReadWrite; v != nil { + kerberos5ReadWrite = *v + } + kerberos5iReadOnly := false + if v := item.Kerberos5iReadOnly; v != nil { + kerberos5iReadOnly = *v + } + kerberos5iReadWrite := false + if v := item.Kerberos5iReadWrite; v != nil { + kerberos5iReadWrite = *v + } + kerberos5pReadOnly := false + if v := item.Kerberos5pReadOnly; v != nil { + kerberos5pReadOnly = *v + } + kerberos5pReadWrite := false + if v := item.Kerberos5pReadWrite; v != nil { + kerberos5pReadWrite = *v + } result := map[string]interface{}{ - "rule_index": ruleIndex, - "allowed_clients": utils.FlattenStringSlice(&allowedClients), - "unix_read_only": unixReadOnly, - "unix_read_write": unixReadWrite, - "root_access_enabled": rootAccessEnabled, - "protocols_enabled": utils.FlattenStringSlice(&protocolsEnabled), + "rule_index": ruleIndex, + "allowed_clients": utils.FlattenStringSlice(&allowedClients), + "unix_read_only": unixReadOnly, + "unix_read_write": unixReadWrite, + "root_access_enabled": rootAccessEnabled, + "protocols_enabled": utils.FlattenStringSlice(&protocolsEnabled), + "kerberos5_read_only": kerberos5ReadOnly, + "kerberos5_read_write": kerberos5ReadWrite, + "kerberos5i_read_only": kerberos5iReadOnly, + "kerberos5i_read_write": kerberos5iReadWrite, + "kerberos5p_read_only": kerberos5pReadOnly, + "kerberos5p_read_write": kerberos5pReadWrite, } results = append(results, result) } From d802c234488a2138041ec524a6794a908c5f7f3d Mon Sep 17 00:00:00 2001 From: Paulo Date: Thu, 14 Jul 2022 17:11:13 -0700 Subject: [PATCH 04/83] Adding volume name to be flatten --- internal/services/netapp/netapp_volume.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/services/netapp/netapp_volume.go b/internal/services/netapp/netapp_volume.go index 9c395fc1d068..b6a7a295910e 100644 --- a/internal/services/netapp/netapp_volume.go +++ b/internal/services/netapp/netapp_volume.go @@ -561,10 +561,12 @@ func flattenNetAppVolumeGroupVolumes(input *[]volumegroups.VolumeGroupVolumeProp } for _, item := range *input { - props := item.Properties - volumeGroupVolume := NetAppVolumeGroupVolume{} + volumeGroupVolume.Name = *item.Name + + props := item.Properties + volumeGroupVolume.VolumePath = props.CreationToken volumeGroupVolume.ServiceLevel = string(*props.ServiceLevel) volumeGroupVolume.SubnetId = props.SubnetId From 5734642ceafe00042111b91308acbc3511a2c029 Mon Sep 17 00:00:00 2001 From: Paulo Date: Fri, 15 Jul 2022 09:36:12 -0700 Subject: [PATCH 05/83] Cleaning up extra info coming from Azure --- internal/services/netapp/netapp_volume.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/internal/services/netapp/netapp_volume.go b/internal/services/netapp/netapp_volume.go index b6a7a295910e..6ba2cd89d800 100644 --- a/internal/services/netapp/netapp_volume.go +++ b/internal/services/netapp/netapp_volume.go @@ -563,7 +563,7 @@ func flattenNetAppVolumeGroupVolumes(input *[]volumegroups.VolumeGroupVolumeProp for _, item := range *input { volumeGroupVolume := NetAppVolumeGroupVolume{} - volumeGroupVolume.Name = *item.Name + volumeGroupVolume.Name = getResourceNameString(item.Name) props := item.Properties @@ -699,3 +699,12 @@ func getNetworkFeaturesString(input *volumegroups.NetworkFeatures) string { return string(*input) } + +func getResourceNameString(input *string) string { + segments := len(strings.Split(*input, "/")) + if segments == 0 { + return "" + } + + return strings.Split(*input, "/")[segments-1] +} From f15b4e07b11ebefa928f51a7bd80b3a830f58e06 Mon Sep 17 00:00:00 2001 From: Paulo Date: Fri, 15 Jul 2022 09:41:44 -0700 Subject: [PATCH 06/83] anf sdk files --- go.mod | 2 +- go.sum | 2 + .../netapp/2021-10-01/volumegroups/README.md | 81 +++++ .../netapp/2021-10-01/volumegroups/client.go | 18 ++ .../2021-10-01/volumegroups/constants.go | 295 ++++++++++++++++++ .../volumegroups/id_netappaccount.go | 124 ++++++++ .../2021-10-01/volumegroups/id_volumegroup.go | 137 ++++++++ .../method_volumegroupscreate_autorest.go | 79 +++++ .../method_volumegroupsdelete_autorest.go | 78 +++++ .../method_volumegroupsget_autorest.go | 67 ++++ ...olumegroupslistbynetappaccount_autorest.go | 68 ++++ .../volumegroups/model_exportpolicyrule.go | 22 ++ .../model_mounttargetproperties.go | 11 + .../model_placementkeyvaluepairs.go | 9 + .../volumegroups/model_replicationobject.go | 12 + .../model_volumebackupproperties.go | 11 + .../volumegroups/model_volumegroup.go | 12 + .../volumegroups/model_volumegroupdetails.go | 13 + .../volumegroups/model_volumegrouplist.go | 8 + .../model_volumegrouplistproperties.go | 9 + .../volumegroups/model_volumegroupmetadata.go | 13 + .../model_volumegroupproperties.go | 10 + .../model_volumegroupvolumeproperties.go | 12 + .../volumegroups/model_volumeproperties.go | 49 +++ .../model_volumepropertiesdataprotection.go | 10 + .../model_volumepropertiesexportpolicy.go | 8 + .../model_volumesnapshotproperties.go | 8 + .../netapp/2021-10-01/volumegroups/version.go | 12 + vendor/modules.txt | 3 +- 29 files changed, 1181 insertions(+), 2 deletions(-) create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/id_netappaccount.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/id_volumegroup.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupscreate_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupsdelete_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupsget_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupslistbynetappaccount_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_exportpolicyrule.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_mounttargetproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_placementkeyvaluepairs.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_replicationobject.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumebackupproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroup.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupdetails.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegrouplist.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegrouplistproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupmetadata.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupvolumeproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumeproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumepropertiesdataprotection.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumepropertiesexportpolicy.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumesnapshotproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/version.go diff --git a/go.mod b/go.mod index dac5127f94a0..49e85b2f142a 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/google/go-cmp v0.5.8 github.com/google/uuid v1.1.2 github.com/hashicorp/go-azure-helpers v0.35.0 - github.com/hashicorp/go-azure-sdk v0.20220701.1073833 + github.com/hashicorp/go-azure-sdk v0.20220708.1064156 github.com/hashicorp/go-multierror v1.1.1 github.com/hashicorp/go-uuid v1.0.3 github.com/hashicorp/go-version v1.6.0 diff --git a/go.sum b/go.sum index 946e0181292b..7e7be197cc3a 100644 --- a/go.sum +++ b/go.sum @@ -218,6 +218,8 @@ github.com/hashicorp/go-azure-helpers v0.35.0 h1:/Jpm37dzTmSHobt9SuC8bK6/jSoWw5F github.com/hashicorp/go-azure-helpers v0.35.0/go.mod h1:gcutZ/Hf/O7YN9M3UIvyZ9l0Rxv7Yrc9x5sSfM9cuSw= github.com/hashicorp/go-azure-sdk v0.20220701.1073833 h1:cwutAQhHojIpJR0a7gyf4884A4KX3Un1lj9SUZDRdxE= github.com/hashicorp/go-azure-sdk v0.20220701.1073833/go.mod h1:yjQPw8DCOtQR8E8+FNaTxF6yz+tyQGkDNiVAGCNoLOo= +github.com/hashicorp/go-azure-sdk v0.20220708.1064156 h1:qtVzr37sv+LgIx+/JPEMxvoAdVrpmltPYv2/zhnQOd0= +github.com/hashicorp/go-azure-sdk v0.20220708.1064156/go.mod h1:yjQPw8DCOtQR8E8+FNaTxF6yz+tyQGkDNiVAGCNoLOo= 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= diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/README.md new file mode 100644 index 000000000000..607525434646 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/README.md @@ -0,0 +1,81 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups` Documentation + +The `volumegroups` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2021-10-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups" +``` + + +### Client Initialization + +```go +client := volumegroups.NewVolumeGroupsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VolumeGroupsClient.VolumeGroupsCreate` + +```go +ctx := context.TODO() +id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "volumeGroupValue") + +payload := volumegroups.VolumeGroupDetails{ + // ... +} + + +if err := client.VolumeGroupsCreateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VolumeGroupsClient.VolumeGroupsDelete` + +```go +ctx := context.TODO() +id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "volumeGroupValue") + +if err := client.VolumeGroupsDeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VolumeGroupsClient.VolumeGroupsGet` + +```go +ctx := context.TODO() +id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "volumeGroupValue") + +read, err := client.VolumeGroupsGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VolumeGroupsClient.VolumeGroupsListByNetAppAccount` + +```go +ctx := context.TODO() +id := volumegroups.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") + +read, err := client.VolumeGroupsListByNetAppAccount(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/client.go new file mode 100644 index 000000000000..c7beab84b9a1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/client.go @@ -0,0 +1,18 @@ +package volumegroups + +import "github.com/Azure/go-autorest/autorest" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupsClient struct { + Client autorest.Client + baseUri string +} + +func NewVolumeGroupsClientWithBaseURI(endpoint string) VolumeGroupsClient { + return VolumeGroupsClient{ + Client: autorest.NewClientWithUserAgent(userAgent()), + baseUri: endpoint, + } +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/constants.go new file mode 100644 index 000000000000..15a1d52b1822 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/constants.go @@ -0,0 +1,295 @@ +package volumegroups + +import "strings" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ApplicationType string + +const ( + ApplicationTypeSAPNegativeHANA ApplicationType = "SAP-HANA" +) + +func PossibleValuesForApplicationType() []string { + return []string{ + string(ApplicationTypeSAPNegativeHANA), + } +} + +func parseApplicationType(input string) (*ApplicationType, error) { + vals := map[string]ApplicationType{ + "sap-hana": ApplicationTypeSAPNegativeHANA, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ApplicationType(input) + return &out, nil +} + +type AvsDataStore string + +const ( + AvsDataStoreDisabled AvsDataStore = "Disabled" + AvsDataStoreEnabled AvsDataStore = "Enabled" +) + +func PossibleValuesForAvsDataStore() []string { + return []string{ + string(AvsDataStoreDisabled), + string(AvsDataStoreEnabled), + } +} + +func parseAvsDataStore(input string) (*AvsDataStore, error) { + vals := map[string]AvsDataStore{ + "disabled": AvsDataStoreDisabled, + "enabled": AvsDataStoreEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AvsDataStore(input) + return &out, nil +} + +type ChownMode string + +const ( + ChownModeRestricted ChownMode = "Restricted" + ChownModeUnrestricted ChownMode = "Unrestricted" +) + +func PossibleValuesForChownMode() []string { + return []string{ + string(ChownModeRestricted), + string(ChownModeUnrestricted), + } +} + +func parseChownMode(input string) (*ChownMode, error) { + vals := map[string]ChownMode{ + "restricted": ChownModeRestricted, + "unrestricted": ChownModeUnrestricted, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ChownMode(input) + return &out, nil +} + +type EnableSubvolumes string + +const ( + EnableSubvolumesDisabled EnableSubvolumes = "Disabled" + EnableSubvolumesEnabled EnableSubvolumes = "Enabled" +) + +func PossibleValuesForEnableSubvolumes() []string { + return []string{ + string(EnableSubvolumesDisabled), + string(EnableSubvolumesEnabled), + } +} + +func parseEnableSubvolumes(input string) (*EnableSubvolumes, error) { + vals := map[string]EnableSubvolumes{ + "disabled": EnableSubvolumesDisabled, + "enabled": EnableSubvolumesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := EnableSubvolumes(input) + return &out, nil +} + +type EndpointType string + +const ( + EndpointTypeDst EndpointType = "dst" + EndpointTypeSrc EndpointType = "src" +) + +func PossibleValuesForEndpointType() []string { + return []string{ + string(EndpointTypeDst), + string(EndpointTypeSrc), + } +} + +func parseEndpointType(input string) (*EndpointType, error) { + vals := map[string]EndpointType{ + "dst": EndpointTypeDst, + "src": EndpointTypeSrc, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := EndpointType(input) + return &out, nil +} + +type NetworkFeatures string + +const ( + NetworkFeaturesBasic NetworkFeatures = "Basic" + NetworkFeaturesStandard NetworkFeatures = "Standard" +) + +func PossibleValuesForNetworkFeatures() []string { + return []string{ + string(NetworkFeaturesBasic), + string(NetworkFeaturesStandard), + } +} + +func parseNetworkFeatures(input string) (*NetworkFeatures, error) { + vals := map[string]NetworkFeatures{ + "basic": NetworkFeaturesBasic, + "standard": NetworkFeaturesStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkFeatures(input) + return &out, nil +} + +type ReplicationSchedule string + +const ( + ReplicationScheduleDaily ReplicationSchedule = "daily" + ReplicationScheduleHourly ReplicationSchedule = "hourly" + ReplicationScheduleOneZerominutely ReplicationSchedule = "_10minutely" +) + +func PossibleValuesForReplicationSchedule() []string { + return []string{ + string(ReplicationScheduleDaily), + string(ReplicationScheduleHourly), + string(ReplicationScheduleOneZerominutely), + } +} + +func parseReplicationSchedule(input string) (*ReplicationSchedule, error) { + vals := map[string]ReplicationSchedule{ + "daily": ReplicationScheduleDaily, + "hourly": ReplicationScheduleHourly, + "_10minutely": ReplicationScheduleOneZerominutely, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ReplicationSchedule(input) + return &out, nil +} + +type SecurityStyle string + +const ( + SecurityStyleNtfs SecurityStyle = "ntfs" + SecurityStyleUnix SecurityStyle = "unix" +) + +func PossibleValuesForSecurityStyle() []string { + return []string{ + string(SecurityStyleNtfs), + string(SecurityStyleUnix), + } +} + +func parseSecurityStyle(input string) (*SecurityStyle, error) { + vals := map[string]SecurityStyle{ + "ntfs": SecurityStyleNtfs, + "unix": SecurityStyleUnix, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityStyle(input) + return &out, nil +} + +type ServiceLevel string + +const ( + ServiceLevelPremium ServiceLevel = "Premium" + ServiceLevelStandard ServiceLevel = "Standard" + ServiceLevelStandardZRS ServiceLevel = "StandardZRS" + ServiceLevelUltra ServiceLevel = "Ultra" +) + +func PossibleValuesForServiceLevel() []string { + return []string{ + string(ServiceLevelPremium), + string(ServiceLevelStandard), + string(ServiceLevelStandardZRS), + string(ServiceLevelUltra), + } +} + +func parseServiceLevel(input string) (*ServiceLevel, error) { + vals := map[string]ServiceLevel{ + "premium": ServiceLevelPremium, + "standard": ServiceLevelStandard, + "standardzrs": ServiceLevelStandardZRS, + "ultra": ServiceLevelUltra, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ServiceLevel(input) + return &out, nil +} + +type VolumeStorageToNetworkProximity string + +const ( + VolumeStorageToNetworkProximityDefault VolumeStorageToNetworkProximity = "Default" + VolumeStorageToNetworkProximityTOne VolumeStorageToNetworkProximity = "T1" + VolumeStorageToNetworkProximityTTwo VolumeStorageToNetworkProximity = "T2" +) + +func PossibleValuesForVolumeStorageToNetworkProximity() []string { + return []string{ + string(VolumeStorageToNetworkProximityDefault), + string(VolumeStorageToNetworkProximityTOne), + string(VolumeStorageToNetworkProximityTTwo), + } +} + +func parseVolumeStorageToNetworkProximity(input string) (*VolumeStorageToNetworkProximity, error) { + vals := map[string]VolumeStorageToNetworkProximity{ + "default": VolumeStorageToNetworkProximityDefault, + "t1": VolumeStorageToNetworkProximityTOne, + "t2": VolumeStorageToNetworkProximityTTwo, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VolumeStorageToNetworkProximity(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/id_netappaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/id_netappaccount.go new file mode 100644 index 000000000000..7b31002a4246 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/id_netappaccount.go @@ -0,0 +1,124 @@ +package volumegroups + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = NetAppAccountId{} + +// NetAppAccountId is a struct representing the Resource ID for a Net App Account +type NetAppAccountId struct { + SubscriptionId string + ResourceGroupName string + AccountName string +} + +// NewNetAppAccountID returns a new NetAppAccountId struct +func NewNetAppAccountID(subscriptionId string, resourceGroupName string, accountName string) NetAppAccountId { + return NetAppAccountId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AccountName: accountName, + } +} + +// ParseNetAppAccountID parses 'input' into a NetAppAccountId +func ParseNetAppAccountID(input string) (*NetAppAccountId, error) { + parser := resourceids.NewParserFromResourceIdType(NetAppAccountId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := NetAppAccountId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseNetAppAccountIDInsensitively parses 'input' case-insensitively into a NetAppAccountId +// note: this method should only be used for API response data and not user input +func ParseNetAppAccountIDInsensitively(input string) (*NetAppAccountId, error) { + parser := resourceids.NewParserFromResourceIdType(NetAppAccountId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := NetAppAccountId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateNetAppAccountID checks that 'input' can be parsed as a Net App Account ID +func ValidateNetAppAccountID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseNetAppAccountID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Net App Account ID +func (id NetAppAccountId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Net App Account ID +func (id NetAppAccountId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("accountName", "accountValue"), + } +} + +// String returns a human-readable description of this Net App Account ID +func (id NetAppAccountId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Account Name: %q", id.AccountName), + } + return fmt.Sprintf("Net App Account (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/id_volumegroup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/id_volumegroup.go new file mode 100644 index 000000000000..a49d03263509 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/id_volumegroup.go @@ -0,0 +1,137 @@ +package volumegroups + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = VolumeGroupId{} + +// VolumeGroupId is a struct representing the Resource ID for a Volume Group +type VolumeGroupId struct { + SubscriptionId string + ResourceGroupName string + AccountName string + VolumeGroupName string +} + +// NewVolumeGroupID returns a new VolumeGroupId struct +func NewVolumeGroupID(subscriptionId string, resourceGroupName string, accountName string, volumeGroupName string) VolumeGroupId { + return VolumeGroupId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AccountName: accountName, + VolumeGroupName: volumeGroupName, + } +} + +// ParseVolumeGroupID parses 'input' into a VolumeGroupId +func ParseVolumeGroupID(input string) (*VolumeGroupId, error) { + parser := resourceids.NewParserFromResourceIdType(VolumeGroupId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VolumeGroupId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + if id.VolumeGroupName, ok = parsed.Parsed["volumeGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'volumeGroupName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseVolumeGroupIDInsensitively parses 'input' case-insensitively into a VolumeGroupId +// note: this method should only be used for API response data and not user input +func ParseVolumeGroupIDInsensitively(input string) (*VolumeGroupId, error) { + parser := resourceids.NewParserFromResourceIdType(VolumeGroupId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VolumeGroupId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + if id.VolumeGroupName, ok = parsed.Parsed["volumeGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'volumeGroupName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateVolumeGroupID checks that 'input' can be parsed as a Volume Group ID +func ValidateVolumeGroupID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseVolumeGroupID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Volume Group ID +func (id VolumeGroupId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/volumeGroups/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName, id.VolumeGroupName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Volume Group ID +func (id VolumeGroupId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("accountName", "accountValue"), + resourceids.StaticSegment("staticVolumeGroups", "volumeGroups", "volumeGroups"), + resourceids.UserSpecifiedSegment("volumeGroupName", "volumeGroupValue"), + } +} + +// String returns a human-readable description of this Volume Group ID +func (id VolumeGroupId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Account Name: %q", id.AccountName), + fmt.Sprintf("Volume Group Name: %q", id.VolumeGroupName), + } + return fmt.Sprintf("Volume Group (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupscreate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupscreate_autorest.go new file mode 100644 index 000000000000..ee9616617b30 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupscreate_autorest.go @@ -0,0 +1,79 @@ +package volumegroups + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupsCreateOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// VolumeGroupsCreate ... +func (c VolumeGroupsClient) VolumeGroupsCreate(ctx context.Context, id VolumeGroupId, input VolumeGroupDetails) (result VolumeGroupsCreateOperationResponse, err error) { + req, err := c.preparerForVolumeGroupsCreate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsCreate", nil, "Failure preparing request") + return + } + + result, err = c.senderForVolumeGroupsCreate(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsCreate", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// VolumeGroupsCreateThenPoll performs VolumeGroupsCreate then polls until it's completed +func (c VolumeGroupsClient) VolumeGroupsCreateThenPoll(ctx context.Context, id VolumeGroupId, input VolumeGroupDetails) error { + result, err := c.VolumeGroupsCreate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing VolumeGroupsCreate: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after VolumeGroupsCreate: %+v", err) + } + + return nil +} + +// preparerForVolumeGroupsCreate prepares the VolumeGroupsCreate request. +func (c VolumeGroupsClient) preparerForVolumeGroupsCreate(ctx context.Context, id VolumeGroupId, input VolumeGroupDetails) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForVolumeGroupsCreate sends the VolumeGroupsCreate request. The method will close the +// http.Response Body if it receives an error. +func (c VolumeGroupsClient) senderForVolumeGroupsCreate(ctx context.Context, req *http.Request) (future VolumeGroupsCreateOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupsdelete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupsdelete_autorest.go new file mode 100644 index 000000000000..b3cba81e1756 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupsdelete_autorest.go @@ -0,0 +1,78 @@ +package volumegroups + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupsDeleteOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// VolumeGroupsDelete ... +func (c VolumeGroupsClient) VolumeGroupsDelete(ctx context.Context, id VolumeGroupId) (result VolumeGroupsDeleteOperationResponse, err error) { + req, err := c.preparerForVolumeGroupsDelete(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsDelete", nil, "Failure preparing request") + return + } + + result, err = c.senderForVolumeGroupsDelete(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsDelete", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// VolumeGroupsDeleteThenPoll performs VolumeGroupsDelete then polls until it's completed +func (c VolumeGroupsClient) VolumeGroupsDeleteThenPoll(ctx context.Context, id VolumeGroupId) error { + result, err := c.VolumeGroupsDelete(ctx, id) + if err != nil { + return fmt.Errorf("performing VolumeGroupsDelete: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after VolumeGroupsDelete: %+v", err) + } + + return nil +} + +// preparerForVolumeGroupsDelete prepares the VolumeGroupsDelete request. +func (c VolumeGroupsClient) preparerForVolumeGroupsDelete(ctx context.Context, id VolumeGroupId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForVolumeGroupsDelete sends the VolumeGroupsDelete request. The method will close the +// http.Response Body if it receives an error. +func (c VolumeGroupsClient) senderForVolumeGroupsDelete(ctx context.Context, req *http.Request) (future VolumeGroupsDeleteOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupsget_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupsget_autorest.go new file mode 100644 index 000000000000..d52a1f2e8c2e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupsget_autorest.go @@ -0,0 +1,67 @@ +package volumegroups + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupsGetOperationResponse struct { + HttpResponse *http.Response + Model *VolumeGroupDetails +} + +// VolumeGroupsGet ... +func (c VolumeGroupsClient) VolumeGroupsGet(ctx context.Context, id VolumeGroupId) (result VolumeGroupsGetOperationResponse, err error) { + req, err := c.preparerForVolumeGroupsGet(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsGet", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsGet", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForVolumeGroupsGet(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsGet", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForVolumeGroupsGet prepares the VolumeGroupsGet request. +func (c VolumeGroupsClient) preparerForVolumeGroupsGet(ctx context.Context, id VolumeGroupId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForVolumeGroupsGet handles the response to the VolumeGroupsGet request. The method always +// closes the http.Response Body. +func (c VolumeGroupsClient) responderForVolumeGroupsGet(resp *http.Response) (result VolumeGroupsGetOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupslistbynetappaccount_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupslistbynetappaccount_autorest.go new file mode 100644 index 000000000000..92517aeaf6f2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupslistbynetappaccount_autorest.go @@ -0,0 +1,68 @@ +package volumegroups + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupsListByNetAppAccountOperationResponse struct { + HttpResponse *http.Response + Model *VolumeGroupList +} + +// VolumeGroupsListByNetAppAccount ... +func (c VolumeGroupsClient) VolumeGroupsListByNetAppAccount(ctx context.Context, id NetAppAccountId) (result VolumeGroupsListByNetAppAccountOperationResponse, err error) { + req, err := c.preparerForVolumeGroupsListByNetAppAccount(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsListByNetAppAccount", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsListByNetAppAccount", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForVolumeGroupsListByNetAppAccount(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsListByNetAppAccount", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForVolumeGroupsListByNetAppAccount prepares the VolumeGroupsListByNetAppAccount request. +func (c VolumeGroupsClient) preparerForVolumeGroupsListByNetAppAccount(ctx context.Context, id NetAppAccountId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/volumeGroups", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForVolumeGroupsListByNetAppAccount handles the response to the VolumeGroupsListByNetAppAccount request. The method always +// closes the http.Response Body. +func (c VolumeGroupsClient) responderForVolumeGroupsListByNetAppAccount(resp *http.Response) (result VolumeGroupsListByNetAppAccountOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_exportpolicyrule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_exportpolicyrule.go new file mode 100644 index 000000000000..e17395ba1a77 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_exportpolicyrule.go @@ -0,0 +1,22 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExportPolicyRule struct { + AllowedClients *string `json:"allowedClients,omitempty"` + ChownMode *ChownMode `json:"chownMode,omitempty"` + Cifs *bool `json:"cifs,omitempty"` + HasRootAccess *bool `json:"hasRootAccess,omitempty"` + Kerberos5ReadOnly *bool `json:"kerberos5ReadOnly,omitempty"` + Kerberos5ReadWrite *bool `json:"kerberos5ReadWrite,omitempty"` + Kerberos5iReadOnly *bool `json:"kerberos5iReadOnly,omitempty"` + Kerberos5iReadWrite *bool `json:"kerberos5iReadWrite,omitempty"` + Kerberos5pReadOnly *bool `json:"kerberos5pReadOnly,omitempty"` + Kerberos5pReadWrite *bool `json:"kerberos5pReadWrite,omitempty"` + Nfsv3 *bool `json:"nfsv3,omitempty"` + Nfsv41 *bool `json:"nfsv41,omitempty"` + RuleIndex *int64 `json:"ruleIndex,omitempty"` + UnixReadOnly *bool `json:"unixReadOnly,omitempty"` + UnixReadWrite *bool `json:"unixReadWrite,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_mounttargetproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_mounttargetproperties.go new file mode 100644 index 000000000000..c59cc0dbf3e7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_mounttargetproperties.go @@ -0,0 +1,11 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MountTargetProperties struct { + FileSystemId string `json:"fileSystemId"` + IpAddress *string `json:"ipAddress,omitempty"` + MountTargetId *string `json:"mountTargetId,omitempty"` + SmbServerFqdn *string `json:"smbServerFqdn,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_placementkeyvaluepairs.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_placementkeyvaluepairs.go new file mode 100644 index 000000000000..1714b1662a1d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_placementkeyvaluepairs.go @@ -0,0 +1,9 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PlacementKeyValuePairs struct { + Key string `json:"key"` + Value string `json:"value"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_replicationobject.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_replicationobject.go new file mode 100644 index 000000000000..6d145aa00798 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_replicationobject.go @@ -0,0 +1,12 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ReplicationObject struct { + EndpointType *EndpointType `json:"endpointType,omitempty"` + RemoteVolumeRegion *string `json:"remoteVolumeRegion,omitempty"` + RemoteVolumeResourceId string `json:"remoteVolumeResourceId"` + ReplicationId *string `json:"replicationId,omitempty"` + ReplicationSchedule *ReplicationSchedule `json:"replicationSchedule,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumebackupproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumebackupproperties.go new file mode 100644 index 000000000000..1141229b560a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumebackupproperties.go @@ -0,0 +1,11 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeBackupProperties struct { + BackupEnabled *bool `json:"backupEnabled,omitempty"` + BackupPolicyId *string `json:"backupPolicyId,omitempty"` + PolicyEnforced *bool `json:"policyEnforced,omitempty"` + VaultId *string `json:"vaultId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroup.go new file mode 100644 index 000000000000..5e4df7bb9c04 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroup.go @@ -0,0 +1,12 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroup struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *VolumeGroupListProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupdetails.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupdetails.go new file mode 100644 index 000000000000..08e48e1d0e8f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupdetails.go @@ -0,0 +1,13 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupDetails struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *VolumeGroupProperties `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegrouplist.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegrouplist.go new file mode 100644 index 000000000000..447c6e6e8588 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegrouplist.go @@ -0,0 +1,8 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupList struct { + Value *[]VolumeGroup `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegrouplistproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegrouplistproperties.go new file mode 100644 index 000000000000..5788ee516fc1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegrouplistproperties.go @@ -0,0 +1,9 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupListProperties struct { + GroupMetaData *VolumeGroupMetaData `json:"groupMetaData,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupmetadata.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupmetadata.go new file mode 100644 index 000000000000..30441c6826d5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupmetadata.go @@ -0,0 +1,13 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupMetaData struct { + ApplicationIdentifier *string `json:"applicationIdentifier,omitempty"` + ApplicationType *ApplicationType `json:"applicationType,omitempty"` + DeploymentSpecId *string `json:"deploymentSpecId,omitempty"` + GlobalPlacementRules *[]PlacementKeyValuePairs `json:"globalPlacementRules,omitempty"` + GroupDescription *string `json:"groupDescription,omitempty"` + VolumesCount *int64 `json:"volumesCount,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupproperties.go new file mode 100644 index 000000000000..0bab153b397e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupproperties.go @@ -0,0 +1,10 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupProperties struct { + GroupMetaData *VolumeGroupMetaData `json:"groupMetaData,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + Volumes *[]VolumeGroupVolumeProperties `json:"volumes,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupvolumeproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupvolumeproperties.go new file mode 100644 index 000000000000..61bbdab9ce3e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupvolumeproperties.go @@ -0,0 +1,12 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupVolumeProperties struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties VolumeProperties `json:"properties"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumeproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumeproperties.go new file mode 100644 index 000000000000..dc67a9543182 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumeproperties.go @@ -0,0 +1,49 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeProperties struct { + AvsDataStore *AvsDataStore `json:"avsDataStore,omitempty"` + BackupId *string `json:"backupId,omitempty"` + BaremetalTenantId *string `json:"baremetalTenantId,omitempty"` + CapacityPoolResourceId *string `json:"capacityPoolResourceId,omitempty"` + CloneProgress *int64 `json:"cloneProgress,omitempty"` + CoolAccess *bool `json:"coolAccess,omitempty"` + CoolnessPeriod *int64 `json:"coolnessPeriod,omitempty"` + CreationToken string `json:"creationToken"` + DataProtection *VolumePropertiesDataProtection `json:"dataProtection,omitempty"` + DefaultGroupQuotaInKiBs *int64 `json:"defaultGroupQuotaInKiBs,omitempty"` + DefaultUserQuotaInKiBs *int64 `json:"defaultUserQuotaInKiBs,omitempty"` + EnableSubvolumes *EnableSubvolumes `json:"enableSubvolumes,omitempty"` + EncryptionKeySource *string `json:"encryptionKeySource,omitempty"` + ExportPolicy *VolumePropertiesExportPolicy `json:"exportPolicy,omitempty"` + FileSystemId *string `json:"fileSystemId,omitempty"` + IsDefaultQuotaEnabled *bool `json:"isDefaultQuotaEnabled,omitempty"` + IsRestoring *bool `json:"isRestoring,omitempty"` + KerberosEnabled *bool `json:"kerberosEnabled,omitempty"` + LdapEnabled *bool `json:"ldapEnabled,omitempty"` + MaximumNumberOfFiles *int64 `json:"maximumNumberOfFiles,omitempty"` + MountTargets *[]MountTargetProperties `json:"mountTargets,omitempty"` + NetworkFeatures *NetworkFeatures `json:"networkFeatures,omitempty"` + NetworkSiblingSetId *string `json:"networkSiblingSetId,omitempty"` + PlacementRules *[]PlacementKeyValuePairs `json:"placementRules,omitempty"` + ProtocolTypes *[]string `json:"protocolTypes,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + ProximityPlacementGroup *string `json:"proximityPlacementGroup,omitempty"` + SecurityStyle *SecurityStyle `json:"securityStyle,omitempty"` + ServiceLevel *ServiceLevel `json:"serviceLevel,omitempty"` + SmbContinuouslyAvailable *bool `json:"smbContinuouslyAvailable,omitempty"` + SmbEncryption *bool `json:"smbEncryption,omitempty"` + SnapshotDirectoryVisible *bool `json:"snapshotDirectoryVisible,omitempty"` + SnapshotId *string `json:"snapshotId,omitempty"` + StorageToNetworkProximity *VolumeStorageToNetworkProximity `json:"storageToNetworkProximity,omitempty"` + SubnetId string `json:"subnetId"` + T2Network *string `json:"t2Network,omitempty"` + ThroughputMibps *float64 `json:"throughputMibps,omitempty"` + UnixPermissions *string `json:"unixPermissions,omitempty"` + UsageThreshold int64 `json:"usageThreshold"` + VolumeGroupName *string `json:"volumeGroupName,omitempty"` + VolumeSpecName *string `json:"volumeSpecName,omitempty"` + VolumeType *string `json:"volumeType,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumepropertiesdataprotection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumepropertiesdataprotection.go new file mode 100644 index 000000000000..5cde3ecbaacc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumepropertiesdataprotection.go @@ -0,0 +1,10 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumePropertiesDataProtection struct { + Backup *VolumeBackupProperties `json:"backup,omitempty"` + Replication *ReplicationObject `json:"replication,omitempty"` + Snapshot *VolumeSnapshotProperties `json:"snapshot,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumepropertiesexportpolicy.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumepropertiesexportpolicy.go new file mode 100644 index 000000000000..227c8586d6f2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumepropertiesexportpolicy.go @@ -0,0 +1,8 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumePropertiesExportPolicy struct { + Rules *[]ExportPolicyRule `json:"rules,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumesnapshotproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumesnapshotproperties.go new file mode 100644 index 000000000000..a3f5011da3b0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumesnapshotproperties.go @@ -0,0 +1,8 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeSnapshotProperties struct { + SnapshotPolicyId *string `json:"snapshotPolicyId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/version.go new file mode 100644 index 000000000000..93f3d1ecbb06 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/version.go @@ -0,0 +1,12 @@ +package volumegroups + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2021-10-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/volumegroups/%s", defaultApiVersion) +} diff --git a/vendor/modules.txt b/vendor/modules.txt index e4cf39a2d116..aafb45996183 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -196,7 +196,7 @@ github.com/hashicorp/go-azure-helpers/resourcemanager/zones github.com/hashicorp/go-azure-helpers/resourceproviders github.com/hashicorp/go-azure-helpers/sender github.com/hashicorp/go-azure-helpers/storage -# github.com/hashicorp/go-azure-sdk v0.20220701.1073833 +# github.com/hashicorp/go-azure-sdk v0.20220708.1064156 ## explicit; go 1.18 github.com/hashicorp/go-azure-sdk/resource-manager/aadb2c/2021-04-01-preview/tenants github.com/hashicorp/go-azure-sdk/resource-manager/analysisservices/2017-08-01/servers @@ -240,6 +240,7 @@ github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypoo github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots +github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication github.com/hashicorp/go-azure-sdk/resource-manager/notificationhubs/2017-04-01/namespaces From 5b1a29b01b121e2250e126f96e9cd81be975a4c2 Mon Sep 17 00:00:00 2001 From: Paulo Date: Fri, 15 Jul 2022 09:48:15 -0700 Subject: [PATCH 07/83] Setting ANF API to latest available --- internal/services/netapp/netapp_volume.go | 2 +- internal/services/netapp/netapp_volume_group_resource.go | 2 +- internal/services/netapp/netapp_volume_group_resource_test.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/services/netapp/netapp_volume.go b/internal/services/netapp/netapp_volume.go index 6ba2cd89d800..17745fab7241 100644 --- a/internal/services/netapp/netapp_volume.go +++ b/internal/services/netapp/netapp_volume.go @@ -6,8 +6,8 @@ import ( "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups" "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" netAppValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/netapp/validate" diff --git a/internal/services/netapp/netapp_volume_group_resource.go b/internal/services/netapp/netapp_volume_group_resource.go index ab10cf5d5a76..7f1ff4ae02ca 100644 --- a/internal/services/netapp/netapp_volume_group_resource.go +++ b/internal/services/netapp/netapp_volume_group_resource.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" netAppValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/netapp/validate" diff --git a/internal/services/netapp/netapp_volume_group_resource_test.go b/internal/services/netapp/netapp_volume_group_resource_test.go index 1b9b48529a72..dcf0c1450f43 100644 --- a/internal/services/netapp/netapp_volume_group_resource_test.go +++ b/internal/services/netapp/netapp_volume_group_resource_test.go @@ -6,7 +6,7 @@ import ( "net/http" "testing" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" From 33aaa015bccb1ae37ff1394a747b9884be8de564 Mon Sep 17 00:00:00 2001 From: Paulo Date: Fri, 15 Jul 2022 09:51:42 -0700 Subject: [PATCH 08/83] Latest ANF SDK version --- go.mod | 2 +- go.sum | 2 + .../netapp/2022-01-01/volumegroups/README.md | 81 +++++ .../netapp/2022-01-01/volumegroups/client.go | 18 + .../2022-01-01/volumegroups/constants.go | 320 ++++++++++++++++++ .../volumegroups/id_netappaccount.go | 124 +++++++ .../2022-01-01/volumegroups/id_volumegroup.go | 137 ++++++++ .../method_volumegroupscreate_autorest.go | 79 +++++ .../method_volumegroupsdelete_autorest.go | 78 +++++ .../method_volumegroupsget_autorest.go | 67 ++++ ...olumegroupslistbynetappaccount_autorest.go | 68 ++++ .../volumegroups/model_exportpolicyrule.go | 22 ++ .../model_mounttargetproperties.go | 11 + .../model_placementkeyvaluepairs.go | 9 + .../volumegroups/model_replicationobject.go | 12 + .../model_volumebackupproperties.go | 11 + .../volumegroups/model_volumegroup.go | 12 + .../volumegroups/model_volumegroupdetails.go | 12 + .../volumegroups/model_volumegrouplist.go | 8 + .../model_volumegrouplistproperties.go | 9 + .../volumegroups/model_volumegroupmetadata.go | 13 + .../model_volumegroupproperties.go | 10 + .../model_volumegroupvolumeproperties.go | 12 + .../volumegroups/model_volumeproperties.go | 50 +++ .../model_volumepropertiesdataprotection.go | 10 + .../model_volumepropertiesexportpolicy.go | 8 + .../model_volumesnapshotproperties.go | 8 + .../netapp/2022-01-01/volumegroups/version.go | 12 + vendor/modules.txt | 3 +- 29 files changed, 1206 insertions(+), 2 deletions(-) create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/id_netappaccount.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/id_volumegroup.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupscreate_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupsdelete_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupsget_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupslistbynetappaccount_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_exportpolicyrule.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_mounttargetproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_placementkeyvaluepairs.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_replicationobject.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumebackupproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroup.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupdetails.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegrouplist.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegrouplistproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupmetadata.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupvolumeproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumeproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumepropertiesdataprotection.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumepropertiesexportpolicy.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumesnapshotproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/version.go diff --git a/go.mod b/go.mod index 4fe0818798e4..a2c715867017 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/google/go-cmp v0.5.8 github.com/google/uuid v1.1.2 github.com/hashicorp/go-azure-helpers v0.37.0 - github.com/hashicorp/go-azure-sdk v0.20220712.1111122 + github.com/hashicorp/go-azure-sdk v0.20220715.1112616 github.com/hashicorp/go-multierror v1.1.1 github.com/hashicorp/go-uuid v1.0.3 github.com/hashicorp/go-version v1.6.0 diff --git a/go.sum b/go.sum index 9078f111c062..869d1baa8bdd 100644 --- a/go.sum +++ b/go.sum @@ -218,6 +218,8 @@ github.com/hashicorp/go-azure-helpers v0.37.0 h1:6UOoQ9esE4MJ4wHJr21qU81IJQ9zsXQ github.com/hashicorp/go-azure-helpers v0.37.0/go.mod h1:gcutZ/Hf/O7YN9M3UIvyZ9l0Rxv7Yrc9x5sSfM9cuSw= github.com/hashicorp/go-azure-sdk v0.20220712.1111122 h1:GiUf/gYHKwgqbqvETA6xLRvLc8u0o83Qor2/zmzwDRo= github.com/hashicorp/go-azure-sdk v0.20220712.1111122/go.mod h1:yjQPw8DCOtQR8E8+FNaTxF6yz+tyQGkDNiVAGCNoLOo= +github.com/hashicorp/go-azure-sdk v0.20220715.1112616 h1:q2PQ+FQGahlXNf1WS3l9VFHJq1XiULlSkPypyaro78M= +github.com/hashicorp/go-azure-sdk v0.20220715.1112616/go.mod h1:yjQPw8DCOtQR8E8+FNaTxF6yz+tyQGkDNiVAGCNoLOo= 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= diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/README.md new file mode 100644 index 000000000000..f733a433557a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/README.md @@ -0,0 +1,81 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups` Documentation + +The `volumegroups` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2022-01-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups" +``` + + +### Client Initialization + +```go +client := volumegroups.NewVolumeGroupsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VolumeGroupsClient.VolumeGroupsCreate` + +```go +ctx := context.TODO() +id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "volumeGroupValue") + +payload := volumegroups.VolumeGroupDetails{ + // ... +} + + +if err := client.VolumeGroupsCreateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VolumeGroupsClient.VolumeGroupsDelete` + +```go +ctx := context.TODO() +id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "volumeGroupValue") + +if err := client.VolumeGroupsDeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VolumeGroupsClient.VolumeGroupsGet` + +```go +ctx := context.TODO() +id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "volumeGroupValue") + +read, err := client.VolumeGroupsGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VolumeGroupsClient.VolumeGroupsListByNetAppAccount` + +```go +ctx := context.TODO() +id := volumegroups.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") + +read, err := client.VolumeGroupsListByNetAppAccount(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/client.go new file mode 100644 index 000000000000..c7beab84b9a1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/client.go @@ -0,0 +1,18 @@ +package volumegroups + +import "github.com/Azure/go-autorest/autorest" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupsClient struct { + Client autorest.Client + baseUri string +} + +func NewVolumeGroupsClientWithBaseURI(endpoint string) VolumeGroupsClient { + return VolumeGroupsClient{ + Client: autorest.NewClientWithUserAgent(userAgent()), + baseUri: endpoint, + } +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/constants.go new file mode 100644 index 000000000000..6eb9b8afe4fb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/constants.go @@ -0,0 +1,320 @@ +package volumegroups + +import "strings" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ApplicationType string + +const ( + ApplicationTypeSAPNegativeHANA ApplicationType = "SAP-HANA" +) + +func PossibleValuesForApplicationType() []string { + return []string{ + string(ApplicationTypeSAPNegativeHANA), + } +} + +func parseApplicationType(input string) (*ApplicationType, error) { + vals := map[string]ApplicationType{ + "sap-hana": ApplicationTypeSAPNegativeHANA, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ApplicationType(input) + return &out, nil +} + +type AvsDataStore string + +const ( + AvsDataStoreDisabled AvsDataStore = "Disabled" + AvsDataStoreEnabled AvsDataStore = "Enabled" +) + +func PossibleValuesForAvsDataStore() []string { + return []string{ + string(AvsDataStoreDisabled), + string(AvsDataStoreEnabled), + } +} + +func parseAvsDataStore(input string) (*AvsDataStore, error) { + vals := map[string]AvsDataStore{ + "disabled": AvsDataStoreDisabled, + "enabled": AvsDataStoreEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AvsDataStore(input) + return &out, nil +} + +type ChownMode string + +const ( + ChownModeRestricted ChownMode = "Restricted" + ChownModeUnrestricted ChownMode = "Unrestricted" +) + +func PossibleValuesForChownMode() []string { + return []string{ + string(ChownModeRestricted), + string(ChownModeUnrestricted), + } +} + +func parseChownMode(input string) (*ChownMode, error) { + vals := map[string]ChownMode{ + "restricted": ChownModeRestricted, + "unrestricted": ChownModeUnrestricted, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ChownMode(input) + return &out, nil +} + +type EnableSubvolumes string + +const ( + EnableSubvolumesDisabled EnableSubvolumes = "Disabled" + EnableSubvolumesEnabled EnableSubvolumes = "Enabled" +) + +func PossibleValuesForEnableSubvolumes() []string { + return []string{ + string(EnableSubvolumesDisabled), + string(EnableSubvolumesEnabled), + } +} + +func parseEnableSubvolumes(input string) (*EnableSubvolumes, error) { + vals := map[string]EnableSubvolumes{ + "disabled": EnableSubvolumesDisabled, + "enabled": EnableSubvolumesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := EnableSubvolumes(input) + return &out, nil +} + +type EncryptionKeySource string + +const ( + EncryptionKeySourceMicrosoftPointNetApp EncryptionKeySource = "Microsoft.NetApp" +) + +func PossibleValuesForEncryptionKeySource() []string { + return []string{ + string(EncryptionKeySourceMicrosoftPointNetApp), + } +} + +func parseEncryptionKeySource(input string) (*EncryptionKeySource, error) { + vals := map[string]EncryptionKeySource{ + "microsoft.netapp": EncryptionKeySourceMicrosoftPointNetApp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := EncryptionKeySource(input) + return &out, nil +} + +type EndpointType string + +const ( + EndpointTypeDst EndpointType = "dst" + EndpointTypeSrc EndpointType = "src" +) + +func PossibleValuesForEndpointType() []string { + return []string{ + string(EndpointTypeDst), + string(EndpointTypeSrc), + } +} + +func parseEndpointType(input string) (*EndpointType, error) { + vals := map[string]EndpointType{ + "dst": EndpointTypeDst, + "src": EndpointTypeSrc, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := EndpointType(input) + return &out, nil +} + +type NetworkFeatures string + +const ( + NetworkFeaturesBasic NetworkFeatures = "Basic" + NetworkFeaturesStandard NetworkFeatures = "Standard" +) + +func PossibleValuesForNetworkFeatures() []string { + return []string{ + string(NetworkFeaturesBasic), + string(NetworkFeaturesStandard), + } +} + +func parseNetworkFeatures(input string) (*NetworkFeatures, error) { + vals := map[string]NetworkFeatures{ + "basic": NetworkFeaturesBasic, + "standard": NetworkFeaturesStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkFeatures(input) + return &out, nil +} + +type ReplicationSchedule string + +const ( + ReplicationScheduleDaily ReplicationSchedule = "daily" + ReplicationScheduleHourly ReplicationSchedule = "hourly" + ReplicationScheduleOneZerominutely ReplicationSchedule = "_10minutely" +) + +func PossibleValuesForReplicationSchedule() []string { + return []string{ + string(ReplicationScheduleDaily), + string(ReplicationScheduleHourly), + string(ReplicationScheduleOneZerominutely), + } +} + +func parseReplicationSchedule(input string) (*ReplicationSchedule, error) { + vals := map[string]ReplicationSchedule{ + "daily": ReplicationScheduleDaily, + "hourly": ReplicationScheduleHourly, + "_10minutely": ReplicationScheduleOneZerominutely, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ReplicationSchedule(input) + return &out, nil +} + +type SecurityStyle string + +const ( + SecurityStyleNtfs SecurityStyle = "ntfs" + SecurityStyleUnix SecurityStyle = "unix" +) + +func PossibleValuesForSecurityStyle() []string { + return []string{ + string(SecurityStyleNtfs), + string(SecurityStyleUnix), + } +} + +func parseSecurityStyle(input string) (*SecurityStyle, error) { + vals := map[string]SecurityStyle{ + "ntfs": SecurityStyleNtfs, + "unix": SecurityStyleUnix, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityStyle(input) + return &out, nil +} + +type ServiceLevel string + +const ( + ServiceLevelPremium ServiceLevel = "Premium" + ServiceLevelStandard ServiceLevel = "Standard" + ServiceLevelStandardZRS ServiceLevel = "StandardZRS" + ServiceLevelUltra ServiceLevel = "Ultra" +) + +func PossibleValuesForServiceLevel() []string { + return []string{ + string(ServiceLevelPremium), + string(ServiceLevelStandard), + string(ServiceLevelStandardZRS), + string(ServiceLevelUltra), + } +} + +func parseServiceLevel(input string) (*ServiceLevel, error) { + vals := map[string]ServiceLevel{ + "premium": ServiceLevelPremium, + "standard": ServiceLevelStandard, + "standardzrs": ServiceLevelStandardZRS, + "ultra": ServiceLevelUltra, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ServiceLevel(input) + return &out, nil +} + +type VolumeStorageToNetworkProximity string + +const ( + VolumeStorageToNetworkProximityDefault VolumeStorageToNetworkProximity = "Default" + VolumeStorageToNetworkProximityTOne VolumeStorageToNetworkProximity = "T1" + VolumeStorageToNetworkProximityTTwo VolumeStorageToNetworkProximity = "T2" +) + +func PossibleValuesForVolumeStorageToNetworkProximity() []string { + return []string{ + string(VolumeStorageToNetworkProximityDefault), + string(VolumeStorageToNetworkProximityTOne), + string(VolumeStorageToNetworkProximityTTwo), + } +} + +func parseVolumeStorageToNetworkProximity(input string) (*VolumeStorageToNetworkProximity, error) { + vals := map[string]VolumeStorageToNetworkProximity{ + "default": VolumeStorageToNetworkProximityDefault, + "t1": VolumeStorageToNetworkProximityTOne, + "t2": VolumeStorageToNetworkProximityTTwo, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VolumeStorageToNetworkProximity(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/id_netappaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/id_netappaccount.go new file mode 100644 index 000000000000..7b31002a4246 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/id_netappaccount.go @@ -0,0 +1,124 @@ +package volumegroups + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = NetAppAccountId{} + +// NetAppAccountId is a struct representing the Resource ID for a Net App Account +type NetAppAccountId struct { + SubscriptionId string + ResourceGroupName string + AccountName string +} + +// NewNetAppAccountID returns a new NetAppAccountId struct +func NewNetAppAccountID(subscriptionId string, resourceGroupName string, accountName string) NetAppAccountId { + return NetAppAccountId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AccountName: accountName, + } +} + +// ParseNetAppAccountID parses 'input' into a NetAppAccountId +func ParseNetAppAccountID(input string) (*NetAppAccountId, error) { + parser := resourceids.NewParserFromResourceIdType(NetAppAccountId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := NetAppAccountId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseNetAppAccountIDInsensitively parses 'input' case-insensitively into a NetAppAccountId +// note: this method should only be used for API response data and not user input +func ParseNetAppAccountIDInsensitively(input string) (*NetAppAccountId, error) { + parser := resourceids.NewParserFromResourceIdType(NetAppAccountId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := NetAppAccountId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateNetAppAccountID checks that 'input' can be parsed as a Net App Account ID +func ValidateNetAppAccountID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseNetAppAccountID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Net App Account ID +func (id NetAppAccountId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Net App Account ID +func (id NetAppAccountId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("accountName", "accountValue"), + } +} + +// String returns a human-readable description of this Net App Account ID +func (id NetAppAccountId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Account Name: %q", id.AccountName), + } + return fmt.Sprintf("Net App Account (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/id_volumegroup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/id_volumegroup.go new file mode 100644 index 000000000000..a49d03263509 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/id_volumegroup.go @@ -0,0 +1,137 @@ +package volumegroups + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = VolumeGroupId{} + +// VolumeGroupId is a struct representing the Resource ID for a Volume Group +type VolumeGroupId struct { + SubscriptionId string + ResourceGroupName string + AccountName string + VolumeGroupName string +} + +// NewVolumeGroupID returns a new VolumeGroupId struct +func NewVolumeGroupID(subscriptionId string, resourceGroupName string, accountName string, volumeGroupName string) VolumeGroupId { + return VolumeGroupId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AccountName: accountName, + VolumeGroupName: volumeGroupName, + } +} + +// ParseVolumeGroupID parses 'input' into a VolumeGroupId +func ParseVolumeGroupID(input string) (*VolumeGroupId, error) { + parser := resourceids.NewParserFromResourceIdType(VolumeGroupId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VolumeGroupId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + if id.VolumeGroupName, ok = parsed.Parsed["volumeGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'volumeGroupName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseVolumeGroupIDInsensitively parses 'input' case-insensitively into a VolumeGroupId +// note: this method should only be used for API response data and not user input +func ParseVolumeGroupIDInsensitively(input string) (*VolumeGroupId, error) { + parser := resourceids.NewParserFromResourceIdType(VolumeGroupId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VolumeGroupId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + if id.VolumeGroupName, ok = parsed.Parsed["volumeGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'volumeGroupName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateVolumeGroupID checks that 'input' can be parsed as a Volume Group ID +func ValidateVolumeGroupID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseVolumeGroupID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Volume Group ID +func (id VolumeGroupId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/volumeGroups/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName, id.VolumeGroupName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Volume Group ID +func (id VolumeGroupId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("accountName", "accountValue"), + resourceids.StaticSegment("staticVolumeGroups", "volumeGroups", "volumeGroups"), + resourceids.UserSpecifiedSegment("volumeGroupName", "volumeGroupValue"), + } +} + +// String returns a human-readable description of this Volume Group ID +func (id VolumeGroupId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Account Name: %q", id.AccountName), + fmt.Sprintf("Volume Group Name: %q", id.VolumeGroupName), + } + return fmt.Sprintf("Volume Group (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupscreate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupscreate_autorest.go new file mode 100644 index 000000000000..ee9616617b30 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupscreate_autorest.go @@ -0,0 +1,79 @@ +package volumegroups + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupsCreateOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// VolumeGroupsCreate ... +func (c VolumeGroupsClient) VolumeGroupsCreate(ctx context.Context, id VolumeGroupId, input VolumeGroupDetails) (result VolumeGroupsCreateOperationResponse, err error) { + req, err := c.preparerForVolumeGroupsCreate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsCreate", nil, "Failure preparing request") + return + } + + result, err = c.senderForVolumeGroupsCreate(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsCreate", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// VolumeGroupsCreateThenPoll performs VolumeGroupsCreate then polls until it's completed +func (c VolumeGroupsClient) VolumeGroupsCreateThenPoll(ctx context.Context, id VolumeGroupId, input VolumeGroupDetails) error { + result, err := c.VolumeGroupsCreate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing VolumeGroupsCreate: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after VolumeGroupsCreate: %+v", err) + } + + return nil +} + +// preparerForVolumeGroupsCreate prepares the VolumeGroupsCreate request. +func (c VolumeGroupsClient) preparerForVolumeGroupsCreate(ctx context.Context, id VolumeGroupId, input VolumeGroupDetails) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForVolumeGroupsCreate sends the VolumeGroupsCreate request. The method will close the +// http.Response Body if it receives an error. +func (c VolumeGroupsClient) senderForVolumeGroupsCreate(ctx context.Context, req *http.Request) (future VolumeGroupsCreateOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupsdelete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupsdelete_autorest.go new file mode 100644 index 000000000000..b3cba81e1756 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupsdelete_autorest.go @@ -0,0 +1,78 @@ +package volumegroups + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupsDeleteOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// VolumeGroupsDelete ... +func (c VolumeGroupsClient) VolumeGroupsDelete(ctx context.Context, id VolumeGroupId) (result VolumeGroupsDeleteOperationResponse, err error) { + req, err := c.preparerForVolumeGroupsDelete(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsDelete", nil, "Failure preparing request") + return + } + + result, err = c.senderForVolumeGroupsDelete(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsDelete", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// VolumeGroupsDeleteThenPoll performs VolumeGroupsDelete then polls until it's completed +func (c VolumeGroupsClient) VolumeGroupsDeleteThenPoll(ctx context.Context, id VolumeGroupId) error { + result, err := c.VolumeGroupsDelete(ctx, id) + if err != nil { + return fmt.Errorf("performing VolumeGroupsDelete: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after VolumeGroupsDelete: %+v", err) + } + + return nil +} + +// preparerForVolumeGroupsDelete prepares the VolumeGroupsDelete request. +func (c VolumeGroupsClient) preparerForVolumeGroupsDelete(ctx context.Context, id VolumeGroupId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForVolumeGroupsDelete sends the VolumeGroupsDelete request. The method will close the +// http.Response Body if it receives an error. +func (c VolumeGroupsClient) senderForVolumeGroupsDelete(ctx context.Context, req *http.Request) (future VolumeGroupsDeleteOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupsget_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupsget_autorest.go new file mode 100644 index 000000000000..d52a1f2e8c2e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupsget_autorest.go @@ -0,0 +1,67 @@ +package volumegroups + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupsGetOperationResponse struct { + HttpResponse *http.Response + Model *VolumeGroupDetails +} + +// VolumeGroupsGet ... +func (c VolumeGroupsClient) VolumeGroupsGet(ctx context.Context, id VolumeGroupId) (result VolumeGroupsGetOperationResponse, err error) { + req, err := c.preparerForVolumeGroupsGet(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsGet", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsGet", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForVolumeGroupsGet(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsGet", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForVolumeGroupsGet prepares the VolumeGroupsGet request. +func (c VolumeGroupsClient) preparerForVolumeGroupsGet(ctx context.Context, id VolumeGroupId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForVolumeGroupsGet handles the response to the VolumeGroupsGet request. The method always +// closes the http.Response Body. +func (c VolumeGroupsClient) responderForVolumeGroupsGet(resp *http.Response) (result VolumeGroupsGetOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupslistbynetappaccount_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupslistbynetappaccount_autorest.go new file mode 100644 index 000000000000..92517aeaf6f2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupslistbynetappaccount_autorest.go @@ -0,0 +1,68 @@ +package volumegroups + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupsListByNetAppAccountOperationResponse struct { + HttpResponse *http.Response + Model *VolumeGroupList +} + +// VolumeGroupsListByNetAppAccount ... +func (c VolumeGroupsClient) VolumeGroupsListByNetAppAccount(ctx context.Context, id NetAppAccountId) (result VolumeGroupsListByNetAppAccountOperationResponse, err error) { + req, err := c.preparerForVolumeGroupsListByNetAppAccount(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsListByNetAppAccount", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsListByNetAppAccount", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForVolumeGroupsListByNetAppAccount(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsListByNetAppAccount", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForVolumeGroupsListByNetAppAccount prepares the VolumeGroupsListByNetAppAccount request. +func (c VolumeGroupsClient) preparerForVolumeGroupsListByNetAppAccount(ctx context.Context, id NetAppAccountId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/volumeGroups", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForVolumeGroupsListByNetAppAccount handles the response to the VolumeGroupsListByNetAppAccount request. The method always +// closes the http.Response Body. +func (c VolumeGroupsClient) responderForVolumeGroupsListByNetAppAccount(resp *http.Response) (result VolumeGroupsListByNetAppAccountOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_exportpolicyrule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_exportpolicyrule.go new file mode 100644 index 000000000000..e17395ba1a77 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_exportpolicyrule.go @@ -0,0 +1,22 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExportPolicyRule struct { + AllowedClients *string `json:"allowedClients,omitempty"` + ChownMode *ChownMode `json:"chownMode,omitempty"` + Cifs *bool `json:"cifs,omitempty"` + HasRootAccess *bool `json:"hasRootAccess,omitempty"` + Kerberos5ReadOnly *bool `json:"kerberos5ReadOnly,omitempty"` + Kerberos5ReadWrite *bool `json:"kerberos5ReadWrite,omitempty"` + Kerberos5iReadOnly *bool `json:"kerberos5iReadOnly,omitempty"` + Kerberos5iReadWrite *bool `json:"kerberos5iReadWrite,omitempty"` + Kerberos5pReadOnly *bool `json:"kerberos5pReadOnly,omitempty"` + Kerberos5pReadWrite *bool `json:"kerberos5pReadWrite,omitempty"` + Nfsv3 *bool `json:"nfsv3,omitempty"` + Nfsv41 *bool `json:"nfsv41,omitempty"` + RuleIndex *int64 `json:"ruleIndex,omitempty"` + UnixReadOnly *bool `json:"unixReadOnly,omitempty"` + UnixReadWrite *bool `json:"unixReadWrite,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_mounttargetproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_mounttargetproperties.go new file mode 100644 index 000000000000..c59cc0dbf3e7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_mounttargetproperties.go @@ -0,0 +1,11 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MountTargetProperties struct { + FileSystemId string `json:"fileSystemId"` + IpAddress *string `json:"ipAddress,omitempty"` + MountTargetId *string `json:"mountTargetId,omitempty"` + SmbServerFqdn *string `json:"smbServerFqdn,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_placementkeyvaluepairs.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_placementkeyvaluepairs.go new file mode 100644 index 000000000000..1714b1662a1d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_placementkeyvaluepairs.go @@ -0,0 +1,9 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PlacementKeyValuePairs struct { + Key string `json:"key"` + Value string `json:"value"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_replicationobject.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_replicationobject.go new file mode 100644 index 000000000000..6d145aa00798 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_replicationobject.go @@ -0,0 +1,12 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ReplicationObject struct { + EndpointType *EndpointType `json:"endpointType,omitempty"` + RemoteVolumeRegion *string `json:"remoteVolumeRegion,omitempty"` + RemoteVolumeResourceId string `json:"remoteVolumeResourceId"` + ReplicationId *string `json:"replicationId,omitempty"` + ReplicationSchedule *ReplicationSchedule `json:"replicationSchedule,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumebackupproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumebackupproperties.go new file mode 100644 index 000000000000..1141229b560a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumebackupproperties.go @@ -0,0 +1,11 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeBackupProperties struct { + BackupEnabled *bool `json:"backupEnabled,omitempty"` + BackupPolicyId *string `json:"backupPolicyId,omitempty"` + PolicyEnforced *bool `json:"policyEnforced,omitempty"` + VaultId *string `json:"vaultId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroup.go new file mode 100644 index 000000000000..5e4df7bb9c04 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroup.go @@ -0,0 +1,12 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroup struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *VolumeGroupListProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupdetails.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupdetails.go new file mode 100644 index 000000000000..5f01af82c0f7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupdetails.go @@ -0,0 +1,12 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupDetails struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *VolumeGroupProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegrouplist.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegrouplist.go new file mode 100644 index 000000000000..447c6e6e8588 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegrouplist.go @@ -0,0 +1,8 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupList struct { + Value *[]VolumeGroup `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegrouplistproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegrouplistproperties.go new file mode 100644 index 000000000000..5788ee516fc1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegrouplistproperties.go @@ -0,0 +1,9 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupListProperties struct { + GroupMetaData *VolumeGroupMetaData `json:"groupMetaData,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupmetadata.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupmetadata.go new file mode 100644 index 000000000000..30441c6826d5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupmetadata.go @@ -0,0 +1,13 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupMetaData struct { + ApplicationIdentifier *string `json:"applicationIdentifier,omitempty"` + ApplicationType *ApplicationType `json:"applicationType,omitempty"` + DeploymentSpecId *string `json:"deploymentSpecId,omitempty"` + GlobalPlacementRules *[]PlacementKeyValuePairs `json:"globalPlacementRules,omitempty"` + GroupDescription *string `json:"groupDescription,omitempty"` + VolumesCount *int64 `json:"volumesCount,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupproperties.go new file mode 100644 index 000000000000..0bab153b397e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupproperties.go @@ -0,0 +1,10 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupProperties struct { + GroupMetaData *VolumeGroupMetaData `json:"groupMetaData,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + Volumes *[]VolumeGroupVolumeProperties `json:"volumes,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupvolumeproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupvolumeproperties.go new file mode 100644 index 000000000000..61bbdab9ce3e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupvolumeproperties.go @@ -0,0 +1,12 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupVolumeProperties struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties VolumeProperties `json:"properties"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumeproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumeproperties.go new file mode 100644 index 000000000000..357c68e318fa --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumeproperties.go @@ -0,0 +1,50 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeProperties struct { + AvsDataStore *AvsDataStore `json:"avsDataStore,omitempty"` + BackupId *string `json:"backupId,omitempty"` + BaremetalTenantId *string `json:"baremetalTenantId,omitempty"` + CapacityPoolResourceId *string `json:"capacityPoolResourceId,omitempty"` + CloneProgress *int64 `json:"cloneProgress,omitempty"` + CoolAccess *bool `json:"coolAccess,omitempty"` + CoolnessPeriod *int64 `json:"coolnessPeriod,omitempty"` + CreationToken string `json:"creationToken"` + DataProtection *VolumePropertiesDataProtection `json:"dataProtection,omitempty"` + DefaultGroupQuotaInKiBs *int64 `json:"defaultGroupQuotaInKiBs,omitempty"` + DefaultUserQuotaInKiBs *int64 `json:"defaultUserQuotaInKiBs,omitempty"` + EnableSubvolumes *EnableSubvolumes `json:"enableSubvolumes,omitempty"` + Encrypted *bool `json:"encrypted,omitempty"` + EncryptionKeySource *EncryptionKeySource `json:"encryptionKeySource,omitempty"` + ExportPolicy *VolumePropertiesExportPolicy `json:"exportPolicy,omitempty"` + FileSystemId *string `json:"fileSystemId,omitempty"` + IsDefaultQuotaEnabled *bool `json:"isDefaultQuotaEnabled,omitempty"` + IsRestoring *bool `json:"isRestoring,omitempty"` + KerberosEnabled *bool `json:"kerberosEnabled,omitempty"` + LdapEnabled *bool `json:"ldapEnabled,omitempty"` + MaximumNumberOfFiles *int64 `json:"maximumNumberOfFiles,omitempty"` + MountTargets *[]MountTargetProperties `json:"mountTargets,omitempty"` + NetworkFeatures *NetworkFeatures `json:"networkFeatures,omitempty"` + NetworkSiblingSetId *string `json:"networkSiblingSetId,omitempty"` + PlacementRules *[]PlacementKeyValuePairs `json:"placementRules,omitempty"` + ProtocolTypes *[]string `json:"protocolTypes,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + ProximityPlacementGroup *string `json:"proximityPlacementGroup,omitempty"` + SecurityStyle *SecurityStyle `json:"securityStyle,omitempty"` + ServiceLevel *ServiceLevel `json:"serviceLevel,omitempty"` + SmbContinuouslyAvailable *bool `json:"smbContinuouslyAvailable,omitempty"` + SmbEncryption *bool `json:"smbEncryption,omitempty"` + SnapshotDirectoryVisible *bool `json:"snapshotDirectoryVisible,omitempty"` + SnapshotId *string `json:"snapshotId,omitempty"` + StorageToNetworkProximity *VolumeStorageToNetworkProximity `json:"storageToNetworkProximity,omitempty"` + SubnetId string `json:"subnetId"` + T2Network *string `json:"t2Network,omitempty"` + ThroughputMibps *float64 `json:"throughputMibps,omitempty"` + UnixPermissions *string `json:"unixPermissions,omitempty"` + UsageThreshold int64 `json:"usageThreshold"` + VolumeGroupName *string `json:"volumeGroupName,omitempty"` + VolumeSpecName *string `json:"volumeSpecName,omitempty"` + VolumeType *string `json:"volumeType,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumepropertiesdataprotection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumepropertiesdataprotection.go new file mode 100644 index 000000000000..5cde3ecbaacc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumepropertiesdataprotection.go @@ -0,0 +1,10 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumePropertiesDataProtection struct { + Backup *VolumeBackupProperties `json:"backup,omitempty"` + Replication *ReplicationObject `json:"replication,omitempty"` + Snapshot *VolumeSnapshotProperties `json:"snapshot,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumepropertiesexportpolicy.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumepropertiesexportpolicy.go new file mode 100644 index 000000000000..227c8586d6f2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumepropertiesexportpolicy.go @@ -0,0 +1,8 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumePropertiesExportPolicy struct { + Rules *[]ExportPolicyRule `json:"rules,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumesnapshotproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumesnapshotproperties.go new file mode 100644 index 000000000000..a3f5011da3b0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumesnapshotproperties.go @@ -0,0 +1,8 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeSnapshotProperties struct { + SnapshotPolicyId *string `json:"snapshotPolicyId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/version.go new file mode 100644 index 000000000000..a2c68d24f1a6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/version.go @@ -0,0 +1,12 @@ +package volumegroups + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-01-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/volumegroups/%s", defaultApiVersion) +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 4174f4de3fb5..dbda48ba9fbe 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -194,7 +194,7 @@ github.com/hashicorp/go-azure-helpers/resourcemanager/zones github.com/hashicorp/go-azure-helpers/resourceproviders github.com/hashicorp/go-azure-helpers/sender github.com/hashicorp/go-azure-helpers/storage -# github.com/hashicorp/go-azure-sdk v0.20220712.1111122 +# github.com/hashicorp/go-azure-sdk v0.20220715.1112616 ## explicit; go 1.18 github.com/hashicorp/go-azure-sdk/resource-manager/aadb2c/2021-04-01-preview/tenants github.com/hashicorp/go-azure-sdk/resource-manager/analysisservices/2017-08-01/servers @@ -245,6 +245,7 @@ github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication +github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups github.com/hashicorp/go-azure-sdk/resource-manager/notificationhubs/2017-04-01/namespaces github.com/hashicorp/go-azure-sdk/resource-manager/notificationhubs/2017-04-01/notificationhubs github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights From 75b179d2840f07ecc1fa7e6e89d9c38524737a00 Mon Sep 17 00:00:00 2001 From: Paulo Date: Fri, 15 Jul 2022 14:00:04 -0700 Subject: [PATCH 09/83] WIP in adding latest API version --- go.mod | 8 +- go.sum | 8 + .../netapp/netapp_account_data_source.go | 2 +- .../netapp/netapp_account_resource.go | 2 +- .../netapp/netapp_account_resource_test.go | 2 +- .../netapp/netapp_pool_data_source.go | 2 +- .../services/netapp/netapp_pool_resource.go | 2 +- .../netapp/netapp_pool_resource_test.go | 2 +- .../netapp/netapp_snapshot_data_source.go | 2 +- .../netapp_snapshot_policy_data_source.go | 2 +- .../netapp/netapp_snapshot_policy_resource.go | 2 +- .../netapp/netapp_snapshot_policy_test.go | 2 +- .../netapp/netapp_snapshot_resource.go | 2 +- .../netapp/netapp_snapshot_resource_test.go | 2 +- internal/services/netapp/netapp_volume.go | 4 +- .../netapp/netapp_volume_data_source.go | 2 +- .../services/netapp/netapp_volume_resource.go | 6 +- .../netapp/netapp_volume_resource_test.go | 2 +- .../netapp/2021-10-01/capacitypools/README.md | 99 ------ .../netapp/2021-10-01/capacitypools/client.go | 18 - .../2021-10-01/capacitypools/constants.go | 96 ------ .../capacitypools/id_capacitypool.go | 137 -------- .../capacitypools/id_netappaccount.go | 124 ------- .../method_poolscreateorupdate_autorest.go | 79 ----- .../method_poolsdelete_autorest.go | 78 ----- .../capacitypools/method_poolsget_autorest.go | 67 ---- .../method_poolslist_autorest.go | 186 ---------- .../method_poolsupdate_autorest.go | 79 ----- .../capacitypools/model_capacitypool.go | 19 -- .../capacitypools/model_capacitypoolpatch.go | 13 - .../model_poolpatchproperties.go | 9 - .../capacitypools/model_poolproperties.go | 16 - .../2021-10-01/capacitypools/predicates.go | 34 -- .../2021-10-01/capacitypools/version.go | 12 - .../2021-10-01/netappaccounts/README.md | 116 ------- .../2021-10-01/netappaccounts/client.go | 18 - .../2021-10-01/netappaccounts/constants.go | 43 --- .../netappaccounts/id_netappaccount.go | 124 ------- .../method_accountscreateorupdate_autorest.go | 79 ----- .../method_accountsdelete_autorest.go | 78 ----- .../method_accountsget_autorest.go | 67 ---- .../method_accountslist_autorest.go | 187 ---------- ...hod_accountslistbysubscription_autorest.go | 187 ---------- .../method_accountsupdate_autorest.go | 79 ----- .../netappaccounts/model_accountencryption.go | 8 - .../netappaccounts/model_accountproperties.go | 10 - .../netappaccounts/model_activedirectory.go | 29 -- .../model_ldapsearchscopeopt.go | 10 - .../netappaccounts/model_netappaccount.go | 19 -- .../model_netappaccountpatch.go | 13 - .../2021-10-01/netappaccounts/predicates.go | 34 -- .../2021-10-01/netappaccounts/version.go | 12 - .../2021-10-01/snapshotpolicy/README.md | 102 ------ .../2021-10-01/snapshotpolicy/client.go | 18 - .../snapshotpolicy/id_netappaccount.go | 124 ------- .../snapshotpolicy/id_snapshotpolicies.go | 137 -------- .../method_snapshotpoliciescreate_autorest.go | 68 ---- .../method_snapshotpoliciesdelete_autorest.go | 78 ----- .../method_snapshotpoliciesget_autorest.go | 67 ---- .../method_snapshotpolicieslist_autorest.go | 68 ---- .../method_snapshotpoliciesupdate_autorest.go | 79 ----- .../snapshotpolicy/model_dailyschedule.go | 11 - .../snapshotpolicy/model_hourlyschedule.go | 10 - .../snapshotpolicy/model_monthlyschedule.go | 12 - .../model_snapshotpolicieslist.go | 8 - .../snapshotpolicy/model_snapshotpolicy.go | 19 -- .../model_snapshotpolicypatch.go | 13 - .../model_snapshotpolicyproperties.go | 13 - .../snapshotpolicy/model_weeklyschedule.go | 12 - .../2021-10-01/snapshotpolicy/version.go | 12 - .../netapp/2021-10-01/snapshots/README.md | 111 ------ .../netapp/2021-10-01/snapshots/client.go | 18 - .../2021-10-01/snapshots/id_snapshot.go | 163 --------- .../netapp/2021-10-01/snapshots/id_volume.go | 150 -------- .../snapshots/method_create_autorest.go | 79 ----- .../snapshots/method_delete_autorest.go | 78 ----- .../snapshots/method_get_autorest.go | 67 ---- .../snapshots/method_list_autorest.go | 68 ---- .../snapshots/method_restorefiles_autorest.go | 79 ----- .../snapshots/method_update_autorest.go | 79 ----- .../2021-10-01/snapshots/model_snapshot.go | 12 - .../snapshots/model_snapshotproperties.go | 28 -- .../snapshots/model_snapshotrestorefiles.go | 9 - .../snapshots/model_snapshotslist.go | 8 - .../netapp/2021-10-01/snapshots/version.go | 12 - .../netapp/2021-10-01/volumegroups/README.md | 81 ----- .../netapp/2021-10-01/volumegroups/client.go | 18 - .../2021-10-01/volumegroups/constants.go | 295 ---------------- .../volumegroups/id_netappaccount.go | 124 ------- .../2021-10-01/volumegroups/id_volumegroup.go | 137 -------- .../method_volumegroupscreate_autorest.go | 79 ----- .../method_volumegroupsdelete_autorest.go | 78 ----- .../method_volumegroupsget_autorest.go | 67 ---- ...olumegroupslistbynetappaccount_autorest.go | 68 ---- .../volumegroups/model_exportpolicyrule.go | 22 -- .../model_mounttargetproperties.go | 11 - .../model_placementkeyvaluepairs.go | 9 - .../volumegroups/model_replicationobject.go | 12 - .../model_volumebackupproperties.go | 11 - .../volumegroups/model_volumegroup.go | 12 - .../volumegroups/model_volumegroupdetails.go | 13 - .../volumegroups/model_volumegrouplist.go | 8 - .../model_volumegrouplistproperties.go | 9 - .../volumegroups/model_volumegroupmetadata.go | 13 - .../model_volumegroupproperties.go | 10 - .../model_volumegroupvolumeproperties.go | 12 - .../volumegroups/model_volumeproperties.go | 49 --- .../model_volumepropertiesdataprotection.go | 10 - .../model_volumepropertiesexportpolicy.go | 8 - .../model_volumesnapshotproperties.go | 8 - .../netapp/2021-10-01/volumegroups/version.go | 12 - .../netapp/2021-10-01/volumes/README.md | 99 ------ .../netapp/2021-10-01/volumes/client.go | 18 - .../netapp/2021-10-01/volumes/constants.go | 270 --------------- .../2021-10-01/volumes/id_capacitypool.go | 137 -------- .../netapp/2021-10-01/volumes/id_volume.go | 150 -------- .../volumes/method_createorupdate_autorest.go | 79 ----- .../volumes/method_delete_autorest.go | 107 ------ .../2021-10-01/volumes/method_get_autorest.go | 67 ---- .../volumes/method_list_autorest.go | 186 ---------- .../volumes/method_update_autorest.go | 79 ----- .../volumes/model_exportpolicyrule.go | 22 -- .../volumes/model_mounttargetproperties.go | 11 - .../volumes/model_placementkeyvaluepairs.go | 9 - .../volumes/model_replicationobject.go | 12 - .../netapp/2021-10-01/volumes/model_volume.go | 19 -- .../volumes/model_volumebackupproperties.go | 11 - .../2021-10-01/volumes/model_volumepatch.go | 13 - .../volumes/model_volumepatchproperties.go | 16 - ...del_volumepatchpropertiesdataprotection.go | 9 - ...model_volumepatchpropertiesexportpolicy.go | 8 - .../volumes/model_volumeproperties.go | 49 --- .../model_volumepropertiesdataprotection.go | 10 - .../model_volumepropertiesexportpolicy.go | 8 - .../volumes/model_volumesnapshotproperties.go | 8 - .../netapp/2021-10-01/volumes/predicates.go | 34 -- .../netapp/2021-10-01/volumes/version.go | 12 - .../2021-10-01/volumesreplication/README.md | 106 ------ .../2021-10-01/volumesreplication/client.go | 18 - .../volumesreplication/constants.go | 65 ---- .../volumesreplication/id_volume.go | 150 -------- ...od_volumesauthorizereplication_autorest.go | 79 ----- ...method_volumesbreakreplication_autorest.go | 79 ----- ...ethod_volumesdeletereplication_autorest.go | 78 ----- ...volumesreinitializereplication_autorest.go | 78 ----- ...ethod_volumesreplicationstatus_autorest.go | 68 ---- ...ethod_volumesresyncreplication_autorest.go | 78 ----- .../model_authorizerequest.go | 8 - .../model_breakreplicationrequest.go | 8 - .../model_replicationstatus.go | 12 - .../2021-10-01/volumesreplication/version.go | 12 - .../netapp/2022-01-01/volumegroups/README.md | 81 ----- .../netapp/2022-01-01/volumegroups/client.go | 18 - .../2022-01-01/volumegroups/constants.go | 320 ------------------ .../volumegroups/id_netappaccount.go | 124 ------- .../2022-01-01/volumegroups/id_volumegroup.go | 137 -------- .../method_volumegroupscreate_autorest.go | 79 ----- .../method_volumegroupsdelete_autorest.go | 78 ----- .../method_volumegroupsget_autorest.go | 67 ---- ...olumegroupslistbynetappaccount_autorest.go | 68 ---- .../volumegroups/model_exportpolicyrule.go | 22 -- .../model_mounttargetproperties.go | 11 - .../model_placementkeyvaluepairs.go | 9 - .../volumegroups/model_replicationobject.go | 12 - .../model_volumebackupproperties.go | 11 - .../volumegroups/model_volumegroup.go | 12 - .../volumegroups/model_volumegroupdetails.go | 12 - .../volumegroups/model_volumegrouplist.go | 8 - .../model_volumegrouplistproperties.go | 9 - .../volumegroups/model_volumegroupmetadata.go | 13 - .../model_volumegroupproperties.go | 10 - .../model_volumegroupvolumeproperties.go | 12 - .../volumegroups/model_volumeproperties.go | 50 --- .../model_volumepropertiesdataprotection.go | 10 - .../model_volumepropertiesexportpolicy.go | 8 - .../model_volumesnapshotproperties.go | 8 - .../netapp/2022-01-01/volumegroups/version.go | 12 - 177 files changed, 31 insertions(+), 8673 deletions(-) delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/README.md delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/client.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/constants.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/id_capacitypool.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/id_netappaccount.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolscreateorupdate_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolsdelete_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolsget_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolslist_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolsupdate_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/model_capacitypool.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/model_capacitypoolpatch.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/model_poolpatchproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/model_poolproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/predicates.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/version.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/README.md delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/client.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/constants.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/id_netappaccount.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountscreateorupdate_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountsdelete_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountsget_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountslist_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountslistbysubscription_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountsupdate_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_accountencryption.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_accountproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_activedirectory.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_ldapsearchscopeopt.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_netappaccount.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_netappaccountpatch.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/predicates.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/version.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/README.md delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/client.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/id_netappaccount.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/id_snapshotpolicies.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpoliciescreate_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpoliciesdelete_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpoliciesget_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpolicieslist_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpoliciesupdate_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_dailyschedule.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_hourlyschedule.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_monthlyschedule.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_snapshotpolicieslist.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_snapshotpolicy.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_snapshotpolicypatch.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_snapshotpolicyproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_weeklyschedule.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/version.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/README.md delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/client.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/id_snapshot.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/id_volume.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_create_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_delete_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_get_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_list_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_restorefiles_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_update_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/model_snapshot.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/model_snapshotproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/model_snapshotrestorefiles.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/model_snapshotslist.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/version.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/README.md delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/client.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/constants.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/id_netappaccount.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/id_volumegroup.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupscreate_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupsdelete_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupsget_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupslistbynetappaccount_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_exportpolicyrule.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_mounttargetproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_placementkeyvaluepairs.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_replicationobject.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumebackupproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroup.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupdetails.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegrouplist.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegrouplistproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupmetadata.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupvolumeproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumeproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumepropertiesdataprotection.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumepropertiesexportpolicy.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumesnapshotproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/version.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/README.md delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/client.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/constants.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/id_capacitypool.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/id_volume.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_createorupdate_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_delete_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_get_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_list_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_update_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_exportpolicyrule.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_mounttargetproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_placementkeyvaluepairs.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_replicationobject.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volume.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumebackupproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepatch.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepatchproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepatchpropertiesdataprotection.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepatchpropertiesexportpolicy.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumeproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepropertiesdataprotection.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepropertiesexportpolicy.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumesnapshotproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/predicates.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/version.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/README.md delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/client.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/constants.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/id_volume.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesauthorizereplication_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesbreakreplication_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesdeletereplication_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesreinitializereplication_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesreplicationstatus_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesresyncreplication_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/model_authorizerequest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/model_breakreplicationrequest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/model_replicationstatus.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/version.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/README.md delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/client.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/constants.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/id_netappaccount.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/id_volumegroup.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupscreate_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupsdelete_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupsget_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupslistbynetappaccount_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_exportpolicyrule.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_mounttargetproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_placementkeyvaluepairs.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_replicationobject.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumebackupproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroup.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupdetails.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegrouplist.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegrouplistproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupmetadata.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupvolumeproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumeproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumepropertiesdataprotection.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumepropertiesexportpolicy.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumesnapshotproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/version.go diff --git a/go.mod b/go.mod index a2c715867017..24814b2e184b 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/gofrs/uuid v4.0.0+incompatible github.com/google/go-cmp v0.5.8 github.com/google/uuid v1.1.2 - github.com/hashicorp/go-azure-helpers v0.37.0 + github.com/hashicorp/go-azure-helpers v0.38.0 github.com/hashicorp/go-azure-sdk v0.20220715.1112616 github.com/hashicorp/go-multierror v1.1.1 github.com/hashicorp/go-uuid v1.0.3 @@ -25,14 +25,14 @@ require ( github.com/sergi/go-diff v1.2.0 github.com/shopspring/decimal v1.2.0 github.com/tombuildsstuff/giovanni v0.20.0 - golang.org/x/crypto v0.0.0-20220517005047-85d78b3ac167 + golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 gopkg.in/yaml.v3 v3.0.1 ) require ( github.com/Azure/go-autorest v14.2.0+incompatible // indirect - github.com/Azure/go-autorest/autorest/adal v0.9.18 // indirect + github.com/Azure/go-autorest/autorest/adal v0.9.20 // indirect github.com/Azure/go-autorest/autorest/azure/cli v0.4.5 // indirect github.com/Azure/go-autorest/logger v0.2.1 // indirect github.com/agext/levenshtein v1.2.3 // indirect @@ -41,7 +41,7 @@ require ( github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect github.com/dimchansky/utfbom v1.1.1 // indirect github.com/fatih/color v1.13.0 // indirect - github.com/golang-jwt/jwt/v4 v4.4.1 // indirect + github.com/golang-jwt/jwt/v4 v4.4.2 // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-checkpoint v0.5.0 // indirect diff --git a/go.sum b/go.sum index 869d1baa8bdd..352194feca83 100644 --- a/go.sum +++ b/go.sum @@ -48,6 +48,8 @@ github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4Uw github.com/Azure/go-autorest/autorest/adal v0.9.14/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M= github.com/Azure/go-autorest/autorest/adal v0.9.18 h1:kLnPsRjzZZUF3K5REu/Kc+qMQrvuza2bwSnNdhmzLfQ= github.com/Azure/go-autorest/autorest/adal v0.9.18/go.mod h1:XVVeme+LZwABT8K5Lc3hA4nAe8LDBVle26gTrguhhPQ= +github.com/Azure/go-autorest/autorest/adal v0.9.20 h1:gJ3E98kMpFB1MFqQCvA1yFab8vthOeD4VlFRQULxahg= +github.com/Azure/go-autorest/autorest/adal v0.9.20/go.mod h1:XVVeme+LZwABT8K5Lc3hA4nAe8LDBVle26gTrguhhPQ= github.com/Azure/go-autorest/autorest/azure/cli v0.4.0/go.mod h1:JljT387FplPzBA31vUcvsetLKF3pec5bdAxjVU4kI2s= github.com/Azure/go-autorest/autorest/azure/cli v0.4.2/go.mod h1:7qkJkT+j6b+hIpzMOwPChJhTqS8VbsqqgULzMNRugoM= github.com/Azure/go-autorest/autorest/azure/cli v0.4.5 h1:0W/yGmFdTIT77fvdlGZ0LMISoLHFJ7Tx4U0yeB+uFs4= @@ -151,6 +153,8 @@ github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzw github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang-jwt/jwt/v4 v4.4.1 h1:pC5DB52sCeK48Wlb9oPcdhnjkz1TKt1D/P7WKJ0kUcQ= github.com/golang-jwt/jwt/v4 v4.4.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang-jwt/jwt/v4 v4.4.2 h1:rcc4lwaZgFMCZ5jxF9ABolDcIHdBytAFgqFPbSJQAYs= +github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -216,6 +220,8 @@ github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brv github.com/hashicorp/go-azure-helpers v0.12.0/go.mod h1:Zc3v4DNeX6PDdy7NljlYpnrdac1++qNW0I4U+ofGwpg= github.com/hashicorp/go-azure-helpers v0.37.0 h1:6UOoQ9esE4MJ4wHJr21qU81IJQ9zsXQ9FbANYUbeE4U= github.com/hashicorp/go-azure-helpers v0.37.0/go.mod h1:gcutZ/Hf/O7YN9M3UIvyZ9l0Rxv7Yrc9x5sSfM9cuSw= +github.com/hashicorp/go-azure-helpers v0.38.0 h1:IxBPa0DZuoip0xh0BpDJO6nd87UjeoutvW3MYLm6H+I= +github.com/hashicorp/go-azure-helpers v0.38.0/go.mod h1:gcutZ/Hf/O7YN9M3UIvyZ9l0Rxv7Yrc9x5sSfM9cuSw= github.com/hashicorp/go-azure-sdk v0.20220712.1111122 h1:GiUf/gYHKwgqbqvETA6xLRvLc8u0o83Qor2/zmzwDRo= github.com/hashicorp/go-azure-sdk v0.20220712.1111122/go.mod h1:yjQPw8DCOtQR8E8+FNaTxF6yz+tyQGkDNiVAGCNoLOo= github.com/hashicorp/go-azure-sdk v0.20220715.1112616 h1:q2PQ+FQGahlXNf1WS3l9VFHJq1XiULlSkPypyaro78M= @@ -406,6 +412,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220517005047-85d78b3ac167 h1:O8uGbHCqlTp2P6QJSLmCojM4mN6UemYv8K+dCnmHmu0= golang.org/x/crypto v0.0.0-20220517005047-85d78b3ac167/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d h1:sK3txAijHtOK88l68nt020reeT1ZdKLIYetKl95FzVY= +golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= diff --git a/internal/services/netapp/netapp_account_data_source.go b/internal/services/netapp/netapp_account_data_source.go index 27699a8203b1..eac93af9192f 100644 --- a/internal/services/netapp/netapp_account_data_source.go +++ b/internal/services/netapp/netapp_account_data_source.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/netapp/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" diff --git a/internal/services/netapp/netapp_account_resource.go b/internal/services/netapp/netapp_account_resource.go index ab1ab8e2cc92..65cd832d7ee2 100644 --- a/internal/services/netapp/netapp_account_resource.go +++ b/internal/services/netapp/netapp_account_resource.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" diff --git a/internal/services/netapp/netapp_account_resource_test.go b/internal/services/netapp/netapp_account_resource_test.go index 618cde189ae8..fbba74d06d97 100644 --- a/internal/services/netapp/netapp_account_resource_test.go +++ b/internal/services/netapp/netapp_account_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts" "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" diff --git a/internal/services/netapp/netapp_pool_data_source.go b/internal/services/netapp/netapp_pool_data_source.go index 28972ab23ba7..238f0607f807 100644 --- a/internal/services/netapp/netapp_pool_data_source.go +++ b/internal/services/netapp/netapp_pool_data_source.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/netapp/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" diff --git a/internal/services/netapp/netapp_pool_resource.go b/internal/services/netapp/netapp_pool_resource.go index 1c8839e7fdd1..6e3cb8afb54b 100644 --- a/internal/services/netapp/netapp_pool_resource.go +++ b/internal/services/netapp/netapp_pool_resource.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/netapp/netapp_pool_resource_test.go b/internal/services/netapp/netapp_pool_resource_test.go index 4c8396269afb..f74baac3c3e0 100644 --- a/internal/services/netapp/netapp_pool_resource_test.go +++ b/internal/services/netapp/netapp_pool_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools" "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" diff --git a/internal/services/netapp/netapp_snapshot_data_source.go b/internal/services/netapp/netapp_snapshot_data_source.go index e5f7e540f7c9..65780eda6ef5 100644 --- a/internal/services/netapp/netapp_snapshot_data_source.go +++ b/internal/services/netapp/netapp_snapshot_data_source.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/netapp/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" diff --git a/internal/services/netapp/netapp_snapshot_policy_data_source.go b/internal/services/netapp/netapp_snapshot_policy_data_source.go index 227a1d90e9af..dcfa4f571249 100644 --- a/internal/services/netapp/netapp_snapshot_policy_data_source.go +++ b/internal/services/netapp/netapp_snapshot_policy_data_source.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/netapp/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tags" diff --git a/internal/services/netapp/netapp_snapshot_policy_resource.go b/internal/services/netapp/netapp_snapshot_policy_resource.go index 13e39b898c31..d231a8d36808 100644 --- a/internal/services/netapp/netapp_snapshot_policy_resource.go +++ b/internal/services/netapp/netapp_snapshot_policy_resource.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/netapp/netapp_snapshot_policy_test.go b/internal/services/netapp/netapp_snapshot_policy_test.go index e34eb0b19a71..7ed86d275d0c 100644 --- a/internal/services/netapp/netapp_snapshot_policy_test.go +++ b/internal/services/netapp/netapp_snapshot_policy_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy" "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" diff --git a/internal/services/netapp/netapp_snapshot_resource.go b/internal/services/netapp/netapp_snapshot_resource.go index 8ae77671d270..5f28a1d77690 100644 --- a/internal/services/netapp/netapp_snapshot_resource.go +++ b/internal/services/netapp/netapp_snapshot_resource.go @@ -8,7 +8,7 @@ import ( "time" "github.com/hashicorp/go-azure-helpers/lang/response" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/netapp/netapp_snapshot_resource_test.go b/internal/services/netapp/netapp_snapshot_resource_test.go index 2a5d329f6d93..54824f5efdda 100644 --- a/internal/services/netapp/netapp_snapshot_resource_test.go +++ b/internal/services/netapp/netapp_snapshot_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" diff --git a/internal/services/netapp/netapp_volume.go b/internal/services/netapp/netapp_volume.go index 17745fab7241..641c9f9dc60b 100644 --- a/internal/services/netapp/netapp_volume.go +++ b/internal/services/netapp/netapp_volume.go @@ -5,9 +5,9 @@ import ( "strings" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots" "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" netAppValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/netapp/validate" diff --git a/internal/services/netapp/netapp_volume_data_source.go b/internal/services/netapp/netapp_volume_data_source.go index b6413b4da7d5..ff26b24dc424 100644 --- a/internal/services/netapp/netapp_volume_data_source.go +++ b/internal/services/netapp/netapp_volume_data_source.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/netapp/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" diff --git a/internal/services/netapp/netapp_volume_resource.go b/internal/services/netapp/netapp_volume_resource.go index 4c8f60454fc4..1c99acea4cc5 100644 --- a/internal/services/netapp/netapp_volume_resource.go +++ b/internal/services/netapp/netapp_volume_resource.go @@ -11,9 +11,9 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/netapp/netapp_volume_resource_test.go b/internal/services/netapp/netapp_volume_resource_test.go index 539cf40d746c..6c7541f7eca1 100644 --- a/internal/services/netapp/netapp_volume_resource_test.go +++ b/internal/services/netapp/netapp_volume_resource_test.go @@ -6,7 +6,7 @@ import ( "os" "testing" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes" "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" diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/README.md deleted file mode 100644 index a47f3c6bf12f..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/README.md +++ /dev/null @@ -1,99 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools` Documentation - -The `capacitypools` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2021-10-01`). - -This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). - -### Import Path - -```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools" -``` - - -### Client Initialization - -```go -client := capacitypools.NewCapacityPoolsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `CapacityPoolsClient.PoolsCreateOrUpdate` - -```go -ctx := context.TODO() -id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue") - -payload := capacitypools.CapacityPool{ - // ... -} - - -if err := client.PoolsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `CapacityPoolsClient.PoolsDelete` - -```go -ctx := context.TODO() -id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue") - -if err := client.PoolsDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `CapacityPoolsClient.PoolsGet` - -```go -ctx := context.TODO() -id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue") - -read, err := client.PoolsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `CapacityPoolsClient.PoolsList` - -```go -ctx := context.TODO() -id := capacitypools.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") - -// alternatively `client.PoolsList(ctx, id)` can be used to do batched pagination -items, err := client.PoolsListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `CapacityPoolsClient.PoolsUpdate` - -```go -ctx := context.TODO() -id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue") - -payload := capacitypools.CapacityPoolPatch{ - // ... -} - - -if err := client.PoolsUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/client.go deleted file mode 100644 index d31b6b301a25..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/client.go +++ /dev/null @@ -1,18 +0,0 @@ -package capacitypools - -import "github.com/Azure/go-autorest/autorest" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CapacityPoolsClient struct { - Client autorest.Client - baseUri string -} - -func NewCapacityPoolsClientWithBaseURI(endpoint string) CapacityPoolsClient { - return CapacityPoolsClient{ - Client: autorest.NewClientWithUserAgent(userAgent()), - baseUri: endpoint, - } -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/constants.go deleted file mode 100644 index 4856e8e79bc3..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/constants.go +++ /dev/null @@ -1,96 +0,0 @@ -package capacitypools - -import "strings" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EncryptionType string - -const ( - EncryptionTypeDouble EncryptionType = "Double" - EncryptionTypeSingle EncryptionType = "Single" -) - -func PossibleValuesForEncryptionType() []string { - return []string{ - string(EncryptionTypeDouble), - string(EncryptionTypeSingle), - } -} - -func parseEncryptionType(input string) (*EncryptionType, error) { - vals := map[string]EncryptionType{ - "double": EncryptionTypeDouble, - "single": EncryptionTypeSingle, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EncryptionType(input) - return &out, nil -} - -type QosType string - -const ( - QosTypeAuto QosType = "Auto" - QosTypeManual QosType = "Manual" -) - -func PossibleValuesForQosType() []string { - return []string{ - string(QosTypeAuto), - string(QosTypeManual), - } -} - -func parseQosType(input string) (*QosType, error) { - vals := map[string]QosType{ - "auto": QosTypeAuto, - "manual": QosTypeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := QosType(input) - return &out, nil -} - -type ServiceLevel string - -const ( - ServiceLevelPremium ServiceLevel = "Premium" - ServiceLevelStandard ServiceLevel = "Standard" - ServiceLevelStandardZRS ServiceLevel = "StandardZRS" - ServiceLevelUltra ServiceLevel = "Ultra" -) - -func PossibleValuesForServiceLevel() []string { - return []string{ - string(ServiceLevelPremium), - string(ServiceLevelStandard), - string(ServiceLevelStandardZRS), - string(ServiceLevelUltra), - } -} - -func parseServiceLevel(input string) (*ServiceLevel, error) { - vals := map[string]ServiceLevel{ - "premium": ServiceLevelPremium, - "standard": ServiceLevelStandard, - "standardzrs": ServiceLevelStandardZRS, - "ultra": ServiceLevelUltra, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ServiceLevel(input) - return &out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/id_capacitypool.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/id_capacitypool.go deleted file mode 100644 index a50e29408397..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/id_capacitypool.go +++ /dev/null @@ -1,137 +0,0 @@ -package capacitypools - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -var _ resourceids.ResourceId = CapacityPoolId{} - -// CapacityPoolId is a struct representing the Resource ID for a Capacity Pool -type CapacityPoolId struct { - SubscriptionId string - ResourceGroupName string - AccountName string - PoolName string -} - -// NewCapacityPoolID returns a new CapacityPoolId struct -func NewCapacityPoolID(subscriptionId string, resourceGroupName string, accountName string, poolName string) CapacityPoolId { - return CapacityPoolId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - AccountName: accountName, - PoolName: poolName, - } -} - -// ParseCapacityPoolID parses 'input' into a CapacityPoolId -func ParseCapacityPoolID(input string) (*CapacityPoolId, error) { - parser := resourceids.NewParserFromResourceIdType(CapacityPoolId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := CapacityPoolId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { - return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ParseCapacityPoolIDInsensitively parses 'input' case-insensitively into a CapacityPoolId -// note: this method should only be used for API response data and not user input -func ParseCapacityPoolIDInsensitively(input string) (*CapacityPoolId, error) { - parser := resourceids.NewParserFromResourceIdType(CapacityPoolId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := CapacityPoolId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { - return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ValidateCapacityPoolID checks that 'input' can be parsed as a Capacity Pool ID -func ValidateCapacityPoolID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := ParseCapacityPoolID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Capacity Pool ID -func (id CapacityPoolId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/capacityPools/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName, id.PoolName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Capacity Pool ID -func (id CapacityPoolId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), - resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("accountName", "accountValue"), - resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("poolName", "poolValue"), - } -} - -// String returns a human-readable description of this Capacity Pool ID -func (id CapacityPoolId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Account Name: %q", id.AccountName), - fmt.Sprintf("Pool Name: %q", id.PoolName), - } - return fmt.Sprintf("Capacity Pool (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/id_netappaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/id_netappaccount.go deleted file mode 100644 index 86bd7fcada46..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/id_netappaccount.go +++ /dev/null @@ -1,124 +0,0 @@ -package capacitypools - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -var _ resourceids.ResourceId = NetAppAccountId{} - -// NetAppAccountId is a struct representing the Resource ID for a Net App Account -type NetAppAccountId struct { - SubscriptionId string - ResourceGroupName string - AccountName string -} - -// NewNetAppAccountID returns a new NetAppAccountId struct -func NewNetAppAccountID(subscriptionId string, resourceGroupName string, accountName string) NetAppAccountId { - return NetAppAccountId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - AccountName: accountName, - } -} - -// ParseNetAppAccountID parses 'input' into a NetAppAccountId -func ParseNetAppAccountID(input string) (*NetAppAccountId, error) { - parser := resourceids.NewParserFromResourceIdType(NetAppAccountId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := NetAppAccountId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ParseNetAppAccountIDInsensitively parses 'input' case-insensitively into a NetAppAccountId -// note: this method should only be used for API response data and not user input -func ParseNetAppAccountIDInsensitively(input string) (*NetAppAccountId, error) { - parser := resourceids.NewParserFromResourceIdType(NetAppAccountId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := NetAppAccountId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ValidateNetAppAccountID checks that 'input' can be parsed as a Net App Account ID -func ValidateNetAppAccountID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := ParseNetAppAccountID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Net App Account ID -func (id NetAppAccountId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Net App Account ID -func (id NetAppAccountId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), - resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("accountName", "accountValue"), - } -} - -// String returns a human-readable description of this Net App Account ID -func (id NetAppAccountId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Account Name: %q", id.AccountName), - } - return fmt.Sprintf("Net App Account (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolscreateorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolscreateorupdate_autorest.go deleted file mode 100644 index 72891f7b9dfb..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolscreateorupdate_autorest.go +++ /dev/null @@ -1,79 +0,0 @@ -package capacitypools - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PoolsCreateOrUpdateOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// PoolsCreateOrUpdate ... -func (c CapacityPoolsClient) PoolsCreateOrUpdate(ctx context.Context, id CapacityPoolId, input CapacityPool) (result PoolsCreateOrUpdateOperationResponse, err error) { - req, err := c.preparerForPoolsCreateOrUpdate(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsCreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = c.senderForPoolsCreateOrUpdate(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsCreateOrUpdate", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// PoolsCreateOrUpdateThenPoll performs PoolsCreateOrUpdate then polls until it's completed -func (c CapacityPoolsClient) PoolsCreateOrUpdateThenPoll(ctx context.Context, id CapacityPoolId, input CapacityPool) error { - result, err := c.PoolsCreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing PoolsCreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after PoolsCreateOrUpdate: %+v", err) - } - - return nil -} - -// preparerForPoolsCreateOrUpdate prepares the PoolsCreateOrUpdate request. -func (c CapacityPoolsClient) preparerForPoolsCreateOrUpdate(ctx context.Context, id CapacityPoolId, input CapacityPool) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForPoolsCreateOrUpdate sends the PoolsCreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (c CapacityPoolsClient) senderForPoolsCreateOrUpdate(ctx context.Context, req *http.Request) (future PoolsCreateOrUpdateOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolsdelete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolsdelete_autorest.go deleted file mode 100644 index 61d0e6104b15..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolsdelete_autorest.go +++ /dev/null @@ -1,78 +0,0 @@ -package capacitypools - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PoolsDeleteOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// PoolsDelete ... -func (c CapacityPoolsClient) PoolsDelete(ctx context.Context, id CapacityPoolId) (result PoolsDeleteOperationResponse, err error) { - req, err := c.preparerForPoolsDelete(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsDelete", nil, "Failure preparing request") - return - } - - result, err = c.senderForPoolsDelete(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsDelete", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// PoolsDeleteThenPoll performs PoolsDelete then polls until it's completed -func (c CapacityPoolsClient) PoolsDeleteThenPoll(ctx context.Context, id CapacityPoolId) error { - result, err := c.PoolsDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing PoolsDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after PoolsDelete: %+v", err) - } - - return nil -} - -// preparerForPoolsDelete prepares the PoolsDelete request. -func (c CapacityPoolsClient) preparerForPoolsDelete(ctx context.Context, id CapacityPoolId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsDelete(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForPoolsDelete sends the PoolsDelete request. The method will close the -// http.Response Body if it receives an error. -func (c CapacityPoolsClient) senderForPoolsDelete(ctx context.Context, req *http.Request) (future PoolsDeleteOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolsget_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolsget_autorest.go deleted file mode 100644 index d2725693da9d..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolsget_autorest.go +++ /dev/null @@ -1,67 +0,0 @@ -package capacitypools - -import ( - "context" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PoolsGetOperationResponse struct { - HttpResponse *http.Response - Model *CapacityPool -} - -// PoolsGet ... -func (c CapacityPoolsClient) PoolsGet(ctx context.Context, id CapacityPoolId) (result PoolsGetOperationResponse, err error) { - req, err := c.preparerForPoolsGet(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsGet", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsGet", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForPoolsGet(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsGet", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForPoolsGet prepares the PoolsGet request. -func (c CapacityPoolsClient) preparerForPoolsGet(ctx context.Context, id CapacityPoolId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForPoolsGet handles the response to the PoolsGet request. The method always -// closes the http.Response Body. -func (c CapacityPoolsClient) responderForPoolsGet(resp *http.Response) (result PoolsGetOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolslist_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolslist_autorest.go deleted file mode 100644 index 25c06a45e9bd..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolslist_autorest.go +++ /dev/null @@ -1,186 +0,0 @@ -package capacitypools - -import ( - "context" - "fmt" - "net/http" - "net/url" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PoolsListOperationResponse struct { - HttpResponse *http.Response - Model *[]CapacityPool - - nextLink *string - nextPageFunc func(ctx context.Context, nextLink string) (PoolsListOperationResponse, error) -} - -type PoolsListCompleteResult struct { - Items []CapacityPool -} - -func (r PoolsListOperationResponse) HasMore() bool { - return r.nextLink != nil -} - -func (r PoolsListOperationResponse) LoadMore(ctx context.Context) (resp PoolsListOperationResponse, err error) { - if !r.HasMore() { - err = fmt.Errorf("no more pages returned") - return - } - return r.nextPageFunc(ctx, *r.nextLink) -} - -// PoolsList ... -func (c CapacityPoolsClient) PoolsList(ctx context.Context, id NetAppAccountId) (resp PoolsListOperationResponse, err error) { - req, err := c.preparerForPoolsList(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsList", nil, "Failure preparing request") - return - } - - resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsList", resp.HttpResponse, "Failure sending request") - return - } - - resp, err = c.responderForPoolsList(resp.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsList", resp.HttpResponse, "Failure responding to request") - return - } - return -} - -// PoolsListComplete retrieves all of the results into a single object -func (c CapacityPoolsClient) PoolsListComplete(ctx context.Context, id NetAppAccountId) (PoolsListCompleteResult, error) { - return c.PoolsListCompleteMatchingPredicate(ctx, id, CapacityPoolOperationPredicate{}) -} - -// PoolsListCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c CapacityPoolsClient) PoolsListCompleteMatchingPredicate(ctx context.Context, id NetAppAccountId, predicate CapacityPoolOperationPredicate) (resp PoolsListCompleteResult, err error) { - items := make([]CapacityPool, 0) - - page, err := c.PoolsList(ctx, id) - if err != nil { - err = fmt.Errorf("loading the initial page: %+v", err) - return - } - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - for page.HasMore() { - page, err = page.LoadMore(ctx) - if err != nil { - err = fmt.Errorf("loading the next page: %+v", err) - return - } - - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - } - - out := PoolsListCompleteResult{ - Items: items, - } - return out, nil -} - -// preparerForPoolsList prepares the PoolsList request. -func (c CapacityPoolsClient) preparerForPoolsList(ctx context.Context, id NetAppAccountId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/capacityPools", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// preparerForPoolsListWithNextLink prepares the PoolsList request with the given nextLink token. -func (c CapacityPoolsClient) preparerForPoolsListWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { - uri, err := url.Parse(nextLink) - if err != nil { - return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) - } - queryParameters := map[string]interface{}{} - for k, v := range uri.Query() { - if len(v) == 0 { - continue - } - val := v[0] - val = autorest.Encode("query", val) - queryParameters[k] = val - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(uri.Path), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForPoolsList handles the response to the PoolsList request. The method always -// closes the http.Response Body. -func (c CapacityPoolsClient) responderForPoolsList(resp *http.Response) (result PoolsListOperationResponse, err error) { - type page struct { - Values []CapacityPool `json:"value"` - NextLink *string `json:"nextLink"` - } - var respObj page - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&respObj), - autorest.ByClosing()) - result.HttpResponse = resp - result.Model = &respObj.Values - result.nextLink = respObj.NextLink - if respObj.NextLink != nil { - result.nextPageFunc = func(ctx context.Context, nextLink string) (result PoolsListOperationResponse, err error) { - req, err := c.preparerForPoolsListWithNextLink(ctx, nextLink) - if err != nil { - err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsList", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsList", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForPoolsList(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsList", result.HttpResponse, "Failure responding to request") - return - } - - return - } - } - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolsupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolsupdate_autorest.go deleted file mode 100644 index 680bc19748a1..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolsupdate_autorest.go +++ /dev/null @@ -1,79 +0,0 @@ -package capacitypools - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PoolsUpdateOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// PoolsUpdate ... -func (c CapacityPoolsClient) PoolsUpdate(ctx context.Context, id CapacityPoolId, input CapacityPoolPatch) (result PoolsUpdateOperationResponse, err error) { - req, err := c.preparerForPoolsUpdate(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsUpdate", nil, "Failure preparing request") - return - } - - result, err = c.senderForPoolsUpdate(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsUpdate", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// PoolsUpdateThenPoll performs PoolsUpdate then polls until it's completed -func (c CapacityPoolsClient) PoolsUpdateThenPoll(ctx context.Context, id CapacityPoolId, input CapacityPoolPatch) error { - result, err := c.PoolsUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing PoolsUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after PoolsUpdate: %+v", err) - } - - return nil -} - -// preparerForPoolsUpdate prepares the PoolsUpdate request. -func (c CapacityPoolsClient) preparerForPoolsUpdate(ctx context.Context, id CapacityPoolId, input CapacityPoolPatch) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForPoolsUpdate sends the PoolsUpdate request. The method will close the -// http.Response Body if it receives an error. -func (c CapacityPoolsClient) senderForPoolsUpdate(ctx context.Context, req *http.Request) (future PoolsUpdateOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/model_capacitypool.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/model_capacitypool.go deleted file mode 100644 index f5d6f1ea86df..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/model_capacitypool.go +++ /dev/null @@ -1,19 +0,0 @@ -package capacitypools - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CapacityPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Properties PoolProperties `json:"properties"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/model_capacitypoolpatch.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/model_capacitypoolpatch.go deleted file mode 100644 index 46abcde6b330..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/model_capacitypoolpatch.go +++ /dev/null @@ -1,13 +0,0 @@ -package capacitypools - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CapacityPoolPatch struct { - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PoolPatchProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/model_poolpatchproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/model_poolpatchproperties.go deleted file mode 100644 index 071dba445599..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/model_poolpatchproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package capacitypools - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PoolPatchProperties struct { - QosType *QosType `json:"qosType,omitempty"` - Size *int64 `json:"size,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/model_poolproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/model_poolproperties.go deleted file mode 100644 index a1fee733fb48..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/model_poolproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package capacitypools - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PoolProperties struct { - CoolAccess *bool `json:"coolAccess,omitempty"` - EncryptionType *EncryptionType `json:"encryptionType,omitempty"` - PoolId *string `json:"poolId,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` - QosType *QosType `json:"qosType,omitempty"` - ServiceLevel ServiceLevel `json:"serviceLevel"` - Size int64 `json:"size"` - TotalThroughputMibps *float64 `json:"totalThroughputMibps,omitempty"` - UtilizedThroughputMibps *float64 `json:"utilizedThroughputMibps,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/predicates.go deleted file mode 100644 index 67e2199aa2cd..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/predicates.go +++ /dev/null @@ -1,34 +0,0 @@ -package capacitypools - -type CapacityPoolOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p CapacityPoolOperationPredicate) Matches(input CapacityPool) bool { - - if p.Etag != nil && (input.Etag == nil && *p.Etag != *input.Etag) { - return false - } - - if p.Id != nil && (input.Id == nil && *p.Id != *input.Id) { - return false - } - - if p.Location != nil && *p.Location != input.Location { - return false - } - - if p.Name != nil && (input.Name == nil && *p.Name != *input.Name) { - return false - } - - if p.Type != nil && (input.Type == nil && *p.Type != *input.Type) { - return false - } - - return true -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/version.go deleted file mode 100644 index c647e1604368..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package capacitypools - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-10-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/capacitypools/%s", defaultApiVersion) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/README.md deleted file mode 100644 index 487820e90f62..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/README.md +++ /dev/null @@ -1,116 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts` Documentation - -The `netappaccounts` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2021-10-01`). - -This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). - -### Import Path - -```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts" -``` - - -### Client Initialization - -```go -client := netappaccounts.NewNetAppAccountsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `NetAppAccountsClient.AccountsCreateOrUpdate` - -```go -ctx := context.TODO() -id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") - -payload := netappaccounts.NetAppAccount{ - // ... -} - - -if err := client.AccountsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetAppAccountsClient.AccountsDelete` - -```go -ctx := context.TODO() -id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") - -if err := client.AccountsDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetAppAccountsClient.AccountsGet` - -```go -ctx := context.TODO() -id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") - -read, err := client.AccountsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetAppAccountsClient.AccountsList` - -```go -ctx := context.TODO() -id := netappaccounts.NewResourceGroupID() - -// alternatively `client.AccountsList(ctx, id)` can be used to do batched pagination -items, err := client.AccountsListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetAppAccountsClient.AccountsListBySubscription` - -```go -ctx := context.TODO() -id := netappaccounts.NewSubscriptionID() - -// alternatively `client.AccountsListBySubscription(ctx, id)` can be used to do batched pagination -items, err := client.AccountsListBySubscriptionComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetAppAccountsClient.AccountsUpdate` - -```go -ctx := context.TODO() -id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") - -payload := netappaccounts.NetAppAccountPatch{ - // ... -} - - -if err := client.AccountsUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/client.go deleted file mode 100644 index 1a10ce8e9b65..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/client.go +++ /dev/null @@ -1,18 +0,0 @@ -package netappaccounts - -import "github.com/Azure/go-autorest/autorest" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetAppAccountsClient struct { - Client autorest.Client - baseUri string -} - -func NewNetAppAccountsClientWithBaseURI(endpoint string) NetAppAccountsClient { - return NetAppAccountsClient{ - Client: autorest.NewClientWithUserAgent(userAgent()), - baseUri: endpoint, - } -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/constants.go deleted file mode 100644 index 6e41970873a4..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/constants.go +++ /dev/null @@ -1,43 +0,0 @@ -package netappaccounts - -import "strings" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ActiveDirectoryStatus string - -const ( - ActiveDirectoryStatusCreated ActiveDirectoryStatus = "Created" - ActiveDirectoryStatusDeleted ActiveDirectoryStatus = "Deleted" - ActiveDirectoryStatusError ActiveDirectoryStatus = "Error" - ActiveDirectoryStatusInUse ActiveDirectoryStatus = "InUse" - ActiveDirectoryStatusUpdating ActiveDirectoryStatus = "Updating" -) - -func PossibleValuesForActiveDirectoryStatus() []string { - return []string{ - string(ActiveDirectoryStatusCreated), - string(ActiveDirectoryStatusDeleted), - string(ActiveDirectoryStatusError), - string(ActiveDirectoryStatusInUse), - string(ActiveDirectoryStatusUpdating), - } -} - -func parseActiveDirectoryStatus(input string) (*ActiveDirectoryStatus, error) { - vals := map[string]ActiveDirectoryStatus{ - "created": ActiveDirectoryStatusCreated, - "deleted": ActiveDirectoryStatusDeleted, - "error": ActiveDirectoryStatusError, - "inuse": ActiveDirectoryStatusInUse, - "updating": ActiveDirectoryStatusUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ActiveDirectoryStatus(input) - return &out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/id_netappaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/id_netappaccount.go deleted file mode 100644 index 68e53f4815fc..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/id_netappaccount.go +++ /dev/null @@ -1,124 +0,0 @@ -package netappaccounts - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -var _ resourceids.ResourceId = NetAppAccountId{} - -// NetAppAccountId is a struct representing the Resource ID for a Net App Account -type NetAppAccountId struct { - SubscriptionId string - ResourceGroupName string - AccountName string -} - -// NewNetAppAccountID returns a new NetAppAccountId struct -func NewNetAppAccountID(subscriptionId string, resourceGroupName string, accountName string) NetAppAccountId { - return NetAppAccountId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - AccountName: accountName, - } -} - -// ParseNetAppAccountID parses 'input' into a NetAppAccountId -func ParseNetAppAccountID(input string) (*NetAppAccountId, error) { - parser := resourceids.NewParserFromResourceIdType(NetAppAccountId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := NetAppAccountId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ParseNetAppAccountIDInsensitively parses 'input' case-insensitively into a NetAppAccountId -// note: this method should only be used for API response data and not user input -func ParseNetAppAccountIDInsensitively(input string) (*NetAppAccountId, error) { - parser := resourceids.NewParserFromResourceIdType(NetAppAccountId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := NetAppAccountId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ValidateNetAppAccountID checks that 'input' can be parsed as a Net App Account ID -func ValidateNetAppAccountID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := ParseNetAppAccountID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Net App Account ID -func (id NetAppAccountId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Net App Account ID -func (id NetAppAccountId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), - resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("accountName", "accountValue"), - } -} - -// String returns a human-readable description of this Net App Account ID -func (id NetAppAccountId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Account Name: %q", id.AccountName), - } - return fmt.Sprintf("Net App Account (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountscreateorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountscreateorupdate_autorest.go deleted file mode 100644 index b192ede4f692..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountscreateorupdate_autorest.go +++ /dev/null @@ -1,79 +0,0 @@ -package netappaccounts - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AccountsCreateOrUpdateOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// AccountsCreateOrUpdate ... -func (c NetAppAccountsClient) AccountsCreateOrUpdate(ctx context.Context, id NetAppAccountId, input NetAppAccount) (result AccountsCreateOrUpdateOperationResponse, err error) { - req, err := c.preparerForAccountsCreateOrUpdate(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsCreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = c.senderForAccountsCreateOrUpdate(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsCreateOrUpdate", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// AccountsCreateOrUpdateThenPoll performs AccountsCreateOrUpdate then polls until it's completed -func (c NetAppAccountsClient) AccountsCreateOrUpdateThenPoll(ctx context.Context, id NetAppAccountId, input NetAppAccount) error { - result, err := c.AccountsCreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing AccountsCreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after AccountsCreateOrUpdate: %+v", err) - } - - return nil -} - -// preparerForAccountsCreateOrUpdate prepares the AccountsCreateOrUpdate request. -func (c NetAppAccountsClient) preparerForAccountsCreateOrUpdate(ctx context.Context, id NetAppAccountId, input NetAppAccount) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForAccountsCreateOrUpdate sends the AccountsCreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (c NetAppAccountsClient) senderForAccountsCreateOrUpdate(ctx context.Context, req *http.Request) (future AccountsCreateOrUpdateOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountsdelete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountsdelete_autorest.go deleted file mode 100644 index 4506db44c634..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountsdelete_autorest.go +++ /dev/null @@ -1,78 +0,0 @@ -package netappaccounts - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AccountsDeleteOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// AccountsDelete ... -func (c NetAppAccountsClient) AccountsDelete(ctx context.Context, id NetAppAccountId) (result AccountsDeleteOperationResponse, err error) { - req, err := c.preparerForAccountsDelete(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsDelete", nil, "Failure preparing request") - return - } - - result, err = c.senderForAccountsDelete(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsDelete", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// AccountsDeleteThenPoll performs AccountsDelete then polls until it's completed -func (c NetAppAccountsClient) AccountsDeleteThenPoll(ctx context.Context, id NetAppAccountId) error { - result, err := c.AccountsDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing AccountsDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after AccountsDelete: %+v", err) - } - - return nil -} - -// preparerForAccountsDelete prepares the AccountsDelete request. -func (c NetAppAccountsClient) preparerForAccountsDelete(ctx context.Context, id NetAppAccountId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsDelete(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForAccountsDelete sends the AccountsDelete request. The method will close the -// http.Response Body if it receives an error. -func (c NetAppAccountsClient) senderForAccountsDelete(ctx context.Context, req *http.Request) (future AccountsDeleteOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountsget_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountsget_autorest.go deleted file mode 100644 index 1c1edc04ccfb..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountsget_autorest.go +++ /dev/null @@ -1,67 +0,0 @@ -package netappaccounts - -import ( - "context" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AccountsGetOperationResponse struct { - HttpResponse *http.Response - Model *NetAppAccount -} - -// AccountsGet ... -func (c NetAppAccountsClient) AccountsGet(ctx context.Context, id NetAppAccountId) (result AccountsGetOperationResponse, err error) { - req, err := c.preparerForAccountsGet(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsGet", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsGet", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForAccountsGet(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsGet", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForAccountsGet prepares the AccountsGet request. -func (c NetAppAccountsClient) preparerForAccountsGet(ctx context.Context, id NetAppAccountId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForAccountsGet handles the response to the AccountsGet request. The method always -// closes the http.Response Body. -func (c NetAppAccountsClient) responderForAccountsGet(resp *http.Response) (result AccountsGetOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountslist_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountslist_autorest.go deleted file mode 100644 index dd93604fbcd5..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountslist_autorest.go +++ /dev/null @@ -1,187 +0,0 @@ -package netappaccounts - -import ( - "context" - "fmt" - "net/http" - "net/url" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AccountsListOperationResponse struct { - HttpResponse *http.Response - Model *[]NetAppAccount - - nextLink *string - nextPageFunc func(ctx context.Context, nextLink string) (AccountsListOperationResponse, error) -} - -type AccountsListCompleteResult struct { - Items []NetAppAccount -} - -func (r AccountsListOperationResponse) HasMore() bool { - return r.nextLink != nil -} - -func (r AccountsListOperationResponse) LoadMore(ctx context.Context) (resp AccountsListOperationResponse, err error) { - if !r.HasMore() { - err = fmt.Errorf("no more pages returned") - return - } - return r.nextPageFunc(ctx, *r.nextLink) -} - -// AccountsList ... -func (c NetAppAccountsClient) AccountsList(ctx context.Context, id commonids.ResourceGroupId) (resp AccountsListOperationResponse, err error) { - req, err := c.preparerForAccountsList(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsList", nil, "Failure preparing request") - return - } - - resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsList", resp.HttpResponse, "Failure sending request") - return - } - - resp, err = c.responderForAccountsList(resp.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsList", resp.HttpResponse, "Failure responding to request") - return - } - return -} - -// AccountsListComplete retrieves all of the results into a single object -func (c NetAppAccountsClient) AccountsListComplete(ctx context.Context, id commonids.ResourceGroupId) (AccountsListCompleteResult, error) { - return c.AccountsListCompleteMatchingPredicate(ctx, id, NetAppAccountOperationPredicate{}) -} - -// AccountsListCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c NetAppAccountsClient) AccountsListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate NetAppAccountOperationPredicate) (resp AccountsListCompleteResult, err error) { - items := make([]NetAppAccount, 0) - - page, err := c.AccountsList(ctx, id) - if err != nil { - err = fmt.Errorf("loading the initial page: %+v", err) - return - } - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - for page.HasMore() { - page, err = page.LoadMore(ctx) - if err != nil { - err = fmt.Errorf("loading the next page: %+v", err) - return - } - - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - } - - out := AccountsListCompleteResult{ - Items: items, - } - return out, nil -} - -// preparerForAccountsList prepares the AccountsList request. -func (c NetAppAccountsClient) preparerForAccountsList(ctx context.Context, id commonids.ResourceGroupId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/providers/Microsoft.NetApp/netAppAccounts", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// preparerForAccountsListWithNextLink prepares the AccountsList request with the given nextLink token. -func (c NetAppAccountsClient) preparerForAccountsListWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { - uri, err := url.Parse(nextLink) - if err != nil { - return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) - } - queryParameters := map[string]interface{}{} - for k, v := range uri.Query() { - if len(v) == 0 { - continue - } - val := v[0] - val = autorest.Encode("query", val) - queryParameters[k] = val - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(uri.Path), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForAccountsList handles the response to the AccountsList request. The method always -// closes the http.Response Body. -func (c NetAppAccountsClient) responderForAccountsList(resp *http.Response) (result AccountsListOperationResponse, err error) { - type page struct { - Values []NetAppAccount `json:"value"` - NextLink *string `json:"nextLink"` - } - var respObj page - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&respObj), - autorest.ByClosing()) - result.HttpResponse = resp - result.Model = &respObj.Values - result.nextLink = respObj.NextLink - if respObj.NextLink != nil { - result.nextPageFunc = func(ctx context.Context, nextLink string) (result AccountsListOperationResponse, err error) { - req, err := c.preparerForAccountsListWithNextLink(ctx, nextLink) - if err != nil { - err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsList", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsList", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForAccountsList(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsList", result.HttpResponse, "Failure responding to request") - return - } - - return - } - } - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountslistbysubscription_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountslistbysubscription_autorest.go deleted file mode 100644 index bd65578f1751..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountslistbysubscription_autorest.go +++ /dev/null @@ -1,187 +0,0 @@ -package netappaccounts - -import ( - "context" - "fmt" - "net/http" - "net/url" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AccountsListBySubscriptionOperationResponse struct { - HttpResponse *http.Response - Model *[]NetAppAccount - - nextLink *string - nextPageFunc func(ctx context.Context, nextLink string) (AccountsListBySubscriptionOperationResponse, error) -} - -type AccountsListBySubscriptionCompleteResult struct { - Items []NetAppAccount -} - -func (r AccountsListBySubscriptionOperationResponse) HasMore() bool { - return r.nextLink != nil -} - -func (r AccountsListBySubscriptionOperationResponse) LoadMore(ctx context.Context) (resp AccountsListBySubscriptionOperationResponse, err error) { - if !r.HasMore() { - err = fmt.Errorf("no more pages returned") - return - } - return r.nextPageFunc(ctx, *r.nextLink) -} - -// AccountsListBySubscription ... -func (c NetAppAccountsClient) AccountsListBySubscription(ctx context.Context, id commonids.SubscriptionId) (resp AccountsListBySubscriptionOperationResponse, err error) { - req, err := c.preparerForAccountsListBySubscription(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsListBySubscription", nil, "Failure preparing request") - return - } - - resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsListBySubscription", resp.HttpResponse, "Failure sending request") - return - } - - resp, err = c.responderForAccountsListBySubscription(resp.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsListBySubscription", resp.HttpResponse, "Failure responding to request") - return - } - return -} - -// AccountsListBySubscriptionComplete retrieves all of the results into a single object -func (c NetAppAccountsClient) AccountsListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId) (AccountsListBySubscriptionCompleteResult, error) { - return c.AccountsListBySubscriptionCompleteMatchingPredicate(ctx, id, NetAppAccountOperationPredicate{}) -} - -// AccountsListBySubscriptionCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c NetAppAccountsClient) AccountsListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate NetAppAccountOperationPredicate) (resp AccountsListBySubscriptionCompleteResult, err error) { - items := make([]NetAppAccount, 0) - - page, err := c.AccountsListBySubscription(ctx, id) - if err != nil { - err = fmt.Errorf("loading the initial page: %+v", err) - return - } - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - for page.HasMore() { - page, err = page.LoadMore(ctx) - if err != nil { - err = fmt.Errorf("loading the next page: %+v", err) - return - } - - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - } - - out := AccountsListBySubscriptionCompleteResult{ - Items: items, - } - return out, nil -} - -// preparerForAccountsListBySubscription prepares the AccountsListBySubscription request. -func (c NetAppAccountsClient) preparerForAccountsListBySubscription(ctx context.Context, id commonids.SubscriptionId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/providers/Microsoft.NetApp/netAppAccounts", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// preparerForAccountsListBySubscriptionWithNextLink prepares the AccountsListBySubscription request with the given nextLink token. -func (c NetAppAccountsClient) preparerForAccountsListBySubscriptionWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { - uri, err := url.Parse(nextLink) - if err != nil { - return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) - } - queryParameters := map[string]interface{}{} - for k, v := range uri.Query() { - if len(v) == 0 { - continue - } - val := v[0] - val = autorest.Encode("query", val) - queryParameters[k] = val - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(uri.Path), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForAccountsListBySubscription handles the response to the AccountsListBySubscription request. The method always -// closes the http.Response Body. -func (c NetAppAccountsClient) responderForAccountsListBySubscription(resp *http.Response) (result AccountsListBySubscriptionOperationResponse, err error) { - type page struct { - Values []NetAppAccount `json:"value"` - NextLink *string `json:"nextLink"` - } - var respObj page - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&respObj), - autorest.ByClosing()) - result.HttpResponse = resp - result.Model = &respObj.Values - result.nextLink = respObj.NextLink - if respObj.NextLink != nil { - result.nextPageFunc = func(ctx context.Context, nextLink string) (result AccountsListBySubscriptionOperationResponse, err error) { - req, err := c.preparerForAccountsListBySubscriptionWithNextLink(ctx, nextLink) - if err != nil { - err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsListBySubscription", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsListBySubscription", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForAccountsListBySubscription(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsListBySubscription", result.HttpResponse, "Failure responding to request") - return - } - - return - } - } - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountsupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountsupdate_autorest.go deleted file mode 100644 index 8ed5cd37c4ce..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountsupdate_autorest.go +++ /dev/null @@ -1,79 +0,0 @@ -package netappaccounts - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AccountsUpdateOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// AccountsUpdate ... -func (c NetAppAccountsClient) AccountsUpdate(ctx context.Context, id NetAppAccountId, input NetAppAccountPatch) (result AccountsUpdateOperationResponse, err error) { - req, err := c.preparerForAccountsUpdate(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsUpdate", nil, "Failure preparing request") - return - } - - result, err = c.senderForAccountsUpdate(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsUpdate", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// AccountsUpdateThenPoll performs AccountsUpdate then polls until it's completed -func (c NetAppAccountsClient) AccountsUpdateThenPoll(ctx context.Context, id NetAppAccountId, input NetAppAccountPatch) error { - result, err := c.AccountsUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing AccountsUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after AccountsUpdate: %+v", err) - } - - return nil -} - -// preparerForAccountsUpdate prepares the AccountsUpdate request. -func (c NetAppAccountsClient) preparerForAccountsUpdate(ctx context.Context, id NetAppAccountId, input NetAppAccountPatch) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForAccountsUpdate sends the AccountsUpdate request. The method will close the -// http.Response Body if it receives an error. -func (c NetAppAccountsClient) senderForAccountsUpdate(ctx context.Context, req *http.Request) (future AccountsUpdateOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_accountencryption.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_accountencryption.go deleted file mode 100644 index 39a9282ce500..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_accountencryption.go +++ /dev/null @@ -1,8 +0,0 @@ -package netappaccounts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AccountEncryption struct { - KeySource *string `json:"keySource,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_accountproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_accountproperties.go deleted file mode 100644 index b158b47fc946..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_accountproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package netappaccounts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AccountProperties struct { - ActiveDirectories *[]ActiveDirectory `json:"activeDirectories,omitempty"` - Encryption *AccountEncryption `json:"encryption,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_activedirectory.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_activedirectory.go deleted file mode 100644 index da90d13da0a4..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_activedirectory.go +++ /dev/null @@ -1,29 +0,0 @@ -package netappaccounts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ActiveDirectory struct { - ActiveDirectoryId *string `json:"activeDirectoryId,omitempty"` - AdName *string `json:"adName,omitempty"` - Administrators *[]string `json:"administrators,omitempty"` - AesEncryption *bool `json:"aesEncryption,omitempty"` - AllowLocalNfsUsersWithLdap *bool `json:"allowLocalNfsUsersWithLdap,omitempty"` - BackupOperators *[]string `json:"backupOperators,omitempty"` - Dns *string `json:"dns,omitempty"` - Domain *string `json:"domain,omitempty"` - EncryptDCConnections *bool `json:"encryptDCConnections,omitempty"` - KdcIP *string `json:"kdcIP,omitempty"` - LdapOverTLS *bool `json:"ldapOverTLS,omitempty"` - LdapSearchScope *LdapSearchScopeOpt `json:"ldapSearchScope,omitempty"` - LdapSigning *bool `json:"ldapSigning,omitempty"` - OrganizationalUnit *string `json:"organizationalUnit,omitempty"` - Password *string `json:"password,omitempty"` - SecurityOperators *[]string `json:"securityOperators,omitempty"` - ServerRootCACertificate *string `json:"serverRootCACertificate,omitempty"` - Site *string `json:"site,omitempty"` - SmbServerName *string `json:"smbServerName,omitempty"` - Status *ActiveDirectoryStatus `json:"status,omitempty"` - StatusDetails *string `json:"statusDetails,omitempty"` - Username *string `json:"username,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_ldapsearchscopeopt.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_ldapsearchscopeopt.go deleted file mode 100644 index c476b0f0875f..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_ldapsearchscopeopt.go +++ /dev/null @@ -1,10 +0,0 @@ -package netappaccounts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LdapSearchScopeOpt struct { - GroupDN *string `json:"groupDN,omitempty"` - GroupMembershipFilter *string `json:"groupMembershipFilter,omitempty"` - UserDN *string `json:"userDN,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_netappaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_netappaccount.go deleted file mode 100644 index ec2ed4aa10c5..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_netappaccount.go +++ /dev/null @@ -1,19 +0,0 @@ -package netappaccounts - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetAppAccount struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Properties *AccountProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_netappaccountpatch.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_netappaccountpatch.go deleted file mode 100644 index d3c6c1efcc20..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_netappaccountpatch.go +++ /dev/null @@ -1,13 +0,0 @@ -package netappaccounts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetAppAccountPatch struct { - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *AccountProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/predicates.go deleted file mode 100644 index cc139fd85c4a..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/predicates.go +++ /dev/null @@ -1,34 +0,0 @@ -package netappaccounts - -type NetAppAccountOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p NetAppAccountOperationPredicate) Matches(input NetAppAccount) bool { - - if p.Etag != nil && (input.Etag == nil && *p.Etag != *input.Etag) { - return false - } - - if p.Id != nil && (input.Id == nil && *p.Id != *input.Id) { - return false - } - - if p.Location != nil && *p.Location != input.Location { - return false - } - - if p.Name != nil && (input.Name == nil && *p.Name != *input.Name) { - return false - } - - if p.Type != nil && (input.Type == nil && *p.Type != *input.Type) { - return false - } - - return true -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/version.go deleted file mode 100644 index 3de2667a1a82..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package netappaccounts - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-10-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/netappaccounts/%s", defaultApiVersion) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/README.md deleted file mode 100644 index 802de9b9653a..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/README.md +++ /dev/null @@ -1,102 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy` Documentation - -The `snapshotpolicy` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2021-10-01`). - -This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). - -### Import Path - -```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy" -``` - - -### Client Initialization - -```go -client := snapshotpolicy.NewSnapshotPolicyClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `SnapshotPolicyClient.SnapshotPoliciesCreate` - -```go -ctx := context.TODO() -id := snapshotpolicy.NewSnapshotPoliciesID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "snapshotPolicyValue") - -payload := snapshotpolicy.SnapshotPolicy{ - // ... -} - - -read, err := client.SnapshotPoliciesCreate(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `SnapshotPolicyClient.SnapshotPoliciesDelete` - -```go -ctx := context.TODO() -id := snapshotpolicy.NewSnapshotPoliciesID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "snapshotPolicyValue") - -if err := client.SnapshotPoliciesDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `SnapshotPolicyClient.SnapshotPoliciesGet` - -```go -ctx := context.TODO() -id := snapshotpolicy.NewSnapshotPoliciesID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "snapshotPolicyValue") - -read, err := client.SnapshotPoliciesGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `SnapshotPolicyClient.SnapshotPoliciesList` - -```go -ctx := context.TODO() -id := snapshotpolicy.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") - -read, err := client.SnapshotPoliciesList(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `SnapshotPolicyClient.SnapshotPoliciesUpdate` - -```go -ctx := context.TODO() -id := snapshotpolicy.NewSnapshotPoliciesID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "snapshotPolicyValue") - -payload := snapshotpolicy.SnapshotPolicyPatch{ - // ... -} - - -if err := client.SnapshotPoliciesUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/client.go deleted file mode 100644 index 63c20fd6ea4d..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/client.go +++ /dev/null @@ -1,18 +0,0 @@ -package snapshotpolicy - -import "github.com/Azure/go-autorest/autorest" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SnapshotPolicyClient struct { - Client autorest.Client - baseUri string -} - -func NewSnapshotPolicyClientWithBaseURI(endpoint string) SnapshotPolicyClient { - return SnapshotPolicyClient{ - Client: autorest.NewClientWithUserAgent(userAgent()), - baseUri: endpoint, - } -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/id_netappaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/id_netappaccount.go deleted file mode 100644 index 726c28f92e9c..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/id_netappaccount.go +++ /dev/null @@ -1,124 +0,0 @@ -package snapshotpolicy - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -var _ resourceids.ResourceId = NetAppAccountId{} - -// NetAppAccountId is a struct representing the Resource ID for a Net App Account -type NetAppAccountId struct { - SubscriptionId string - ResourceGroupName string - AccountName string -} - -// NewNetAppAccountID returns a new NetAppAccountId struct -func NewNetAppAccountID(subscriptionId string, resourceGroupName string, accountName string) NetAppAccountId { - return NetAppAccountId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - AccountName: accountName, - } -} - -// ParseNetAppAccountID parses 'input' into a NetAppAccountId -func ParseNetAppAccountID(input string) (*NetAppAccountId, error) { - parser := resourceids.NewParserFromResourceIdType(NetAppAccountId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := NetAppAccountId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ParseNetAppAccountIDInsensitively parses 'input' case-insensitively into a NetAppAccountId -// note: this method should only be used for API response data and not user input -func ParseNetAppAccountIDInsensitively(input string) (*NetAppAccountId, error) { - parser := resourceids.NewParserFromResourceIdType(NetAppAccountId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := NetAppAccountId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ValidateNetAppAccountID checks that 'input' can be parsed as a Net App Account ID -func ValidateNetAppAccountID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := ParseNetAppAccountID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Net App Account ID -func (id NetAppAccountId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Net App Account ID -func (id NetAppAccountId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), - resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("accountName", "accountValue"), - } -} - -// String returns a human-readable description of this Net App Account ID -func (id NetAppAccountId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Account Name: %q", id.AccountName), - } - return fmt.Sprintf("Net App Account (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/id_snapshotpolicies.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/id_snapshotpolicies.go deleted file mode 100644 index f0662d3bf339..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/id_snapshotpolicies.go +++ /dev/null @@ -1,137 +0,0 @@ -package snapshotpolicy - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -var _ resourceids.ResourceId = SnapshotPoliciesId{} - -// SnapshotPoliciesId is a struct representing the Resource ID for a Snapshot Policies -type SnapshotPoliciesId struct { - SubscriptionId string - ResourceGroupName string - AccountName string - SnapshotPolicyName string -} - -// NewSnapshotPoliciesID returns a new SnapshotPoliciesId struct -func NewSnapshotPoliciesID(subscriptionId string, resourceGroupName string, accountName string, snapshotPolicyName string) SnapshotPoliciesId { - return SnapshotPoliciesId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - AccountName: accountName, - SnapshotPolicyName: snapshotPolicyName, - } -} - -// ParseSnapshotPoliciesID parses 'input' into a SnapshotPoliciesId -func ParseSnapshotPoliciesID(input string) (*SnapshotPoliciesId, error) { - parser := resourceids.NewParserFromResourceIdType(SnapshotPoliciesId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := SnapshotPoliciesId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - if id.SnapshotPolicyName, ok = parsed.Parsed["snapshotPolicyName"]; !ok { - return nil, fmt.Errorf("the segment 'snapshotPolicyName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ParseSnapshotPoliciesIDInsensitively parses 'input' case-insensitively into a SnapshotPoliciesId -// note: this method should only be used for API response data and not user input -func ParseSnapshotPoliciesIDInsensitively(input string) (*SnapshotPoliciesId, error) { - parser := resourceids.NewParserFromResourceIdType(SnapshotPoliciesId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := SnapshotPoliciesId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - if id.SnapshotPolicyName, ok = parsed.Parsed["snapshotPolicyName"]; !ok { - return nil, fmt.Errorf("the segment 'snapshotPolicyName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ValidateSnapshotPoliciesID checks that 'input' can be parsed as a Snapshot Policies ID -func ValidateSnapshotPoliciesID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := ParseSnapshotPoliciesID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Snapshot Policies ID -func (id SnapshotPoliciesId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/snapshotPolicies/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName, id.SnapshotPolicyName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Snapshot Policies ID -func (id SnapshotPoliciesId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), - resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("accountName", "accountValue"), - resourceids.StaticSegment("staticSnapshotPolicies", "snapshotPolicies", "snapshotPolicies"), - resourceids.UserSpecifiedSegment("snapshotPolicyName", "snapshotPolicyValue"), - } -} - -// String returns a human-readable description of this Snapshot Policies ID -func (id SnapshotPoliciesId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Account Name: %q", id.AccountName), - fmt.Sprintf("Snapshot Policy Name: %q", id.SnapshotPolicyName), - } - return fmt.Sprintf("Snapshot Policies (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpoliciescreate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpoliciescreate_autorest.go deleted file mode 100644 index 43d25be8b167..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpoliciescreate_autorest.go +++ /dev/null @@ -1,68 +0,0 @@ -package snapshotpolicy - -import ( - "context" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SnapshotPoliciesCreateOperationResponse struct { - HttpResponse *http.Response - Model *SnapshotPolicy -} - -// SnapshotPoliciesCreate ... -func (c SnapshotPolicyClient) SnapshotPoliciesCreate(ctx context.Context, id SnapshotPoliciesId, input SnapshotPolicy) (result SnapshotPoliciesCreateOperationResponse, err error) { - req, err := c.preparerForSnapshotPoliciesCreate(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesCreate", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesCreate", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForSnapshotPoliciesCreate(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesCreate", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForSnapshotPoliciesCreate prepares the SnapshotPoliciesCreate request. -func (c SnapshotPolicyClient) preparerForSnapshotPoliciesCreate(ctx context.Context, id SnapshotPoliciesId, input SnapshotPolicy) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForSnapshotPoliciesCreate handles the response to the SnapshotPoliciesCreate request. The method always -// closes the http.Response Body. -func (c SnapshotPolicyClient) responderForSnapshotPoliciesCreate(resp *http.Response) (result SnapshotPoliciesCreateOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpoliciesdelete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpoliciesdelete_autorest.go deleted file mode 100644 index 0b2ba8905215..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpoliciesdelete_autorest.go +++ /dev/null @@ -1,78 +0,0 @@ -package snapshotpolicy - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SnapshotPoliciesDeleteOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// SnapshotPoliciesDelete ... -func (c SnapshotPolicyClient) SnapshotPoliciesDelete(ctx context.Context, id SnapshotPoliciesId) (result SnapshotPoliciesDeleteOperationResponse, err error) { - req, err := c.preparerForSnapshotPoliciesDelete(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesDelete", nil, "Failure preparing request") - return - } - - result, err = c.senderForSnapshotPoliciesDelete(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesDelete", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// SnapshotPoliciesDeleteThenPoll performs SnapshotPoliciesDelete then polls until it's completed -func (c SnapshotPolicyClient) SnapshotPoliciesDeleteThenPoll(ctx context.Context, id SnapshotPoliciesId) error { - result, err := c.SnapshotPoliciesDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing SnapshotPoliciesDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after SnapshotPoliciesDelete: %+v", err) - } - - return nil -} - -// preparerForSnapshotPoliciesDelete prepares the SnapshotPoliciesDelete request. -func (c SnapshotPolicyClient) preparerForSnapshotPoliciesDelete(ctx context.Context, id SnapshotPoliciesId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsDelete(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForSnapshotPoliciesDelete sends the SnapshotPoliciesDelete request. The method will close the -// http.Response Body if it receives an error. -func (c SnapshotPolicyClient) senderForSnapshotPoliciesDelete(ctx context.Context, req *http.Request) (future SnapshotPoliciesDeleteOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpoliciesget_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpoliciesget_autorest.go deleted file mode 100644 index 26d3741d8b6c..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpoliciesget_autorest.go +++ /dev/null @@ -1,67 +0,0 @@ -package snapshotpolicy - -import ( - "context" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SnapshotPoliciesGetOperationResponse struct { - HttpResponse *http.Response - Model *SnapshotPolicy -} - -// SnapshotPoliciesGet ... -func (c SnapshotPolicyClient) SnapshotPoliciesGet(ctx context.Context, id SnapshotPoliciesId) (result SnapshotPoliciesGetOperationResponse, err error) { - req, err := c.preparerForSnapshotPoliciesGet(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesGet", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesGet", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForSnapshotPoliciesGet(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesGet", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForSnapshotPoliciesGet prepares the SnapshotPoliciesGet request. -func (c SnapshotPolicyClient) preparerForSnapshotPoliciesGet(ctx context.Context, id SnapshotPoliciesId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForSnapshotPoliciesGet handles the response to the SnapshotPoliciesGet request. The method always -// closes the http.Response Body. -func (c SnapshotPolicyClient) responderForSnapshotPoliciesGet(resp *http.Response) (result SnapshotPoliciesGetOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpolicieslist_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpolicieslist_autorest.go deleted file mode 100644 index b9f36c35c96f..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpolicieslist_autorest.go +++ /dev/null @@ -1,68 +0,0 @@ -package snapshotpolicy - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SnapshotPoliciesListOperationResponse struct { - HttpResponse *http.Response - Model *SnapshotPoliciesList -} - -// SnapshotPoliciesList ... -func (c SnapshotPolicyClient) SnapshotPoliciesList(ctx context.Context, id NetAppAccountId) (result SnapshotPoliciesListOperationResponse, err error) { - req, err := c.preparerForSnapshotPoliciesList(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesList", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesList", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForSnapshotPoliciesList(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesList", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForSnapshotPoliciesList prepares the SnapshotPoliciesList request. -func (c SnapshotPolicyClient) preparerForSnapshotPoliciesList(ctx context.Context, id NetAppAccountId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/snapshotPolicies", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForSnapshotPoliciesList handles the response to the SnapshotPoliciesList request. The method always -// closes the http.Response Body. -func (c SnapshotPolicyClient) responderForSnapshotPoliciesList(resp *http.Response) (result SnapshotPoliciesListOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpoliciesupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpoliciesupdate_autorest.go deleted file mode 100644 index eea75a1378c0..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpoliciesupdate_autorest.go +++ /dev/null @@ -1,79 +0,0 @@ -package snapshotpolicy - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SnapshotPoliciesUpdateOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// SnapshotPoliciesUpdate ... -func (c SnapshotPolicyClient) SnapshotPoliciesUpdate(ctx context.Context, id SnapshotPoliciesId, input SnapshotPolicyPatch) (result SnapshotPoliciesUpdateOperationResponse, err error) { - req, err := c.preparerForSnapshotPoliciesUpdate(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesUpdate", nil, "Failure preparing request") - return - } - - result, err = c.senderForSnapshotPoliciesUpdate(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesUpdate", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// SnapshotPoliciesUpdateThenPoll performs SnapshotPoliciesUpdate then polls until it's completed -func (c SnapshotPolicyClient) SnapshotPoliciesUpdateThenPoll(ctx context.Context, id SnapshotPoliciesId, input SnapshotPolicyPatch) error { - result, err := c.SnapshotPoliciesUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing SnapshotPoliciesUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after SnapshotPoliciesUpdate: %+v", err) - } - - return nil -} - -// preparerForSnapshotPoliciesUpdate prepares the SnapshotPoliciesUpdate request. -func (c SnapshotPolicyClient) preparerForSnapshotPoliciesUpdate(ctx context.Context, id SnapshotPoliciesId, input SnapshotPolicyPatch) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForSnapshotPoliciesUpdate sends the SnapshotPoliciesUpdate request. The method will close the -// http.Response Body if it receives an error. -func (c SnapshotPolicyClient) senderForSnapshotPoliciesUpdate(ctx context.Context, req *http.Request) (future SnapshotPoliciesUpdateOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_dailyschedule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_dailyschedule.go deleted file mode 100644 index bdafb72e6e09..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_dailyschedule.go +++ /dev/null @@ -1,11 +0,0 @@ -package snapshotpolicy - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DailySchedule struct { - Hour *int64 `json:"hour,omitempty"` - Minute *int64 `json:"minute,omitempty"` - SnapshotsToKeep *int64 `json:"snapshotsToKeep,omitempty"` - UsedBytes *int64 `json:"usedBytes,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_hourlyschedule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_hourlyschedule.go deleted file mode 100644 index a1e5d0fa0283..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_hourlyschedule.go +++ /dev/null @@ -1,10 +0,0 @@ -package snapshotpolicy - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HourlySchedule struct { - Minute *int64 `json:"minute,omitempty"` - SnapshotsToKeep *int64 `json:"snapshotsToKeep,omitempty"` - UsedBytes *int64 `json:"usedBytes,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_monthlyschedule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_monthlyschedule.go deleted file mode 100644 index 02cbcad6a592..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_monthlyschedule.go +++ /dev/null @@ -1,12 +0,0 @@ -package snapshotpolicy - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MonthlySchedule struct { - DaysOfMonth *string `json:"daysOfMonth,omitempty"` - Hour *int64 `json:"hour,omitempty"` - Minute *int64 `json:"minute,omitempty"` - SnapshotsToKeep *int64 `json:"snapshotsToKeep,omitempty"` - UsedBytes *int64 `json:"usedBytes,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_snapshotpolicieslist.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_snapshotpolicieslist.go deleted file mode 100644 index 910e2519adbe..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_snapshotpolicieslist.go +++ /dev/null @@ -1,8 +0,0 @@ -package snapshotpolicy - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SnapshotPoliciesList struct { - Value *[]SnapshotPolicy `json:"value,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_snapshotpolicy.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_snapshotpolicy.go deleted file mode 100644 index 310cfaaf1bb9..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_snapshotpolicy.go +++ /dev/null @@ -1,19 +0,0 @@ -package snapshotpolicy - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SnapshotPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Properties SnapshotPolicyProperties `json:"properties"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_snapshotpolicypatch.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_snapshotpolicypatch.go deleted file mode 100644 index 76df9be172b9..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_snapshotpolicypatch.go +++ /dev/null @@ -1,13 +0,0 @@ -package snapshotpolicy - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SnapshotPolicyPatch struct { - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SnapshotPolicyProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_snapshotpolicyproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_snapshotpolicyproperties.go deleted file mode 100644 index fb4fb0fcb05a..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_snapshotpolicyproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package snapshotpolicy - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SnapshotPolicyProperties struct { - DailySchedule *DailySchedule `json:"dailySchedule,omitempty"` - Enabled *bool `json:"enabled,omitempty"` - HourlySchedule *HourlySchedule `json:"hourlySchedule,omitempty"` - MonthlySchedule *MonthlySchedule `json:"monthlySchedule,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` - WeeklySchedule *WeeklySchedule `json:"weeklySchedule,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_weeklyschedule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_weeklyschedule.go deleted file mode 100644 index 128ece7ef5ef..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_weeklyschedule.go +++ /dev/null @@ -1,12 +0,0 @@ -package snapshotpolicy - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type WeeklySchedule struct { - Day *string `json:"day,omitempty"` - Hour *int64 `json:"hour,omitempty"` - Minute *int64 `json:"minute,omitempty"` - SnapshotsToKeep *int64 `json:"snapshotsToKeep,omitempty"` - UsedBytes *int64 `json:"usedBytes,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/version.go deleted file mode 100644 index 00061163a3a7..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package snapshotpolicy - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-10-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/snapshotpolicy/%s", defaultApiVersion) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/README.md deleted file mode 100644 index e6d357e24b68..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/README.md +++ /dev/null @@ -1,111 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots` Documentation - -The `snapshots` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2021-10-01`). - -This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). - -### Import Path - -```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots" -``` - - -### Client Initialization - -```go -client := snapshots.NewSnapshotsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `SnapshotsClient.Create` - -```go -ctx := context.TODO() -id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue", "snapshotValue") - -payload := snapshots.Snapshot{ - // ... -} - - -if err := client.CreateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `SnapshotsClient.Delete` - -```go -ctx := context.TODO() -id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue", "snapshotValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `SnapshotsClient.Get` - -```go -ctx := context.TODO() -id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue", "snapshotValue") - -read, err := client.Get(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `SnapshotsClient.List` - -```go -ctx := context.TODO() -id := snapshots.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue") - -read, err := client.List(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `SnapshotsClient.RestoreFiles` - -```go -ctx := context.TODO() -id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue", "snapshotValue") - -payload := snapshots.SnapshotRestoreFiles{ - // ... -} - - -if err := client.RestoreFilesThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `SnapshotsClient.Update` - -```go -ctx := context.TODO() -id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue", "snapshotValue") -var payload interface{} - -if err := client.UpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/client.go deleted file mode 100644 index 62d2a1323835..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/client.go +++ /dev/null @@ -1,18 +0,0 @@ -package snapshots - -import "github.com/Azure/go-autorest/autorest" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SnapshotsClient struct { - Client autorest.Client - baseUri string -} - -func NewSnapshotsClientWithBaseURI(endpoint string) SnapshotsClient { - return SnapshotsClient{ - Client: autorest.NewClientWithUserAgent(userAgent()), - baseUri: endpoint, - } -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/id_snapshot.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/id_snapshot.go deleted file mode 100644 index d38fb8cb8f01..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/id_snapshot.go +++ /dev/null @@ -1,163 +0,0 @@ -package snapshots - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -var _ resourceids.ResourceId = SnapshotId{} - -// SnapshotId is a struct representing the Resource ID for a Snapshot -type SnapshotId struct { - SubscriptionId string - ResourceGroupName string - AccountName string - PoolName string - VolumeName string - SnapshotName string -} - -// NewSnapshotID returns a new SnapshotId struct -func NewSnapshotID(subscriptionId string, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) SnapshotId { - return SnapshotId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - AccountName: accountName, - PoolName: poolName, - VolumeName: volumeName, - SnapshotName: snapshotName, - } -} - -// ParseSnapshotID parses 'input' into a SnapshotId -func ParseSnapshotID(input string) (*SnapshotId, error) { - parser := resourceids.NewParserFromResourceIdType(SnapshotId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := SnapshotId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { - return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) - } - - if id.VolumeName, ok = parsed.Parsed["volumeName"]; !ok { - return nil, fmt.Errorf("the segment 'volumeName' was not found in the resource id %q", input) - } - - if id.SnapshotName, ok = parsed.Parsed["snapshotName"]; !ok { - return nil, fmt.Errorf("the segment 'snapshotName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ParseSnapshotIDInsensitively parses 'input' case-insensitively into a SnapshotId -// note: this method should only be used for API response data and not user input -func ParseSnapshotIDInsensitively(input string) (*SnapshotId, error) { - parser := resourceids.NewParserFromResourceIdType(SnapshotId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := SnapshotId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { - return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) - } - - if id.VolumeName, ok = parsed.Parsed["volumeName"]; !ok { - return nil, fmt.Errorf("the segment 'volumeName' was not found in the resource id %q", input) - } - - if id.SnapshotName, ok = parsed.Parsed["snapshotName"]; !ok { - return nil, fmt.Errorf("the segment 'snapshotName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ValidateSnapshotID checks that 'input' can be parsed as a Snapshot ID -func ValidateSnapshotID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := ParseSnapshotID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Snapshot ID -func (id SnapshotId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/capacityPools/%s/volumes/%s/snapshots/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName, id.PoolName, id.VolumeName, id.SnapshotName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Snapshot ID -func (id SnapshotId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), - resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("accountName", "accountValue"), - resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("poolName", "poolValue"), - resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), - resourceids.UserSpecifiedSegment("volumeName", "volumeValue"), - resourceids.StaticSegment("staticSnapshots", "snapshots", "snapshots"), - resourceids.UserSpecifiedSegment("snapshotName", "snapshotValue"), - } -} - -// String returns a human-readable description of this Snapshot ID -func (id SnapshotId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Account Name: %q", id.AccountName), - fmt.Sprintf("Pool Name: %q", id.PoolName), - fmt.Sprintf("Volume Name: %q", id.VolumeName), - fmt.Sprintf("Snapshot Name: %q", id.SnapshotName), - } - return fmt.Sprintf("Snapshot (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/id_volume.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/id_volume.go deleted file mode 100644 index c5cc73e141c7..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/id_volume.go +++ /dev/null @@ -1,150 +0,0 @@ -package snapshots - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -var _ resourceids.ResourceId = VolumeId{} - -// VolumeId is a struct representing the Resource ID for a Volume -type VolumeId struct { - SubscriptionId string - ResourceGroupName string - AccountName string - PoolName string - VolumeName string -} - -// NewVolumeID returns a new VolumeId struct -func NewVolumeID(subscriptionId string, resourceGroupName string, accountName string, poolName string, volumeName string) VolumeId { - return VolumeId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - AccountName: accountName, - PoolName: poolName, - VolumeName: volumeName, - } -} - -// ParseVolumeID parses 'input' into a VolumeId -func ParseVolumeID(input string) (*VolumeId, error) { - parser := resourceids.NewParserFromResourceIdType(VolumeId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := VolumeId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { - return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) - } - - if id.VolumeName, ok = parsed.Parsed["volumeName"]; !ok { - return nil, fmt.Errorf("the segment 'volumeName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ParseVolumeIDInsensitively parses 'input' case-insensitively into a VolumeId -// note: this method should only be used for API response data and not user input -func ParseVolumeIDInsensitively(input string) (*VolumeId, error) { - parser := resourceids.NewParserFromResourceIdType(VolumeId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := VolumeId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { - return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) - } - - if id.VolumeName, ok = parsed.Parsed["volumeName"]; !ok { - return nil, fmt.Errorf("the segment 'volumeName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ValidateVolumeID checks that 'input' can be parsed as a Volume ID -func ValidateVolumeID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := ParseVolumeID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Volume ID -func (id VolumeId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/capacityPools/%s/volumes/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName, id.PoolName, id.VolumeName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Volume ID -func (id VolumeId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), - resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("accountName", "accountValue"), - resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("poolName", "poolValue"), - resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), - resourceids.UserSpecifiedSegment("volumeName", "volumeValue"), - } -} - -// String returns a human-readable description of this Volume ID -func (id VolumeId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Account Name: %q", id.AccountName), - fmt.Sprintf("Pool Name: %q", id.PoolName), - fmt.Sprintf("Volume Name: %q", id.VolumeName), - } - return fmt.Sprintf("Volume (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_create_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_create_autorest.go deleted file mode 100644 index 90b33471adef..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_create_autorest.go +++ /dev/null @@ -1,79 +0,0 @@ -package snapshots - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CreateOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// Create ... -func (c SnapshotsClient) Create(ctx context.Context, id SnapshotId, input Snapshot) (result CreateOperationResponse, err error) { - req, err := c.preparerForCreate(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "Create", nil, "Failure preparing request") - return - } - - result, err = c.senderForCreate(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "Create", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// CreateThenPoll performs Create then polls until it's completed -func (c SnapshotsClient) CreateThenPoll(ctx context.Context, id SnapshotId, input Snapshot) error { - result, err := c.Create(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Create: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after Create: %+v", err) - } - - return nil -} - -// preparerForCreate prepares the Create request. -func (c SnapshotsClient) preparerForCreate(ctx context.Context, id SnapshotId, input Snapshot) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForCreate sends the Create request. The method will close the -// http.Response Body if it receives an error. -func (c SnapshotsClient) senderForCreate(ctx context.Context, req *http.Request) (future CreateOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_delete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_delete_autorest.go deleted file mode 100644 index 55f7d9d07967..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_delete_autorest.go +++ /dev/null @@ -1,78 +0,0 @@ -package snapshots - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DeleteOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// Delete ... -func (c SnapshotsClient) Delete(ctx context.Context, id SnapshotId) (result DeleteOperationResponse, err error) { - req, err := c.preparerForDelete(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = c.senderForDelete(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "Delete", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// DeleteThenPoll performs Delete then polls until it's completed -func (c SnapshotsClient) DeleteThenPoll(ctx context.Context, id SnapshotId) error { - result, err := c.Delete(ctx, id) - if err != nil { - return fmt.Errorf("performing Delete: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after Delete: %+v", err) - } - - return nil -} - -// preparerForDelete prepares the Delete request. -func (c SnapshotsClient) preparerForDelete(ctx context.Context, id SnapshotId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsDelete(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForDelete sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (c SnapshotsClient) senderForDelete(ctx context.Context, req *http.Request) (future DeleteOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_get_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_get_autorest.go deleted file mode 100644 index 4764bf6f0606..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_get_autorest.go +++ /dev/null @@ -1,67 +0,0 @@ -package snapshots - -import ( - "context" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GetOperationResponse struct { - HttpResponse *http.Response - Model *Snapshot -} - -// Get ... -func (c SnapshotsClient) Get(ctx context.Context, id SnapshotId) (result GetOperationResponse, err error) { - req, err := c.preparerForGet(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "Get", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "Get", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForGet(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "Get", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForGet prepares the Get request. -func (c SnapshotsClient) preparerForGet(ctx context.Context, id SnapshotId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForGet handles the response to the Get request. The method always -// closes the http.Response Body. -func (c SnapshotsClient) responderForGet(resp *http.Response) (result GetOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_list_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_list_autorest.go deleted file mode 100644 index 5d2f714bdc1f..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_list_autorest.go +++ /dev/null @@ -1,68 +0,0 @@ -package snapshots - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ListOperationResponse struct { - HttpResponse *http.Response - Model *SnapshotsList -} - -// List ... -func (c SnapshotsClient) List(ctx context.Context, id VolumeId) (result ListOperationResponse, err error) { - req, err := c.preparerForList(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "List", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "List", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForList(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "List", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForList prepares the List request. -func (c SnapshotsClient) preparerForList(ctx context.Context, id VolumeId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/snapshots", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForList handles the response to the List request. The method always -// closes the http.Response Body. -func (c SnapshotsClient) responderForList(resp *http.Response) (result ListOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_restorefiles_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_restorefiles_autorest.go deleted file mode 100644 index 18ef248aa733..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_restorefiles_autorest.go +++ /dev/null @@ -1,79 +0,0 @@ -package snapshots - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RestoreFilesOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// RestoreFiles ... -func (c SnapshotsClient) RestoreFiles(ctx context.Context, id SnapshotId, input SnapshotRestoreFiles) (result RestoreFilesOperationResponse, err error) { - req, err := c.preparerForRestoreFiles(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "RestoreFiles", nil, "Failure preparing request") - return - } - - result, err = c.senderForRestoreFiles(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "RestoreFiles", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// RestoreFilesThenPoll performs RestoreFiles then polls until it's completed -func (c SnapshotsClient) RestoreFilesThenPoll(ctx context.Context, id SnapshotId, input SnapshotRestoreFiles) error { - result, err := c.RestoreFiles(ctx, id, input) - if err != nil { - return fmt.Errorf("performing RestoreFiles: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after RestoreFiles: %+v", err) - } - - return nil -} - -// preparerForRestoreFiles prepares the RestoreFiles request. -func (c SnapshotsClient) preparerForRestoreFiles(ctx context.Context, id SnapshotId, input SnapshotRestoreFiles) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/restoreFiles", id.ID())), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForRestoreFiles sends the RestoreFiles request. The method will close the -// http.Response Body if it receives an error. -func (c SnapshotsClient) senderForRestoreFiles(ctx context.Context, req *http.Request) (future RestoreFilesOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_update_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_update_autorest.go deleted file mode 100644 index f96261c20b0b..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_update_autorest.go +++ /dev/null @@ -1,79 +0,0 @@ -package snapshots - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UpdateOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// Update ... -func (c SnapshotsClient) Update(ctx context.Context, id SnapshotId, input interface{}) (result UpdateOperationResponse, err error) { - req, err := c.preparerForUpdate(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = c.senderForUpdate(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "Update", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// UpdateThenPoll performs Update then polls until it's completed -func (c SnapshotsClient) UpdateThenPoll(ctx context.Context, id SnapshotId, input interface{}) error { - result, err := c.Update(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Update: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after Update: %+v", err) - } - - return nil -} - -// preparerForUpdate prepares the Update request. -func (c SnapshotsClient) preparerForUpdate(ctx context.Context, id SnapshotId, input interface{}) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForUpdate sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (c SnapshotsClient) senderForUpdate(ctx context.Context, req *http.Request) (future UpdateOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/model_snapshot.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/model_snapshot.go deleted file mode 100644 index 996c7160dd19..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/model_snapshot.go +++ /dev/null @@ -1,12 +0,0 @@ -package snapshots - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Snapshot struct { - Id *string `json:"id,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Properties *SnapshotProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/model_snapshotproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/model_snapshotproperties.go deleted file mode 100644 index fe60537eaaa9..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/model_snapshotproperties.go +++ /dev/null @@ -1,28 +0,0 @@ -package snapshots - -import ( - "time" - - "github.com/hashicorp/go-azure-helpers/lang/dates" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SnapshotProperties struct { - Created *string `json:"created,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` - SnapshotId *string `json:"snapshotId,omitempty"` -} - -func (o *SnapshotProperties) GetCreatedAsTime() (*time.Time, error) { - if o.Created == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Created, "2006-01-02T15:04:05Z07:00") -} - -func (o *SnapshotProperties) SetCreatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Created = &formatted -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/model_snapshotrestorefiles.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/model_snapshotrestorefiles.go deleted file mode 100644 index de80d971dcf6..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/model_snapshotrestorefiles.go +++ /dev/null @@ -1,9 +0,0 @@ -package snapshots - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SnapshotRestoreFiles struct { - DestinationPath *string `json:"destinationPath,omitempty"` - FilePaths []string `json:"filePaths"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/model_snapshotslist.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/model_snapshotslist.go deleted file mode 100644 index bf283b0d2ac6..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/model_snapshotslist.go +++ /dev/null @@ -1,8 +0,0 @@ -package snapshots - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SnapshotsList struct { - Value *[]Snapshot `json:"value,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/version.go deleted file mode 100644 index 90179a6f56ae..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package snapshots - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-10-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/snapshots/%s", defaultApiVersion) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/README.md deleted file mode 100644 index 607525434646..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/README.md +++ /dev/null @@ -1,81 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups` Documentation - -The `volumegroups` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2021-10-01`). - -This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). - -### Import Path - -```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups" -``` - - -### Client Initialization - -```go -client := volumegroups.NewVolumeGroupsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VolumeGroupsClient.VolumeGroupsCreate` - -```go -ctx := context.TODO() -id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "volumeGroupValue") - -payload := volumegroups.VolumeGroupDetails{ - // ... -} - - -if err := client.VolumeGroupsCreateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VolumeGroupsClient.VolumeGroupsDelete` - -```go -ctx := context.TODO() -id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "volumeGroupValue") - -if err := client.VolumeGroupsDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VolumeGroupsClient.VolumeGroupsGet` - -```go -ctx := context.TODO() -id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "volumeGroupValue") - -read, err := client.VolumeGroupsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VolumeGroupsClient.VolumeGroupsListByNetAppAccount` - -```go -ctx := context.TODO() -id := volumegroups.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") - -read, err := client.VolumeGroupsListByNetAppAccount(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/client.go deleted file mode 100644 index c7beab84b9a1..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/client.go +++ /dev/null @@ -1,18 +0,0 @@ -package volumegroups - -import "github.com/Azure/go-autorest/autorest" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeGroupsClient struct { - Client autorest.Client - baseUri string -} - -func NewVolumeGroupsClientWithBaseURI(endpoint string) VolumeGroupsClient { - return VolumeGroupsClient{ - Client: autorest.NewClientWithUserAgent(userAgent()), - baseUri: endpoint, - } -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/constants.go deleted file mode 100644 index 15a1d52b1822..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/constants.go +++ /dev/null @@ -1,295 +0,0 @@ -package volumegroups - -import "strings" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationType string - -const ( - ApplicationTypeSAPNegativeHANA ApplicationType = "SAP-HANA" -) - -func PossibleValuesForApplicationType() []string { - return []string{ - string(ApplicationTypeSAPNegativeHANA), - } -} - -func parseApplicationType(input string) (*ApplicationType, error) { - vals := map[string]ApplicationType{ - "sap-hana": ApplicationTypeSAPNegativeHANA, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationType(input) - return &out, nil -} - -type AvsDataStore string - -const ( - AvsDataStoreDisabled AvsDataStore = "Disabled" - AvsDataStoreEnabled AvsDataStore = "Enabled" -) - -func PossibleValuesForAvsDataStore() []string { - return []string{ - string(AvsDataStoreDisabled), - string(AvsDataStoreEnabled), - } -} - -func parseAvsDataStore(input string) (*AvsDataStore, error) { - vals := map[string]AvsDataStore{ - "disabled": AvsDataStoreDisabled, - "enabled": AvsDataStoreEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AvsDataStore(input) - return &out, nil -} - -type ChownMode string - -const ( - ChownModeRestricted ChownMode = "Restricted" - ChownModeUnrestricted ChownMode = "Unrestricted" -) - -func PossibleValuesForChownMode() []string { - return []string{ - string(ChownModeRestricted), - string(ChownModeUnrestricted), - } -} - -func parseChownMode(input string) (*ChownMode, error) { - vals := map[string]ChownMode{ - "restricted": ChownModeRestricted, - "unrestricted": ChownModeUnrestricted, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ChownMode(input) - return &out, nil -} - -type EnableSubvolumes string - -const ( - EnableSubvolumesDisabled EnableSubvolumes = "Disabled" - EnableSubvolumesEnabled EnableSubvolumes = "Enabled" -) - -func PossibleValuesForEnableSubvolumes() []string { - return []string{ - string(EnableSubvolumesDisabled), - string(EnableSubvolumesEnabled), - } -} - -func parseEnableSubvolumes(input string) (*EnableSubvolumes, error) { - vals := map[string]EnableSubvolumes{ - "disabled": EnableSubvolumesDisabled, - "enabled": EnableSubvolumesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EnableSubvolumes(input) - return &out, nil -} - -type EndpointType string - -const ( - EndpointTypeDst EndpointType = "dst" - EndpointTypeSrc EndpointType = "src" -) - -func PossibleValuesForEndpointType() []string { - return []string{ - string(EndpointTypeDst), - string(EndpointTypeSrc), - } -} - -func parseEndpointType(input string) (*EndpointType, error) { - vals := map[string]EndpointType{ - "dst": EndpointTypeDst, - "src": EndpointTypeSrc, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EndpointType(input) - return &out, nil -} - -type NetworkFeatures string - -const ( - NetworkFeaturesBasic NetworkFeatures = "Basic" - NetworkFeaturesStandard NetworkFeatures = "Standard" -) - -func PossibleValuesForNetworkFeatures() []string { - return []string{ - string(NetworkFeaturesBasic), - string(NetworkFeaturesStandard), - } -} - -func parseNetworkFeatures(input string) (*NetworkFeatures, error) { - vals := map[string]NetworkFeatures{ - "basic": NetworkFeaturesBasic, - "standard": NetworkFeaturesStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkFeatures(input) - return &out, nil -} - -type ReplicationSchedule string - -const ( - ReplicationScheduleDaily ReplicationSchedule = "daily" - ReplicationScheduleHourly ReplicationSchedule = "hourly" - ReplicationScheduleOneZerominutely ReplicationSchedule = "_10minutely" -) - -func PossibleValuesForReplicationSchedule() []string { - return []string{ - string(ReplicationScheduleDaily), - string(ReplicationScheduleHourly), - string(ReplicationScheduleOneZerominutely), - } -} - -func parseReplicationSchedule(input string) (*ReplicationSchedule, error) { - vals := map[string]ReplicationSchedule{ - "daily": ReplicationScheduleDaily, - "hourly": ReplicationScheduleHourly, - "_10minutely": ReplicationScheduleOneZerominutely, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ReplicationSchedule(input) - return &out, nil -} - -type SecurityStyle string - -const ( - SecurityStyleNtfs SecurityStyle = "ntfs" - SecurityStyleUnix SecurityStyle = "unix" -) - -func PossibleValuesForSecurityStyle() []string { - return []string{ - string(SecurityStyleNtfs), - string(SecurityStyleUnix), - } -} - -func parseSecurityStyle(input string) (*SecurityStyle, error) { - vals := map[string]SecurityStyle{ - "ntfs": SecurityStyleNtfs, - "unix": SecurityStyleUnix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityStyle(input) - return &out, nil -} - -type ServiceLevel string - -const ( - ServiceLevelPremium ServiceLevel = "Premium" - ServiceLevelStandard ServiceLevel = "Standard" - ServiceLevelStandardZRS ServiceLevel = "StandardZRS" - ServiceLevelUltra ServiceLevel = "Ultra" -) - -func PossibleValuesForServiceLevel() []string { - return []string{ - string(ServiceLevelPremium), - string(ServiceLevelStandard), - string(ServiceLevelStandardZRS), - string(ServiceLevelUltra), - } -} - -func parseServiceLevel(input string) (*ServiceLevel, error) { - vals := map[string]ServiceLevel{ - "premium": ServiceLevelPremium, - "standard": ServiceLevelStandard, - "standardzrs": ServiceLevelStandardZRS, - "ultra": ServiceLevelUltra, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ServiceLevel(input) - return &out, nil -} - -type VolumeStorageToNetworkProximity string - -const ( - VolumeStorageToNetworkProximityDefault VolumeStorageToNetworkProximity = "Default" - VolumeStorageToNetworkProximityTOne VolumeStorageToNetworkProximity = "T1" - VolumeStorageToNetworkProximityTTwo VolumeStorageToNetworkProximity = "T2" -) - -func PossibleValuesForVolumeStorageToNetworkProximity() []string { - return []string{ - string(VolumeStorageToNetworkProximityDefault), - string(VolumeStorageToNetworkProximityTOne), - string(VolumeStorageToNetworkProximityTTwo), - } -} - -func parseVolumeStorageToNetworkProximity(input string) (*VolumeStorageToNetworkProximity, error) { - vals := map[string]VolumeStorageToNetworkProximity{ - "default": VolumeStorageToNetworkProximityDefault, - "t1": VolumeStorageToNetworkProximityTOne, - "t2": VolumeStorageToNetworkProximityTTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VolumeStorageToNetworkProximity(input) - return &out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/id_netappaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/id_netappaccount.go deleted file mode 100644 index 7b31002a4246..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/id_netappaccount.go +++ /dev/null @@ -1,124 +0,0 @@ -package volumegroups - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -var _ resourceids.ResourceId = NetAppAccountId{} - -// NetAppAccountId is a struct representing the Resource ID for a Net App Account -type NetAppAccountId struct { - SubscriptionId string - ResourceGroupName string - AccountName string -} - -// NewNetAppAccountID returns a new NetAppAccountId struct -func NewNetAppAccountID(subscriptionId string, resourceGroupName string, accountName string) NetAppAccountId { - return NetAppAccountId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - AccountName: accountName, - } -} - -// ParseNetAppAccountID parses 'input' into a NetAppAccountId -func ParseNetAppAccountID(input string) (*NetAppAccountId, error) { - parser := resourceids.NewParserFromResourceIdType(NetAppAccountId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := NetAppAccountId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ParseNetAppAccountIDInsensitively parses 'input' case-insensitively into a NetAppAccountId -// note: this method should only be used for API response data and not user input -func ParseNetAppAccountIDInsensitively(input string) (*NetAppAccountId, error) { - parser := resourceids.NewParserFromResourceIdType(NetAppAccountId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := NetAppAccountId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ValidateNetAppAccountID checks that 'input' can be parsed as a Net App Account ID -func ValidateNetAppAccountID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := ParseNetAppAccountID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Net App Account ID -func (id NetAppAccountId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Net App Account ID -func (id NetAppAccountId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), - resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("accountName", "accountValue"), - } -} - -// String returns a human-readable description of this Net App Account ID -func (id NetAppAccountId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Account Name: %q", id.AccountName), - } - return fmt.Sprintf("Net App Account (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/id_volumegroup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/id_volumegroup.go deleted file mode 100644 index a49d03263509..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/id_volumegroup.go +++ /dev/null @@ -1,137 +0,0 @@ -package volumegroups - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -var _ resourceids.ResourceId = VolumeGroupId{} - -// VolumeGroupId is a struct representing the Resource ID for a Volume Group -type VolumeGroupId struct { - SubscriptionId string - ResourceGroupName string - AccountName string - VolumeGroupName string -} - -// NewVolumeGroupID returns a new VolumeGroupId struct -func NewVolumeGroupID(subscriptionId string, resourceGroupName string, accountName string, volumeGroupName string) VolumeGroupId { - return VolumeGroupId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - AccountName: accountName, - VolumeGroupName: volumeGroupName, - } -} - -// ParseVolumeGroupID parses 'input' into a VolumeGroupId -func ParseVolumeGroupID(input string) (*VolumeGroupId, error) { - parser := resourceids.NewParserFromResourceIdType(VolumeGroupId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := VolumeGroupId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - if id.VolumeGroupName, ok = parsed.Parsed["volumeGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'volumeGroupName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ParseVolumeGroupIDInsensitively parses 'input' case-insensitively into a VolumeGroupId -// note: this method should only be used for API response data and not user input -func ParseVolumeGroupIDInsensitively(input string) (*VolumeGroupId, error) { - parser := resourceids.NewParserFromResourceIdType(VolumeGroupId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := VolumeGroupId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - if id.VolumeGroupName, ok = parsed.Parsed["volumeGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'volumeGroupName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ValidateVolumeGroupID checks that 'input' can be parsed as a Volume Group ID -func ValidateVolumeGroupID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := ParseVolumeGroupID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Volume Group ID -func (id VolumeGroupId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/volumeGroups/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName, id.VolumeGroupName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Volume Group ID -func (id VolumeGroupId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), - resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("accountName", "accountValue"), - resourceids.StaticSegment("staticVolumeGroups", "volumeGroups", "volumeGroups"), - resourceids.UserSpecifiedSegment("volumeGroupName", "volumeGroupValue"), - } -} - -// String returns a human-readable description of this Volume Group ID -func (id VolumeGroupId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Account Name: %q", id.AccountName), - fmt.Sprintf("Volume Group Name: %q", id.VolumeGroupName), - } - return fmt.Sprintf("Volume Group (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupscreate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupscreate_autorest.go deleted file mode 100644 index ee9616617b30..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupscreate_autorest.go +++ /dev/null @@ -1,79 +0,0 @@ -package volumegroups - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeGroupsCreateOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// VolumeGroupsCreate ... -func (c VolumeGroupsClient) VolumeGroupsCreate(ctx context.Context, id VolumeGroupId, input VolumeGroupDetails) (result VolumeGroupsCreateOperationResponse, err error) { - req, err := c.preparerForVolumeGroupsCreate(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsCreate", nil, "Failure preparing request") - return - } - - result, err = c.senderForVolumeGroupsCreate(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsCreate", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// VolumeGroupsCreateThenPoll performs VolumeGroupsCreate then polls until it's completed -func (c VolumeGroupsClient) VolumeGroupsCreateThenPoll(ctx context.Context, id VolumeGroupId, input VolumeGroupDetails) error { - result, err := c.VolumeGroupsCreate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing VolumeGroupsCreate: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after VolumeGroupsCreate: %+v", err) - } - - return nil -} - -// preparerForVolumeGroupsCreate prepares the VolumeGroupsCreate request. -func (c VolumeGroupsClient) preparerForVolumeGroupsCreate(ctx context.Context, id VolumeGroupId, input VolumeGroupDetails) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForVolumeGroupsCreate sends the VolumeGroupsCreate request. The method will close the -// http.Response Body if it receives an error. -func (c VolumeGroupsClient) senderForVolumeGroupsCreate(ctx context.Context, req *http.Request) (future VolumeGroupsCreateOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupsdelete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupsdelete_autorest.go deleted file mode 100644 index b3cba81e1756..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupsdelete_autorest.go +++ /dev/null @@ -1,78 +0,0 @@ -package volumegroups - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeGroupsDeleteOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// VolumeGroupsDelete ... -func (c VolumeGroupsClient) VolumeGroupsDelete(ctx context.Context, id VolumeGroupId) (result VolumeGroupsDeleteOperationResponse, err error) { - req, err := c.preparerForVolumeGroupsDelete(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsDelete", nil, "Failure preparing request") - return - } - - result, err = c.senderForVolumeGroupsDelete(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsDelete", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// VolumeGroupsDeleteThenPoll performs VolumeGroupsDelete then polls until it's completed -func (c VolumeGroupsClient) VolumeGroupsDeleteThenPoll(ctx context.Context, id VolumeGroupId) error { - result, err := c.VolumeGroupsDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing VolumeGroupsDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after VolumeGroupsDelete: %+v", err) - } - - return nil -} - -// preparerForVolumeGroupsDelete prepares the VolumeGroupsDelete request. -func (c VolumeGroupsClient) preparerForVolumeGroupsDelete(ctx context.Context, id VolumeGroupId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsDelete(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForVolumeGroupsDelete sends the VolumeGroupsDelete request. The method will close the -// http.Response Body if it receives an error. -func (c VolumeGroupsClient) senderForVolumeGroupsDelete(ctx context.Context, req *http.Request) (future VolumeGroupsDeleteOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupsget_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupsget_autorest.go deleted file mode 100644 index d52a1f2e8c2e..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupsget_autorest.go +++ /dev/null @@ -1,67 +0,0 @@ -package volumegroups - -import ( - "context" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeGroupsGetOperationResponse struct { - HttpResponse *http.Response - Model *VolumeGroupDetails -} - -// VolumeGroupsGet ... -func (c VolumeGroupsClient) VolumeGroupsGet(ctx context.Context, id VolumeGroupId) (result VolumeGroupsGetOperationResponse, err error) { - req, err := c.preparerForVolumeGroupsGet(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsGet", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsGet", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForVolumeGroupsGet(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsGet", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForVolumeGroupsGet prepares the VolumeGroupsGet request. -func (c VolumeGroupsClient) preparerForVolumeGroupsGet(ctx context.Context, id VolumeGroupId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForVolumeGroupsGet handles the response to the VolumeGroupsGet request. The method always -// closes the http.Response Body. -func (c VolumeGroupsClient) responderForVolumeGroupsGet(resp *http.Response) (result VolumeGroupsGetOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupslistbynetappaccount_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupslistbynetappaccount_autorest.go deleted file mode 100644 index 92517aeaf6f2..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupslistbynetappaccount_autorest.go +++ /dev/null @@ -1,68 +0,0 @@ -package volumegroups - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeGroupsListByNetAppAccountOperationResponse struct { - HttpResponse *http.Response - Model *VolumeGroupList -} - -// VolumeGroupsListByNetAppAccount ... -func (c VolumeGroupsClient) VolumeGroupsListByNetAppAccount(ctx context.Context, id NetAppAccountId) (result VolumeGroupsListByNetAppAccountOperationResponse, err error) { - req, err := c.preparerForVolumeGroupsListByNetAppAccount(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsListByNetAppAccount", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsListByNetAppAccount", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForVolumeGroupsListByNetAppAccount(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsListByNetAppAccount", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForVolumeGroupsListByNetAppAccount prepares the VolumeGroupsListByNetAppAccount request. -func (c VolumeGroupsClient) preparerForVolumeGroupsListByNetAppAccount(ctx context.Context, id NetAppAccountId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/volumeGroups", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForVolumeGroupsListByNetAppAccount handles the response to the VolumeGroupsListByNetAppAccount request. The method always -// closes the http.Response Body. -func (c VolumeGroupsClient) responderForVolumeGroupsListByNetAppAccount(resp *http.Response) (result VolumeGroupsListByNetAppAccountOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_exportpolicyrule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_exportpolicyrule.go deleted file mode 100644 index e17395ba1a77..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_exportpolicyrule.go +++ /dev/null @@ -1,22 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExportPolicyRule struct { - AllowedClients *string `json:"allowedClients,omitempty"` - ChownMode *ChownMode `json:"chownMode,omitempty"` - Cifs *bool `json:"cifs,omitempty"` - HasRootAccess *bool `json:"hasRootAccess,omitempty"` - Kerberos5ReadOnly *bool `json:"kerberos5ReadOnly,omitempty"` - Kerberos5ReadWrite *bool `json:"kerberos5ReadWrite,omitempty"` - Kerberos5iReadOnly *bool `json:"kerberos5iReadOnly,omitempty"` - Kerberos5iReadWrite *bool `json:"kerberos5iReadWrite,omitempty"` - Kerberos5pReadOnly *bool `json:"kerberos5pReadOnly,omitempty"` - Kerberos5pReadWrite *bool `json:"kerberos5pReadWrite,omitempty"` - Nfsv3 *bool `json:"nfsv3,omitempty"` - Nfsv41 *bool `json:"nfsv41,omitempty"` - RuleIndex *int64 `json:"ruleIndex,omitempty"` - UnixReadOnly *bool `json:"unixReadOnly,omitempty"` - UnixReadWrite *bool `json:"unixReadWrite,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_mounttargetproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_mounttargetproperties.go deleted file mode 100644 index c59cc0dbf3e7..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_mounttargetproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MountTargetProperties struct { - FileSystemId string `json:"fileSystemId"` - IpAddress *string `json:"ipAddress,omitempty"` - MountTargetId *string `json:"mountTargetId,omitempty"` - SmbServerFqdn *string `json:"smbServerFqdn,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_placementkeyvaluepairs.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_placementkeyvaluepairs.go deleted file mode 100644 index 1714b1662a1d..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_placementkeyvaluepairs.go +++ /dev/null @@ -1,9 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PlacementKeyValuePairs struct { - Key string `json:"key"` - Value string `json:"value"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_replicationobject.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_replicationobject.go deleted file mode 100644 index 6d145aa00798..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_replicationobject.go +++ /dev/null @@ -1,12 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ReplicationObject struct { - EndpointType *EndpointType `json:"endpointType,omitempty"` - RemoteVolumeRegion *string `json:"remoteVolumeRegion,omitempty"` - RemoteVolumeResourceId string `json:"remoteVolumeResourceId"` - ReplicationId *string `json:"replicationId,omitempty"` - ReplicationSchedule *ReplicationSchedule `json:"replicationSchedule,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumebackupproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumebackupproperties.go deleted file mode 100644 index 1141229b560a..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumebackupproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeBackupProperties struct { - BackupEnabled *bool `json:"backupEnabled,omitempty"` - BackupPolicyId *string `json:"backupPolicyId,omitempty"` - PolicyEnforced *bool `json:"policyEnforced,omitempty"` - VaultId *string `json:"vaultId,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroup.go deleted file mode 100644 index 5e4df7bb9c04..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroup.go +++ /dev/null @@ -1,12 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeGroup struct { - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VolumeGroupListProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupdetails.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupdetails.go deleted file mode 100644 index 08e48e1d0e8f..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupdetails.go +++ /dev/null @@ -1,13 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeGroupDetails struct { - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VolumeGroupProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegrouplist.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegrouplist.go deleted file mode 100644 index 447c6e6e8588..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegrouplist.go +++ /dev/null @@ -1,8 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeGroupList struct { - Value *[]VolumeGroup `json:"value,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegrouplistproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegrouplistproperties.go deleted file mode 100644 index 5788ee516fc1..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegrouplistproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeGroupListProperties struct { - GroupMetaData *VolumeGroupMetaData `json:"groupMetaData,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupmetadata.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupmetadata.go deleted file mode 100644 index 30441c6826d5..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupmetadata.go +++ /dev/null @@ -1,13 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeGroupMetaData struct { - ApplicationIdentifier *string `json:"applicationIdentifier,omitempty"` - ApplicationType *ApplicationType `json:"applicationType,omitempty"` - DeploymentSpecId *string `json:"deploymentSpecId,omitempty"` - GlobalPlacementRules *[]PlacementKeyValuePairs `json:"globalPlacementRules,omitempty"` - GroupDescription *string `json:"groupDescription,omitempty"` - VolumesCount *int64 `json:"volumesCount,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupproperties.go deleted file mode 100644 index 0bab153b397e..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeGroupProperties struct { - GroupMetaData *VolumeGroupMetaData `json:"groupMetaData,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` - Volumes *[]VolumeGroupVolumeProperties `json:"volumes,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupvolumeproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupvolumeproperties.go deleted file mode 100644 index 61bbdab9ce3e..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupvolumeproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeGroupVolumeProperties struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties VolumeProperties `json:"properties"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumeproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumeproperties.go deleted file mode 100644 index dc67a9543182..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumeproperties.go +++ /dev/null @@ -1,49 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeProperties struct { - AvsDataStore *AvsDataStore `json:"avsDataStore,omitempty"` - BackupId *string `json:"backupId,omitempty"` - BaremetalTenantId *string `json:"baremetalTenantId,omitempty"` - CapacityPoolResourceId *string `json:"capacityPoolResourceId,omitempty"` - CloneProgress *int64 `json:"cloneProgress,omitempty"` - CoolAccess *bool `json:"coolAccess,omitempty"` - CoolnessPeriod *int64 `json:"coolnessPeriod,omitempty"` - CreationToken string `json:"creationToken"` - DataProtection *VolumePropertiesDataProtection `json:"dataProtection,omitempty"` - DefaultGroupQuotaInKiBs *int64 `json:"defaultGroupQuotaInKiBs,omitempty"` - DefaultUserQuotaInKiBs *int64 `json:"defaultUserQuotaInKiBs,omitempty"` - EnableSubvolumes *EnableSubvolumes `json:"enableSubvolumes,omitempty"` - EncryptionKeySource *string `json:"encryptionKeySource,omitempty"` - ExportPolicy *VolumePropertiesExportPolicy `json:"exportPolicy,omitempty"` - FileSystemId *string `json:"fileSystemId,omitempty"` - IsDefaultQuotaEnabled *bool `json:"isDefaultQuotaEnabled,omitempty"` - IsRestoring *bool `json:"isRestoring,omitempty"` - KerberosEnabled *bool `json:"kerberosEnabled,omitempty"` - LdapEnabled *bool `json:"ldapEnabled,omitempty"` - MaximumNumberOfFiles *int64 `json:"maximumNumberOfFiles,omitempty"` - MountTargets *[]MountTargetProperties `json:"mountTargets,omitempty"` - NetworkFeatures *NetworkFeatures `json:"networkFeatures,omitempty"` - NetworkSiblingSetId *string `json:"networkSiblingSetId,omitempty"` - PlacementRules *[]PlacementKeyValuePairs `json:"placementRules,omitempty"` - ProtocolTypes *[]string `json:"protocolTypes,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` - ProximityPlacementGroup *string `json:"proximityPlacementGroup,omitempty"` - SecurityStyle *SecurityStyle `json:"securityStyle,omitempty"` - ServiceLevel *ServiceLevel `json:"serviceLevel,omitempty"` - SmbContinuouslyAvailable *bool `json:"smbContinuouslyAvailable,omitempty"` - SmbEncryption *bool `json:"smbEncryption,omitempty"` - SnapshotDirectoryVisible *bool `json:"snapshotDirectoryVisible,omitempty"` - SnapshotId *string `json:"snapshotId,omitempty"` - StorageToNetworkProximity *VolumeStorageToNetworkProximity `json:"storageToNetworkProximity,omitempty"` - SubnetId string `json:"subnetId"` - T2Network *string `json:"t2Network,omitempty"` - ThroughputMibps *float64 `json:"throughputMibps,omitempty"` - UnixPermissions *string `json:"unixPermissions,omitempty"` - UsageThreshold int64 `json:"usageThreshold"` - VolumeGroupName *string `json:"volumeGroupName,omitempty"` - VolumeSpecName *string `json:"volumeSpecName,omitempty"` - VolumeType *string `json:"volumeType,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumepropertiesdataprotection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumepropertiesdataprotection.go deleted file mode 100644 index 5cde3ecbaacc..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumepropertiesdataprotection.go +++ /dev/null @@ -1,10 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumePropertiesDataProtection struct { - Backup *VolumeBackupProperties `json:"backup,omitempty"` - Replication *ReplicationObject `json:"replication,omitempty"` - Snapshot *VolumeSnapshotProperties `json:"snapshot,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumepropertiesexportpolicy.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumepropertiesexportpolicy.go deleted file mode 100644 index 227c8586d6f2..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumepropertiesexportpolicy.go +++ /dev/null @@ -1,8 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumePropertiesExportPolicy struct { - Rules *[]ExportPolicyRule `json:"rules,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumesnapshotproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumesnapshotproperties.go deleted file mode 100644 index a3f5011da3b0..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumesnapshotproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeSnapshotProperties struct { - SnapshotPolicyId *string `json:"snapshotPolicyId,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/version.go deleted file mode 100644 index 93f3d1ecbb06..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package volumegroups - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-10-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/volumegroups/%s", defaultApiVersion) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/README.md deleted file mode 100644 index c42f7262724b..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/README.md +++ /dev/null @@ -1,99 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes` Documentation - -The `volumes` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2021-10-01`). - -This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). - -### Import Path - -```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes" -``` - - -### Client Initialization - -```go -client := volumes.NewVolumesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VolumesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue") - -payload := volumes.Volume{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VolumesClient.Delete` - -```go -ctx := context.TODO() -id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue") - -if err := client.DeleteThenPoll(ctx, id, volumes.DefaultDeleteOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `VolumesClient.Get` - -```go -ctx := context.TODO() -id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue") - -read, err := client.Get(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VolumesClient.List` - -```go -ctx := context.TODO() -id := volumes.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue") - -// alternatively `client.List(ctx, id)` can be used to do batched pagination -items, err := client.ListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VolumesClient.Update` - -```go -ctx := context.TODO() -id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue") - -payload := volumes.VolumePatch{ - // ... -} - - -if err := client.UpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/client.go deleted file mode 100644 index d0a40573bf00..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/client.go +++ /dev/null @@ -1,18 +0,0 @@ -package volumes - -import "github.com/Azure/go-autorest/autorest" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumesClient struct { - Client autorest.Client - baseUri string -} - -func NewVolumesClientWithBaseURI(endpoint string) VolumesClient { - return VolumesClient{ - Client: autorest.NewClientWithUserAgent(userAgent()), - baseUri: endpoint, - } -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/constants.go deleted file mode 100644 index 4c9bed0d63be..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/constants.go +++ /dev/null @@ -1,270 +0,0 @@ -package volumes - -import "strings" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AvsDataStore string - -const ( - AvsDataStoreDisabled AvsDataStore = "Disabled" - AvsDataStoreEnabled AvsDataStore = "Enabled" -) - -func PossibleValuesForAvsDataStore() []string { - return []string{ - string(AvsDataStoreDisabled), - string(AvsDataStoreEnabled), - } -} - -func parseAvsDataStore(input string) (*AvsDataStore, error) { - vals := map[string]AvsDataStore{ - "disabled": AvsDataStoreDisabled, - "enabled": AvsDataStoreEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AvsDataStore(input) - return &out, nil -} - -type ChownMode string - -const ( - ChownModeRestricted ChownMode = "Restricted" - ChownModeUnrestricted ChownMode = "Unrestricted" -) - -func PossibleValuesForChownMode() []string { - return []string{ - string(ChownModeRestricted), - string(ChownModeUnrestricted), - } -} - -func parseChownMode(input string) (*ChownMode, error) { - vals := map[string]ChownMode{ - "restricted": ChownModeRestricted, - "unrestricted": ChownModeUnrestricted, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ChownMode(input) - return &out, nil -} - -type EnableSubvolumes string - -const ( - EnableSubvolumesDisabled EnableSubvolumes = "Disabled" - EnableSubvolumesEnabled EnableSubvolumes = "Enabled" -) - -func PossibleValuesForEnableSubvolumes() []string { - return []string{ - string(EnableSubvolumesDisabled), - string(EnableSubvolumesEnabled), - } -} - -func parseEnableSubvolumes(input string) (*EnableSubvolumes, error) { - vals := map[string]EnableSubvolumes{ - "disabled": EnableSubvolumesDisabled, - "enabled": EnableSubvolumesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EnableSubvolumes(input) - return &out, nil -} - -type EndpointType string - -const ( - EndpointTypeDst EndpointType = "dst" - EndpointTypeSrc EndpointType = "src" -) - -func PossibleValuesForEndpointType() []string { - return []string{ - string(EndpointTypeDst), - string(EndpointTypeSrc), - } -} - -func parseEndpointType(input string) (*EndpointType, error) { - vals := map[string]EndpointType{ - "dst": EndpointTypeDst, - "src": EndpointTypeSrc, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EndpointType(input) - return &out, nil -} - -type NetworkFeatures string - -const ( - NetworkFeaturesBasic NetworkFeatures = "Basic" - NetworkFeaturesStandard NetworkFeatures = "Standard" -) - -func PossibleValuesForNetworkFeatures() []string { - return []string{ - string(NetworkFeaturesBasic), - string(NetworkFeaturesStandard), - } -} - -func parseNetworkFeatures(input string) (*NetworkFeatures, error) { - vals := map[string]NetworkFeatures{ - "basic": NetworkFeaturesBasic, - "standard": NetworkFeaturesStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkFeatures(input) - return &out, nil -} - -type ReplicationSchedule string - -const ( - ReplicationScheduleDaily ReplicationSchedule = "daily" - ReplicationScheduleHourly ReplicationSchedule = "hourly" - ReplicationScheduleOneZerominutely ReplicationSchedule = "_10minutely" -) - -func PossibleValuesForReplicationSchedule() []string { - return []string{ - string(ReplicationScheduleDaily), - string(ReplicationScheduleHourly), - string(ReplicationScheduleOneZerominutely), - } -} - -func parseReplicationSchedule(input string) (*ReplicationSchedule, error) { - vals := map[string]ReplicationSchedule{ - "daily": ReplicationScheduleDaily, - "hourly": ReplicationScheduleHourly, - "_10minutely": ReplicationScheduleOneZerominutely, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ReplicationSchedule(input) - return &out, nil -} - -type SecurityStyle string - -const ( - SecurityStyleNtfs SecurityStyle = "ntfs" - SecurityStyleUnix SecurityStyle = "unix" -) - -func PossibleValuesForSecurityStyle() []string { - return []string{ - string(SecurityStyleNtfs), - string(SecurityStyleUnix), - } -} - -func parseSecurityStyle(input string) (*SecurityStyle, error) { - vals := map[string]SecurityStyle{ - "ntfs": SecurityStyleNtfs, - "unix": SecurityStyleUnix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityStyle(input) - return &out, nil -} - -type ServiceLevel string - -const ( - ServiceLevelPremium ServiceLevel = "Premium" - ServiceLevelStandard ServiceLevel = "Standard" - ServiceLevelStandardZRS ServiceLevel = "StandardZRS" - ServiceLevelUltra ServiceLevel = "Ultra" -) - -func PossibleValuesForServiceLevel() []string { - return []string{ - string(ServiceLevelPremium), - string(ServiceLevelStandard), - string(ServiceLevelStandardZRS), - string(ServiceLevelUltra), - } -} - -func parseServiceLevel(input string) (*ServiceLevel, error) { - vals := map[string]ServiceLevel{ - "premium": ServiceLevelPremium, - "standard": ServiceLevelStandard, - "standardzrs": ServiceLevelStandardZRS, - "ultra": ServiceLevelUltra, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ServiceLevel(input) - return &out, nil -} - -type VolumeStorageToNetworkProximity string - -const ( - VolumeStorageToNetworkProximityDefault VolumeStorageToNetworkProximity = "Default" - VolumeStorageToNetworkProximityTOne VolumeStorageToNetworkProximity = "T1" - VolumeStorageToNetworkProximityTTwo VolumeStorageToNetworkProximity = "T2" -) - -func PossibleValuesForVolumeStorageToNetworkProximity() []string { - return []string{ - string(VolumeStorageToNetworkProximityDefault), - string(VolumeStorageToNetworkProximityTOne), - string(VolumeStorageToNetworkProximityTTwo), - } -} - -func parseVolumeStorageToNetworkProximity(input string) (*VolumeStorageToNetworkProximity, error) { - vals := map[string]VolumeStorageToNetworkProximity{ - "default": VolumeStorageToNetworkProximityDefault, - "t1": VolumeStorageToNetworkProximityTOne, - "t2": VolumeStorageToNetworkProximityTTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VolumeStorageToNetworkProximity(input) - return &out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/id_capacitypool.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/id_capacitypool.go deleted file mode 100644 index 06f8b4531bd9..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/id_capacitypool.go +++ /dev/null @@ -1,137 +0,0 @@ -package volumes - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -var _ resourceids.ResourceId = CapacityPoolId{} - -// CapacityPoolId is a struct representing the Resource ID for a Capacity Pool -type CapacityPoolId struct { - SubscriptionId string - ResourceGroupName string - AccountName string - PoolName string -} - -// NewCapacityPoolID returns a new CapacityPoolId struct -func NewCapacityPoolID(subscriptionId string, resourceGroupName string, accountName string, poolName string) CapacityPoolId { - return CapacityPoolId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - AccountName: accountName, - PoolName: poolName, - } -} - -// ParseCapacityPoolID parses 'input' into a CapacityPoolId -func ParseCapacityPoolID(input string) (*CapacityPoolId, error) { - parser := resourceids.NewParserFromResourceIdType(CapacityPoolId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := CapacityPoolId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { - return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ParseCapacityPoolIDInsensitively parses 'input' case-insensitively into a CapacityPoolId -// note: this method should only be used for API response data and not user input -func ParseCapacityPoolIDInsensitively(input string) (*CapacityPoolId, error) { - parser := resourceids.NewParserFromResourceIdType(CapacityPoolId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := CapacityPoolId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { - return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ValidateCapacityPoolID checks that 'input' can be parsed as a Capacity Pool ID -func ValidateCapacityPoolID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := ParseCapacityPoolID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Capacity Pool ID -func (id CapacityPoolId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/capacityPools/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName, id.PoolName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Capacity Pool ID -func (id CapacityPoolId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), - resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("accountName", "accountValue"), - resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("poolName", "poolValue"), - } -} - -// String returns a human-readable description of this Capacity Pool ID -func (id CapacityPoolId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Account Name: %q", id.AccountName), - fmt.Sprintf("Pool Name: %q", id.PoolName), - } - return fmt.Sprintf("Capacity Pool (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/id_volume.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/id_volume.go deleted file mode 100644 index d4e93b387a44..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/id_volume.go +++ /dev/null @@ -1,150 +0,0 @@ -package volumes - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -var _ resourceids.ResourceId = VolumeId{} - -// VolumeId is a struct representing the Resource ID for a Volume -type VolumeId struct { - SubscriptionId string - ResourceGroupName string - AccountName string - PoolName string - VolumeName string -} - -// NewVolumeID returns a new VolumeId struct -func NewVolumeID(subscriptionId string, resourceGroupName string, accountName string, poolName string, volumeName string) VolumeId { - return VolumeId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - AccountName: accountName, - PoolName: poolName, - VolumeName: volumeName, - } -} - -// ParseVolumeID parses 'input' into a VolumeId -func ParseVolumeID(input string) (*VolumeId, error) { - parser := resourceids.NewParserFromResourceIdType(VolumeId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := VolumeId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { - return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) - } - - if id.VolumeName, ok = parsed.Parsed["volumeName"]; !ok { - return nil, fmt.Errorf("the segment 'volumeName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ParseVolumeIDInsensitively parses 'input' case-insensitively into a VolumeId -// note: this method should only be used for API response data and not user input -func ParseVolumeIDInsensitively(input string) (*VolumeId, error) { - parser := resourceids.NewParserFromResourceIdType(VolumeId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := VolumeId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { - return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) - } - - if id.VolumeName, ok = parsed.Parsed["volumeName"]; !ok { - return nil, fmt.Errorf("the segment 'volumeName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ValidateVolumeID checks that 'input' can be parsed as a Volume ID -func ValidateVolumeID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := ParseVolumeID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Volume ID -func (id VolumeId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/capacityPools/%s/volumes/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName, id.PoolName, id.VolumeName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Volume ID -func (id VolumeId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), - resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("accountName", "accountValue"), - resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("poolName", "poolValue"), - resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), - resourceids.UserSpecifiedSegment("volumeName", "volumeValue"), - } -} - -// String returns a human-readable description of this Volume ID -func (id VolumeId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Account Name: %q", id.AccountName), - fmt.Sprintf("Pool Name: %q", id.PoolName), - fmt.Sprintf("Volume Name: %q", id.VolumeName), - } - return fmt.Sprintf("Volume (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_createorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_createorupdate_autorest.go deleted file mode 100644 index ae61c0fe91ec..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_createorupdate_autorest.go +++ /dev/null @@ -1,79 +0,0 @@ -package volumes - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CreateOrUpdateOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// CreateOrUpdate ... -func (c VolumesClient) CreateOrUpdate(ctx context.Context, id VolumeId, input Volume) (result CreateOrUpdateOperationResponse, err error) { - req, err := c.preparerForCreateOrUpdate(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = c.senderForCreateOrUpdate(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "CreateOrUpdate", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c VolumesClient) CreateOrUpdateThenPoll(ctx context.Context, id VolumeId, input Volume) error { - result, err := c.CreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing CreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after CreateOrUpdate: %+v", err) - } - - return nil -} - -// preparerForCreateOrUpdate prepares the CreateOrUpdate request. -func (c VolumesClient) preparerForCreateOrUpdate(ctx context.Context, id VolumeId, input Volume) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForCreateOrUpdate sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (c VolumesClient) senderForCreateOrUpdate(ctx context.Context, req *http.Request) (future CreateOrUpdateOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_delete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_delete_autorest.go deleted file mode 100644 index 1b97fdf87abf..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_delete_autorest.go +++ /dev/null @@ -1,107 +0,0 @@ -package volumes - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DeleteOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -type DeleteOperationOptions struct { - ForceDelete *bool -} - -func DefaultDeleteOperationOptions() DeleteOperationOptions { - return DeleteOperationOptions{} -} - -func (o DeleteOperationOptions) toHeaders() map[string]interface{} { - out := make(map[string]interface{}) - - return out -} - -func (o DeleteOperationOptions) toQueryString() map[string]interface{} { - out := make(map[string]interface{}) - - if o.ForceDelete != nil { - out["forceDelete"] = *o.ForceDelete - } - - return out -} - -// Delete ... -func (c VolumesClient) Delete(ctx context.Context, id VolumeId, options DeleteOperationOptions) (result DeleteOperationResponse, err error) { - req, err := c.preparerForDelete(ctx, id, options) - if err != nil { - err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = c.senderForDelete(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "Delete", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// DeleteThenPoll performs Delete then polls until it's completed -func (c VolumesClient) DeleteThenPoll(ctx context.Context, id VolumeId, options DeleteOperationOptions) error { - result, err := c.Delete(ctx, id, options) - if err != nil { - return fmt.Errorf("performing Delete: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after Delete: %+v", err) - } - - return nil -} - -// preparerForDelete prepares the Delete request. -func (c VolumesClient) preparerForDelete(ctx context.Context, id VolumeId, options DeleteOperationOptions) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - for k, v := range options.toQueryString() { - queryParameters[k] = autorest.Encode("query", v) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsDelete(), - autorest.WithBaseURL(c.baseUri), - autorest.WithHeaders(options.toHeaders()), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForDelete sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (c VolumesClient) senderForDelete(ctx context.Context, req *http.Request) (future DeleteOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_get_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_get_autorest.go deleted file mode 100644 index f35ab8d36ba5..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_get_autorest.go +++ /dev/null @@ -1,67 +0,0 @@ -package volumes - -import ( - "context" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GetOperationResponse struct { - HttpResponse *http.Response - Model *Volume -} - -// Get ... -func (c VolumesClient) Get(ctx context.Context, id VolumeId) (result GetOperationResponse, err error) { - req, err := c.preparerForGet(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "Get", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "Get", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForGet(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "Get", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForGet prepares the Get request. -func (c VolumesClient) preparerForGet(ctx context.Context, id VolumeId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForGet handles the response to the Get request. The method always -// closes the http.Response Body. -func (c VolumesClient) responderForGet(resp *http.Response) (result GetOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_list_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_list_autorest.go deleted file mode 100644 index 40c311905e59..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_list_autorest.go +++ /dev/null @@ -1,186 +0,0 @@ -package volumes - -import ( - "context" - "fmt" - "net/http" - "net/url" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ListOperationResponse struct { - HttpResponse *http.Response - Model *[]Volume - - nextLink *string - nextPageFunc func(ctx context.Context, nextLink string) (ListOperationResponse, error) -} - -type ListCompleteResult struct { - Items []Volume -} - -func (r ListOperationResponse) HasMore() bool { - return r.nextLink != nil -} - -func (r ListOperationResponse) LoadMore(ctx context.Context) (resp ListOperationResponse, err error) { - if !r.HasMore() { - err = fmt.Errorf("no more pages returned") - return - } - return r.nextPageFunc(ctx, *r.nextLink) -} - -// List ... -func (c VolumesClient) List(ctx context.Context, id CapacityPoolId) (resp ListOperationResponse, err error) { - req, err := c.preparerForList(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "List", nil, "Failure preparing request") - return - } - - resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "List", resp.HttpResponse, "Failure sending request") - return - } - - resp, err = c.responderForList(resp.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "List", resp.HttpResponse, "Failure responding to request") - return - } - return -} - -// ListComplete retrieves all of the results into a single object -func (c VolumesClient) ListComplete(ctx context.Context, id CapacityPoolId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, VolumeOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c VolumesClient) ListCompleteMatchingPredicate(ctx context.Context, id CapacityPoolId, predicate VolumeOperationPredicate) (resp ListCompleteResult, err error) { - items := make([]Volume, 0) - - page, err := c.List(ctx, id) - if err != nil { - err = fmt.Errorf("loading the initial page: %+v", err) - return - } - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - for page.HasMore() { - page, err = page.LoadMore(ctx) - if err != nil { - err = fmt.Errorf("loading the next page: %+v", err) - return - } - - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - } - - out := ListCompleteResult{ - Items: items, - } - return out, nil -} - -// preparerForList prepares the List request. -func (c VolumesClient) preparerForList(ctx context.Context, id CapacityPoolId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/volumes", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// preparerForListWithNextLink prepares the List request with the given nextLink token. -func (c VolumesClient) preparerForListWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { - uri, err := url.Parse(nextLink) - if err != nil { - return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) - } - queryParameters := map[string]interface{}{} - for k, v := range uri.Query() { - if len(v) == 0 { - continue - } - val := v[0] - val = autorest.Encode("query", val) - queryParameters[k] = val - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(uri.Path), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForList handles the response to the List request. The method always -// closes the http.Response Body. -func (c VolumesClient) responderForList(resp *http.Response) (result ListOperationResponse, err error) { - type page struct { - Values []Volume `json:"value"` - NextLink *string `json:"nextLink"` - } - var respObj page - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&respObj), - autorest.ByClosing()) - result.HttpResponse = resp - result.Model = &respObj.Values - result.nextLink = respObj.NextLink - if respObj.NextLink != nil { - result.nextPageFunc = func(ctx context.Context, nextLink string) (result ListOperationResponse, err error) { - req, err := c.preparerForListWithNextLink(ctx, nextLink) - if err != nil { - err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "List", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "List", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForList(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "List", result.HttpResponse, "Failure responding to request") - return - } - - return - } - } - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_update_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_update_autorest.go deleted file mode 100644 index 7e6872e1513e..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_update_autorest.go +++ /dev/null @@ -1,79 +0,0 @@ -package volumes - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UpdateOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// Update ... -func (c VolumesClient) Update(ctx context.Context, id VolumeId, input VolumePatch) (result UpdateOperationResponse, err error) { - req, err := c.preparerForUpdate(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "Update", nil, "Failure preparing request") - return - } - - result, err = c.senderForUpdate(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "Update", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// UpdateThenPoll performs Update then polls until it's completed -func (c VolumesClient) UpdateThenPoll(ctx context.Context, id VolumeId, input VolumePatch) error { - result, err := c.Update(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Update: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after Update: %+v", err) - } - - return nil -} - -// preparerForUpdate prepares the Update request. -func (c VolumesClient) preparerForUpdate(ctx context.Context, id VolumeId, input VolumePatch) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForUpdate sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (c VolumesClient) senderForUpdate(ctx context.Context, req *http.Request) (future UpdateOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_exportpolicyrule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_exportpolicyrule.go deleted file mode 100644 index 9b059c747578..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_exportpolicyrule.go +++ /dev/null @@ -1,22 +0,0 @@ -package volumes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExportPolicyRule struct { - AllowedClients *string `json:"allowedClients,omitempty"` - ChownMode *ChownMode `json:"chownMode,omitempty"` - Cifs *bool `json:"cifs,omitempty"` - HasRootAccess *bool `json:"hasRootAccess,omitempty"` - Kerberos5ReadOnly *bool `json:"kerberos5ReadOnly,omitempty"` - Kerberos5ReadWrite *bool `json:"kerberos5ReadWrite,omitempty"` - Kerberos5iReadOnly *bool `json:"kerberos5iReadOnly,omitempty"` - Kerberos5iReadWrite *bool `json:"kerberos5iReadWrite,omitempty"` - Kerberos5pReadOnly *bool `json:"kerberos5pReadOnly,omitempty"` - Kerberos5pReadWrite *bool `json:"kerberos5pReadWrite,omitempty"` - Nfsv3 *bool `json:"nfsv3,omitempty"` - Nfsv41 *bool `json:"nfsv41,omitempty"` - RuleIndex *int64 `json:"ruleIndex,omitempty"` - UnixReadOnly *bool `json:"unixReadOnly,omitempty"` - UnixReadWrite *bool `json:"unixReadWrite,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_mounttargetproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_mounttargetproperties.go deleted file mode 100644 index b92b9edb4154..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_mounttargetproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package volumes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MountTargetProperties struct { - FileSystemId string `json:"fileSystemId"` - IpAddress *string `json:"ipAddress,omitempty"` - MountTargetId *string `json:"mountTargetId,omitempty"` - SmbServerFqdn *string `json:"smbServerFqdn,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_placementkeyvaluepairs.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_placementkeyvaluepairs.go deleted file mode 100644 index 588e9729c1e4..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_placementkeyvaluepairs.go +++ /dev/null @@ -1,9 +0,0 @@ -package volumes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PlacementKeyValuePairs struct { - Key string `json:"key"` - Value string `json:"value"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_replicationobject.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_replicationobject.go deleted file mode 100644 index b7d6873811e2..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_replicationobject.go +++ /dev/null @@ -1,12 +0,0 @@ -package volumes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ReplicationObject struct { - EndpointType *EndpointType `json:"endpointType,omitempty"` - RemoteVolumeRegion *string `json:"remoteVolumeRegion,omitempty"` - RemoteVolumeResourceId string `json:"remoteVolumeResourceId"` - ReplicationId *string `json:"replicationId,omitempty"` - ReplicationSchedule *ReplicationSchedule `json:"replicationSchedule,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volume.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volume.go deleted file mode 100644 index f92955c95e93..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volume.go +++ /dev/null @@ -1,19 +0,0 @@ -package volumes - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Volume struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Properties VolumeProperties `json:"properties"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumebackupproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumebackupproperties.go deleted file mode 100644 index 1de25f15e330..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumebackupproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package volumes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeBackupProperties struct { - BackupEnabled *bool `json:"backupEnabled,omitempty"` - BackupPolicyId *string `json:"backupPolicyId,omitempty"` - PolicyEnforced *bool `json:"policyEnforced,omitempty"` - VaultId *string `json:"vaultId,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepatch.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepatch.go deleted file mode 100644 index b39ea01aee89..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepatch.go +++ /dev/null @@ -1,13 +0,0 @@ -package volumes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumePatch struct { - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VolumePatchProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepatchproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepatchproperties.go deleted file mode 100644 index ed4479ca252b..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepatchproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package volumes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumePatchProperties struct { - DataProtection *VolumePatchPropertiesDataProtection `json:"dataProtection,omitempty"` - DefaultGroupQuotaInKiBs *int64 `json:"defaultGroupQuotaInKiBs,omitempty"` - DefaultUserQuotaInKiBs *int64 `json:"defaultUserQuotaInKiBs,omitempty"` - ExportPolicy *VolumePatchPropertiesExportPolicy `json:"exportPolicy,omitempty"` - IsDefaultQuotaEnabled *bool `json:"isDefaultQuotaEnabled,omitempty"` - ServiceLevel *ServiceLevel `json:"serviceLevel,omitempty"` - ThroughputMibps *float64 `json:"throughputMibps,omitempty"` - UnixPermissions *string `json:"unixPermissions,omitempty"` - UsageThreshold *int64 `json:"usageThreshold,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepatchpropertiesdataprotection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepatchpropertiesdataprotection.go deleted file mode 100644 index 8c9edc10ff72..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepatchpropertiesdataprotection.go +++ /dev/null @@ -1,9 +0,0 @@ -package volumes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumePatchPropertiesDataProtection struct { - Backup *VolumeBackupProperties `json:"backup,omitempty"` - Snapshot *VolumeSnapshotProperties `json:"snapshot,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepatchpropertiesexportpolicy.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepatchpropertiesexportpolicy.go deleted file mode 100644 index ae83a5fc1b4f..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepatchpropertiesexportpolicy.go +++ /dev/null @@ -1,8 +0,0 @@ -package volumes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumePatchPropertiesExportPolicy struct { - Rules *[]ExportPolicyRule `json:"rules,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumeproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumeproperties.go deleted file mode 100644 index 6ae23e00b8da..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumeproperties.go +++ /dev/null @@ -1,49 +0,0 @@ -package volumes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeProperties struct { - AvsDataStore *AvsDataStore `json:"avsDataStore,omitempty"` - BackupId *string `json:"backupId,omitempty"` - BaremetalTenantId *string `json:"baremetalTenantId,omitempty"` - CapacityPoolResourceId *string `json:"capacityPoolResourceId,omitempty"` - CloneProgress *int64 `json:"cloneProgress,omitempty"` - CoolAccess *bool `json:"coolAccess,omitempty"` - CoolnessPeriod *int64 `json:"coolnessPeriod,omitempty"` - CreationToken string `json:"creationToken"` - DataProtection *VolumePropertiesDataProtection `json:"dataProtection,omitempty"` - DefaultGroupQuotaInKiBs *int64 `json:"defaultGroupQuotaInKiBs,omitempty"` - DefaultUserQuotaInKiBs *int64 `json:"defaultUserQuotaInKiBs,omitempty"` - EnableSubvolumes *EnableSubvolumes `json:"enableSubvolumes,omitempty"` - EncryptionKeySource *string `json:"encryptionKeySource,omitempty"` - ExportPolicy *VolumePropertiesExportPolicy `json:"exportPolicy,omitempty"` - FileSystemId *string `json:"fileSystemId,omitempty"` - IsDefaultQuotaEnabled *bool `json:"isDefaultQuotaEnabled,omitempty"` - IsRestoring *bool `json:"isRestoring,omitempty"` - KerberosEnabled *bool `json:"kerberosEnabled,omitempty"` - LdapEnabled *bool `json:"ldapEnabled,omitempty"` - MaximumNumberOfFiles *int64 `json:"maximumNumberOfFiles,omitempty"` - MountTargets *[]MountTargetProperties `json:"mountTargets,omitempty"` - NetworkFeatures *NetworkFeatures `json:"networkFeatures,omitempty"` - NetworkSiblingSetId *string `json:"networkSiblingSetId,omitempty"` - PlacementRules *[]PlacementKeyValuePairs `json:"placementRules,omitempty"` - ProtocolTypes *[]string `json:"protocolTypes,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` - ProximityPlacementGroup *string `json:"proximityPlacementGroup,omitempty"` - SecurityStyle *SecurityStyle `json:"securityStyle,omitempty"` - ServiceLevel *ServiceLevel `json:"serviceLevel,omitempty"` - SmbContinuouslyAvailable *bool `json:"smbContinuouslyAvailable,omitempty"` - SmbEncryption *bool `json:"smbEncryption,omitempty"` - SnapshotDirectoryVisible *bool `json:"snapshotDirectoryVisible,omitempty"` - SnapshotId *string `json:"snapshotId,omitempty"` - StorageToNetworkProximity *VolumeStorageToNetworkProximity `json:"storageToNetworkProximity,omitempty"` - SubnetId string `json:"subnetId"` - T2Network *string `json:"t2Network,omitempty"` - ThroughputMibps *float64 `json:"throughputMibps,omitempty"` - UnixPermissions *string `json:"unixPermissions,omitempty"` - UsageThreshold int64 `json:"usageThreshold"` - VolumeGroupName *string `json:"volumeGroupName,omitempty"` - VolumeSpecName *string `json:"volumeSpecName,omitempty"` - VolumeType *string `json:"volumeType,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepropertiesdataprotection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepropertiesdataprotection.go deleted file mode 100644 index 28163c70a51c..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepropertiesdataprotection.go +++ /dev/null @@ -1,10 +0,0 @@ -package volumes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumePropertiesDataProtection struct { - Backup *VolumeBackupProperties `json:"backup,omitempty"` - Replication *ReplicationObject `json:"replication,omitempty"` - Snapshot *VolumeSnapshotProperties `json:"snapshot,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepropertiesexportpolicy.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepropertiesexportpolicy.go deleted file mode 100644 index fda5f4739dee..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepropertiesexportpolicy.go +++ /dev/null @@ -1,8 +0,0 @@ -package volumes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumePropertiesExportPolicy struct { - Rules *[]ExportPolicyRule `json:"rules,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumesnapshotproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumesnapshotproperties.go deleted file mode 100644 index 48aba2acce0d..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumesnapshotproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package volumes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeSnapshotProperties struct { - SnapshotPolicyId *string `json:"snapshotPolicyId,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/predicates.go deleted file mode 100644 index 536d6a70dc81..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/predicates.go +++ /dev/null @@ -1,34 +0,0 @@ -package volumes - -type VolumeOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p VolumeOperationPredicate) Matches(input Volume) bool { - - if p.Etag != nil && (input.Etag == nil && *p.Etag != *input.Etag) { - return false - } - - if p.Id != nil && (input.Id == nil && *p.Id != *input.Id) { - return false - } - - if p.Location != nil && *p.Location != input.Location { - return false - } - - if p.Name != nil && (input.Name == nil && *p.Name != *input.Name) { - return false - } - - if p.Type != nil && (input.Type == nil && *p.Type != *input.Type) { - return false - } - - return true -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/version.go deleted file mode 100644 index 55ac8a54fde6..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package volumes - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-10-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/volumes/%s", defaultApiVersion) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/README.md deleted file mode 100644 index 037bd15af1bb..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/README.md +++ /dev/null @@ -1,106 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication` Documentation - -The `volumesreplication` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2021-10-01`). - -This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). - -### Import Path - -```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication" -``` - - -### Client Initialization - -```go -client := volumesreplication.NewVolumesReplicationClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VolumesReplicationClient.VolumesAuthorizeReplication` - -```go -ctx := context.TODO() -id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue") - -payload := volumesreplication.AuthorizeRequest{ - // ... -} - - -if err := client.VolumesAuthorizeReplicationThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VolumesReplicationClient.VolumesBreakReplication` - -```go -ctx := context.TODO() -id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue") - -payload := volumesreplication.BreakReplicationRequest{ - // ... -} - - -if err := client.VolumesBreakReplicationThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VolumesReplicationClient.VolumesDeleteReplication` - -```go -ctx := context.TODO() -id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue") - -if err := client.VolumesDeleteReplicationThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VolumesReplicationClient.VolumesReInitializeReplication` - -```go -ctx := context.TODO() -id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue") - -if err := client.VolumesReInitializeReplicationThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VolumesReplicationClient.VolumesReplicationStatus` - -```go -ctx := context.TODO() -id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue") - -read, err := client.VolumesReplicationStatus(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VolumesReplicationClient.VolumesResyncReplication` - -```go -ctx := context.TODO() -id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue") - -if err := client.VolumesResyncReplicationThenPoll(ctx, id); err != nil { - // handle the error -} -``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/client.go deleted file mode 100644 index 64a4d559d37e..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/client.go +++ /dev/null @@ -1,18 +0,0 @@ -package volumesreplication - -import "github.com/Azure/go-autorest/autorest" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumesReplicationClient struct { - Client autorest.Client - baseUri string -} - -func NewVolumesReplicationClientWithBaseURI(endpoint string) VolumesReplicationClient { - return VolumesReplicationClient{ - Client: autorest.NewClientWithUserAgent(userAgent()), - baseUri: endpoint, - } -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/constants.go deleted file mode 100644 index 6b67c17d5884..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/constants.go +++ /dev/null @@ -1,65 +0,0 @@ -package volumesreplication - -import "strings" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MirrorState string - -const ( - MirrorStateBroken MirrorState = "Broken" - MirrorStateMirrored MirrorState = "Mirrored" - MirrorStateUninitialized MirrorState = "Uninitialized" -) - -func PossibleValuesForMirrorState() []string { - return []string{ - string(MirrorStateBroken), - string(MirrorStateMirrored), - string(MirrorStateUninitialized), - } -} - -func parseMirrorState(input string) (*MirrorState, error) { - vals := map[string]MirrorState{ - "broken": MirrorStateBroken, - "mirrored": MirrorStateMirrored, - "uninitialized": MirrorStateUninitialized, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := MirrorState(input) - return &out, nil -} - -type RelationshipStatus string - -const ( - RelationshipStatusIdle RelationshipStatus = "Idle" - RelationshipStatusTransferring RelationshipStatus = "Transferring" -) - -func PossibleValuesForRelationshipStatus() []string { - return []string{ - string(RelationshipStatusIdle), - string(RelationshipStatusTransferring), - } -} - -func parseRelationshipStatus(input string) (*RelationshipStatus, error) { - vals := map[string]RelationshipStatus{ - "idle": RelationshipStatusIdle, - "transferring": RelationshipStatusTransferring, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RelationshipStatus(input) - return &out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/id_volume.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/id_volume.go deleted file mode 100644 index c88adaf98587..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/id_volume.go +++ /dev/null @@ -1,150 +0,0 @@ -package volumesreplication - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -var _ resourceids.ResourceId = VolumeId{} - -// VolumeId is a struct representing the Resource ID for a Volume -type VolumeId struct { - SubscriptionId string - ResourceGroupName string - AccountName string - PoolName string - VolumeName string -} - -// NewVolumeID returns a new VolumeId struct -func NewVolumeID(subscriptionId string, resourceGroupName string, accountName string, poolName string, volumeName string) VolumeId { - return VolumeId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - AccountName: accountName, - PoolName: poolName, - VolumeName: volumeName, - } -} - -// ParseVolumeID parses 'input' into a VolumeId -func ParseVolumeID(input string) (*VolumeId, error) { - parser := resourceids.NewParserFromResourceIdType(VolumeId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := VolumeId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { - return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) - } - - if id.VolumeName, ok = parsed.Parsed["volumeName"]; !ok { - return nil, fmt.Errorf("the segment 'volumeName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ParseVolumeIDInsensitively parses 'input' case-insensitively into a VolumeId -// note: this method should only be used for API response data and not user input -func ParseVolumeIDInsensitively(input string) (*VolumeId, error) { - parser := resourceids.NewParserFromResourceIdType(VolumeId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := VolumeId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { - return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) - } - - if id.VolumeName, ok = parsed.Parsed["volumeName"]; !ok { - return nil, fmt.Errorf("the segment 'volumeName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ValidateVolumeID checks that 'input' can be parsed as a Volume ID -func ValidateVolumeID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := ParseVolumeID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Volume ID -func (id VolumeId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/capacityPools/%s/volumes/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName, id.PoolName, id.VolumeName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Volume ID -func (id VolumeId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), - resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("accountName", "accountValue"), - resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("poolName", "poolValue"), - resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), - resourceids.UserSpecifiedSegment("volumeName", "volumeValue"), - } -} - -// String returns a human-readable description of this Volume ID -func (id VolumeId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Account Name: %q", id.AccountName), - fmt.Sprintf("Pool Name: %q", id.PoolName), - fmt.Sprintf("Volume Name: %q", id.VolumeName), - } - return fmt.Sprintf("Volume (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesauthorizereplication_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesauthorizereplication_autorest.go deleted file mode 100644 index 76b9f035e73f..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesauthorizereplication_autorest.go +++ /dev/null @@ -1,79 +0,0 @@ -package volumesreplication - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumesAuthorizeReplicationOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// VolumesAuthorizeReplication ... -func (c VolumesReplicationClient) VolumesAuthorizeReplication(ctx context.Context, id VolumeId, input AuthorizeRequest) (result VolumesAuthorizeReplicationOperationResponse, err error) { - req, err := c.preparerForVolumesAuthorizeReplication(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesAuthorizeReplication", nil, "Failure preparing request") - return - } - - result, err = c.senderForVolumesAuthorizeReplication(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesAuthorizeReplication", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// VolumesAuthorizeReplicationThenPoll performs VolumesAuthorizeReplication then polls until it's completed -func (c VolumesReplicationClient) VolumesAuthorizeReplicationThenPoll(ctx context.Context, id VolumeId, input AuthorizeRequest) error { - result, err := c.VolumesAuthorizeReplication(ctx, id, input) - if err != nil { - return fmt.Errorf("performing VolumesAuthorizeReplication: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after VolumesAuthorizeReplication: %+v", err) - } - - return nil -} - -// preparerForVolumesAuthorizeReplication prepares the VolumesAuthorizeReplication request. -func (c VolumesReplicationClient) preparerForVolumesAuthorizeReplication(ctx context.Context, id VolumeId, input AuthorizeRequest) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/authorizeReplication", id.ID())), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForVolumesAuthorizeReplication sends the VolumesAuthorizeReplication request. The method will close the -// http.Response Body if it receives an error. -func (c VolumesReplicationClient) senderForVolumesAuthorizeReplication(ctx context.Context, req *http.Request) (future VolumesAuthorizeReplicationOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesbreakreplication_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesbreakreplication_autorest.go deleted file mode 100644 index 2d1739198e38..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesbreakreplication_autorest.go +++ /dev/null @@ -1,79 +0,0 @@ -package volumesreplication - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumesBreakReplicationOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// VolumesBreakReplication ... -func (c VolumesReplicationClient) VolumesBreakReplication(ctx context.Context, id VolumeId, input BreakReplicationRequest) (result VolumesBreakReplicationOperationResponse, err error) { - req, err := c.preparerForVolumesBreakReplication(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesBreakReplication", nil, "Failure preparing request") - return - } - - result, err = c.senderForVolumesBreakReplication(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesBreakReplication", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// VolumesBreakReplicationThenPoll performs VolumesBreakReplication then polls until it's completed -func (c VolumesReplicationClient) VolumesBreakReplicationThenPoll(ctx context.Context, id VolumeId, input BreakReplicationRequest) error { - result, err := c.VolumesBreakReplication(ctx, id, input) - if err != nil { - return fmt.Errorf("performing VolumesBreakReplication: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after VolumesBreakReplication: %+v", err) - } - - return nil -} - -// preparerForVolumesBreakReplication prepares the VolumesBreakReplication request. -func (c VolumesReplicationClient) preparerForVolumesBreakReplication(ctx context.Context, id VolumeId, input BreakReplicationRequest) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/breakReplication", id.ID())), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForVolumesBreakReplication sends the VolumesBreakReplication request. The method will close the -// http.Response Body if it receives an error. -func (c VolumesReplicationClient) senderForVolumesBreakReplication(ctx context.Context, req *http.Request) (future VolumesBreakReplicationOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesdeletereplication_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesdeletereplication_autorest.go deleted file mode 100644 index 6dd32453b2de..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesdeletereplication_autorest.go +++ /dev/null @@ -1,78 +0,0 @@ -package volumesreplication - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumesDeleteReplicationOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// VolumesDeleteReplication ... -func (c VolumesReplicationClient) VolumesDeleteReplication(ctx context.Context, id VolumeId) (result VolumesDeleteReplicationOperationResponse, err error) { - req, err := c.preparerForVolumesDeleteReplication(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesDeleteReplication", nil, "Failure preparing request") - return - } - - result, err = c.senderForVolumesDeleteReplication(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesDeleteReplication", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// VolumesDeleteReplicationThenPoll performs VolumesDeleteReplication then polls until it's completed -func (c VolumesReplicationClient) VolumesDeleteReplicationThenPoll(ctx context.Context, id VolumeId) error { - result, err := c.VolumesDeleteReplication(ctx, id) - if err != nil { - return fmt.Errorf("performing VolumesDeleteReplication: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after VolumesDeleteReplication: %+v", err) - } - - return nil -} - -// preparerForVolumesDeleteReplication prepares the VolumesDeleteReplication request. -func (c VolumesReplicationClient) preparerForVolumesDeleteReplication(ctx context.Context, id VolumeId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/deleteReplication", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForVolumesDeleteReplication sends the VolumesDeleteReplication request. The method will close the -// http.Response Body if it receives an error. -func (c VolumesReplicationClient) senderForVolumesDeleteReplication(ctx context.Context, req *http.Request) (future VolumesDeleteReplicationOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesreinitializereplication_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesreinitializereplication_autorest.go deleted file mode 100644 index f894605753fa..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesreinitializereplication_autorest.go +++ /dev/null @@ -1,78 +0,0 @@ -package volumesreplication - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumesReInitializeReplicationOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// VolumesReInitializeReplication ... -func (c VolumesReplicationClient) VolumesReInitializeReplication(ctx context.Context, id VolumeId) (result VolumesReInitializeReplicationOperationResponse, err error) { - req, err := c.preparerForVolumesReInitializeReplication(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesReInitializeReplication", nil, "Failure preparing request") - return - } - - result, err = c.senderForVolumesReInitializeReplication(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesReInitializeReplication", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// VolumesReInitializeReplicationThenPoll performs VolumesReInitializeReplication then polls until it's completed -func (c VolumesReplicationClient) VolumesReInitializeReplicationThenPoll(ctx context.Context, id VolumeId) error { - result, err := c.VolumesReInitializeReplication(ctx, id) - if err != nil { - return fmt.Errorf("performing VolumesReInitializeReplication: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after VolumesReInitializeReplication: %+v", err) - } - - return nil -} - -// preparerForVolumesReInitializeReplication prepares the VolumesReInitializeReplication request. -func (c VolumesReplicationClient) preparerForVolumesReInitializeReplication(ctx context.Context, id VolumeId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/reinitializeReplication", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForVolumesReInitializeReplication sends the VolumesReInitializeReplication request. The method will close the -// http.Response Body if it receives an error. -func (c VolumesReplicationClient) senderForVolumesReInitializeReplication(ctx context.Context, req *http.Request) (future VolumesReInitializeReplicationOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesreplicationstatus_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesreplicationstatus_autorest.go deleted file mode 100644 index 12b0382b0cd4..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesreplicationstatus_autorest.go +++ /dev/null @@ -1,68 +0,0 @@ -package volumesreplication - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumesReplicationStatusOperationResponse struct { - HttpResponse *http.Response - Model *ReplicationStatus -} - -// VolumesReplicationStatus ... -func (c VolumesReplicationClient) VolumesReplicationStatus(ctx context.Context, id VolumeId) (result VolumesReplicationStatusOperationResponse, err error) { - req, err := c.preparerForVolumesReplicationStatus(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesReplicationStatus", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesReplicationStatus", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForVolumesReplicationStatus(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesReplicationStatus", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForVolumesReplicationStatus prepares the VolumesReplicationStatus request. -func (c VolumesReplicationClient) preparerForVolumesReplicationStatus(ctx context.Context, id VolumeId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/replicationStatus", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForVolumesReplicationStatus handles the response to the VolumesReplicationStatus request. The method always -// closes the http.Response Body. -func (c VolumesReplicationClient) responderForVolumesReplicationStatus(resp *http.Response) (result VolumesReplicationStatusOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesresyncreplication_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesresyncreplication_autorest.go deleted file mode 100644 index 05f303966fa5..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesresyncreplication_autorest.go +++ /dev/null @@ -1,78 +0,0 @@ -package volumesreplication - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumesResyncReplicationOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// VolumesResyncReplication ... -func (c VolumesReplicationClient) VolumesResyncReplication(ctx context.Context, id VolumeId) (result VolumesResyncReplicationOperationResponse, err error) { - req, err := c.preparerForVolumesResyncReplication(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesResyncReplication", nil, "Failure preparing request") - return - } - - result, err = c.senderForVolumesResyncReplication(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesResyncReplication", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// VolumesResyncReplicationThenPoll performs VolumesResyncReplication then polls until it's completed -func (c VolumesReplicationClient) VolumesResyncReplicationThenPoll(ctx context.Context, id VolumeId) error { - result, err := c.VolumesResyncReplication(ctx, id) - if err != nil { - return fmt.Errorf("performing VolumesResyncReplication: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after VolumesResyncReplication: %+v", err) - } - - return nil -} - -// preparerForVolumesResyncReplication prepares the VolumesResyncReplication request. -func (c VolumesReplicationClient) preparerForVolumesResyncReplication(ctx context.Context, id VolumeId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/resyncReplication", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForVolumesResyncReplication sends the VolumesResyncReplication request. The method will close the -// http.Response Body if it receives an error. -func (c VolumesReplicationClient) senderForVolumesResyncReplication(ctx context.Context, req *http.Request) (future VolumesResyncReplicationOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/model_authorizerequest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/model_authorizerequest.go deleted file mode 100644 index ff1cefa31efa..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/model_authorizerequest.go +++ /dev/null @@ -1,8 +0,0 @@ -package volumesreplication - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AuthorizeRequest struct { - RemoteVolumeResourceId *string `json:"remoteVolumeResourceId,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/model_breakreplicationrequest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/model_breakreplicationrequest.go deleted file mode 100644 index b6a0a179a9c6..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/model_breakreplicationrequest.go +++ /dev/null @@ -1,8 +0,0 @@ -package volumesreplication - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BreakReplicationRequest struct { - ForceBreakReplication *bool `json:"forceBreakReplication,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/model_replicationstatus.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/model_replicationstatus.go deleted file mode 100644 index 2a79dddf7a40..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/model_replicationstatus.go +++ /dev/null @@ -1,12 +0,0 @@ -package volumesreplication - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ReplicationStatus struct { - ErrorMessage *string `json:"errorMessage,omitempty"` - Healthy *bool `json:"healthy,omitempty"` - MirrorState *MirrorState `json:"mirrorState,omitempty"` - RelationshipStatus *RelationshipStatus `json:"relationshipStatus,omitempty"` - TotalProgress *string `json:"totalProgress,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/version.go deleted file mode 100644 index 5a6266022a22..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package volumesreplication - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-10-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/volumesreplication/%s", defaultApiVersion) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/README.md deleted file mode 100644 index f733a433557a..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/README.md +++ /dev/null @@ -1,81 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups` Documentation - -The `volumegroups` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2022-01-01`). - -This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). - -### Import Path - -```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups" -``` - - -### Client Initialization - -```go -client := volumegroups.NewVolumeGroupsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VolumeGroupsClient.VolumeGroupsCreate` - -```go -ctx := context.TODO() -id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "volumeGroupValue") - -payload := volumegroups.VolumeGroupDetails{ - // ... -} - - -if err := client.VolumeGroupsCreateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VolumeGroupsClient.VolumeGroupsDelete` - -```go -ctx := context.TODO() -id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "volumeGroupValue") - -if err := client.VolumeGroupsDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VolumeGroupsClient.VolumeGroupsGet` - -```go -ctx := context.TODO() -id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "volumeGroupValue") - -read, err := client.VolumeGroupsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VolumeGroupsClient.VolumeGroupsListByNetAppAccount` - -```go -ctx := context.TODO() -id := volumegroups.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") - -read, err := client.VolumeGroupsListByNetAppAccount(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/client.go deleted file mode 100644 index c7beab84b9a1..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/client.go +++ /dev/null @@ -1,18 +0,0 @@ -package volumegroups - -import "github.com/Azure/go-autorest/autorest" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeGroupsClient struct { - Client autorest.Client - baseUri string -} - -func NewVolumeGroupsClientWithBaseURI(endpoint string) VolumeGroupsClient { - return VolumeGroupsClient{ - Client: autorest.NewClientWithUserAgent(userAgent()), - baseUri: endpoint, - } -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/constants.go deleted file mode 100644 index 6eb9b8afe4fb..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/constants.go +++ /dev/null @@ -1,320 +0,0 @@ -package volumegroups - -import "strings" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationType string - -const ( - ApplicationTypeSAPNegativeHANA ApplicationType = "SAP-HANA" -) - -func PossibleValuesForApplicationType() []string { - return []string{ - string(ApplicationTypeSAPNegativeHANA), - } -} - -func parseApplicationType(input string) (*ApplicationType, error) { - vals := map[string]ApplicationType{ - "sap-hana": ApplicationTypeSAPNegativeHANA, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationType(input) - return &out, nil -} - -type AvsDataStore string - -const ( - AvsDataStoreDisabled AvsDataStore = "Disabled" - AvsDataStoreEnabled AvsDataStore = "Enabled" -) - -func PossibleValuesForAvsDataStore() []string { - return []string{ - string(AvsDataStoreDisabled), - string(AvsDataStoreEnabled), - } -} - -func parseAvsDataStore(input string) (*AvsDataStore, error) { - vals := map[string]AvsDataStore{ - "disabled": AvsDataStoreDisabled, - "enabled": AvsDataStoreEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AvsDataStore(input) - return &out, nil -} - -type ChownMode string - -const ( - ChownModeRestricted ChownMode = "Restricted" - ChownModeUnrestricted ChownMode = "Unrestricted" -) - -func PossibleValuesForChownMode() []string { - return []string{ - string(ChownModeRestricted), - string(ChownModeUnrestricted), - } -} - -func parseChownMode(input string) (*ChownMode, error) { - vals := map[string]ChownMode{ - "restricted": ChownModeRestricted, - "unrestricted": ChownModeUnrestricted, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ChownMode(input) - return &out, nil -} - -type EnableSubvolumes string - -const ( - EnableSubvolumesDisabled EnableSubvolumes = "Disabled" - EnableSubvolumesEnabled EnableSubvolumes = "Enabled" -) - -func PossibleValuesForEnableSubvolumes() []string { - return []string{ - string(EnableSubvolumesDisabled), - string(EnableSubvolumesEnabled), - } -} - -func parseEnableSubvolumes(input string) (*EnableSubvolumes, error) { - vals := map[string]EnableSubvolumes{ - "disabled": EnableSubvolumesDisabled, - "enabled": EnableSubvolumesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EnableSubvolumes(input) - return &out, nil -} - -type EncryptionKeySource string - -const ( - EncryptionKeySourceMicrosoftPointNetApp EncryptionKeySource = "Microsoft.NetApp" -) - -func PossibleValuesForEncryptionKeySource() []string { - return []string{ - string(EncryptionKeySourceMicrosoftPointNetApp), - } -} - -func parseEncryptionKeySource(input string) (*EncryptionKeySource, error) { - vals := map[string]EncryptionKeySource{ - "microsoft.netapp": EncryptionKeySourceMicrosoftPointNetApp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EncryptionKeySource(input) - return &out, nil -} - -type EndpointType string - -const ( - EndpointTypeDst EndpointType = "dst" - EndpointTypeSrc EndpointType = "src" -) - -func PossibleValuesForEndpointType() []string { - return []string{ - string(EndpointTypeDst), - string(EndpointTypeSrc), - } -} - -func parseEndpointType(input string) (*EndpointType, error) { - vals := map[string]EndpointType{ - "dst": EndpointTypeDst, - "src": EndpointTypeSrc, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EndpointType(input) - return &out, nil -} - -type NetworkFeatures string - -const ( - NetworkFeaturesBasic NetworkFeatures = "Basic" - NetworkFeaturesStandard NetworkFeatures = "Standard" -) - -func PossibleValuesForNetworkFeatures() []string { - return []string{ - string(NetworkFeaturesBasic), - string(NetworkFeaturesStandard), - } -} - -func parseNetworkFeatures(input string) (*NetworkFeatures, error) { - vals := map[string]NetworkFeatures{ - "basic": NetworkFeaturesBasic, - "standard": NetworkFeaturesStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkFeatures(input) - return &out, nil -} - -type ReplicationSchedule string - -const ( - ReplicationScheduleDaily ReplicationSchedule = "daily" - ReplicationScheduleHourly ReplicationSchedule = "hourly" - ReplicationScheduleOneZerominutely ReplicationSchedule = "_10minutely" -) - -func PossibleValuesForReplicationSchedule() []string { - return []string{ - string(ReplicationScheduleDaily), - string(ReplicationScheduleHourly), - string(ReplicationScheduleOneZerominutely), - } -} - -func parseReplicationSchedule(input string) (*ReplicationSchedule, error) { - vals := map[string]ReplicationSchedule{ - "daily": ReplicationScheduleDaily, - "hourly": ReplicationScheduleHourly, - "_10minutely": ReplicationScheduleOneZerominutely, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ReplicationSchedule(input) - return &out, nil -} - -type SecurityStyle string - -const ( - SecurityStyleNtfs SecurityStyle = "ntfs" - SecurityStyleUnix SecurityStyle = "unix" -) - -func PossibleValuesForSecurityStyle() []string { - return []string{ - string(SecurityStyleNtfs), - string(SecurityStyleUnix), - } -} - -func parseSecurityStyle(input string) (*SecurityStyle, error) { - vals := map[string]SecurityStyle{ - "ntfs": SecurityStyleNtfs, - "unix": SecurityStyleUnix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityStyle(input) - return &out, nil -} - -type ServiceLevel string - -const ( - ServiceLevelPremium ServiceLevel = "Premium" - ServiceLevelStandard ServiceLevel = "Standard" - ServiceLevelStandardZRS ServiceLevel = "StandardZRS" - ServiceLevelUltra ServiceLevel = "Ultra" -) - -func PossibleValuesForServiceLevel() []string { - return []string{ - string(ServiceLevelPremium), - string(ServiceLevelStandard), - string(ServiceLevelStandardZRS), - string(ServiceLevelUltra), - } -} - -func parseServiceLevel(input string) (*ServiceLevel, error) { - vals := map[string]ServiceLevel{ - "premium": ServiceLevelPremium, - "standard": ServiceLevelStandard, - "standardzrs": ServiceLevelStandardZRS, - "ultra": ServiceLevelUltra, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ServiceLevel(input) - return &out, nil -} - -type VolumeStorageToNetworkProximity string - -const ( - VolumeStorageToNetworkProximityDefault VolumeStorageToNetworkProximity = "Default" - VolumeStorageToNetworkProximityTOne VolumeStorageToNetworkProximity = "T1" - VolumeStorageToNetworkProximityTTwo VolumeStorageToNetworkProximity = "T2" -) - -func PossibleValuesForVolumeStorageToNetworkProximity() []string { - return []string{ - string(VolumeStorageToNetworkProximityDefault), - string(VolumeStorageToNetworkProximityTOne), - string(VolumeStorageToNetworkProximityTTwo), - } -} - -func parseVolumeStorageToNetworkProximity(input string) (*VolumeStorageToNetworkProximity, error) { - vals := map[string]VolumeStorageToNetworkProximity{ - "default": VolumeStorageToNetworkProximityDefault, - "t1": VolumeStorageToNetworkProximityTOne, - "t2": VolumeStorageToNetworkProximityTTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VolumeStorageToNetworkProximity(input) - return &out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/id_netappaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/id_netappaccount.go deleted file mode 100644 index 7b31002a4246..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/id_netappaccount.go +++ /dev/null @@ -1,124 +0,0 @@ -package volumegroups - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -var _ resourceids.ResourceId = NetAppAccountId{} - -// NetAppAccountId is a struct representing the Resource ID for a Net App Account -type NetAppAccountId struct { - SubscriptionId string - ResourceGroupName string - AccountName string -} - -// NewNetAppAccountID returns a new NetAppAccountId struct -func NewNetAppAccountID(subscriptionId string, resourceGroupName string, accountName string) NetAppAccountId { - return NetAppAccountId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - AccountName: accountName, - } -} - -// ParseNetAppAccountID parses 'input' into a NetAppAccountId -func ParseNetAppAccountID(input string) (*NetAppAccountId, error) { - parser := resourceids.NewParserFromResourceIdType(NetAppAccountId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := NetAppAccountId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ParseNetAppAccountIDInsensitively parses 'input' case-insensitively into a NetAppAccountId -// note: this method should only be used for API response data and not user input -func ParseNetAppAccountIDInsensitively(input string) (*NetAppAccountId, error) { - parser := resourceids.NewParserFromResourceIdType(NetAppAccountId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := NetAppAccountId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ValidateNetAppAccountID checks that 'input' can be parsed as a Net App Account ID -func ValidateNetAppAccountID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := ParseNetAppAccountID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Net App Account ID -func (id NetAppAccountId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Net App Account ID -func (id NetAppAccountId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), - resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("accountName", "accountValue"), - } -} - -// String returns a human-readable description of this Net App Account ID -func (id NetAppAccountId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Account Name: %q", id.AccountName), - } - return fmt.Sprintf("Net App Account (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/id_volumegroup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/id_volumegroup.go deleted file mode 100644 index a49d03263509..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/id_volumegroup.go +++ /dev/null @@ -1,137 +0,0 @@ -package volumegroups - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -var _ resourceids.ResourceId = VolumeGroupId{} - -// VolumeGroupId is a struct representing the Resource ID for a Volume Group -type VolumeGroupId struct { - SubscriptionId string - ResourceGroupName string - AccountName string - VolumeGroupName string -} - -// NewVolumeGroupID returns a new VolumeGroupId struct -func NewVolumeGroupID(subscriptionId string, resourceGroupName string, accountName string, volumeGroupName string) VolumeGroupId { - return VolumeGroupId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - AccountName: accountName, - VolumeGroupName: volumeGroupName, - } -} - -// ParseVolumeGroupID parses 'input' into a VolumeGroupId -func ParseVolumeGroupID(input string) (*VolumeGroupId, error) { - parser := resourceids.NewParserFromResourceIdType(VolumeGroupId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := VolumeGroupId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - if id.VolumeGroupName, ok = parsed.Parsed["volumeGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'volumeGroupName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ParseVolumeGroupIDInsensitively parses 'input' case-insensitively into a VolumeGroupId -// note: this method should only be used for API response data and not user input -func ParseVolumeGroupIDInsensitively(input string) (*VolumeGroupId, error) { - parser := resourceids.NewParserFromResourceIdType(VolumeGroupId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := VolumeGroupId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - if id.VolumeGroupName, ok = parsed.Parsed["volumeGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'volumeGroupName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ValidateVolumeGroupID checks that 'input' can be parsed as a Volume Group ID -func ValidateVolumeGroupID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := ParseVolumeGroupID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Volume Group ID -func (id VolumeGroupId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/volumeGroups/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName, id.VolumeGroupName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Volume Group ID -func (id VolumeGroupId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), - resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("accountName", "accountValue"), - resourceids.StaticSegment("staticVolumeGroups", "volumeGroups", "volumeGroups"), - resourceids.UserSpecifiedSegment("volumeGroupName", "volumeGroupValue"), - } -} - -// String returns a human-readable description of this Volume Group ID -func (id VolumeGroupId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Account Name: %q", id.AccountName), - fmt.Sprintf("Volume Group Name: %q", id.VolumeGroupName), - } - return fmt.Sprintf("Volume Group (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupscreate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupscreate_autorest.go deleted file mode 100644 index ee9616617b30..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupscreate_autorest.go +++ /dev/null @@ -1,79 +0,0 @@ -package volumegroups - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeGroupsCreateOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// VolumeGroupsCreate ... -func (c VolumeGroupsClient) VolumeGroupsCreate(ctx context.Context, id VolumeGroupId, input VolumeGroupDetails) (result VolumeGroupsCreateOperationResponse, err error) { - req, err := c.preparerForVolumeGroupsCreate(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsCreate", nil, "Failure preparing request") - return - } - - result, err = c.senderForVolumeGroupsCreate(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsCreate", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// VolumeGroupsCreateThenPoll performs VolumeGroupsCreate then polls until it's completed -func (c VolumeGroupsClient) VolumeGroupsCreateThenPoll(ctx context.Context, id VolumeGroupId, input VolumeGroupDetails) error { - result, err := c.VolumeGroupsCreate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing VolumeGroupsCreate: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after VolumeGroupsCreate: %+v", err) - } - - return nil -} - -// preparerForVolumeGroupsCreate prepares the VolumeGroupsCreate request. -func (c VolumeGroupsClient) preparerForVolumeGroupsCreate(ctx context.Context, id VolumeGroupId, input VolumeGroupDetails) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForVolumeGroupsCreate sends the VolumeGroupsCreate request. The method will close the -// http.Response Body if it receives an error. -func (c VolumeGroupsClient) senderForVolumeGroupsCreate(ctx context.Context, req *http.Request) (future VolumeGroupsCreateOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupsdelete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupsdelete_autorest.go deleted file mode 100644 index b3cba81e1756..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupsdelete_autorest.go +++ /dev/null @@ -1,78 +0,0 @@ -package volumegroups - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeGroupsDeleteOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// VolumeGroupsDelete ... -func (c VolumeGroupsClient) VolumeGroupsDelete(ctx context.Context, id VolumeGroupId) (result VolumeGroupsDeleteOperationResponse, err error) { - req, err := c.preparerForVolumeGroupsDelete(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsDelete", nil, "Failure preparing request") - return - } - - result, err = c.senderForVolumeGroupsDelete(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsDelete", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// VolumeGroupsDeleteThenPoll performs VolumeGroupsDelete then polls until it's completed -func (c VolumeGroupsClient) VolumeGroupsDeleteThenPoll(ctx context.Context, id VolumeGroupId) error { - result, err := c.VolumeGroupsDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing VolumeGroupsDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after VolumeGroupsDelete: %+v", err) - } - - return nil -} - -// preparerForVolumeGroupsDelete prepares the VolumeGroupsDelete request. -func (c VolumeGroupsClient) preparerForVolumeGroupsDelete(ctx context.Context, id VolumeGroupId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsDelete(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForVolumeGroupsDelete sends the VolumeGroupsDelete request. The method will close the -// http.Response Body if it receives an error. -func (c VolumeGroupsClient) senderForVolumeGroupsDelete(ctx context.Context, req *http.Request) (future VolumeGroupsDeleteOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupsget_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupsget_autorest.go deleted file mode 100644 index d52a1f2e8c2e..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupsget_autorest.go +++ /dev/null @@ -1,67 +0,0 @@ -package volumegroups - -import ( - "context" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeGroupsGetOperationResponse struct { - HttpResponse *http.Response - Model *VolumeGroupDetails -} - -// VolumeGroupsGet ... -func (c VolumeGroupsClient) VolumeGroupsGet(ctx context.Context, id VolumeGroupId) (result VolumeGroupsGetOperationResponse, err error) { - req, err := c.preparerForVolumeGroupsGet(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsGet", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsGet", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForVolumeGroupsGet(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsGet", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForVolumeGroupsGet prepares the VolumeGroupsGet request. -func (c VolumeGroupsClient) preparerForVolumeGroupsGet(ctx context.Context, id VolumeGroupId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForVolumeGroupsGet handles the response to the VolumeGroupsGet request. The method always -// closes the http.Response Body. -func (c VolumeGroupsClient) responderForVolumeGroupsGet(resp *http.Response) (result VolumeGroupsGetOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupslistbynetappaccount_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupslistbynetappaccount_autorest.go deleted file mode 100644 index 92517aeaf6f2..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupslistbynetappaccount_autorest.go +++ /dev/null @@ -1,68 +0,0 @@ -package volumegroups - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeGroupsListByNetAppAccountOperationResponse struct { - HttpResponse *http.Response - Model *VolumeGroupList -} - -// VolumeGroupsListByNetAppAccount ... -func (c VolumeGroupsClient) VolumeGroupsListByNetAppAccount(ctx context.Context, id NetAppAccountId) (result VolumeGroupsListByNetAppAccountOperationResponse, err error) { - req, err := c.preparerForVolumeGroupsListByNetAppAccount(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsListByNetAppAccount", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsListByNetAppAccount", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForVolumeGroupsListByNetAppAccount(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsListByNetAppAccount", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForVolumeGroupsListByNetAppAccount prepares the VolumeGroupsListByNetAppAccount request. -func (c VolumeGroupsClient) preparerForVolumeGroupsListByNetAppAccount(ctx context.Context, id NetAppAccountId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/volumeGroups", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForVolumeGroupsListByNetAppAccount handles the response to the VolumeGroupsListByNetAppAccount request. The method always -// closes the http.Response Body. -func (c VolumeGroupsClient) responderForVolumeGroupsListByNetAppAccount(resp *http.Response) (result VolumeGroupsListByNetAppAccountOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_exportpolicyrule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_exportpolicyrule.go deleted file mode 100644 index e17395ba1a77..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_exportpolicyrule.go +++ /dev/null @@ -1,22 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExportPolicyRule struct { - AllowedClients *string `json:"allowedClients,omitempty"` - ChownMode *ChownMode `json:"chownMode,omitempty"` - Cifs *bool `json:"cifs,omitempty"` - HasRootAccess *bool `json:"hasRootAccess,omitempty"` - Kerberos5ReadOnly *bool `json:"kerberos5ReadOnly,omitempty"` - Kerberos5ReadWrite *bool `json:"kerberos5ReadWrite,omitempty"` - Kerberos5iReadOnly *bool `json:"kerberos5iReadOnly,omitempty"` - Kerberos5iReadWrite *bool `json:"kerberos5iReadWrite,omitempty"` - Kerberos5pReadOnly *bool `json:"kerberos5pReadOnly,omitempty"` - Kerberos5pReadWrite *bool `json:"kerberos5pReadWrite,omitempty"` - Nfsv3 *bool `json:"nfsv3,omitempty"` - Nfsv41 *bool `json:"nfsv41,omitempty"` - RuleIndex *int64 `json:"ruleIndex,omitempty"` - UnixReadOnly *bool `json:"unixReadOnly,omitempty"` - UnixReadWrite *bool `json:"unixReadWrite,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_mounttargetproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_mounttargetproperties.go deleted file mode 100644 index c59cc0dbf3e7..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_mounttargetproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MountTargetProperties struct { - FileSystemId string `json:"fileSystemId"` - IpAddress *string `json:"ipAddress,omitempty"` - MountTargetId *string `json:"mountTargetId,omitempty"` - SmbServerFqdn *string `json:"smbServerFqdn,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_placementkeyvaluepairs.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_placementkeyvaluepairs.go deleted file mode 100644 index 1714b1662a1d..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_placementkeyvaluepairs.go +++ /dev/null @@ -1,9 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PlacementKeyValuePairs struct { - Key string `json:"key"` - Value string `json:"value"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_replicationobject.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_replicationobject.go deleted file mode 100644 index 6d145aa00798..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_replicationobject.go +++ /dev/null @@ -1,12 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ReplicationObject struct { - EndpointType *EndpointType `json:"endpointType,omitempty"` - RemoteVolumeRegion *string `json:"remoteVolumeRegion,omitempty"` - RemoteVolumeResourceId string `json:"remoteVolumeResourceId"` - ReplicationId *string `json:"replicationId,omitempty"` - ReplicationSchedule *ReplicationSchedule `json:"replicationSchedule,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumebackupproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumebackupproperties.go deleted file mode 100644 index 1141229b560a..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumebackupproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeBackupProperties struct { - BackupEnabled *bool `json:"backupEnabled,omitempty"` - BackupPolicyId *string `json:"backupPolicyId,omitempty"` - PolicyEnforced *bool `json:"policyEnforced,omitempty"` - VaultId *string `json:"vaultId,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroup.go deleted file mode 100644 index 5e4df7bb9c04..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroup.go +++ /dev/null @@ -1,12 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeGroup struct { - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VolumeGroupListProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupdetails.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupdetails.go deleted file mode 100644 index 5f01af82c0f7..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupdetails.go +++ /dev/null @@ -1,12 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeGroupDetails struct { - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VolumeGroupProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegrouplist.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegrouplist.go deleted file mode 100644 index 447c6e6e8588..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegrouplist.go +++ /dev/null @@ -1,8 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeGroupList struct { - Value *[]VolumeGroup `json:"value,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegrouplistproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegrouplistproperties.go deleted file mode 100644 index 5788ee516fc1..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegrouplistproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeGroupListProperties struct { - GroupMetaData *VolumeGroupMetaData `json:"groupMetaData,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupmetadata.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupmetadata.go deleted file mode 100644 index 30441c6826d5..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupmetadata.go +++ /dev/null @@ -1,13 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeGroupMetaData struct { - ApplicationIdentifier *string `json:"applicationIdentifier,omitempty"` - ApplicationType *ApplicationType `json:"applicationType,omitempty"` - DeploymentSpecId *string `json:"deploymentSpecId,omitempty"` - GlobalPlacementRules *[]PlacementKeyValuePairs `json:"globalPlacementRules,omitempty"` - GroupDescription *string `json:"groupDescription,omitempty"` - VolumesCount *int64 `json:"volumesCount,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupproperties.go deleted file mode 100644 index 0bab153b397e..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeGroupProperties struct { - GroupMetaData *VolumeGroupMetaData `json:"groupMetaData,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` - Volumes *[]VolumeGroupVolumeProperties `json:"volumes,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupvolumeproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupvolumeproperties.go deleted file mode 100644 index 61bbdab9ce3e..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupvolumeproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeGroupVolumeProperties struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties VolumeProperties `json:"properties"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumeproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumeproperties.go deleted file mode 100644 index 357c68e318fa..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumeproperties.go +++ /dev/null @@ -1,50 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeProperties struct { - AvsDataStore *AvsDataStore `json:"avsDataStore,omitempty"` - BackupId *string `json:"backupId,omitempty"` - BaremetalTenantId *string `json:"baremetalTenantId,omitempty"` - CapacityPoolResourceId *string `json:"capacityPoolResourceId,omitempty"` - CloneProgress *int64 `json:"cloneProgress,omitempty"` - CoolAccess *bool `json:"coolAccess,omitempty"` - CoolnessPeriod *int64 `json:"coolnessPeriod,omitempty"` - CreationToken string `json:"creationToken"` - DataProtection *VolumePropertiesDataProtection `json:"dataProtection,omitempty"` - DefaultGroupQuotaInKiBs *int64 `json:"defaultGroupQuotaInKiBs,omitempty"` - DefaultUserQuotaInKiBs *int64 `json:"defaultUserQuotaInKiBs,omitempty"` - EnableSubvolumes *EnableSubvolumes `json:"enableSubvolumes,omitempty"` - Encrypted *bool `json:"encrypted,omitempty"` - EncryptionKeySource *EncryptionKeySource `json:"encryptionKeySource,omitempty"` - ExportPolicy *VolumePropertiesExportPolicy `json:"exportPolicy,omitempty"` - FileSystemId *string `json:"fileSystemId,omitempty"` - IsDefaultQuotaEnabled *bool `json:"isDefaultQuotaEnabled,omitempty"` - IsRestoring *bool `json:"isRestoring,omitempty"` - KerberosEnabled *bool `json:"kerberosEnabled,omitempty"` - LdapEnabled *bool `json:"ldapEnabled,omitempty"` - MaximumNumberOfFiles *int64 `json:"maximumNumberOfFiles,omitempty"` - MountTargets *[]MountTargetProperties `json:"mountTargets,omitempty"` - NetworkFeatures *NetworkFeatures `json:"networkFeatures,omitempty"` - NetworkSiblingSetId *string `json:"networkSiblingSetId,omitempty"` - PlacementRules *[]PlacementKeyValuePairs `json:"placementRules,omitempty"` - ProtocolTypes *[]string `json:"protocolTypes,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` - ProximityPlacementGroup *string `json:"proximityPlacementGroup,omitempty"` - SecurityStyle *SecurityStyle `json:"securityStyle,omitempty"` - ServiceLevel *ServiceLevel `json:"serviceLevel,omitempty"` - SmbContinuouslyAvailable *bool `json:"smbContinuouslyAvailable,omitempty"` - SmbEncryption *bool `json:"smbEncryption,omitempty"` - SnapshotDirectoryVisible *bool `json:"snapshotDirectoryVisible,omitempty"` - SnapshotId *string `json:"snapshotId,omitempty"` - StorageToNetworkProximity *VolumeStorageToNetworkProximity `json:"storageToNetworkProximity,omitempty"` - SubnetId string `json:"subnetId"` - T2Network *string `json:"t2Network,omitempty"` - ThroughputMibps *float64 `json:"throughputMibps,omitempty"` - UnixPermissions *string `json:"unixPermissions,omitempty"` - UsageThreshold int64 `json:"usageThreshold"` - VolumeGroupName *string `json:"volumeGroupName,omitempty"` - VolumeSpecName *string `json:"volumeSpecName,omitempty"` - VolumeType *string `json:"volumeType,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumepropertiesdataprotection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumepropertiesdataprotection.go deleted file mode 100644 index 5cde3ecbaacc..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumepropertiesdataprotection.go +++ /dev/null @@ -1,10 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumePropertiesDataProtection struct { - Backup *VolumeBackupProperties `json:"backup,omitempty"` - Replication *ReplicationObject `json:"replication,omitempty"` - Snapshot *VolumeSnapshotProperties `json:"snapshot,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumepropertiesexportpolicy.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumepropertiesexportpolicy.go deleted file mode 100644 index 227c8586d6f2..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumepropertiesexportpolicy.go +++ /dev/null @@ -1,8 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumePropertiesExportPolicy struct { - Rules *[]ExportPolicyRule `json:"rules,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumesnapshotproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumesnapshotproperties.go deleted file mode 100644 index a3f5011da3b0..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumesnapshotproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeSnapshotProperties struct { - SnapshotPolicyId *string `json:"snapshotPolicyId,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/version.go deleted file mode 100644 index a2c68d24f1a6..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package volumegroups - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-01-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/volumegroups/%s", defaultApiVersion) -} From cab0347d6d05995b697a58c59422a2b17ec2e381 Mon Sep 17 00:00:00 2001 From: Matthew Frahry Date: Fri, 15 Jul 2022 14:31:28 -0700 Subject: [PATCH 10/83] Upgo mod vendor --- .../Azure/go-autorest/autorest/adal/README.md | 8 +- .../Azure/go-autorest/autorest/adal/token.go | 90 ++++- vendor/github.com/golang-jwt/jwt/v4/README.md | 29 +- .../github.com/golang-jwt/jwt/v4/SECURITY.md | 19 ++ .../github.com/golang-jwt/jwt/v4/rsa_pss.go | 1 + vendor/github.com/golang-jwt/jwt/v4/token.go | 1 - vendor/github.com/golang-jwt/jwt/v4/types.go | 20 +- .../authentication/environment.go | 2 +- .../netapp/2021-10-01/capacitypools/README.md | 99 ++++++ .../netapp/2021-10-01/capacitypools/client.go | 18 + .../2021-10-01/capacitypools/constants.go | 96 ++++++ .../capacitypools/id_capacitypool.go | 137 ++++++++ .../capacitypools/id_netappaccount.go | 124 +++++++ .../method_poolscreateorupdate_autorest.go | 79 +++++ .../method_poolsdelete_autorest.go | 78 +++++ .../capacitypools/method_poolsget_autorest.go | 67 ++++ .../method_poolslist_autorest.go | 186 ++++++++++ .../method_poolsupdate_autorest.go | 79 +++++ .../capacitypools/model_capacitypool.go | 19 ++ .../capacitypools/model_capacitypoolpatch.go | 13 + .../model_poolpatchproperties.go | 9 + .../capacitypools/model_poolproperties.go | 16 + .../2021-10-01/capacitypools/predicates.go | 34 ++ .../2021-10-01/capacitypools/version.go | 12 + .../2021-10-01/netappaccounts/README.md | 116 +++++++ .../2021-10-01/netappaccounts/client.go | 18 + .../2021-10-01/netappaccounts/constants.go | 43 +++ .../netappaccounts/id_netappaccount.go | 124 +++++++ .../method_accountscreateorupdate_autorest.go | 79 +++++ .../method_accountsdelete_autorest.go | 78 +++++ .../method_accountsget_autorest.go | 67 ++++ .../method_accountslist_autorest.go | 187 ++++++++++ ...hod_accountslistbysubscription_autorest.go | 187 ++++++++++ .../method_accountsupdate_autorest.go | 79 +++++ .../netappaccounts/model_accountencryption.go | 8 + .../netappaccounts/model_accountproperties.go | 10 + .../netappaccounts/model_activedirectory.go | 29 ++ .../model_ldapsearchscopeopt.go | 10 + .../netappaccounts/model_netappaccount.go | 19 ++ .../model_netappaccountpatch.go | 13 + .../2021-10-01/netappaccounts/predicates.go | 34 ++ .../2021-10-01/netappaccounts/version.go | 12 + .../2021-10-01/snapshotpolicy/README.md | 102 ++++++ .../2021-10-01/snapshotpolicy/client.go | 18 + .../snapshotpolicy/id_netappaccount.go | 124 +++++++ .../snapshotpolicy/id_snapshotpolicies.go | 137 ++++++++ .../method_snapshotpoliciescreate_autorest.go | 68 ++++ .../method_snapshotpoliciesdelete_autorest.go | 78 +++++ .../method_snapshotpoliciesget_autorest.go | 67 ++++ .../method_snapshotpolicieslist_autorest.go | 68 ++++ .../method_snapshotpoliciesupdate_autorest.go | 79 +++++ .../snapshotpolicy/model_dailyschedule.go | 11 + .../snapshotpolicy/model_hourlyschedule.go | 10 + .../snapshotpolicy/model_monthlyschedule.go | 12 + .../model_snapshotpolicieslist.go | 8 + .../snapshotpolicy/model_snapshotpolicy.go | 19 ++ .../model_snapshotpolicypatch.go | 13 + .../model_snapshotpolicyproperties.go | 13 + .../snapshotpolicy/model_weeklyschedule.go | 12 + .../2021-10-01/snapshotpolicy/version.go | 12 + .../netapp/2021-10-01/snapshots/README.md | 111 ++++++ .../netapp/2021-10-01/snapshots/client.go | 18 + .../2021-10-01/snapshots/id_snapshot.go | 163 +++++++++ .../netapp/2021-10-01/snapshots/id_volume.go | 150 ++++++++ .../snapshots/method_create_autorest.go | 79 +++++ .../snapshots/method_delete_autorest.go | 78 +++++ .../snapshots/method_get_autorest.go | 67 ++++ .../snapshots/method_list_autorest.go | 68 ++++ .../snapshots/method_restorefiles_autorest.go | 79 +++++ .../snapshots/method_update_autorest.go | 79 +++++ .../2021-10-01/snapshots/model_snapshot.go | 12 + .../snapshots/model_snapshotproperties.go | 28 ++ .../snapshots/model_snapshotrestorefiles.go | 9 + .../snapshots/model_snapshotslist.go | 8 + .../netapp/2021-10-01/snapshots/version.go | 12 + .../netapp/2021-10-01/volumegroups/README.md | 81 +++++ .../netapp/2021-10-01/volumegroups/client.go | 18 + .../2021-10-01/volumegroups/constants.go | 295 ++++++++++++++++ .../volumegroups/id_netappaccount.go | 124 +++++++ .../2021-10-01/volumegroups/id_volumegroup.go | 137 ++++++++ .../method_volumegroupscreate_autorest.go | 79 +++++ .../method_volumegroupsdelete_autorest.go | 78 +++++ .../method_volumegroupsget_autorest.go | 67 ++++ ...olumegroupslistbynetappaccount_autorest.go | 68 ++++ .../volumegroups/model_exportpolicyrule.go | 22 ++ .../model_mounttargetproperties.go | 11 + .../model_placementkeyvaluepairs.go | 9 + .../volumegroups/model_replicationobject.go | 12 + .../model_volumebackupproperties.go | 11 + .../volumegroups/model_volumegroup.go | 12 + .../volumegroups/model_volumegroupdetails.go | 13 + .../volumegroups/model_volumegrouplist.go | 8 + .../model_volumegrouplistproperties.go | 9 + .../volumegroups/model_volumegroupmetadata.go | 13 + .../model_volumegroupproperties.go | 10 + .../model_volumegroupvolumeproperties.go | 12 + .../volumegroups/model_volumeproperties.go | 49 +++ .../model_volumepropertiesdataprotection.go | 10 + .../model_volumepropertiesexportpolicy.go | 8 + .../model_volumesnapshotproperties.go | 8 + .../netapp/2021-10-01/volumegroups/version.go | 12 + .../netapp/2021-10-01/volumes/README.md | 99 ++++++ .../netapp/2021-10-01/volumes/client.go | 18 + .../netapp/2021-10-01/volumes/constants.go | 270 +++++++++++++++ .../2021-10-01/volumes/id_capacitypool.go | 137 ++++++++ .../netapp/2021-10-01/volumes/id_volume.go | 150 ++++++++ .../volumes/method_createorupdate_autorest.go | 79 +++++ .../volumes/method_delete_autorest.go | 107 ++++++ .../2021-10-01/volumes/method_get_autorest.go | 67 ++++ .../volumes/method_list_autorest.go | 186 ++++++++++ .../volumes/method_update_autorest.go | 79 +++++ .../volumes/model_exportpolicyrule.go | 22 ++ .../volumes/model_mounttargetproperties.go | 11 + .../volumes/model_placementkeyvaluepairs.go | 9 + .../volumes/model_replicationobject.go | 12 + .../netapp/2021-10-01/volumes/model_volume.go | 19 ++ .../volumes/model_volumebackupproperties.go | 11 + .../2021-10-01/volumes/model_volumepatch.go | 13 + .../volumes/model_volumepatchproperties.go | 16 + ...del_volumepatchpropertiesdataprotection.go | 9 + ...model_volumepatchpropertiesexportpolicy.go | 8 + .../volumes/model_volumeproperties.go | 49 +++ .../model_volumepropertiesdataprotection.go | 10 + .../model_volumepropertiesexportpolicy.go | 8 + .../volumes/model_volumesnapshotproperties.go | 8 + .../netapp/2021-10-01/volumes/predicates.go | 34 ++ .../netapp/2021-10-01/volumes/version.go | 12 + .../2021-10-01/volumesreplication/README.md | 106 ++++++ .../2021-10-01/volumesreplication/client.go | 18 + .../volumesreplication/constants.go | 65 ++++ .../volumesreplication/id_volume.go | 150 ++++++++ ...od_volumesauthorizereplication_autorest.go | 79 +++++ ...method_volumesbreakreplication_autorest.go | 79 +++++ ...ethod_volumesdeletereplication_autorest.go | 78 +++++ ...volumesreinitializereplication_autorest.go | 78 +++++ ...ethod_volumesreplicationstatus_autorest.go | 68 ++++ ...ethod_volumesresyncreplication_autorest.go | 78 +++++ .../model_authorizerequest.go | 8 + .../model_breakreplicationrequest.go | 8 + .../model_replicationstatus.go | 12 + .../2021-10-01/volumesreplication/version.go | 12 + .../netapp/2022-01-01/capacitypools/README.md | 99 ++++++ .../netapp/2022-01-01/capacitypools/client.go | 18 + .../2022-01-01/capacitypools/constants.go | 96 ++++++ .../capacitypools/id_capacitypool.go | 137 ++++++++ .../capacitypools/id_netappaccount.go | 124 +++++++ .../method_poolscreateorupdate_autorest.go | 79 +++++ .../method_poolsdelete_autorest.go | 78 +++++ .../capacitypools/method_poolsget_autorest.go | 67 ++++ .../method_poolslist_autorest.go | 186 ++++++++++ .../method_poolsupdate_autorest.go | 79 +++++ .../capacitypools/model_capacitypool.go | 19 ++ .../capacitypools/model_capacitypoolpatch.go | 13 + .../model_poolpatchproperties.go | 9 + .../capacitypools/model_poolproperties.go | 16 + .../2022-01-01/capacitypools/predicates.go | 34 ++ .../2022-01-01/capacitypools/version.go | 12 + .../2022-01-01/netappaccounts/README.md | 116 +++++++ .../2022-01-01/netappaccounts/client.go | 18 + .../2022-01-01/netappaccounts/constants.go | 43 +++ .../netappaccounts/id_netappaccount.go | 124 +++++++ .../method_accountscreateorupdate_autorest.go | 79 +++++ .../method_accountsdelete_autorest.go | 78 +++++ .../method_accountsget_autorest.go | 67 ++++ .../method_accountslist_autorest.go | 187 ++++++++++ ...hod_accountslistbysubscription_autorest.go | 187 ++++++++++ .../method_accountsupdate_autorest.go | 79 +++++ .../netappaccounts/model_accountencryption.go | 8 + .../netappaccounts/model_accountproperties.go | 10 + .../netappaccounts/model_activedirectory.go | 29 ++ .../model_ldapsearchscopeopt.go | 10 + .../netappaccounts/model_netappaccount.go | 19 ++ .../model_netappaccountpatch.go | 13 + .../2022-01-01/netappaccounts/predicates.go | 34 ++ .../2022-01-01/netappaccounts/version.go | 12 + .../2022-01-01/snapshotpolicy/README.md | 102 ++++++ .../2022-01-01/snapshotpolicy/client.go | 18 + .../snapshotpolicy/id_netappaccount.go | 124 +++++++ .../snapshotpolicy/id_snapshotpolicies.go | 137 ++++++++ .../method_snapshotpoliciescreate_autorest.go | 68 ++++ .../method_snapshotpoliciesdelete_autorest.go | 78 +++++ .../method_snapshotpoliciesget_autorest.go | 67 ++++ .../method_snapshotpolicieslist_autorest.go | 68 ++++ .../method_snapshotpoliciesupdate_autorest.go | 79 +++++ .../snapshotpolicy/model_dailyschedule.go | 11 + .../snapshotpolicy/model_hourlyschedule.go | 10 + .../snapshotpolicy/model_monthlyschedule.go | 12 + .../model_snapshotpolicieslist.go | 8 + .../snapshotpolicy/model_snapshotpolicy.go | 19 ++ .../model_snapshotpolicypatch.go | 13 + .../model_snapshotpolicyproperties.go | 13 + .../snapshotpolicy/model_weeklyschedule.go | 12 + .../2022-01-01/snapshotpolicy/version.go | 12 + .../netapp/2022-01-01/snapshots/README.md | 111 ++++++ .../netapp/2022-01-01/snapshots/client.go | 18 + .../2022-01-01/snapshots/id_snapshot.go | 163 +++++++++ .../netapp/2022-01-01/snapshots/id_volume.go | 150 ++++++++ .../snapshots/method_create_autorest.go | 79 +++++ .../snapshots/method_delete_autorest.go | 78 +++++ .../snapshots/method_get_autorest.go | 67 ++++ .../snapshots/method_list_autorest.go | 68 ++++ .../snapshots/method_restorefiles_autorest.go | 79 +++++ .../snapshots/method_update_autorest.go | 79 +++++ .../2022-01-01/snapshots/model_snapshot.go | 12 + .../snapshots/model_snapshotproperties.go | 28 ++ .../snapshots/model_snapshotrestorefiles.go | 9 + .../snapshots/model_snapshotslist.go | 8 + .../netapp/2022-01-01/snapshots/version.go | 12 + .../netapp/2022-01-01/volumegroups/README.md | 81 +++++ .../netapp/2022-01-01/volumegroups/client.go | 18 + .../2022-01-01/volumegroups/constants.go | 320 ++++++++++++++++++ .../volumegroups/id_netappaccount.go | 124 +++++++ .../2022-01-01/volumegroups/id_volumegroup.go | 137 ++++++++ .../method_volumegroupscreate_autorest.go | 79 +++++ .../method_volumegroupsdelete_autorest.go | 78 +++++ .../method_volumegroupsget_autorest.go | 67 ++++ ...olumegroupslistbynetappaccount_autorest.go | 68 ++++ .../volumegroups/model_exportpolicyrule.go | 22 ++ .../model_mounttargetproperties.go | 11 + .../model_placementkeyvaluepairs.go | 9 + .../volumegroups/model_replicationobject.go | 12 + .../model_volumebackupproperties.go | 11 + .../volumegroups/model_volumegroup.go | 12 + .../volumegroups/model_volumegroupdetails.go | 12 + .../volumegroups/model_volumegrouplist.go | 8 + .../model_volumegrouplistproperties.go | 9 + .../volumegroups/model_volumegroupmetadata.go | 13 + .../model_volumegroupproperties.go | 10 + .../model_volumegroupvolumeproperties.go | 12 + .../volumegroups/model_volumeproperties.go | 50 +++ .../model_volumepropertiesdataprotection.go | 10 + .../model_volumepropertiesexportpolicy.go | 8 + .../model_volumesnapshotproperties.go | 8 + .../netapp/2022-01-01/volumegroups/version.go | 12 + .../netapp/2022-01-01/volumes/README.md | 99 ++++++ .../netapp/2022-01-01/volumes/client.go | 18 + .../netapp/2022-01-01/volumes/constants.go | 295 ++++++++++++++++ .../2022-01-01/volumes/id_capacitypool.go | 137 ++++++++ .../netapp/2022-01-01/volumes/id_volume.go | 150 ++++++++ .../volumes/method_createorupdate_autorest.go | 79 +++++ .../volumes/method_delete_autorest.go | 107 ++++++ .../2022-01-01/volumes/method_get_autorest.go | 67 ++++ .../volumes/method_list_autorest.go | 186 ++++++++++ .../volumes/method_update_autorest.go | 79 +++++ .../volumes/model_exportpolicyrule.go | 22 ++ .../volumes/model_mounttargetproperties.go | 11 + .../volumes/model_placementkeyvaluepairs.go | 9 + .../volumes/model_replicationobject.go | 12 + .../netapp/2022-01-01/volumes/model_volume.go | 20 ++ .../volumes/model_volumebackupproperties.go | 11 + .../2022-01-01/volumes/model_volumepatch.go | 13 + .../volumes/model_volumepatchproperties.go | 16 + ...del_volumepatchpropertiesdataprotection.go | 9 + ...model_volumepatchpropertiesexportpolicy.go | 8 + .../volumes/model_volumeproperties.go | 50 +++ .../model_volumepropertiesdataprotection.go | 10 + .../model_volumepropertiesexportpolicy.go | 8 + .../volumes/model_volumesnapshotproperties.go | 8 + .../netapp/2022-01-01/volumes/predicates.go | 34 ++ .../netapp/2022-01-01/volumes/version.go | 12 + .../2022-01-01/volumesreplication/README.md | 122 +++++++ .../2022-01-01/volumesreplication/client.go | 18 + .../volumesreplication/constants.go | 124 +++++++ .../volumesreplication/id_volume.go | 150 ++++++++ ...od_volumesauthorizereplication_autorest.go | 79 +++++ ...method_volumesbreakreplication_autorest.go | 79 +++++ ...ethod_volumesdeletereplication_autorest.go | 78 +++++ ...method_volumeslistreplications_autorest.go | 68 ++++ ...volumesreinitializereplication_autorest.go | 78 +++++ ...ethod_volumesreplicationstatus_autorest.go | 68 ++++ ...ethod_volumesresyncreplication_autorest.go | 78 +++++ .../model_authorizerequest.go | 8 + .../model_breakreplicationrequest.go | 8 + .../model_listreplications.go | 8 + .../volumesreplication/model_replication.go | 11 + .../model_replicationstatus.go | 12 + .../2022-01-01/volumesreplication/version.go | 12 + .../x/crypto/curve25519/curve25519.go | 9 +- vendor/modules.txt | 14 +- 279 files changed, 15271 insertions(+), 34 deletions(-) create mode 100644 vendor/github.com/golang-jwt/jwt/v4/SECURITY.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/id_capacitypool.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/id_netappaccount.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolscreateorupdate_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolsdelete_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolsget_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolslist_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolsupdate_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/model_capacitypool.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/model_capacitypoolpatch.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/model_poolpatchproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/model_poolproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/predicates.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/version.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/id_netappaccount.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountscreateorupdate_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountsdelete_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountsget_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountslist_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountslistbysubscription_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountsupdate_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_accountencryption.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_accountproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_activedirectory.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_ldapsearchscopeopt.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_netappaccount.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_netappaccountpatch.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/predicates.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/version.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/id_netappaccount.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/id_snapshotpolicies.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpoliciescreate_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpoliciesdelete_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpoliciesget_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpolicieslist_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpoliciesupdate_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_dailyschedule.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_hourlyschedule.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_monthlyschedule.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_snapshotpolicieslist.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_snapshotpolicy.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_snapshotpolicypatch.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_snapshotpolicyproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_weeklyschedule.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/version.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/id_snapshot.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/id_volume.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_create_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_delete_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_get_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_list_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_restorefiles_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_update_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/model_snapshot.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/model_snapshotproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/model_snapshotrestorefiles.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/model_snapshotslist.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/version.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/id_netappaccount.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/id_volumegroup.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupscreate_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupsdelete_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupsget_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupslistbynetappaccount_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_exportpolicyrule.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_mounttargetproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_placementkeyvaluepairs.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_replicationobject.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumebackupproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroup.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupdetails.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegrouplist.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegrouplistproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupmetadata.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupvolumeproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumeproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumepropertiesdataprotection.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumepropertiesexportpolicy.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumesnapshotproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/version.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/id_capacitypool.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/id_volume.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_createorupdate_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_delete_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_get_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_list_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_update_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_exportpolicyrule.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_mounttargetproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_placementkeyvaluepairs.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_replicationobject.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volume.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumebackupproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepatch.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepatchproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepatchpropertiesdataprotection.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepatchpropertiesexportpolicy.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumeproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepropertiesdataprotection.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepropertiesexportpolicy.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumesnapshotproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/predicates.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/version.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/id_volume.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesauthorizereplication_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesbreakreplication_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesdeletereplication_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesreinitializereplication_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesreplicationstatus_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesresyncreplication_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/model_authorizerequest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/model_breakreplicationrequest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/model_replicationstatus.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/version.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/id_capacitypool.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/id_netappaccount.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/method_poolscreateorupdate_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/method_poolsdelete_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/method_poolsget_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/method_poolslist_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/method_poolsupdate_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/model_capacitypool.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/model_capacitypoolpatch.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/model_poolpatchproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/model_poolproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/predicates.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/version.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/id_netappaccount.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountscreateorupdate_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountsdelete_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountsget_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountslist_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountslistbysubscription_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountsupdate_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/model_accountencryption.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/model_accountproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/model_activedirectory.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/model_ldapsearchscopeopt.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/model_netappaccount.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/model_netappaccountpatch.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/predicates.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/version.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/id_netappaccount.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/id_snapshotpolicies.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/method_snapshotpoliciescreate_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/method_snapshotpoliciesdelete_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/method_snapshotpoliciesget_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/method_snapshotpolicieslist_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/method_snapshotpoliciesupdate_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_dailyschedule.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_hourlyschedule.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_monthlyschedule.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_snapshotpolicieslist.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_snapshotpolicy.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_snapshotpolicypatch.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_snapshotpolicyproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_weeklyschedule.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/version.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/id_snapshot.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/id_volume.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_create_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_delete_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_get_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_list_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_restorefiles_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_update_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/model_snapshot.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/model_snapshotproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/model_snapshotrestorefiles.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/model_snapshotslist.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/version.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/id_netappaccount.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/id_volumegroup.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupscreate_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupsdelete_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupsget_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupslistbynetappaccount_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_exportpolicyrule.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_mounttargetproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_placementkeyvaluepairs.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_replicationobject.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumebackupproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroup.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupdetails.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegrouplist.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegrouplistproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupmetadata.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupvolumeproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumeproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumepropertiesdataprotection.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumepropertiesexportpolicy.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumesnapshotproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/version.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/id_capacitypool.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/id_volume.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/method_createorupdate_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/method_delete_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/method_get_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/method_list_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/method_update_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_exportpolicyrule.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_mounttargetproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_placementkeyvaluepairs.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_replicationobject.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volume.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumebackupproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepatch.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepatchproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepatchpropertiesdataprotection.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepatchpropertiesexportpolicy.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumeproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepropertiesdataprotection.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepropertiesexportpolicy.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumesnapshotproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/predicates.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/version.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/id_volume.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesauthorizereplication_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesbreakreplication_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesdeletereplication_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumeslistreplications_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesreinitializereplication_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesreplicationstatus_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesresyncreplication_autorest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/model_authorizerequest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/model_breakreplicationrequest.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/model_listreplications.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/model_replication.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/model_replicationstatus.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/version.go diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/README.md b/vendor/github.com/Azure/go-autorest/autorest/adal/README.md index fec416a9c415..b11eb07884b0 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/adal/README.md +++ b/vendor/github.com/Azure/go-autorest/autorest/adal/README.md @@ -1,3 +1,5 @@ +# NOTE: This module will go out of support by March 31, 2023. For authenticating with Azure AD, use module [azidentity](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity) instead. For help migrating from `adal` to `azidentiy` please consult the [migration guide](https://aka.ms/azsdk/go/identity/migration). General information about the retirement of this and other legacy modules can be found [here](https://azure.microsoft.com/updates/support-for-azure-sdk-libraries-that-do-not-conform-to-our-current-azure-sdk-guidelines-will-be-retired-as-of-31-march-2023/). + # Azure Active Directory authentication for Go This is a standalone package for authenticating with Azure Active @@ -18,7 +20,7 @@ go get -u github.com/Azure/go-autorest/autorest/adal ## Usage -An Active Directory application is required in order to use this library. An application can be registered in the [Azure Portal](https://portal.azure.com/) by following these [guidelines](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-integrating-applications) or using the [Azure CLI](https://github.com/Azure/azure-cli). +An Active Directory application is required in order to use this library. An application can be registered in the [Azure Portal](https://portal.azure.com/) by following these [guidelines](https://docs.microsoft.com/azure/active-directory/develop/active-directory-integrating-applications) or using the [Azure CLI](https://github.com/Azure/azure-cli). ### Register an Azure AD Application with secret @@ -88,7 +90,7 @@ An Active Directory application is required in order to use this library. An app ### Grant the necessary permissions Azure relies on a Role-Based Access Control (RBAC) model to manage the access to resources at a fine-grained -level. There is a set of [pre-defined roles](https://docs.microsoft.com/en-us/azure/active-directory/role-based-access-built-in-roles) +level. There is a set of [pre-defined roles](https://docs.microsoft.com/azure/active-directory/role-based-access-built-in-roles) which can be assigned to a service principal of an Azure AD application depending of your needs. ``` @@ -104,7 +106,7 @@ It is also possible to define custom role definitions. az role definition create --role-definition role-definition.json ``` -* Check [custom roles](https://docs.microsoft.com/en-us/azure/active-directory/role-based-access-control-custom-roles) for more details regarding the content of `role-definition.json` file. +* Check [custom roles](https://docs.microsoft.com/azure/active-directory/role-based-access-control-custom-roles) for more details regarding the content of `role-definition.json` file. ### Acquire Access Token diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/token.go b/vendor/github.com/Azure/go-autorest/autorest/adal/token.go index 310be07ec335..1a9c8ab537f0 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/adal/token.go +++ b/vendor/github.com/Azure/go-autorest/autorest/adal/token.go @@ -365,6 +365,25 @@ func (secret ServicePrincipalAuthorizationCodeSecret) MarshalJSON() ([]byte, err }) } +// ServicePrincipalFederatedSecret implements ServicePrincipalSecret for Federated JWTs. +type ServicePrincipalFederatedSecret struct { + jwt string +} + +// SetAuthenticationValues is a method of the interface ServicePrincipalSecret. +// It will populate the form submitted during OAuth Token Acquisition using a JWT signed by an OIDC issuer. +func (secret *ServicePrincipalFederatedSecret) SetAuthenticationValues(spt *ServicePrincipalToken, v *url.Values) error { + + v.Set("client_assertion", secret.jwt) + v.Set("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer") + return nil +} + +// MarshalJSON implements the json.Marshaler interface. +func (secret ServicePrincipalFederatedSecret) MarshalJSON() ([]byte, error) { + return nil, errors.New("marshalling ServicePrincipalFederatedSecret is not supported") +} + // ServicePrincipalToken encapsulates a Token created for a Service Principal. type ServicePrincipalToken struct { inner servicePrincipalToken @@ -419,6 +438,8 @@ func (spt *ServicePrincipalToken) UnmarshalJSON(data []byte) error { spt.inner.Secret = &ServicePrincipalUsernamePasswordSecret{} case "ServicePrincipalAuthorizationCodeSecret": spt.inner.Secret = &ServicePrincipalAuthorizationCodeSecret{} + case "ServicePrincipalFederatedSecret": + return errors.New("unmarshalling ServicePrincipalFederatedSecret is not supported") default: return fmt.Errorf("unrecognized token type '%s'", secret["type"]) } @@ -665,6 +686,31 @@ func NewServicePrincipalTokenFromAuthorizationCode(oauthConfig OAuthConfig, clie ) } +// NewServicePrincipalTokenFromFederatedToken creates a ServicePrincipalToken from the supplied federated OIDC JWT. +func NewServicePrincipalTokenFromFederatedToken(oauthConfig OAuthConfig, clientID string, jwt string, resource string, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) { + if err := validateOAuthConfig(oauthConfig); err != nil { + return nil, err + } + if err := validateStringParam(clientID, "clientID"); err != nil { + return nil, err + } + if err := validateStringParam(resource, "resource"); err != nil { + return nil, err + } + if jwt == "" { + return nil, fmt.Errorf("parameter 'jwt' cannot be empty") + } + return NewServicePrincipalTokenWithSecret( + oauthConfig, + clientID, + resource, + &ServicePrincipalFederatedSecret{ + jwt: jwt, + }, + callbacks..., + ) +} + type msiType int const ( @@ -1058,8 +1104,8 @@ func (spt *ServicePrincipalToken) refreshInternal(ctx context.Context, resource // AAD returns expires_in as a string, ADFS returns it as an int ExpiresIn json.Number `json:"expires_in"` - // expires_on can be in two formats, a UTC time stamp or the number of seconds. - ExpiresOn string `json:"expires_on"` + // expires_on can be in three formats, a UTC time stamp, or the number of seconds as a string *or* int. + ExpiresOn interface{} `json:"expires_on"` NotBefore json.Number `json:"not_before"` Resource string `json:"resource"` @@ -1072,7 +1118,7 @@ func (spt *ServicePrincipalToken) refreshInternal(ctx context.Context, resource } expiresOn := json.Number("") // ADFS doesn't include the expires_on field - if token.ExpiresOn != "" { + if token.ExpiresOn != nil { if expiresOn, err = parseExpiresOn(token.ExpiresOn); err != nil { return newTokenRefreshError(fmt.Sprintf("adal: failed to parse expires_on: %v value '%s'", err, token.ExpiresOn), resp) } @@ -1089,18 +1135,27 @@ func (spt *ServicePrincipalToken) refreshInternal(ctx context.Context, resource } // converts expires_on to the number of seconds -func parseExpiresOn(s string) (json.Number, error) { - // convert the expiration date to the number of seconds from now +func parseExpiresOn(s interface{}) (json.Number, error) { + // the JSON unmarshaler treats JSON numbers unmarshaled into an interface{} as float64 + asFloat64, ok := s.(float64) + if ok { + // this is the number of seconds as int case + return json.Number(strconv.FormatInt(int64(asFloat64), 10)), nil + } + asStr, ok := s.(string) + if !ok { + return "", fmt.Errorf("unexpected expires_on type %T", s) + } + // convert the expiration date to the number of seconds from the unix epoch timeToDuration := func(t time.Time) json.Number { - dur := t.Sub(time.Now().UTC()) - return json.Number(strconv.FormatInt(int64(dur.Round(time.Second).Seconds()), 10)) + return json.Number(strconv.FormatInt(t.UTC().Unix(), 10)) } - if _, err := strconv.ParseInt(s, 10, 64); err == nil { + if _, err := json.Number(asStr).Int64(); err == nil { // this is the number of seconds case, no conversion required - return json.Number(s), nil - } else if eo, err := time.Parse(expiresOnDateFormatPM, s); err == nil { + return json.Number(asStr), nil + } else if eo, err := time.Parse(expiresOnDateFormatPM, asStr); err == nil { return timeToDuration(eo), nil - } else if eo, err := time.Parse(expiresOnDateFormat, s); err == nil { + } else if eo, err := time.Parse(expiresOnDateFormat, asStr); err == nil { return timeToDuration(eo), nil } else { // unknown format @@ -1317,12 +1372,25 @@ func NewMultiTenantServicePrincipalTokenFromCertificate(multiTenantCfg MultiTena // MSIAvailable returns true if the MSI endpoint is available for authentication. func MSIAvailable(ctx context.Context, s Sender) bool { + msiType, _, err := getMSIType() + + if err != nil { + return false + } + + if msiType != msiTypeIMDS { + return true + } + if s == nil { s = sender() } + resp, err := getMSIEndpoint(ctx, s) + if err == nil { resp.Body.Close() } + return err == nil } diff --git a/vendor/github.com/golang-jwt/jwt/v4/README.md b/vendor/github.com/golang-jwt/jwt/v4/README.md index 01b21646e015..f5d551ca8fd8 100644 --- a/vendor/github.com/golang-jwt/jwt/v4/README.md +++ b/vendor/github.com/golang-jwt/jwt/v4/README.md @@ -36,9 +36,23 @@ The part in the middle is the interesting bit. It's called the Claims and conta This library supports the parsing and verification as well as the generation and signing of JWTs. Current supported signing algorithms are HMAC SHA, RSA, RSA-PSS, and ECDSA, though hooks are present for adding your own. +## Installation Guidelines + +1. To install the jwt package, you first need to have [Go](https://go.dev/doc/install) installed, then you can use the command below to add `jwt-go` as a dependency in your Go program. + +```sh +go get -u github.com/golang-jwt/jwt/v4 +``` + +2. Import it in your code: + +```go +import "github.com/golang-jwt/jwt/v4" +``` + ## Examples -See [the project documentation](https://pkg.go.dev/github.com/golang-jwt/jwt) for examples of usage: +See [the project documentation](https://pkg.go.dev/github.com/golang-jwt/jwt/v4) for examples of usage: * [Simple example of parsing and validating a token](https://pkg.go.dev/github.com/golang-jwt/jwt#example-Parse-Hmac) * [Simple example of building and signing a token](https://pkg.go.dev/github.com/golang-jwt/jwt#example-New-Hmac) @@ -46,14 +60,15 @@ See [the project documentation](https://pkg.go.dev/github.com/golang-jwt/jwt) fo ## Extensions -This library publishes all the necessary components for adding your own signing methods. Simply implement the `SigningMethod` interface and register a factory method using `RegisterSigningMethod`. +This library publishes all the necessary components for adding your own signing methods or key functions. Simply implement the `SigningMethod` interface and register a factory method using `RegisterSigningMethod` or provide a `jwt.Keyfunc`. -A common use case would be integrating with different 3rd party signature providers, like key management services from various cloud providers or Hardware Security Modules (HSMs). +A common use case would be integrating with different 3rd party signature providers, like key management services from various cloud providers or Hardware Security Modules (HSMs) or to implement additional standards. -| Extension | Purpose | Repo | -|-----------|----------------------------------------------------------------------------------------------|--------------------------------------------| -| GCP | Integrates with multiple Google Cloud Platform signing tools (AppEngine, IAM API, Cloud KMS) | https://github.com/someone1/gcp-jwt-go | -| AWS | Integrates with AWS Key Management Service, KMS | https://github.com/matelang/jwt-go-aws-kms | +| Extension | Purpose | Repo | +| --------- | -------------------------------------------------------------------------------------------------------- | ------------------------------------------ | +| GCP | Integrates with multiple Google Cloud Platform signing tools (AppEngine, IAM API, Cloud KMS) | https://github.com/someone1/gcp-jwt-go | +| AWS | Integrates with AWS Key Management Service, KMS | https://github.com/matelang/jwt-go-aws-kms | +| JWKS | Provides support for JWKS ([RFC 7517](https://datatracker.ietf.org/doc/html/rfc7517)) as a `jwt.Keyfunc` | https://github.com/MicahParks/keyfunc | *Disclaimer*: Unless otherwise specified, these integrations are maintained by third parties and should not be considered as a primary offer by any of the mentioned cloud providers diff --git a/vendor/github.com/golang-jwt/jwt/v4/SECURITY.md b/vendor/github.com/golang-jwt/jwt/v4/SECURITY.md new file mode 100644 index 000000000000..b08402c3427f --- /dev/null +++ b/vendor/github.com/golang-jwt/jwt/v4/SECURITY.md @@ -0,0 +1,19 @@ +# Security Policy + +## Supported Versions + +As of February 2022 (and until this document is updated), the latest version `v4` is supported. + +## Reporting a Vulnerability + +If you think you found a vulnerability, and even if you are not sure, please report it to jwt-go-security@googlegroups.com or one of the other [golang-jwt maintainers](https://github.com/orgs/golang-jwt/people). Please try be explicit, describe steps to reproduce the security issue with code example(s). + +You will receive a response within a timely manner. If the issue is confirmed, we will do our best to release a patch as soon as possible given the complexity of the problem. + +## Public Discussions + +Please avoid publicly discussing a potential security vulnerability. + +Let's take this offline and find a solution first, this limits the potential impact as much as possible. + +We appreciate your help! diff --git a/vendor/github.com/golang-jwt/jwt/v4/rsa_pss.go b/vendor/github.com/golang-jwt/jwt/v4/rsa_pss.go index 5a8502feb34b..4fd6f9e610b0 100644 --- a/vendor/github.com/golang-jwt/jwt/v4/rsa_pss.go +++ b/vendor/github.com/golang-jwt/jwt/v4/rsa_pss.go @@ -1,3 +1,4 @@ +//go:build go1.4 // +build go1.4 package jwt diff --git a/vendor/github.com/golang-jwt/jwt/v4/token.go b/vendor/github.com/golang-jwt/jwt/v4/token.go index 09b4cde5aebd..3cb0f3f0e4c0 100644 --- a/vendor/github.com/golang-jwt/jwt/v4/token.go +++ b/vendor/github.com/golang-jwt/jwt/v4/token.go @@ -7,7 +7,6 @@ import ( "time" ) - // DecodePaddingAllowed will switch the codec used for decoding JWTs respectively. Note that the JWS RFC7515 // states that the tokens will utilize a Base64url encoding with no padding. Unfortunately, some implementations // of JWT are producing non-standard tokens, and thus require support for decoding. Note that this is a global diff --git a/vendor/github.com/golang-jwt/jwt/v4/types.go b/vendor/github.com/golang-jwt/jwt/v4/types.go index 2c647fd2e6d2..ac8e140eb119 100644 --- a/vendor/github.com/golang-jwt/jwt/v4/types.go +++ b/vendor/github.com/golang-jwt/jwt/v4/types.go @@ -53,9 +53,23 @@ func (date NumericDate) MarshalJSON() (b []byte, err error) { if TimePrecision < time.Second { prec = int(math.Log10(float64(time.Second) / float64(TimePrecision))) } - f := float64(date.Truncate(TimePrecision).UnixNano()) / float64(time.Second) - - return []byte(strconv.FormatFloat(f, 'f', prec, 64)), nil + truncatedDate := date.Truncate(TimePrecision) + + // For very large timestamps, UnixNano would overflow an int64, but this + // function requires nanosecond level precision, so we have to use the + // following technique to get round the issue: + // 1. Take the normal unix timestamp to form the whole number part of the + // output, + // 2. Take the result of the Nanosecond function, which retuns the offset + // within the second of the particular unix time instance, to form the + // decimal part of the output + // 3. Concatenate them to produce the final result + seconds := strconv.FormatInt(truncatedDate.Unix(), 10) + nanosecondsOffset := strconv.FormatFloat(float64(truncatedDate.Nanosecond())/float64(time.Second), 'f', prec, 64) + + output := append([]byte(seconds), []byte(nanosecondsOffset)[1:]...) + + return output, nil } // UnmarshalJSON is an implementation of the json.RawMessage interface and deserializses a diff --git a/vendor/github.com/hashicorp/go-azure-helpers/authentication/environment.go b/vendor/github.com/hashicorp/go-azure-helpers/authentication/environment.go index 69ec44474411..fe0a53806680 100644 --- a/vendor/github.com/hashicorp/go-azure-helpers/authentication/environment.go +++ b/vendor/github.com/hashicorp/go-azure-helpers/authentication/environment.go @@ -113,7 +113,7 @@ func AzureEnvironmentByNameFromEndpoint(ctx context.Context, endpoint string, en // while the array contains values for _, env := range environments { - if strings.EqualFold(env.Name, environmentName) { + if strings.EqualFold(env.Name, environmentName) || (environmentName == "" && len(environments) == 1) { // if resourceManager endpoint is empty, assume it's the provided endpoint if env.ResourceManager == "" { env.ResourceManager = fmt.Sprintf("https://%s/", endpoint) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/README.md new file mode 100644 index 000000000000..a47f3c6bf12f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/README.md @@ -0,0 +1,99 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools` Documentation + +The `capacitypools` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2021-10-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools" +``` + + +### Client Initialization + +```go +client := capacitypools.NewCapacityPoolsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `CapacityPoolsClient.PoolsCreateOrUpdate` + +```go +ctx := context.TODO() +id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue") + +payload := capacitypools.CapacityPool{ + // ... +} + + +if err := client.PoolsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `CapacityPoolsClient.PoolsDelete` + +```go +ctx := context.TODO() +id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue") + +if err := client.PoolsDeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `CapacityPoolsClient.PoolsGet` + +```go +ctx := context.TODO() +id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue") + +read, err := client.PoolsGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CapacityPoolsClient.PoolsList` + +```go +ctx := context.TODO() +id := capacitypools.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") + +// alternatively `client.PoolsList(ctx, id)` can be used to do batched pagination +items, err := client.PoolsListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `CapacityPoolsClient.PoolsUpdate` + +```go +ctx := context.TODO() +id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue") + +payload := capacitypools.CapacityPoolPatch{ + // ... +} + + +if err := client.PoolsUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/client.go new file mode 100644 index 000000000000..d31b6b301a25 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/client.go @@ -0,0 +1,18 @@ +package capacitypools + +import "github.com/Azure/go-autorest/autorest" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CapacityPoolsClient struct { + Client autorest.Client + baseUri string +} + +func NewCapacityPoolsClientWithBaseURI(endpoint string) CapacityPoolsClient { + return CapacityPoolsClient{ + Client: autorest.NewClientWithUserAgent(userAgent()), + baseUri: endpoint, + } +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/constants.go new file mode 100644 index 000000000000..4856e8e79bc3 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/constants.go @@ -0,0 +1,96 @@ +package capacitypools + +import "strings" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type EncryptionType string + +const ( + EncryptionTypeDouble EncryptionType = "Double" + EncryptionTypeSingle EncryptionType = "Single" +) + +func PossibleValuesForEncryptionType() []string { + return []string{ + string(EncryptionTypeDouble), + string(EncryptionTypeSingle), + } +} + +func parseEncryptionType(input string) (*EncryptionType, error) { + vals := map[string]EncryptionType{ + "double": EncryptionTypeDouble, + "single": EncryptionTypeSingle, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := EncryptionType(input) + return &out, nil +} + +type QosType string + +const ( + QosTypeAuto QosType = "Auto" + QosTypeManual QosType = "Manual" +) + +func PossibleValuesForQosType() []string { + return []string{ + string(QosTypeAuto), + string(QosTypeManual), + } +} + +func parseQosType(input string) (*QosType, error) { + vals := map[string]QosType{ + "auto": QosTypeAuto, + "manual": QosTypeManual, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := QosType(input) + return &out, nil +} + +type ServiceLevel string + +const ( + ServiceLevelPremium ServiceLevel = "Premium" + ServiceLevelStandard ServiceLevel = "Standard" + ServiceLevelStandardZRS ServiceLevel = "StandardZRS" + ServiceLevelUltra ServiceLevel = "Ultra" +) + +func PossibleValuesForServiceLevel() []string { + return []string{ + string(ServiceLevelPremium), + string(ServiceLevelStandard), + string(ServiceLevelStandardZRS), + string(ServiceLevelUltra), + } +} + +func parseServiceLevel(input string) (*ServiceLevel, error) { + vals := map[string]ServiceLevel{ + "premium": ServiceLevelPremium, + "standard": ServiceLevelStandard, + "standardzrs": ServiceLevelStandardZRS, + "ultra": ServiceLevelUltra, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ServiceLevel(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/id_capacitypool.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/id_capacitypool.go new file mode 100644 index 000000000000..a50e29408397 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/id_capacitypool.go @@ -0,0 +1,137 @@ +package capacitypools + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = CapacityPoolId{} + +// CapacityPoolId is a struct representing the Resource ID for a Capacity Pool +type CapacityPoolId struct { + SubscriptionId string + ResourceGroupName string + AccountName string + PoolName string +} + +// NewCapacityPoolID returns a new CapacityPoolId struct +func NewCapacityPoolID(subscriptionId string, resourceGroupName string, accountName string, poolName string) CapacityPoolId { + return CapacityPoolId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AccountName: accountName, + PoolName: poolName, + } +} + +// ParseCapacityPoolID parses 'input' into a CapacityPoolId +func ParseCapacityPoolID(input string) (*CapacityPoolId, error) { + parser := resourceids.NewParserFromResourceIdType(CapacityPoolId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := CapacityPoolId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { + return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseCapacityPoolIDInsensitively parses 'input' case-insensitively into a CapacityPoolId +// note: this method should only be used for API response data and not user input +func ParseCapacityPoolIDInsensitively(input string) (*CapacityPoolId, error) { + parser := resourceids.NewParserFromResourceIdType(CapacityPoolId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := CapacityPoolId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { + return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateCapacityPoolID checks that 'input' can be parsed as a Capacity Pool ID +func ValidateCapacityPoolID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseCapacityPoolID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Capacity Pool ID +func (id CapacityPoolId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/capacityPools/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName, id.PoolName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Capacity Pool ID +func (id CapacityPoolId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("accountName", "accountValue"), + resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), + resourceids.UserSpecifiedSegment("poolName", "poolValue"), + } +} + +// String returns a human-readable description of this Capacity Pool ID +func (id CapacityPoolId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Account Name: %q", id.AccountName), + fmt.Sprintf("Pool Name: %q", id.PoolName), + } + return fmt.Sprintf("Capacity Pool (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/id_netappaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/id_netappaccount.go new file mode 100644 index 000000000000..86bd7fcada46 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/id_netappaccount.go @@ -0,0 +1,124 @@ +package capacitypools + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = NetAppAccountId{} + +// NetAppAccountId is a struct representing the Resource ID for a Net App Account +type NetAppAccountId struct { + SubscriptionId string + ResourceGroupName string + AccountName string +} + +// NewNetAppAccountID returns a new NetAppAccountId struct +func NewNetAppAccountID(subscriptionId string, resourceGroupName string, accountName string) NetAppAccountId { + return NetAppAccountId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AccountName: accountName, + } +} + +// ParseNetAppAccountID parses 'input' into a NetAppAccountId +func ParseNetAppAccountID(input string) (*NetAppAccountId, error) { + parser := resourceids.NewParserFromResourceIdType(NetAppAccountId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := NetAppAccountId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseNetAppAccountIDInsensitively parses 'input' case-insensitively into a NetAppAccountId +// note: this method should only be used for API response data and not user input +func ParseNetAppAccountIDInsensitively(input string) (*NetAppAccountId, error) { + parser := resourceids.NewParserFromResourceIdType(NetAppAccountId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := NetAppAccountId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateNetAppAccountID checks that 'input' can be parsed as a Net App Account ID +func ValidateNetAppAccountID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseNetAppAccountID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Net App Account ID +func (id NetAppAccountId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Net App Account ID +func (id NetAppAccountId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("accountName", "accountValue"), + } +} + +// String returns a human-readable description of this Net App Account ID +func (id NetAppAccountId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Account Name: %q", id.AccountName), + } + return fmt.Sprintf("Net App Account (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolscreateorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolscreateorupdate_autorest.go new file mode 100644 index 000000000000..72891f7b9dfb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolscreateorupdate_autorest.go @@ -0,0 +1,79 @@ +package capacitypools + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PoolsCreateOrUpdateOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// PoolsCreateOrUpdate ... +func (c CapacityPoolsClient) PoolsCreateOrUpdate(ctx context.Context, id CapacityPoolId, input CapacityPool) (result PoolsCreateOrUpdateOperationResponse, err error) { + req, err := c.preparerForPoolsCreateOrUpdate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsCreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = c.senderForPoolsCreateOrUpdate(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsCreateOrUpdate", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// PoolsCreateOrUpdateThenPoll performs PoolsCreateOrUpdate then polls until it's completed +func (c CapacityPoolsClient) PoolsCreateOrUpdateThenPoll(ctx context.Context, id CapacityPoolId, input CapacityPool) error { + result, err := c.PoolsCreateOrUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing PoolsCreateOrUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after PoolsCreateOrUpdate: %+v", err) + } + + return nil +} + +// preparerForPoolsCreateOrUpdate prepares the PoolsCreateOrUpdate request. +func (c CapacityPoolsClient) preparerForPoolsCreateOrUpdate(ctx context.Context, id CapacityPoolId, input CapacityPool) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForPoolsCreateOrUpdate sends the PoolsCreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (c CapacityPoolsClient) senderForPoolsCreateOrUpdate(ctx context.Context, req *http.Request) (future PoolsCreateOrUpdateOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolsdelete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolsdelete_autorest.go new file mode 100644 index 000000000000..61d0e6104b15 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolsdelete_autorest.go @@ -0,0 +1,78 @@ +package capacitypools + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PoolsDeleteOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// PoolsDelete ... +func (c CapacityPoolsClient) PoolsDelete(ctx context.Context, id CapacityPoolId) (result PoolsDeleteOperationResponse, err error) { + req, err := c.preparerForPoolsDelete(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsDelete", nil, "Failure preparing request") + return + } + + result, err = c.senderForPoolsDelete(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsDelete", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// PoolsDeleteThenPoll performs PoolsDelete then polls until it's completed +func (c CapacityPoolsClient) PoolsDeleteThenPoll(ctx context.Context, id CapacityPoolId) error { + result, err := c.PoolsDelete(ctx, id) + if err != nil { + return fmt.Errorf("performing PoolsDelete: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after PoolsDelete: %+v", err) + } + + return nil +} + +// preparerForPoolsDelete prepares the PoolsDelete request. +func (c CapacityPoolsClient) preparerForPoolsDelete(ctx context.Context, id CapacityPoolId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForPoolsDelete sends the PoolsDelete request. The method will close the +// http.Response Body if it receives an error. +func (c CapacityPoolsClient) senderForPoolsDelete(ctx context.Context, req *http.Request) (future PoolsDeleteOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolsget_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolsget_autorest.go new file mode 100644 index 000000000000..d2725693da9d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolsget_autorest.go @@ -0,0 +1,67 @@ +package capacitypools + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PoolsGetOperationResponse struct { + HttpResponse *http.Response + Model *CapacityPool +} + +// PoolsGet ... +func (c CapacityPoolsClient) PoolsGet(ctx context.Context, id CapacityPoolId) (result PoolsGetOperationResponse, err error) { + req, err := c.preparerForPoolsGet(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsGet", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsGet", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForPoolsGet(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsGet", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForPoolsGet prepares the PoolsGet request. +func (c CapacityPoolsClient) preparerForPoolsGet(ctx context.Context, id CapacityPoolId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForPoolsGet handles the response to the PoolsGet request. The method always +// closes the http.Response Body. +func (c CapacityPoolsClient) responderForPoolsGet(resp *http.Response) (result PoolsGetOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolslist_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolslist_autorest.go new file mode 100644 index 000000000000..25c06a45e9bd --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolslist_autorest.go @@ -0,0 +1,186 @@ +package capacitypools + +import ( + "context" + "fmt" + "net/http" + "net/url" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PoolsListOperationResponse struct { + HttpResponse *http.Response + Model *[]CapacityPool + + nextLink *string + nextPageFunc func(ctx context.Context, nextLink string) (PoolsListOperationResponse, error) +} + +type PoolsListCompleteResult struct { + Items []CapacityPool +} + +func (r PoolsListOperationResponse) HasMore() bool { + return r.nextLink != nil +} + +func (r PoolsListOperationResponse) LoadMore(ctx context.Context) (resp PoolsListOperationResponse, err error) { + if !r.HasMore() { + err = fmt.Errorf("no more pages returned") + return + } + return r.nextPageFunc(ctx, *r.nextLink) +} + +// PoolsList ... +func (c CapacityPoolsClient) PoolsList(ctx context.Context, id NetAppAccountId) (resp PoolsListOperationResponse, err error) { + req, err := c.preparerForPoolsList(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsList", nil, "Failure preparing request") + return + } + + resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsList", resp.HttpResponse, "Failure sending request") + return + } + + resp, err = c.responderForPoolsList(resp.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsList", resp.HttpResponse, "Failure responding to request") + return + } + return +} + +// PoolsListComplete retrieves all of the results into a single object +func (c CapacityPoolsClient) PoolsListComplete(ctx context.Context, id NetAppAccountId) (PoolsListCompleteResult, error) { + return c.PoolsListCompleteMatchingPredicate(ctx, id, CapacityPoolOperationPredicate{}) +} + +// PoolsListCompleteMatchingPredicate retrieves all of the results and then applied the predicate +func (c CapacityPoolsClient) PoolsListCompleteMatchingPredicate(ctx context.Context, id NetAppAccountId, predicate CapacityPoolOperationPredicate) (resp PoolsListCompleteResult, err error) { + items := make([]CapacityPool, 0) + + page, err := c.PoolsList(ctx, id) + if err != nil { + err = fmt.Errorf("loading the initial page: %+v", err) + return + } + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + for page.HasMore() { + page, err = page.LoadMore(ctx) + if err != nil { + err = fmt.Errorf("loading the next page: %+v", err) + return + } + + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + } + + out := PoolsListCompleteResult{ + Items: items, + } + return out, nil +} + +// preparerForPoolsList prepares the PoolsList request. +func (c CapacityPoolsClient) preparerForPoolsList(ctx context.Context, id NetAppAccountId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/capacityPools", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// preparerForPoolsListWithNextLink prepares the PoolsList request with the given nextLink token. +func (c CapacityPoolsClient) preparerForPoolsListWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { + uri, err := url.Parse(nextLink) + if err != nil { + return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) + } + queryParameters := map[string]interface{}{} + for k, v := range uri.Query() { + if len(v) == 0 { + continue + } + val := v[0] + val = autorest.Encode("query", val) + queryParameters[k] = val + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(uri.Path), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForPoolsList handles the response to the PoolsList request. The method always +// closes the http.Response Body. +func (c CapacityPoolsClient) responderForPoolsList(resp *http.Response) (result PoolsListOperationResponse, err error) { + type page struct { + Values []CapacityPool `json:"value"` + NextLink *string `json:"nextLink"` + } + var respObj page + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&respObj), + autorest.ByClosing()) + result.HttpResponse = resp + result.Model = &respObj.Values + result.nextLink = respObj.NextLink + if respObj.NextLink != nil { + result.nextPageFunc = func(ctx context.Context, nextLink string) (result PoolsListOperationResponse, err error) { + req, err := c.preparerForPoolsListWithNextLink(ctx, nextLink) + if err != nil { + err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsList", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsList", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForPoolsList(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsList", result.HttpResponse, "Failure responding to request") + return + } + + return + } + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolsupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolsupdate_autorest.go new file mode 100644 index 000000000000..680bc19748a1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolsupdate_autorest.go @@ -0,0 +1,79 @@ +package capacitypools + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PoolsUpdateOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// PoolsUpdate ... +func (c CapacityPoolsClient) PoolsUpdate(ctx context.Context, id CapacityPoolId, input CapacityPoolPatch) (result PoolsUpdateOperationResponse, err error) { + req, err := c.preparerForPoolsUpdate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsUpdate", nil, "Failure preparing request") + return + } + + result, err = c.senderForPoolsUpdate(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsUpdate", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// PoolsUpdateThenPoll performs PoolsUpdate then polls until it's completed +func (c CapacityPoolsClient) PoolsUpdateThenPoll(ctx context.Context, id CapacityPoolId, input CapacityPoolPatch) error { + result, err := c.PoolsUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing PoolsUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after PoolsUpdate: %+v", err) + } + + return nil +} + +// preparerForPoolsUpdate prepares the PoolsUpdate request. +func (c CapacityPoolsClient) preparerForPoolsUpdate(ctx context.Context, id CapacityPoolId, input CapacityPoolPatch) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForPoolsUpdate sends the PoolsUpdate request. The method will close the +// http.Response Body if it receives an error. +func (c CapacityPoolsClient) senderForPoolsUpdate(ctx context.Context, req *http.Request) (future PoolsUpdateOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/model_capacitypool.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/model_capacitypool.go new file mode 100644 index 000000000000..f5d6f1ea86df --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/model_capacitypool.go @@ -0,0 +1,19 @@ +package capacitypools + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CapacityPool struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties PoolProperties `json:"properties"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/model_capacitypoolpatch.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/model_capacitypoolpatch.go new file mode 100644 index 000000000000..46abcde6b330 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/model_capacitypoolpatch.go @@ -0,0 +1,13 @@ +package capacitypools + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CapacityPoolPatch struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *PoolPatchProperties `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/model_poolpatchproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/model_poolpatchproperties.go new file mode 100644 index 000000000000..071dba445599 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/model_poolpatchproperties.go @@ -0,0 +1,9 @@ +package capacitypools + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PoolPatchProperties struct { + QosType *QosType `json:"qosType,omitempty"` + Size *int64 `json:"size,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/model_poolproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/model_poolproperties.go new file mode 100644 index 000000000000..a1fee733fb48 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/model_poolproperties.go @@ -0,0 +1,16 @@ +package capacitypools + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PoolProperties struct { + CoolAccess *bool `json:"coolAccess,omitempty"` + EncryptionType *EncryptionType `json:"encryptionType,omitempty"` + PoolId *string `json:"poolId,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + QosType *QosType `json:"qosType,omitempty"` + ServiceLevel ServiceLevel `json:"serviceLevel"` + Size int64 `json:"size"` + TotalThroughputMibps *float64 `json:"totalThroughputMibps,omitempty"` + UtilizedThroughputMibps *float64 `json:"utilizedThroughputMibps,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/predicates.go new file mode 100644 index 000000000000..67e2199aa2cd --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/predicates.go @@ -0,0 +1,34 @@ +package capacitypools + +type CapacityPoolOperationPredicate struct { + Etag *string + Id *string + Location *string + Name *string + Type *string +} + +func (p CapacityPoolOperationPredicate) Matches(input CapacityPool) bool { + + if p.Etag != nil && (input.Etag == nil && *p.Etag != *input.Etag) { + return false + } + + if p.Id != nil && (input.Id == nil && *p.Id != *input.Id) { + return false + } + + if p.Location != nil && *p.Location != input.Location { + return false + } + + if p.Name != nil && (input.Name == nil && *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil && *p.Type != *input.Type) { + return false + } + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/version.go new file mode 100644 index 000000000000..c647e1604368 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/version.go @@ -0,0 +1,12 @@ +package capacitypools + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2021-10-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/capacitypools/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/README.md new file mode 100644 index 000000000000..487820e90f62 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/README.md @@ -0,0 +1,116 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts` Documentation + +The `netappaccounts` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2021-10-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts" +``` + + +### Client Initialization + +```go +client := netappaccounts.NewNetAppAccountsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `NetAppAccountsClient.AccountsCreateOrUpdate` + +```go +ctx := context.TODO() +id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") + +payload := netappaccounts.NetAppAccount{ + // ... +} + + +if err := client.AccountsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `NetAppAccountsClient.AccountsDelete` + +```go +ctx := context.TODO() +id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") + +if err := client.AccountsDeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `NetAppAccountsClient.AccountsGet` + +```go +ctx := context.TODO() +id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") + +read, err := client.AccountsGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `NetAppAccountsClient.AccountsList` + +```go +ctx := context.TODO() +id := netappaccounts.NewResourceGroupID() + +// alternatively `client.AccountsList(ctx, id)` can be used to do batched pagination +items, err := client.AccountsListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `NetAppAccountsClient.AccountsListBySubscription` + +```go +ctx := context.TODO() +id := netappaccounts.NewSubscriptionID() + +// alternatively `client.AccountsListBySubscription(ctx, id)` can be used to do batched pagination +items, err := client.AccountsListBySubscriptionComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `NetAppAccountsClient.AccountsUpdate` + +```go +ctx := context.TODO() +id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") + +payload := netappaccounts.NetAppAccountPatch{ + // ... +} + + +if err := client.AccountsUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/client.go new file mode 100644 index 000000000000..1a10ce8e9b65 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/client.go @@ -0,0 +1,18 @@ +package netappaccounts + +import "github.com/Azure/go-autorest/autorest" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetAppAccountsClient struct { + Client autorest.Client + baseUri string +} + +func NewNetAppAccountsClientWithBaseURI(endpoint string) NetAppAccountsClient { + return NetAppAccountsClient{ + Client: autorest.NewClientWithUserAgent(userAgent()), + baseUri: endpoint, + } +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/constants.go new file mode 100644 index 000000000000..6e41970873a4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/constants.go @@ -0,0 +1,43 @@ +package netappaccounts + +import "strings" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ActiveDirectoryStatus string + +const ( + ActiveDirectoryStatusCreated ActiveDirectoryStatus = "Created" + ActiveDirectoryStatusDeleted ActiveDirectoryStatus = "Deleted" + ActiveDirectoryStatusError ActiveDirectoryStatus = "Error" + ActiveDirectoryStatusInUse ActiveDirectoryStatus = "InUse" + ActiveDirectoryStatusUpdating ActiveDirectoryStatus = "Updating" +) + +func PossibleValuesForActiveDirectoryStatus() []string { + return []string{ + string(ActiveDirectoryStatusCreated), + string(ActiveDirectoryStatusDeleted), + string(ActiveDirectoryStatusError), + string(ActiveDirectoryStatusInUse), + string(ActiveDirectoryStatusUpdating), + } +} + +func parseActiveDirectoryStatus(input string) (*ActiveDirectoryStatus, error) { + vals := map[string]ActiveDirectoryStatus{ + "created": ActiveDirectoryStatusCreated, + "deleted": ActiveDirectoryStatusDeleted, + "error": ActiveDirectoryStatusError, + "inuse": ActiveDirectoryStatusInUse, + "updating": ActiveDirectoryStatusUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ActiveDirectoryStatus(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/id_netappaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/id_netappaccount.go new file mode 100644 index 000000000000..68e53f4815fc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/id_netappaccount.go @@ -0,0 +1,124 @@ +package netappaccounts + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = NetAppAccountId{} + +// NetAppAccountId is a struct representing the Resource ID for a Net App Account +type NetAppAccountId struct { + SubscriptionId string + ResourceGroupName string + AccountName string +} + +// NewNetAppAccountID returns a new NetAppAccountId struct +func NewNetAppAccountID(subscriptionId string, resourceGroupName string, accountName string) NetAppAccountId { + return NetAppAccountId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AccountName: accountName, + } +} + +// ParseNetAppAccountID parses 'input' into a NetAppAccountId +func ParseNetAppAccountID(input string) (*NetAppAccountId, error) { + parser := resourceids.NewParserFromResourceIdType(NetAppAccountId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := NetAppAccountId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseNetAppAccountIDInsensitively parses 'input' case-insensitively into a NetAppAccountId +// note: this method should only be used for API response data and not user input +func ParseNetAppAccountIDInsensitively(input string) (*NetAppAccountId, error) { + parser := resourceids.NewParserFromResourceIdType(NetAppAccountId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := NetAppAccountId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateNetAppAccountID checks that 'input' can be parsed as a Net App Account ID +func ValidateNetAppAccountID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseNetAppAccountID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Net App Account ID +func (id NetAppAccountId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Net App Account ID +func (id NetAppAccountId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("accountName", "accountValue"), + } +} + +// String returns a human-readable description of this Net App Account ID +func (id NetAppAccountId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Account Name: %q", id.AccountName), + } + return fmt.Sprintf("Net App Account (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountscreateorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountscreateorupdate_autorest.go new file mode 100644 index 000000000000..b192ede4f692 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountscreateorupdate_autorest.go @@ -0,0 +1,79 @@ +package netappaccounts + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AccountsCreateOrUpdateOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// AccountsCreateOrUpdate ... +func (c NetAppAccountsClient) AccountsCreateOrUpdate(ctx context.Context, id NetAppAccountId, input NetAppAccount) (result AccountsCreateOrUpdateOperationResponse, err error) { + req, err := c.preparerForAccountsCreateOrUpdate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsCreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = c.senderForAccountsCreateOrUpdate(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsCreateOrUpdate", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// AccountsCreateOrUpdateThenPoll performs AccountsCreateOrUpdate then polls until it's completed +func (c NetAppAccountsClient) AccountsCreateOrUpdateThenPoll(ctx context.Context, id NetAppAccountId, input NetAppAccount) error { + result, err := c.AccountsCreateOrUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing AccountsCreateOrUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after AccountsCreateOrUpdate: %+v", err) + } + + return nil +} + +// preparerForAccountsCreateOrUpdate prepares the AccountsCreateOrUpdate request. +func (c NetAppAccountsClient) preparerForAccountsCreateOrUpdate(ctx context.Context, id NetAppAccountId, input NetAppAccount) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForAccountsCreateOrUpdate sends the AccountsCreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (c NetAppAccountsClient) senderForAccountsCreateOrUpdate(ctx context.Context, req *http.Request) (future AccountsCreateOrUpdateOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountsdelete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountsdelete_autorest.go new file mode 100644 index 000000000000..4506db44c634 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountsdelete_autorest.go @@ -0,0 +1,78 @@ +package netappaccounts + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AccountsDeleteOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// AccountsDelete ... +func (c NetAppAccountsClient) AccountsDelete(ctx context.Context, id NetAppAccountId) (result AccountsDeleteOperationResponse, err error) { + req, err := c.preparerForAccountsDelete(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsDelete", nil, "Failure preparing request") + return + } + + result, err = c.senderForAccountsDelete(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsDelete", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// AccountsDeleteThenPoll performs AccountsDelete then polls until it's completed +func (c NetAppAccountsClient) AccountsDeleteThenPoll(ctx context.Context, id NetAppAccountId) error { + result, err := c.AccountsDelete(ctx, id) + if err != nil { + return fmt.Errorf("performing AccountsDelete: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after AccountsDelete: %+v", err) + } + + return nil +} + +// preparerForAccountsDelete prepares the AccountsDelete request. +func (c NetAppAccountsClient) preparerForAccountsDelete(ctx context.Context, id NetAppAccountId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForAccountsDelete sends the AccountsDelete request. The method will close the +// http.Response Body if it receives an error. +func (c NetAppAccountsClient) senderForAccountsDelete(ctx context.Context, req *http.Request) (future AccountsDeleteOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountsget_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountsget_autorest.go new file mode 100644 index 000000000000..1c1edc04ccfb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountsget_autorest.go @@ -0,0 +1,67 @@ +package netappaccounts + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AccountsGetOperationResponse struct { + HttpResponse *http.Response + Model *NetAppAccount +} + +// AccountsGet ... +func (c NetAppAccountsClient) AccountsGet(ctx context.Context, id NetAppAccountId) (result AccountsGetOperationResponse, err error) { + req, err := c.preparerForAccountsGet(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsGet", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsGet", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForAccountsGet(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsGet", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForAccountsGet prepares the AccountsGet request. +func (c NetAppAccountsClient) preparerForAccountsGet(ctx context.Context, id NetAppAccountId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForAccountsGet handles the response to the AccountsGet request. The method always +// closes the http.Response Body. +func (c NetAppAccountsClient) responderForAccountsGet(resp *http.Response) (result AccountsGetOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountslist_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountslist_autorest.go new file mode 100644 index 000000000000..dd93604fbcd5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountslist_autorest.go @@ -0,0 +1,187 @@ +package netappaccounts + +import ( + "context" + "fmt" + "net/http" + "net/url" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AccountsListOperationResponse struct { + HttpResponse *http.Response + Model *[]NetAppAccount + + nextLink *string + nextPageFunc func(ctx context.Context, nextLink string) (AccountsListOperationResponse, error) +} + +type AccountsListCompleteResult struct { + Items []NetAppAccount +} + +func (r AccountsListOperationResponse) HasMore() bool { + return r.nextLink != nil +} + +func (r AccountsListOperationResponse) LoadMore(ctx context.Context) (resp AccountsListOperationResponse, err error) { + if !r.HasMore() { + err = fmt.Errorf("no more pages returned") + return + } + return r.nextPageFunc(ctx, *r.nextLink) +} + +// AccountsList ... +func (c NetAppAccountsClient) AccountsList(ctx context.Context, id commonids.ResourceGroupId) (resp AccountsListOperationResponse, err error) { + req, err := c.preparerForAccountsList(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsList", nil, "Failure preparing request") + return + } + + resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsList", resp.HttpResponse, "Failure sending request") + return + } + + resp, err = c.responderForAccountsList(resp.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsList", resp.HttpResponse, "Failure responding to request") + return + } + return +} + +// AccountsListComplete retrieves all of the results into a single object +func (c NetAppAccountsClient) AccountsListComplete(ctx context.Context, id commonids.ResourceGroupId) (AccountsListCompleteResult, error) { + return c.AccountsListCompleteMatchingPredicate(ctx, id, NetAppAccountOperationPredicate{}) +} + +// AccountsListCompleteMatchingPredicate retrieves all of the results and then applied the predicate +func (c NetAppAccountsClient) AccountsListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate NetAppAccountOperationPredicate) (resp AccountsListCompleteResult, err error) { + items := make([]NetAppAccount, 0) + + page, err := c.AccountsList(ctx, id) + if err != nil { + err = fmt.Errorf("loading the initial page: %+v", err) + return + } + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + for page.HasMore() { + page, err = page.LoadMore(ctx) + if err != nil { + err = fmt.Errorf("loading the next page: %+v", err) + return + } + + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + } + + out := AccountsListCompleteResult{ + Items: items, + } + return out, nil +} + +// preparerForAccountsList prepares the AccountsList request. +func (c NetAppAccountsClient) preparerForAccountsList(ctx context.Context, id commonids.ResourceGroupId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/providers/Microsoft.NetApp/netAppAccounts", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// preparerForAccountsListWithNextLink prepares the AccountsList request with the given nextLink token. +func (c NetAppAccountsClient) preparerForAccountsListWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { + uri, err := url.Parse(nextLink) + if err != nil { + return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) + } + queryParameters := map[string]interface{}{} + for k, v := range uri.Query() { + if len(v) == 0 { + continue + } + val := v[0] + val = autorest.Encode("query", val) + queryParameters[k] = val + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(uri.Path), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForAccountsList handles the response to the AccountsList request. The method always +// closes the http.Response Body. +func (c NetAppAccountsClient) responderForAccountsList(resp *http.Response) (result AccountsListOperationResponse, err error) { + type page struct { + Values []NetAppAccount `json:"value"` + NextLink *string `json:"nextLink"` + } + var respObj page + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&respObj), + autorest.ByClosing()) + result.HttpResponse = resp + result.Model = &respObj.Values + result.nextLink = respObj.NextLink + if respObj.NextLink != nil { + result.nextPageFunc = func(ctx context.Context, nextLink string) (result AccountsListOperationResponse, err error) { + req, err := c.preparerForAccountsListWithNextLink(ctx, nextLink) + if err != nil { + err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsList", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsList", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForAccountsList(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsList", result.HttpResponse, "Failure responding to request") + return + } + + return + } + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountslistbysubscription_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountslistbysubscription_autorest.go new file mode 100644 index 000000000000..bd65578f1751 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountslistbysubscription_autorest.go @@ -0,0 +1,187 @@ +package netappaccounts + +import ( + "context" + "fmt" + "net/http" + "net/url" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AccountsListBySubscriptionOperationResponse struct { + HttpResponse *http.Response + Model *[]NetAppAccount + + nextLink *string + nextPageFunc func(ctx context.Context, nextLink string) (AccountsListBySubscriptionOperationResponse, error) +} + +type AccountsListBySubscriptionCompleteResult struct { + Items []NetAppAccount +} + +func (r AccountsListBySubscriptionOperationResponse) HasMore() bool { + return r.nextLink != nil +} + +func (r AccountsListBySubscriptionOperationResponse) LoadMore(ctx context.Context) (resp AccountsListBySubscriptionOperationResponse, err error) { + if !r.HasMore() { + err = fmt.Errorf("no more pages returned") + return + } + return r.nextPageFunc(ctx, *r.nextLink) +} + +// AccountsListBySubscription ... +func (c NetAppAccountsClient) AccountsListBySubscription(ctx context.Context, id commonids.SubscriptionId) (resp AccountsListBySubscriptionOperationResponse, err error) { + req, err := c.preparerForAccountsListBySubscription(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsListBySubscription", nil, "Failure preparing request") + return + } + + resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsListBySubscription", resp.HttpResponse, "Failure sending request") + return + } + + resp, err = c.responderForAccountsListBySubscription(resp.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsListBySubscription", resp.HttpResponse, "Failure responding to request") + return + } + return +} + +// AccountsListBySubscriptionComplete retrieves all of the results into a single object +func (c NetAppAccountsClient) AccountsListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId) (AccountsListBySubscriptionCompleteResult, error) { + return c.AccountsListBySubscriptionCompleteMatchingPredicate(ctx, id, NetAppAccountOperationPredicate{}) +} + +// AccountsListBySubscriptionCompleteMatchingPredicate retrieves all of the results and then applied the predicate +func (c NetAppAccountsClient) AccountsListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate NetAppAccountOperationPredicate) (resp AccountsListBySubscriptionCompleteResult, err error) { + items := make([]NetAppAccount, 0) + + page, err := c.AccountsListBySubscription(ctx, id) + if err != nil { + err = fmt.Errorf("loading the initial page: %+v", err) + return + } + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + for page.HasMore() { + page, err = page.LoadMore(ctx) + if err != nil { + err = fmt.Errorf("loading the next page: %+v", err) + return + } + + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + } + + out := AccountsListBySubscriptionCompleteResult{ + Items: items, + } + return out, nil +} + +// preparerForAccountsListBySubscription prepares the AccountsListBySubscription request. +func (c NetAppAccountsClient) preparerForAccountsListBySubscription(ctx context.Context, id commonids.SubscriptionId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/providers/Microsoft.NetApp/netAppAccounts", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// preparerForAccountsListBySubscriptionWithNextLink prepares the AccountsListBySubscription request with the given nextLink token. +func (c NetAppAccountsClient) preparerForAccountsListBySubscriptionWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { + uri, err := url.Parse(nextLink) + if err != nil { + return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) + } + queryParameters := map[string]interface{}{} + for k, v := range uri.Query() { + if len(v) == 0 { + continue + } + val := v[0] + val = autorest.Encode("query", val) + queryParameters[k] = val + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(uri.Path), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForAccountsListBySubscription handles the response to the AccountsListBySubscription request. The method always +// closes the http.Response Body. +func (c NetAppAccountsClient) responderForAccountsListBySubscription(resp *http.Response) (result AccountsListBySubscriptionOperationResponse, err error) { + type page struct { + Values []NetAppAccount `json:"value"` + NextLink *string `json:"nextLink"` + } + var respObj page + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&respObj), + autorest.ByClosing()) + result.HttpResponse = resp + result.Model = &respObj.Values + result.nextLink = respObj.NextLink + if respObj.NextLink != nil { + result.nextPageFunc = func(ctx context.Context, nextLink string) (result AccountsListBySubscriptionOperationResponse, err error) { + req, err := c.preparerForAccountsListBySubscriptionWithNextLink(ctx, nextLink) + if err != nil { + err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsListBySubscription", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsListBySubscription", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForAccountsListBySubscription(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsListBySubscription", result.HttpResponse, "Failure responding to request") + return + } + + return + } + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountsupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountsupdate_autorest.go new file mode 100644 index 000000000000..8ed5cd37c4ce --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountsupdate_autorest.go @@ -0,0 +1,79 @@ +package netappaccounts + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AccountsUpdateOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// AccountsUpdate ... +func (c NetAppAccountsClient) AccountsUpdate(ctx context.Context, id NetAppAccountId, input NetAppAccountPatch) (result AccountsUpdateOperationResponse, err error) { + req, err := c.preparerForAccountsUpdate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsUpdate", nil, "Failure preparing request") + return + } + + result, err = c.senderForAccountsUpdate(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsUpdate", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// AccountsUpdateThenPoll performs AccountsUpdate then polls until it's completed +func (c NetAppAccountsClient) AccountsUpdateThenPoll(ctx context.Context, id NetAppAccountId, input NetAppAccountPatch) error { + result, err := c.AccountsUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing AccountsUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after AccountsUpdate: %+v", err) + } + + return nil +} + +// preparerForAccountsUpdate prepares the AccountsUpdate request. +func (c NetAppAccountsClient) preparerForAccountsUpdate(ctx context.Context, id NetAppAccountId, input NetAppAccountPatch) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForAccountsUpdate sends the AccountsUpdate request. The method will close the +// http.Response Body if it receives an error. +func (c NetAppAccountsClient) senderForAccountsUpdate(ctx context.Context, req *http.Request) (future AccountsUpdateOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_accountencryption.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_accountencryption.go new file mode 100644 index 000000000000..39a9282ce500 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_accountencryption.go @@ -0,0 +1,8 @@ +package netappaccounts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AccountEncryption struct { + KeySource *string `json:"keySource,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_accountproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_accountproperties.go new file mode 100644 index 000000000000..b158b47fc946 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_accountproperties.go @@ -0,0 +1,10 @@ +package netappaccounts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AccountProperties struct { + ActiveDirectories *[]ActiveDirectory `json:"activeDirectories,omitempty"` + Encryption *AccountEncryption `json:"encryption,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_activedirectory.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_activedirectory.go new file mode 100644 index 000000000000..da90d13da0a4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_activedirectory.go @@ -0,0 +1,29 @@ +package netappaccounts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ActiveDirectory struct { + ActiveDirectoryId *string `json:"activeDirectoryId,omitempty"` + AdName *string `json:"adName,omitempty"` + Administrators *[]string `json:"administrators,omitempty"` + AesEncryption *bool `json:"aesEncryption,omitempty"` + AllowLocalNfsUsersWithLdap *bool `json:"allowLocalNfsUsersWithLdap,omitempty"` + BackupOperators *[]string `json:"backupOperators,omitempty"` + Dns *string `json:"dns,omitempty"` + Domain *string `json:"domain,omitempty"` + EncryptDCConnections *bool `json:"encryptDCConnections,omitempty"` + KdcIP *string `json:"kdcIP,omitempty"` + LdapOverTLS *bool `json:"ldapOverTLS,omitempty"` + LdapSearchScope *LdapSearchScopeOpt `json:"ldapSearchScope,omitempty"` + LdapSigning *bool `json:"ldapSigning,omitempty"` + OrganizationalUnit *string `json:"organizationalUnit,omitempty"` + Password *string `json:"password,omitempty"` + SecurityOperators *[]string `json:"securityOperators,omitempty"` + ServerRootCACertificate *string `json:"serverRootCACertificate,omitempty"` + Site *string `json:"site,omitempty"` + SmbServerName *string `json:"smbServerName,omitempty"` + Status *ActiveDirectoryStatus `json:"status,omitempty"` + StatusDetails *string `json:"statusDetails,omitempty"` + Username *string `json:"username,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_ldapsearchscopeopt.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_ldapsearchscopeopt.go new file mode 100644 index 000000000000..c476b0f0875f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_ldapsearchscopeopt.go @@ -0,0 +1,10 @@ +package netappaccounts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type LdapSearchScopeOpt struct { + GroupDN *string `json:"groupDN,omitempty"` + GroupMembershipFilter *string `json:"groupMembershipFilter,omitempty"` + UserDN *string `json:"userDN,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_netappaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_netappaccount.go new file mode 100644 index 000000000000..ec2ed4aa10c5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_netappaccount.go @@ -0,0 +1,19 @@ +package netappaccounts + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetAppAccount struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties *AccountProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_netappaccountpatch.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_netappaccountpatch.go new file mode 100644 index 000000000000..d3c6c1efcc20 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_netappaccountpatch.go @@ -0,0 +1,13 @@ +package netappaccounts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetAppAccountPatch struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *AccountProperties `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/predicates.go new file mode 100644 index 000000000000..cc139fd85c4a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/predicates.go @@ -0,0 +1,34 @@ +package netappaccounts + +type NetAppAccountOperationPredicate struct { + Etag *string + Id *string + Location *string + Name *string + Type *string +} + +func (p NetAppAccountOperationPredicate) Matches(input NetAppAccount) bool { + + if p.Etag != nil && (input.Etag == nil && *p.Etag != *input.Etag) { + return false + } + + if p.Id != nil && (input.Id == nil && *p.Id != *input.Id) { + return false + } + + if p.Location != nil && *p.Location != input.Location { + return false + } + + if p.Name != nil && (input.Name == nil && *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil && *p.Type != *input.Type) { + return false + } + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/version.go new file mode 100644 index 000000000000..3de2667a1a82 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/version.go @@ -0,0 +1,12 @@ +package netappaccounts + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2021-10-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/netappaccounts/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/README.md new file mode 100644 index 000000000000..802de9b9653a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/README.md @@ -0,0 +1,102 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy` Documentation + +The `snapshotpolicy` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2021-10-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy" +``` + + +### Client Initialization + +```go +client := snapshotpolicy.NewSnapshotPolicyClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `SnapshotPolicyClient.SnapshotPoliciesCreate` + +```go +ctx := context.TODO() +id := snapshotpolicy.NewSnapshotPoliciesID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "snapshotPolicyValue") + +payload := snapshotpolicy.SnapshotPolicy{ + // ... +} + + +read, err := client.SnapshotPoliciesCreate(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `SnapshotPolicyClient.SnapshotPoliciesDelete` + +```go +ctx := context.TODO() +id := snapshotpolicy.NewSnapshotPoliciesID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "snapshotPolicyValue") + +if err := client.SnapshotPoliciesDeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `SnapshotPolicyClient.SnapshotPoliciesGet` + +```go +ctx := context.TODO() +id := snapshotpolicy.NewSnapshotPoliciesID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "snapshotPolicyValue") + +read, err := client.SnapshotPoliciesGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `SnapshotPolicyClient.SnapshotPoliciesList` + +```go +ctx := context.TODO() +id := snapshotpolicy.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") + +read, err := client.SnapshotPoliciesList(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `SnapshotPolicyClient.SnapshotPoliciesUpdate` + +```go +ctx := context.TODO() +id := snapshotpolicy.NewSnapshotPoliciesID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "snapshotPolicyValue") + +payload := snapshotpolicy.SnapshotPolicyPatch{ + // ... +} + + +if err := client.SnapshotPoliciesUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/client.go new file mode 100644 index 000000000000..63c20fd6ea4d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/client.go @@ -0,0 +1,18 @@ +package snapshotpolicy + +import "github.com/Azure/go-autorest/autorest" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SnapshotPolicyClient struct { + Client autorest.Client + baseUri string +} + +func NewSnapshotPolicyClientWithBaseURI(endpoint string) SnapshotPolicyClient { + return SnapshotPolicyClient{ + Client: autorest.NewClientWithUserAgent(userAgent()), + baseUri: endpoint, + } +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/id_netappaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/id_netappaccount.go new file mode 100644 index 000000000000..726c28f92e9c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/id_netappaccount.go @@ -0,0 +1,124 @@ +package snapshotpolicy + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = NetAppAccountId{} + +// NetAppAccountId is a struct representing the Resource ID for a Net App Account +type NetAppAccountId struct { + SubscriptionId string + ResourceGroupName string + AccountName string +} + +// NewNetAppAccountID returns a new NetAppAccountId struct +func NewNetAppAccountID(subscriptionId string, resourceGroupName string, accountName string) NetAppAccountId { + return NetAppAccountId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AccountName: accountName, + } +} + +// ParseNetAppAccountID parses 'input' into a NetAppAccountId +func ParseNetAppAccountID(input string) (*NetAppAccountId, error) { + parser := resourceids.NewParserFromResourceIdType(NetAppAccountId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := NetAppAccountId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseNetAppAccountIDInsensitively parses 'input' case-insensitively into a NetAppAccountId +// note: this method should only be used for API response data and not user input +func ParseNetAppAccountIDInsensitively(input string) (*NetAppAccountId, error) { + parser := resourceids.NewParserFromResourceIdType(NetAppAccountId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := NetAppAccountId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateNetAppAccountID checks that 'input' can be parsed as a Net App Account ID +func ValidateNetAppAccountID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseNetAppAccountID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Net App Account ID +func (id NetAppAccountId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Net App Account ID +func (id NetAppAccountId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("accountName", "accountValue"), + } +} + +// String returns a human-readable description of this Net App Account ID +func (id NetAppAccountId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Account Name: %q", id.AccountName), + } + return fmt.Sprintf("Net App Account (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/id_snapshotpolicies.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/id_snapshotpolicies.go new file mode 100644 index 000000000000..f0662d3bf339 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/id_snapshotpolicies.go @@ -0,0 +1,137 @@ +package snapshotpolicy + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = SnapshotPoliciesId{} + +// SnapshotPoliciesId is a struct representing the Resource ID for a Snapshot Policies +type SnapshotPoliciesId struct { + SubscriptionId string + ResourceGroupName string + AccountName string + SnapshotPolicyName string +} + +// NewSnapshotPoliciesID returns a new SnapshotPoliciesId struct +func NewSnapshotPoliciesID(subscriptionId string, resourceGroupName string, accountName string, snapshotPolicyName string) SnapshotPoliciesId { + return SnapshotPoliciesId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AccountName: accountName, + SnapshotPolicyName: snapshotPolicyName, + } +} + +// ParseSnapshotPoliciesID parses 'input' into a SnapshotPoliciesId +func ParseSnapshotPoliciesID(input string) (*SnapshotPoliciesId, error) { + parser := resourceids.NewParserFromResourceIdType(SnapshotPoliciesId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := SnapshotPoliciesId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + if id.SnapshotPolicyName, ok = parsed.Parsed["snapshotPolicyName"]; !ok { + return nil, fmt.Errorf("the segment 'snapshotPolicyName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseSnapshotPoliciesIDInsensitively parses 'input' case-insensitively into a SnapshotPoliciesId +// note: this method should only be used for API response data and not user input +func ParseSnapshotPoliciesIDInsensitively(input string) (*SnapshotPoliciesId, error) { + parser := resourceids.NewParserFromResourceIdType(SnapshotPoliciesId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := SnapshotPoliciesId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + if id.SnapshotPolicyName, ok = parsed.Parsed["snapshotPolicyName"]; !ok { + return nil, fmt.Errorf("the segment 'snapshotPolicyName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateSnapshotPoliciesID checks that 'input' can be parsed as a Snapshot Policies ID +func ValidateSnapshotPoliciesID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseSnapshotPoliciesID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Snapshot Policies ID +func (id SnapshotPoliciesId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/snapshotPolicies/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName, id.SnapshotPolicyName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Snapshot Policies ID +func (id SnapshotPoliciesId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("accountName", "accountValue"), + resourceids.StaticSegment("staticSnapshotPolicies", "snapshotPolicies", "snapshotPolicies"), + resourceids.UserSpecifiedSegment("snapshotPolicyName", "snapshotPolicyValue"), + } +} + +// String returns a human-readable description of this Snapshot Policies ID +func (id SnapshotPoliciesId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Account Name: %q", id.AccountName), + fmt.Sprintf("Snapshot Policy Name: %q", id.SnapshotPolicyName), + } + return fmt.Sprintf("Snapshot Policies (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpoliciescreate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpoliciescreate_autorest.go new file mode 100644 index 000000000000..43d25be8b167 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpoliciescreate_autorest.go @@ -0,0 +1,68 @@ +package snapshotpolicy + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SnapshotPoliciesCreateOperationResponse struct { + HttpResponse *http.Response + Model *SnapshotPolicy +} + +// SnapshotPoliciesCreate ... +func (c SnapshotPolicyClient) SnapshotPoliciesCreate(ctx context.Context, id SnapshotPoliciesId, input SnapshotPolicy) (result SnapshotPoliciesCreateOperationResponse, err error) { + req, err := c.preparerForSnapshotPoliciesCreate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesCreate", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesCreate", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForSnapshotPoliciesCreate(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesCreate", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForSnapshotPoliciesCreate prepares the SnapshotPoliciesCreate request. +func (c SnapshotPolicyClient) preparerForSnapshotPoliciesCreate(ctx context.Context, id SnapshotPoliciesId, input SnapshotPolicy) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForSnapshotPoliciesCreate handles the response to the SnapshotPoliciesCreate request. The method always +// closes the http.Response Body. +func (c SnapshotPolicyClient) responderForSnapshotPoliciesCreate(resp *http.Response) (result SnapshotPoliciesCreateOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpoliciesdelete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpoliciesdelete_autorest.go new file mode 100644 index 000000000000..0b2ba8905215 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpoliciesdelete_autorest.go @@ -0,0 +1,78 @@ +package snapshotpolicy + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SnapshotPoliciesDeleteOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// SnapshotPoliciesDelete ... +func (c SnapshotPolicyClient) SnapshotPoliciesDelete(ctx context.Context, id SnapshotPoliciesId) (result SnapshotPoliciesDeleteOperationResponse, err error) { + req, err := c.preparerForSnapshotPoliciesDelete(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesDelete", nil, "Failure preparing request") + return + } + + result, err = c.senderForSnapshotPoliciesDelete(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesDelete", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// SnapshotPoliciesDeleteThenPoll performs SnapshotPoliciesDelete then polls until it's completed +func (c SnapshotPolicyClient) SnapshotPoliciesDeleteThenPoll(ctx context.Context, id SnapshotPoliciesId) error { + result, err := c.SnapshotPoliciesDelete(ctx, id) + if err != nil { + return fmt.Errorf("performing SnapshotPoliciesDelete: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after SnapshotPoliciesDelete: %+v", err) + } + + return nil +} + +// preparerForSnapshotPoliciesDelete prepares the SnapshotPoliciesDelete request. +func (c SnapshotPolicyClient) preparerForSnapshotPoliciesDelete(ctx context.Context, id SnapshotPoliciesId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForSnapshotPoliciesDelete sends the SnapshotPoliciesDelete request. The method will close the +// http.Response Body if it receives an error. +func (c SnapshotPolicyClient) senderForSnapshotPoliciesDelete(ctx context.Context, req *http.Request) (future SnapshotPoliciesDeleteOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpoliciesget_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpoliciesget_autorest.go new file mode 100644 index 000000000000..26d3741d8b6c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpoliciesget_autorest.go @@ -0,0 +1,67 @@ +package snapshotpolicy + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SnapshotPoliciesGetOperationResponse struct { + HttpResponse *http.Response + Model *SnapshotPolicy +} + +// SnapshotPoliciesGet ... +func (c SnapshotPolicyClient) SnapshotPoliciesGet(ctx context.Context, id SnapshotPoliciesId) (result SnapshotPoliciesGetOperationResponse, err error) { + req, err := c.preparerForSnapshotPoliciesGet(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesGet", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesGet", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForSnapshotPoliciesGet(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesGet", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForSnapshotPoliciesGet prepares the SnapshotPoliciesGet request. +func (c SnapshotPolicyClient) preparerForSnapshotPoliciesGet(ctx context.Context, id SnapshotPoliciesId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForSnapshotPoliciesGet handles the response to the SnapshotPoliciesGet request. The method always +// closes the http.Response Body. +func (c SnapshotPolicyClient) responderForSnapshotPoliciesGet(resp *http.Response) (result SnapshotPoliciesGetOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpolicieslist_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpolicieslist_autorest.go new file mode 100644 index 000000000000..b9f36c35c96f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpolicieslist_autorest.go @@ -0,0 +1,68 @@ +package snapshotpolicy + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SnapshotPoliciesListOperationResponse struct { + HttpResponse *http.Response + Model *SnapshotPoliciesList +} + +// SnapshotPoliciesList ... +func (c SnapshotPolicyClient) SnapshotPoliciesList(ctx context.Context, id NetAppAccountId) (result SnapshotPoliciesListOperationResponse, err error) { + req, err := c.preparerForSnapshotPoliciesList(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesList", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesList", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForSnapshotPoliciesList(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesList", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForSnapshotPoliciesList prepares the SnapshotPoliciesList request. +func (c SnapshotPolicyClient) preparerForSnapshotPoliciesList(ctx context.Context, id NetAppAccountId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/snapshotPolicies", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForSnapshotPoliciesList handles the response to the SnapshotPoliciesList request. The method always +// closes the http.Response Body. +func (c SnapshotPolicyClient) responderForSnapshotPoliciesList(resp *http.Response) (result SnapshotPoliciesListOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpoliciesupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpoliciesupdate_autorest.go new file mode 100644 index 000000000000..eea75a1378c0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpoliciesupdate_autorest.go @@ -0,0 +1,79 @@ +package snapshotpolicy + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SnapshotPoliciesUpdateOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// SnapshotPoliciesUpdate ... +func (c SnapshotPolicyClient) SnapshotPoliciesUpdate(ctx context.Context, id SnapshotPoliciesId, input SnapshotPolicyPatch) (result SnapshotPoliciesUpdateOperationResponse, err error) { + req, err := c.preparerForSnapshotPoliciesUpdate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesUpdate", nil, "Failure preparing request") + return + } + + result, err = c.senderForSnapshotPoliciesUpdate(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesUpdate", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// SnapshotPoliciesUpdateThenPoll performs SnapshotPoliciesUpdate then polls until it's completed +func (c SnapshotPolicyClient) SnapshotPoliciesUpdateThenPoll(ctx context.Context, id SnapshotPoliciesId, input SnapshotPolicyPatch) error { + result, err := c.SnapshotPoliciesUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing SnapshotPoliciesUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after SnapshotPoliciesUpdate: %+v", err) + } + + return nil +} + +// preparerForSnapshotPoliciesUpdate prepares the SnapshotPoliciesUpdate request. +func (c SnapshotPolicyClient) preparerForSnapshotPoliciesUpdate(ctx context.Context, id SnapshotPoliciesId, input SnapshotPolicyPatch) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForSnapshotPoliciesUpdate sends the SnapshotPoliciesUpdate request. The method will close the +// http.Response Body if it receives an error. +func (c SnapshotPolicyClient) senderForSnapshotPoliciesUpdate(ctx context.Context, req *http.Request) (future SnapshotPoliciesUpdateOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_dailyschedule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_dailyschedule.go new file mode 100644 index 000000000000..bdafb72e6e09 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_dailyschedule.go @@ -0,0 +1,11 @@ +package snapshotpolicy + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DailySchedule struct { + Hour *int64 `json:"hour,omitempty"` + Minute *int64 `json:"minute,omitempty"` + SnapshotsToKeep *int64 `json:"snapshotsToKeep,omitempty"` + UsedBytes *int64 `json:"usedBytes,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_hourlyschedule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_hourlyschedule.go new file mode 100644 index 000000000000..a1e5d0fa0283 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_hourlyschedule.go @@ -0,0 +1,10 @@ +package snapshotpolicy + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HourlySchedule struct { + Minute *int64 `json:"minute,omitempty"` + SnapshotsToKeep *int64 `json:"snapshotsToKeep,omitempty"` + UsedBytes *int64 `json:"usedBytes,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_monthlyschedule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_monthlyschedule.go new file mode 100644 index 000000000000..02cbcad6a592 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_monthlyschedule.go @@ -0,0 +1,12 @@ +package snapshotpolicy + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MonthlySchedule struct { + DaysOfMonth *string `json:"daysOfMonth,omitempty"` + Hour *int64 `json:"hour,omitempty"` + Minute *int64 `json:"minute,omitempty"` + SnapshotsToKeep *int64 `json:"snapshotsToKeep,omitempty"` + UsedBytes *int64 `json:"usedBytes,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_snapshotpolicieslist.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_snapshotpolicieslist.go new file mode 100644 index 000000000000..910e2519adbe --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_snapshotpolicieslist.go @@ -0,0 +1,8 @@ +package snapshotpolicy + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SnapshotPoliciesList struct { + Value *[]SnapshotPolicy `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_snapshotpolicy.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_snapshotpolicy.go new file mode 100644 index 000000000000..310cfaaf1bb9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_snapshotpolicy.go @@ -0,0 +1,19 @@ +package snapshotpolicy + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SnapshotPolicy struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties SnapshotPolicyProperties `json:"properties"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_snapshotpolicypatch.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_snapshotpolicypatch.go new file mode 100644 index 000000000000..76df9be172b9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_snapshotpolicypatch.go @@ -0,0 +1,13 @@ +package snapshotpolicy + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SnapshotPolicyPatch struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *SnapshotPolicyProperties `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_snapshotpolicyproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_snapshotpolicyproperties.go new file mode 100644 index 000000000000..fb4fb0fcb05a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_snapshotpolicyproperties.go @@ -0,0 +1,13 @@ +package snapshotpolicy + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SnapshotPolicyProperties struct { + DailySchedule *DailySchedule `json:"dailySchedule,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + HourlySchedule *HourlySchedule `json:"hourlySchedule,omitempty"` + MonthlySchedule *MonthlySchedule `json:"monthlySchedule,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + WeeklySchedule *WeeklySchedule `json:"weeklySchedule,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_weeklyschedule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_weeklyschedule.go new file mode 100644 index 000000000000..128ece7ef5ef --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_weeklyschedule.go @@ -0,0 +1,12 @@ +package snapshotpolicy + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WeeklySchedule struct { + Day *string `json:"day,omitempty"` + Hour *int64 `json:"hour,omitempty"` + Minute *int64 `json:"minute,omitempty"` + SnapshotsToKeep *int64 `json:"snapshotsToKeep,omitempty"` + UsedBytes *int64 `json:"usedBytes,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/version.go new file mode 100644 index 000000000000..00061163a3a7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/version.go @@ -0,0 +1,12 @@ +package snapshotpolicy + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2021-10-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/snapshotpolicy/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/README.md new file mode 100644 index 000000000000..e6d357e24b68 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/README.md @@ -0,0 +1,111 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots` Documentation + +The `snapshots` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2021-10-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots" +``` + + +### Client Initialization + +```go +client := snapshots.NewSnapshotsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `SnapshotsClient.Create` + +```go +ctx := context.TODO() +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue", "snapshotValue") + +payload := snapshots.Snapshot{ + // ... +} + + +if err := client.CreateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `SnapshotsClient.Delete` + +```go +ctx := context.TODO() +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue", "snapshotValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `SnapshotsClient.Get` + +```go +ctx := context.TODO() +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue", "snapshotValue") + +read, err := client.Get(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `SnapshotsClient.List` + +```go +ctx := context.TODO() +id := snapshots.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue") + +read, err := client.List(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `SnapshotsClient.RestoreFiles` + +```go +ctx := context.TODO() +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue", "snapshotValue") + +payload := snapshots.SnapshotRestoreFiles{ + // ... +} + + +if err := client.RestoreFilesThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `SnapshotsClient.Update` + +```go +ctx := context.TODO() +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue", "snapshotValue") +var payload interface{} + +if err := client.UpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/client.go new file mode 100644 index 000000000000..62d2a1323835 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/client.go @@ -0,0 +1,18 @@ +package snapshots + +import "github.com/Azure/go-autorest/autorest" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SnapshotsClient struct { + Client autorest.Client + baseUri string +} + +func NewSnapshotsClientWithBaseURI(endpoint string) SnapshotsClient { + return SnapshotsClient{ + Client: autorest.NewClientWithUserAgent(userAgent()), + baseUri: endpoint, + } +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/id_snapshot.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/id_snapshot.go new file mode 100644 index 000000000000..d38fb8cb8f01 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/id_snapshot.go @@ -0,0 +1,163 @@ +package snapshots + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = SnapshotId{} + +// SnapshotId is a struct representing the Resource ID for a Snapshot +type SnapshotId struct { + SubscriptionId string + ResourceGroupName string + AccountName string + PoolName string + VolumeName string + SnapshotName string +} + +// NewSnapshotID returns a new SnapshotId struct +func NewSnapshotID(subscriptionId string, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) SnapshotId { + return SnapshotId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AccountName: accountName, + PoolName: poolName, + VolumeName: volumeName, + SnapshotName: snapshotName, + } +} + +// ParseSnapshotID parses 'input' into a SnapshotId +func ParseSnapshotID(input string) (*SnapshotId, error) { + parser := resourceids.NewParserFromResourceIdType(SnapshotId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := SnapshotId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { + return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) + } + + if id.VolumeName, ok = parsed.Parsed["volumeName"]; !ok { + return nil, fmt.Errorf("the segment 'volumeName' was not found in the resource id %q", input) + } + + if id.SnapshotName, ok = parsed.Parsed["snapshotName"]; !ok { + return nil, fmt.Errorf("the segment 'snapshotName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseSnapshotIDInsensitively parses 'input' case-insensitively into a SnapshotId +// note: this method should only be used for API response data and not user input +func ParseSnapshotIDInsensitively(input string) (*SnapshotId, error) { + parser := resourceids.NewParserFromResourceIdType(SnapshotId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := SnapshotId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { + return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) + } + + if id.VolumeName, ok = parsed.Parsed["volumeName"]; !ok { + return nil, fmt.Errorf("the segment 'volumeName' was not found in the resource id %q", input) + } + + if id.SnapshotName, ok = parsed.Parsed["snapshotName"]; !ok { + return nil, fmt.Errorf("the segment 'snapshotName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateSnapshotID checks that 'input' can be parsed as a Snapshot ID +func ValidateSnapshotID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseSnapshotID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Snapshot ID +func (id SnapshotId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/capacityPools/%s/volumes/%s/snapshots/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName, id.PoolName, id.VolumeName, id.SnapshotName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Snapshot ID +func (id SnapshotId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("accountName", "accountValue"), + resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), + resourceids.UserSpecifiedSegment("poolName", "poolValue"), + resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), + resourceids.UserSpecifiedSegment("volumeName", "volumeValue"), + resourceids.StaticSegment("staticSnapshots", "snapshots", "snapshots"), + resourceids.UserSpecifiedSegment("snapshotName", "snapshotValue"), + } +} + +// String returns a human-readable description of this Snapshot ID +func (id SnapshotId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Account Name: %q", id.AccountName), + fmt.Sprintf("Pool Name: %q", id.PoolName), + fmt.Sprintf("Volume Name: %q", id.VolumeName), + fmt.Sprintf("Snapshot Name: %q", id.SnapshotName), + } + return fmt.Sprintf("Snapshot (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/id_volume.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/id_volume.go new file mode 100644 index 000000000000..c5cc73e141c7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/id_volume.go @@ -0,0 +1,150 @@ +package snapshots + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = VolumeId{} + +// VolumeId is a struct representing the Resource ID for a Volume +type VolumeId struct { + SubscriptionId string + ResourceGroupName string + AccountName string + PoolName string + VolumeName string +} + +// NewVolumeID returns a new VolumeId struct +func NewVolumeID(subscriptionId string, resourceGroupName string, accountName string, poolName string, volumeName string) VolumeId { + return VolumeId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AccountName: accountName, + PoolName: poolName, + VolumeName: volumeName, + } +} + +// ParseVolumeID parses 'input' into a VolumeId +func ParseVolumeID(input string) (*VolumeId, error) { + parser := resourceids.NewParserFromResourceIdType(VolumeId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VolumeId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { + return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) + } + + if id.VolumeName, ok = parsed.Parsed["volumeName"]; !ok { + return nil, fmt.Errorf("the segment 'volumeName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseVolumeIDInsensitively parses 'input' case-insensitively into a VolumeId +// note: this method should only be used for API response data and not user input +func ParseVolumeIDInsensitively(input string) (*VolumeId, error) { + parser := resourceids.NewParserFromResourceIdType(VolumeId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VolumeId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { + return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) + } + + if id.VolumeName, ok = parsed.Parsed["volumeName"]; !ok { + return nil, fmt.Errorf("the segment 'volumeName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateVolumeID checks that 'input' can be parsed as a Volume ID +func ValidateVolumeID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseVolumeID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Volume ID +func (id VolumeId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/capacityPools/%s/volumes/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName, id.PoolName, id.VolumeName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Volume ID +func (id VolumeId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("accountName", "accountValue"), + resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), + resourceids.UserSpecifiedSegment("poolName", "poolValue"), + resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), + resourceids.UserSpecifiedSegment("volumeName", "volumeValue"), + } +} + +// String returns a human-readable description of this Volume ID +func (id VolumeId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Account Name: %q", id.AccountName), + fmt.Sprintf("Pool Name: %q", id.PoolName), + fmt.Sprintf("Volume Name: %q", id.VolumeName), + } + return fmt.Sprintf("Volume (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_create_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_create_autorest.go new file mode 100644 index 000000000000..90b33471adef --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_create_autorest.go @@ -0,0 +1,79 @@ +package snapshots + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// Create ... +func (c SnapshotsClient) Create(ctx context.Context, id SnapshotId, input Snapshot) (result CreateOperationResponse, err error) { + req, err := c.preparerForCreate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = c.senderForCreate(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "Create", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// CreateThenPoll performs Create then polls until it's completed +func (c SnapshotsClient) CreateThenPoll(ctx context.Context, id SnapshotId, input Snapshot) error { + result, err := c.Create(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Create: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after Create: %+v", err) + } + + return nil +} + +// preparerForCreate prepares the Create request. +func (c SnapshotsClient) preparerForCreate(ctx context.Context, id SnapshotId, input Snapshot) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForCreate sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (c SnapshotsClient) senderForCreate(ctx context.Context, req *http.Request) (future CreateOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_delete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_delete_autorest.go new file mode 100644 index 000000000000..55f7d9d07967 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_delete_autorest.go @@ -0,0 +1,78 @@ +package snapshots + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// Delete ... +func (c SnapshotsClient) Delete(ctx context.Context, id SnapshotId) (result DeleteOperationResponse, err error) { + req, err := c.preparerForDelete(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = c.senderForDelete(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "Delete", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// DeleteThenPoll performs Delete then polls until it's completed +func (c SnapshotsClient) DeleteThenPoll(ctx context.Context, id SnapshotId) error { + result, err := c.Delete(ctx, id) + if err != nil { + return fmt.Errorf("performing Delete: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after Delete: %+v", err) + } + + return nil +} + +// preparerForDelete prepares the Delete request. +func (c SnapshotsClient) preparerForDelete(ctx context.Context, id SnapshotId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForDelete sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (c SnapshotsClient) senderForDelete(ctx context.Context, req *http.Request) (future DeleteOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_get_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_get_autorest.go new file mode 100644 index 000000000000..4764bf6f0606 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_get_autorest.go @@ -0,0 +1,67 @@ +package snapshots + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetOperationResponse struct { + HttpResponse *http.Response + Model *Snapshot +} + +// Get ... +func (c SnapshotsClient) Get(ctx context.Context, id SnapshotId) (result GetOperationResponse, err error) { + req, err := c.preparerForGet(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "Get", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "Get", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForGet(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "Get", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForGet prepares the Get request. +func (c SnapshotsClient) preparerForGet(ctx context.Context, id SnapshotId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForGet handles the response to the Get request. The method always +// closes the http.Response Body. +func (c SnapshotsClient) responderForGet(resp *http.Response) (result GetOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_list_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_list_autorest.go new file mode 100644 index 000000000000..5d2f714bdc1f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_list_autorest.go @@ -0,0 +1,68 @@ +package snapshots + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListOperationResponse struct { + HttpResponse *http.Response + Model *SnapshotsList +} + +// List ... +func (c SnapshotsClient) List(ctx context.Context, id VolumeId) (result ListOperationResponse, err error) { + req, err := c.preparerForList(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "List", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "List", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForList(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "List", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForList prepares the List request. +func (c SnapshotsClient) preparerForList(ctx context.Context, id VolumeId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/snapshots", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForList handles the response to the List request. The method always +// closes the http.Response Body. +func (c SnapshotsClient) responderForList(resp *http.Response) (result ListOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_restorefiles_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_restorefiles_autorest.go new file mode 100644 index 000000000000..18ef248aa733 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_restorefiles_autorest.go @@ -0,0 +1,79 @@ +package snapshots + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RestoreFilesOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// RestoreFiles ... +func (c SnapshotsClient) RestoreFiles(ctx context.Context, id SnapshotId, input SnapshotRestoreFiles) (result RestoreFilesOperationResponse, err error) { + req, err := c.preparerForRestoreFiles(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "RestoreFiles", nil, "Failure preparing request") + return + } + + result, err = c.senderForRestoreFiles(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "RestoreFiles", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// RestoreFilesThenPoll performs RestoreFiles then polls until it's completed +func (c SnapshotsClient) RestoreFilesThenPoll(ctx context.Context, id SnapshotId, input SnapshotRestoreFiles) error { + result, err := c.RestoreFiles(ctx, id, input) + if err != nil { + return fmt.Errorf("performing RestoreFiles: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after RestoreFiles: %+v", err) + } + + return nil +} + +// preparerForRestoreFiles prepares the RestoreFiles request. +func (c SnapshotsClient) preparerForRestoreFiles(ctx context.Context, id SnapshotId, input SnapshotRestoreFiles) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/restoreFiles", id.ID())), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForRestoreFiles sends the RestoreFiles request. The method will close the +// http.Response Body if it receives an error. +func (c SnapshotsClient) senderForRestoreFiles(ctx context.Context, req *http.Request) (future RestoreFilesOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_update_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_update_autorest.go new file mode 100644 index 000000000000..f96261c20b0b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_update_autorest.go @@ -0,0 +1,79 @@ +package snapshots + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpdateOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// Update ... +func (c SnapshotsClient) Update(ctx context.Context, id SnapshotId, input interface{}) (result UpdateOperationResponse, err error) { + req, err := c.preparerForUpdate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = c.senderForUpdate(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "Update", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// UpdateThenPoll performs Update then polls until it's completed +func (c SnapshotsClient) UpdateThenPoll(ctx context.Context, id SnapshotId, input interface{}) error { + result, err := c.Update(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Update: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after Update: %+v", err) + } + + return nil +} + +// preparerForUpdate prepares the Update request. +func (c SnapshotsClient) preparerForUpdate(ctx context.Context, id SnapshotId, input interface{}) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForUpdate sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (c SnapshotsClient) senderForUpdate(ctx context.Context, req *http.Request) (future UpdateOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/model_snapshot.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/model_snapshot.go new file mode 100644 index 000000000000..996c7160dd19 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/model_snapshot.go @@ -0,0 +1,12 @@ +package snapshots + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Snapshot struct { + Id *string `json:"id,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties *SnapshotProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/model_snapshotproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/model_snapshotproperties.go new file mode 100644 index 000000000000..fe60537eaaa9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/model_snapshotproperties.go @@ -0,0 +1,28 @@ +package snapshots + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SnapshotProperties struct { + Created *string `json:"created,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + SnapshotId *string `json:"snapshotId,omitempty"` +} + +func (o *SnapshotProperties) GetCreatedAsTime() (*time.Time, error) { + if o.Created == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Created, "2006-01-02T15:04:05Z07:00") +} + +func (o *SnapshotProperties) SetCreatedAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Created = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/model_snapshotrestorefiles.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/model_snapshotrestorefiles.go new file mode 100644 index 000000000000..de80d971dcf6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/model_snapshotrestorefiles.go @@ -0,0 +1,9 @@ +package snapshots + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SnapshotRestoreFiles struct { + DestinationPath *string `json:"destinationPath,omitempty"` + FilePaths []string `json:"filePaths"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/model_snapshotslist.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/model_snapshotslist.go new file mode 100644 index 000000000000..bf283b0d2ac6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/model_snapshotslist.go @@ -0,0 +1,8 @@ +package snapshots + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SnapshotsList struct { + Value *[]Snapshot `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/version.go new file mode 100644 index 000000000000..90179a6f56ae --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/version.go @@ -0,0 +1,12 @@ +package snapshots + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2021-10-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/snapshots/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/README.md new file mode 100644 index 000000000000..607525434646 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/README.md @@ -0,0 +1,81 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups` Documentation + +The `volumegroups` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2021-10-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups" +``` + + +### Client Initialization + +```go +client := volumegroups.NewVolumeGroupsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VolumeGroupsClient.VolumeGroupsCreate` + +```go +ctx := context.TODO() +id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "volumeGroupValue") + +payload := volumegroups.VolumeGroupDetails{ + // ... +} + + +if err := client.VolumeGroupsCreateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VolumeGroupsClient.VolumeGroupsDelete` + +```go +ctx := context.TODO() +id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "volumeGroupValue") + +if err := client.VolumeGroupsDeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VolumeGroupsClient.VolumeGroupsGet` + +```go +ctx := context.TODO() +id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "volumeGroupValue") + +read, err := client.VolumeGroupsGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VolumeGroupsClient.VolumeGroupsListByNetAppAccount` + +```go +ctx := context.TODO() +id := volumegroups.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") + +read, err := client.VolumeGroupsListByNetAppAccount(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/client.go new file mode 100644 index 000000000000..c7beab84b9a1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/client.go @@ -0,0 +1,18 @@ +package volumegroups + +import "github.com/Azure/go-autorest/autorest" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupsClient struct { + Client autorest.Client + baseUri string +} + +func NewVolumeGroupsClientWithBaseURI(endpoint string) VolumeGroupsClient { + return VolumeGroupsClient{ + Client: autorest.NewClientWithUserAgent(userAgent()), + baseUri: endpoint, + } +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/constants.go new file mode 100644 index 000000000000..15a1d52b1822 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/constants.go @@ -0,0 +1,295 @@ +package volumegroups + +import "strings" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ApplicationType string + +const ( + ApplicationTypeSAPNegativeHANA ApplicationType = "SAP-HANA" +) + +func PossibleValuesForApplicationType() []string { + return []string{ + string(ApplicationTypeSAPNegativeHANA), + } +} + +func parseApplicationType(input string) (*ApplicationType, error) { + vals := map[string]ApplicationType{ + "sap-hana": ApplicationTypeSAPNegativeHANA, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ApplicationType(input) + return &out, nil +} + +type AvsDataStore string + +const ( + AvsDataStoreDisabled AvsDataStore = "Disabled" + AvsDataStoreEnabled AvsDataStore = "Enabled" +) + +func PossibleValuesForAvsDataStore() []string { + return []string{ + string(AvsDataStoreDisabled), + string(AvsDataStoreEnabled), + } +} + +func parseAvsDataStore(input string) (*AvsDataStore, error) { + vals := map[string]AvsDataStore{ + "disabled": AvsDataStoreDisabled, + "enabled": AvsDataStoreEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AvsDataStore(input) + return &out, nil +} + +type ChownMode string + +const ( + ChownModeRestricted ChownMode = "Restricted" + ChownModeUnrestricted ChownMode = "Unrestricted" +) + +func PossibleValuesForChownMode() []string { + return []string{ + string(ChownModeRestricted), + string(ChownModeUnrestricted), + } +} + +func parseChownMode(input string) (*ChownMode, error) { + vals := map[string]ChownMode{ + "restricted": ChownModeRestricted, + "unrestricted": ChownModeUnrestricted, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ChownMode(input) + return &out, nil +} + +type EnableSubvolumes string + +const ( + EnableSubvolumesDisabled EnableSubvolumes = "Disabled" + EnableSubvolumesEnabled EnableSubvolumes = "Enabled" +) + +func PossibleValuesForEnableSubvolumes() []string { + return []string{ + string(EnableSubvolumesDisabled), + string(EnableSubvolumesEnabled), + } +} + +func parseEnableSubvolumes(input string) (*EnableSubvolumes, error) { + vals := map[string]EnableSubvolumes{ + "disabled": EnableSubvolumesDisabled, + "enabled": EnableSubvolumesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := EnableSubvolumes(input) + return &out, nil +} + +type EndpointType string + +const ( + EndpointTypeDst EndpointType = "dst" + EndpointTypeSrc EndpointType = "src" +) + +func PossibleValuesForEndpointType() []string { + return []string{ + string(EndpointTypeDst), + string(EndpointTypeSrc), + } +} + +func parseEndpointType(input string) (*EndpointType, error) { + vals := map[string]EndpointType{ + "dst": EndpointTypeDst, + "src": EndpointTypeSrc, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := EndpointType(input) + return &out, nil +} + +type NetworkFeatures string + +const ( + NetworkFeaturesBasic NetworkFeatures = "Basic" + NetworkFeaturesStandard NetworkFeatures = "Standard" +) + +func PossibleValuesForNetworkFeatures() []string { + return []string{ + string(NetworkFeaturesBasic), + string(NetworkFeaturesStandard), + } +} + +func parseNetworkFeatures(input string) (*NetworkFeatures, error) { + vals := map[string]NetworkFeatures{ + "basic": NetworkFeaturesBasic, + "standard": NetworkFeaturesStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkFeatures(input) + return &out, nil +} + +type ReplicationSchedule string + +const ( + ReplicationScheduleDaily ReplicationSchedule = "daily" + ReplicationScheduleHourly ReplicationSchedule = "hourly" + ReplicationScheduleOneZerominutely ReplicationSchedule = "_10minutely" +) + +func PossibleValuesForReplicationSchedule() []string { + return []string{ + string(ReplicationScheduleDaily), + string(ReplicationScheduleHourly), + string(ReplicationScheduleOneZerominutely), + } +} + +func parseReplicationSchedule(input string) (*ReplicationSchedule, error) { + vals := map[string]ReplicationSchedule{ + "daily": ReplicationScheduleDaily, + "hourly": ReplicationScheduleHourly, + "_10minutely": ReplicationScheduleOneZerominutely, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ReplicationSchedule(input) + return &out, nil +} + +type SecurityStyle string + +const ( + SecurityStyleNtfs SecurityStyle = "ntfs" + SecurityStyleUnix SecurityStyle = "unix" +) + +func PossibleValuesForSecurityStyle() []string { + return []string{ + string(SecurityStyleNtfs), + string(SecurityStyleUnix), + } +} + +func parseSecurityStyle(input string) (*SecurityStyle, error) { + vals := map[string]SecurityStyle{ + "ntfs": SecurityStyleNtfs, + "unix": SecurityStyleUnix, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityStyle(input) + return &out, nil +} + +type ServiceLevel string + +const ( + ServiceLevelPremium ServiceLevel = "Premium" + ServiceLevelStandard ServiceLevel = "Standard" + ServiceLevelStandardZRS ServiceLevel = "StandardZRS" + ServiceLevelUltra ServiceLevel = "Ultra" +) + +func PossibleValuesForServiceLevel() []string { + return []string{ + string(ServiceLevelPremium), + string(ServiceLevelStandard), + string(ServiceLevelStandardZRS), + string(ServiceLevelUltra), + } +} + +func parseServiceLevel(input string) (*ServiceLevel, error) { + vals := map[string]ServiceLevel{ + "premium": ServiceLevelPremium, + "standard": ServiceLevelStandard, + "standardzrs": ServiceLevelStandardZRS, + "ultra": ServiceLevelUltra, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ServiceLevel(input) + return &out, nil +} + +type VolumeStorageToNetworkProximity string + +const ( + VolumeStorageToNetworkProximityDefault VolumeStorageToNetworkProximity = "Default" + VolumeStorageToNetworkProximityTOne VolumeStorageToNetworkProximity = "T1" + VolumeStorageToNetworkProximityTTwo VolumeStorageToNetworkProximity = "T2" +) + +func PossibleValuesForVolumeStorageToNetworkProximity() []string { + return []string{ + string(VolumeStorageToNetworkProximityDefault), + string(VolumeStorageToNetworkProximityTOne), + string(VolumeStorageToNetworkProximityTTwo), + } +} + +func parseVolumeStorageToNetworkProximity(input string) (*VolumeStorageToNetworkProximity, error) { + vals := map[string]VolumeStorageToNetworkProximity{ + "default": VolumeStorageToNetworkProximityDefault, + "t1": VolumeStorageToNetworkProximityTOne, + "t2": VolumeStorageToNetworkProximityTTwo, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VolumeStorageToNetworkProximity(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/id_netappaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/id_netappaccount.go new file mode 100644 index 000000000000..7b31002a4246 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/id_netappaccount.go @@ -0,0 +1,124 @@ +package volumegroups + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = NetAppAccountId{} + +// NetAppAccountId is a struct representing the Resource ID for a Net App Account +type NetAppAccountId struct { + SubscriptionId string + ResourceGroupName string + AccountName string +} + +// NewNetAppAccountID returns a new NetAppAccountId struct +func NewNetAppAccountID(subscriptionId string, resourceGroupName string, accountName string) NetAppAccountId { + return NetAppAccountId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AccountName: accountName, + } +} + +// ParseNetAppAccountID parses 'input' into a NetAppAccountId +func ParseNetAppAccountID(input string) (*NetAppAccountId, error) { + parser := resourceids.NewParserFromResourceIdType(NetAppAccountId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := NetAppAccountId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseNetAppAccountIDInsensitively parses 'input' case-insensitively into a NetAppAccountId +// note: this method should only be used for API response data and not user input +func ParseNetAppAccountIDInsensitively(input string) (*NetAppAccountId, error) { + parser := resourceids.NewParserFromResourceIdType(NetAppAccountId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := NetAppAccountId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateNetAppAccountID checks that 'input' can be parsed as a Net App Account ID +func ValidateNetAppAccountID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseNetAppAccountID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Net App Account ID +func (id NetAppAccountId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Net App Account ID +func (id NetAppAccountId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("accountName", "accountValue"), + } +} + +// String returns a human-readable description of this Net App Account ID +func (id NetAppAccountId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Account Name: %q", id.AccountName), + } + return fmt.Sprintf("Net App Account (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/id_volumegroup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/id_volumegroup.go new file mode 100644 index 000000000000..a49d03263509 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/id_volumegroup.go @@ -0,0 +1,137 @@ +package volumegroups + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = VolumeGroupId{} + +// VolumeGroupId is a struct representing the Resource ID for a Volume Group +type VolumeGroupId struct { + SubscriptionId string + ResourceGroupName string + AccountName string + VolumeGroupName string +} + +// NewVolumeGroupID returns a new VolumeGroupId struct +func NewVolumeGroupID(subscriptionId string, resourceGroupName string, accountName string, volumeGroupName string) VolumeGroupId { + return VolumeGroupId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AccountName: accountName, + VolumeGroupName: volumeGroupName, + } +} + +// ParseVolumeGroupID parses 'input' into a VolumeGroupId +func ParseVolumeGroupID(input string) (*VolumeGroupId, error) { + parser := resourceids.NewParserFromResourceIdType(VolumeGroupId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VolumeGroupId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + if id.VolumeGroupName, ok = parsed.Parsed["volumeGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'volumeGroupName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseVolumeGroupIDInsensitively parses 'input' case-insensitively into a VolumeGroupId +// note: this method should only be used for API response data and not user input +func ParseVolumeGroupIDInsensitively(input string) (*VolumeGroupId, error) { + parser := resourceids.NewParserFromResourceIdType(VolumeGroupId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VolumeGroupId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + if id.VolumeGroupName, ok = parsed.Parsed["volumeGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'volumeGroupName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateVolumeGroupID checks that 'input' can be parsed as a Volume Group ID +func ValidateVolumeGroupID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseVolumeGroupID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Volume Group ID +func (id VolumeGroupId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/volumeGroups/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName, id.VolumeGroupName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Volume Group ID +func (id VolumeGroupId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("accountName", "accountValue"), + resourceids.StaticSegment("staticVolumeGroups", "volumeGroups", "volumeGroups"), + resourceids.UserSpecifiedSegment("volumeGroupName", "volumeGroupValue"), + } +} + +// String returns a human-readable description of this Volume Group ID +func (id VolumeGroupId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Account Name: %q", id.AccountName), + fmt.Sprintf("Volume Group Name: %q", id.VolumeGroupName), + } + return fmt.Sprintf("Volume Group (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupscreate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupscreate_autorest.go new file mode 100644 index 000000000000..ee9616617b30 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupscreate_autorest.go @@ -0,0 +1,79 @@ +package volumegroups + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupsCreateOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// VolumeGroupsCreate ... +func (c VolumeGroupsClient) VolumeGroupsCreate(ctx context.Context, id VolumeGroupId, input VolumeGroupDetails) (result VolumeGroupsCreateOperationResponse, err error) { + req, err := c.preparerForVolumeGroupsCreate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsCreate", nil, "Failure preparing request") + return + } + + result, err = c.senderForVolumeGroupsCreate(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsCreate", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// VolumeGroupsCreateThenPoll performs VolumeGroupsCreate then polls until it's completed +func (c VolumeGroupsClient) VolumeGroupsCreateThenPoll(ctx context.Context, id VolumeGroupId, input VolumeGroupDetails) error { + result, err := c.VolumeGroupsCreate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing VolumeGroupsCreate: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after VolumeGroupsCreate: %+v", err) + } + + return nil +} + +// preparerForVolumeGroupsCreate prepares the VolumeGroupsCreate request. +func (c VolumeGroupsClient) preparerForVolumeGroupsCreate(ctx context.Context, id VolumeGroupId, input VolumeGroupDetails) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForVolumeGroupsCreate sends the VolumeGroupsCreate request. The method will close the +// http.Response Body if it receives an error. +func (c VolumeGroupsClient) senderForVolumeGroupsCreate(ctx context.Context, req *http.Request) (future VolumeGroupsCreateOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupsdelete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupsdelete_autorest.go new file mode 100644 index 000000000000..b3cba81e1756 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupsdelete_autorest.go @@ -0,0 +1,78 @@ +package volumegroups + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupsDeleteOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// VolumeGroupsDelete ... +func (c VolumeGroupsClient) VolumeGroupsDelete(ctx context.Context, id VolumeGroupId) (result VolumeGroupsDeleteOperationResponse, err error) { + req, err := c.preparerForVolumeGroupsDelete(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsDelete", nil, "Failure preparing request") + return + } + + result, err = c.senderForVolumeGroupsDelete(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsDelete", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// VolumeGroupsDeleteThenPoll performs VolumeGroupsDelete then polls until it's completed +func (c VolumeGroupsClient) VolumeGroupsDeleteThenPoll(ctx context.Context, id VolumeGroupId) error { + result, err := c.VolumeGroupsDelete(ctx, id) + if err != nil { + return fmt.Errorf("performing VolumeGroupsDelete: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after VolumeGroupsDelete: %+v", err) + } + + return nil +} + +// preparerForVolumeGroupsDelete prepares the VolumeGroupsDelete request. +func (c VolumeGroupsClient) preparerForVolumeGroupsDelete(ctx context.Context, id VolumeGroupId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForVolumeGroupsDelete sends the VolumeGroupsDelete request. The method will close the +// http.Response Body if it receives an error. +func (c VolumeGroupsClient) senderForVolumeGroupsDelete(ctx context.Context, req *http.Request) (future VolumeGroupsDeleteOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupsget_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupsget_autorest.go new file mode 100644 index 000000000000..d52a1f2e8c2e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupsget_autorest.go @@ -0,0 +1,67 @@ +package volumegroups + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupsGetOperationResponse struct { + HttpResponse *http.Response + Model *VolumeGroupDetails +} + +// VolumeGroupsGet ... +func (c VolumeGroupsClient) VolumeGroupsGet(ctx context.Context, id VolumeGroupId) (result VolumeGroupsGetOperationResponse, err error) { + req, err := c.preparerForVolumeGroupsGet(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsGet", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsGet", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForVolumeGroupsGet(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsGet", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForVolumeGroupsGet prepares the VolumeGroupsGet request. +func (c VolumeGroupsClient) preparerForVolumeGroupsGet(ctx context.Context, id VolumeGroupId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForVolumeGroupsGet handles the response to the VolumeGroupsGet request. The method always +// closes the http.Response Body. +func (c VolumeGroupsClient) responderForVolumeGroupsGet(resp *http.Response) (result VolumeGroupsGetOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupslistbynetappaccount_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupslistbynetappaccount_autorest.go new file mode 100644 index 000000000000..92517aeaf6f2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupslistbynetappaccount_autorest.go @@ -0,0 +1,68 @@ +package volumegroups + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupsListByNetAppAccountOperationResponse struct { + HttpResponse *http.Response + Model *VolumeGroupList +} + +// VolumeGroupsListByNetAppAccount ... +func (c VolumeGroupsClient) VolumeGroupsListByNetAppAccount(ctx context.Context, id NetAppAccountId) (result VolumeGroupsListByNetAppAccountOperationResponse, err error) { + req, err := c.preparerForVolumeGroupsListByNetAppAccount(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsListByNetAppAccount", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsListByNetAppAccount", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForVolumeGroupsListByNetAppAccount(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsListByNetAppAccount", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForVolumeGroupsListByNetAppAccount prepares the VolumeGroupsListByNetAppAccount request. +func (c VolumeGroupsClient) preparerForVolumeGroupsListByNetAppAccount(ctx context.Context, id NetAppAccountId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/volumeGroups", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForVolumeGroupsListByNetAppAccount handles the response to the VolumeGroupsListByNetAppAccount request. The method always +// closes the http.Response Body. +func (c VolumeGroupsClient) responderForVolumeGroupsListByNetAppAccount(resp *http.Response) (result VolumeGroupsListByNetAppAccountOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_exportpolicyrule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_exportpolicyrule.go new file mode 100644 index 000000000000..e17395ba1a77 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_exportpolicyrule.go @@ -0,0 +1,22 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExportPolicyRule struct { + AllowedClients *string `json:"allowedClients,omitempty"` + ChownMode *ChownMode `json:"chownMode,omitempty"` + Cifs *bool `json:"cifs,omitempty"` + HasRootAccess *bool `json:"hasRootAccess,omitempty"` + Kerberos5ReadOnly *bool `json:"kerberos5ReadOnly,omitempty"` + Kerberos5ReadWrite *bool `json:"kerberos5ReadWrite,omitempty"` + Kerberos5iReadOnly *bool `json:"kerberos5iReadOnly,omitempty"` + Kerberos5iReadWrite *bool `json:"kerberos5iReadWrite,omitempty"` + Kerberos5pReadOnly *bool `json:"kerberos5pReadOnly,omitempty"` + Kerberos5pReadWrite *bool `json:"kerberos5pReadWrite,omitempty"` + Nfsv3 *bool `json:"nfsv3,omitempty"` + Nfsv41 *bool `json:"nfsv41,omitempty"` + RuleIndex *int64 `json:"ruleIndex,omitempty"` + UnixReadOnly *bool `json:"unixReadOnly,omitempty"` + UnixReadWrite *bool `json:"unixReadWrite,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_mounttargetproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_mounttargetproperties.go new file mode 100644 index 000000000000..c59cc0dbf3e7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_mounttargetproperties.go @@ -0,0 +1,11 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MountTargetProperties struct { + FileSystemId string `json:"fileSystemId"` + IpAddress *string `json:"ipAddress,omitempty"` + MountTargetId *string `json:"mountTargetId,omitempty"` + SmbServerFqdn *string `json:"smbServerFqdn,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_placementkeyvaluepairs.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_placementkeyvaluepairs.go new file mode 100644 index 000000000000..1714b1662a1d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_placementkeyvaluepairs.go @@ -0,0 +1,9 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PlacementKeyValuePairs struct { + Key string `json:"key"` + Value string `json:"value"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_replicationobject.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_replicationobject.go new file mode 100644 index 000000000000..6d145aa00798 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_replicationobject.go @@ -0,0 +1,12 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ReplicationObject struct { + EndpointType *EndpointType `json:"endpointType,omitempty"` + RemoteVolumeRegion *string `json:"remoteVolumeRegion,omitempty"` + RemoteVolumeResourceId string `json:"remoteVolumeResourceId"` + ReplicationId *string `json:"replicationId,omitempty"` + ReplicationSchedule *ReplicationSchedule `json:"replicationSchedule,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumebackupproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumebackupproperties.go new file mode 100644 index 000000000000..1141229b560a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumebackupproperties.go @@ -0,0 +1,11 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeBackupProperties struct { + BackupEnabled *bool `json:"backupEnabled,omitempty"` + BackupPolicyId *string `json:"backupPolicyId,omitempty"` + PolicyEnforced *bool `json:"policyEnforced,omitempty"` + VaultId *string `json:"vaultId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroup.go new file mode 100644 index 000000000000..5e4df7bb9c04 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroup.go @@ -0,0 +1,12 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroup struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *VolumeGroupListProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupdetails.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupdetails.go new file mode 100644 index 000000000000..08e48e1d0e8f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupdetails.go @@ -0,0 +1,13 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupDetails struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *VolumeGroupProperties `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegrouplist.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegrouplist.go new file mode 100644 index 000000000000..447c6e6e8588 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegrouplist.go @@ -0,0 +1,8 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupList struct { + Value *[]VolumeGroup `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegrouplistproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegrouplistproperties.go new file mode 100644 index 000000000000..5788ee516fc1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegrouplistproperties.go @@ -0,0 +1,9 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupListProperties struct { + GroupMetaData *VolumeGroupMetaData `json:"groupMetaData,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupmetadata.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupmetadata.go new file mode 100644 index 000000000000..30441c6826d5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupmetadata.go @@ -0,0 +1,13 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupMetaData struct { + ApplicationIdentifier *string `json:"applicationIdentifier,omitempty"` + ApplicationType *ApplicationType `json:"applicationType,omitempty"` + DeploymentSpecId *string `json:"deploymentSpecId,omitempty"` + GlobalPlacementRules *[]PlacementKeyValuePairs `json:"globalPlacementRules,omitempty"` + GroupDescription *string `json:"groupDescription,omitempty"` + VolumesCount *int64 `json:"volumesCount,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupproperties.go new file mode 100644 index 000000000000..0bab153b397e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupproperties.go @@ -0,0 +1,10 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupProperties struct { + GroupMetaData *VolumeGroupMetaData `json:"groupMetaData,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + Volumes *[]VolumeGroupVolumeProperties `json:"volumes,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupvolumeproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupvolumeproperties.go new file mode 100644 index 000000000000..61bbdab9ce3e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupvolumeproperties.go @@ -0,0 +1,12 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupVolumeProperties struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties VolumeProperties `json:"properties"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumeproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumeproperties.go new file mode 100644 index 000000000000..dc67a9543182 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumeproperties.go @@ -0,0 +1,49 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeProperties struct { + AvsDataStore *AvsDataStore `json:"avsDataStore,omitempty"` + BackupId *string `json:"backupId,omitempty"` + BaremetalTenantId *string `json:"baremetalTenantId,omitempty"` + CapacityPoolResourceId *string `json:"capacityPoolResourceId,omitempty"` + CloneProgress *int64 `json:"cloneProgress,omitempty"` + CoolAccess *bool `json:"coolAccess,omitempty"` + CoolnessPeriod *int64 `json:"coolnessPeriod,omitempty"` + CreationToken string `json:"creationToken"` + DataProtection *VolumePropertiesDataProtection `json:"dataProtection,omitempty"` + DefaultGroupQuotaInKiBs *int64 `json:"defaultGroupQuotaInKiBs,omitempty"` + DefaultUserQuotaInKiBs *int64 `json:"defaultUserQuotaInKiBs,omitempty"` + EnableSubvolumes *EnableSubvolumes `json:"enableSubvolumes,omitempty"` + EncryptionKeySource *string `json:"encryptionKeySource,omitempty"` + ExportPolicy *VolumePropertiesExportPolicy `json:"exportPolicy,omitempty"` + FileSystemId *string `json:"fileSystemId,omitempty"` + IsDefaultQuotaEnabled *bool `json:"isDefaultQuotaEnabled,omitempty"` + IsRestoring *bool `json:"isRestoring,omitempty"` + KerberosEnabled *bool `json:"kerberosEnabled,omitempty"` + LdapEnabled *bool `json:"ldapEnabled,omitempty"` + MaximumNumberOfFiles *int64 `json:"maximumNumberOfFiles,omitempty"` + MountTargets *[]MountTargetProperties `json:"mountTargets,omitempty"` + NetworkFeatures *NetworkFeatures `json:"networkFeatures,omitempty"` + NetworkSiblingSetId *string `json:"networkSiblingSetId,omitempty"` + PlacementRules *[]PlacementKeyValuePairs `json:"placementRules,omitempty"` + ProtocolTypes *[]string `json:"protocolTypes,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + ProximityPlacementGroup *string `json:"proximityPlacementGroup,omitempty"` + SecurityStyle *SecurityStyle `json:"securityStyle,omitempty"` + ServiceLevel *ServiceLevel `json:"serviceLevel,omitempty"` + SmbContinuouslyAvailable *bool `json:"smbContinuouslyAvailable,omitempty"` + SmbEncryption *bool `json:"smbEncryption,omitempty"` + SnapshotDirectoryVisible *bool `json:"snapshotDirectoryVisible,omitempty"` + SnapshotId *string `json:"snapshotId,omitempty"` + StorageToNetworkProximity *VolumeStorageToNetworkProximity `json:"storageToNetworkProximity,omitempty"` + SubnetId string `json:"subnetId"` + T2Network *string `json:"t2Network,omitempty"` + ThroughputMibps *float64 `json:"throughputMibps,omitempty"` + UnixPermissions *string `json:"unixPermissions,omitempty"` + UsageThreshold int64 `json:"usageThreshold"` + VolumeGroupName *string `json:"volumeGroupName,omitempty"` + VolumeSpecName *string `json:"volumeSpecName,omitempty"` + VolumeType *string `json:"volumeType,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumepropertiesdataprotection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumepropertiesdataprotection.go new file mode 100644 index 000000000000..5cde3ecbaacc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumepropertiesdataprotection.go @@ -0,0 +1,10 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumePropertiesDataProtection struct { + Backup *VolumeBackupProperties `json:"backup,omitempty"` + Replication *ReplicationObject `json:"replication,omitempty"` + Snapshot *VolumeSnapshotProperties `json:"snapshot,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumepropertiesexportpolicy.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumepropertiesexportpolicy.go new file mode 100644 index 000000000000..227c8586d6f2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumepropertiesexportpolicy.go @@ -0,0 +1,8 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumePropertiesExportPolicy struct { + Rules *[]ExportPolicyRule `json:"rules,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumesnapshotproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumesnapshotproperties.go new file mode 100644 index 000000000000..a3f5011da3b0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumesnapshotproperties.go @@ -0,0 +1,8 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeSnapshotProperties struct { + SnapshotPolicyId *string `json:"snapshotPolicyId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/version.go new file mode 100644 index 000000000000..93f3d1ecbb06 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/version.go @@ -0,0 +1,12 @@ +package volumegroups + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2021-10-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/volumegroups/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/README.md new file mode 100644 index 000000000000..c42f7262724b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/README.md @@ -0,0 +1,99 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes` Documentation + +The `volumes` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2021-10-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes" +``` + + +### Client Initialization + +```go +client := volumes.NewVolumesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VolumesClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue") + +payload := volumes.Volume{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VolumesClient.Delete` + +```go +ctx := context.TODO() +id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue") + +if err := client.DeleteThenPoll(ctx, id, volumes.DefaultDeleteOperationOptions()); err != nil { + // handle the error +} +``` + + +### Example Usage: `VolumesClient.Get` + +```go +ctx := context.TODO() +id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue") + +read, err := client.Get(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VolumesClient.List` + +```go +ctx := context.TODO() +id := volumes.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue") + +// alternatively `client.List(ctx, id)` can be used to do batched pagination +items, err := client.ListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `VolumesClient.Update` + +```go +ctx := context.TODO() +id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue") + +payload := volumes.VolumePatch{ + // ... +} + + +if err := client.UpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/client.go new file mode 100644 index 000000000000..d0a40573bf00 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/client.go @@ -0,0 +1,18 @@ +package volumes + +import "github.com/Azure/go-autorest/autorest" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumesClient struct { + Client autorest.Client + baseUri string +} + +func NewVolumesClientWithBaseURI(endpoint string) VolumesClient { + return VolumesClient{ + Client: autorest.NewClientWithUserAgent(userAgent()), + baseUri: endpoint, + } +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/constants.go new file mode 100644 index 000000000000..4c9bed0d63be --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/constants.go @@ -0,0 +1,270 @@ +package volumes + +import "strings" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AvsDataStore string + +const ( + AvsDataStoreDisabled AvsDataStore = "Disabled" + AvsDataStoreEnabled AvsDataStore = "Enabled" +) + +func PossibleValuesForAvsDataStore() []string { + return []string{ + string(AvsDataStoreDisabled), + string(AvsDataStoreEnabled), + } +} + +func parseAvsDataStore(input string) (*AvsDataStore, error) { + vals := map[string]AvsDataStore{ + "disabled": AvsDataStoreDisabled, + "enabled": AvsDataStoreEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AvsDataStore(input) + return &out, nil +} + +type ChownMode string + +const ( + ChownModeRestricted ChownMode = "Restricted" + ChownModeUnrestricted ChownMode = "Unrestricted" +) + +func PossibleValuesForChownMode() []string { + return []string{ + string(ChownModeRestricted), + string(ChownModeUnrestricted), + } +} + +func parseChownMode(input string) (*ChownMode, error) { + vals := map[string]ChownMode{ + "restricted": ChownModeRestricted, + "unrestricted": ChownModeUnrestricted, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ChownMode(input) + return &out, nil +} + +type EnableSubvolumes string + +const ( + EnableSubvolumesDisabled EnableSubvolumes = "Disabled" + EnableSubvolumesEnabled EnableSubvolumes = "Enabled" +) + +func PossibleValuesForEnableSubvolumes() []string { + return []string{ + string(EnableSubvolumesDisabled), + string(EnableSubvolumesEnabled), + } +} + +func parseEnableSubvolumes(input string) (*EnableSubvolumes, error) { + vals := map[string]EnableSubvolumes{ + "disabled": EnableSubvolumesDisabled, + "enabled": EnableSubvolumesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := EnableSubvolumes(input) + return &out, nil +} + +type EndpointType string + +const ( + EndpointTypeDst EndpointType = "dst" + EndpointTypeSrc EndpointType = "src" +) + +func PossibleValuesForEndpointType() []string { + return []string{ + string(EndpointTypeDst), + string(EndpointTypeSrc), + } +} + +func parseEndpointType(input string) (*EndpointType, error) { + vals := map[string]EndpointType{ + "dst": EndpointTypeDst, + "src": EndpointTypeSrc, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := EndpointType(input) + return &out, nil +} + +type NetworkFeatures string + +const ( + NetworkFeaturesBasic NetworkFeatures = "Basic" + NetworkFeaturesStandard NetworkFeatures = "Standard" +) + +func PossibleValuesForNetworkFeatures() []string { + return []string{ + string(NetworkFeaturesBasic), + string(NetworkFeaturesStandard), + } +} + +func parseNetworkFeatures(input string) (*NetworkFeatures, error) { + vals := map[string]NetworkFeatures{ + "basic": NetworkFeaturesBasic, + "standard": NetworkFeaturesStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkFeatures(input) + return &out, nil +} + +type ReplicationSchedule string + +const ( + ReplicationScheduleDaily ReplicationSchedule = "daily" + ReplicationScheduleHourly ReplicationSchedule = "hourly" + ReplicationScheduleOneZerominutely ReplicationSchedule = "_10minutely" +) + +func PossibleValuesForReplicationSchedule() []string { + return []string{ + string(ReplicationScheduleDaily), + string(ReplicationScheduleHourly), + string(ReplicationScheduleOneZerominutely), + } +} + +func parseReplicationSchedule(input string) (*ReplicationSchedule, error) { + vals := map[string]ReplicationSchedule{ + "daily": ReplicationScheduleDaily, + "hourly": ReplicationScheduleHourly, + "_10minutely": ReplicationScheduleOneZerominutely, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ReplicationSchedule(input) + return &out, nil +} + +type SecurityStyle string + +const ( + SecurityStyleNtfs SecurityStyle = "ntfs" + SecurityStyleUnix SecurityStyle = "unix" +) + +func PossibleValuesForSecurityStyle() []string { + return []string{ + string(SecurityStyleNtfs), + string(SecurityStyleUnix), + } +} + +func parseSecurityStyle(input string) (*SecurityStyle, error) { + vals := map[string]SecurityStyle{ + "ntfs": SecurityStyleNtfs, + "unix": SecurityStyleUnix, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityStyle(input) + return &out, nil +} + +type ServiceLevel string + +const ( + ServiceLevelPremium ServiceLevel = "Premium" + ServiceLevelStandard ServiceLevel = "Standard" + ServiceLevelStandardZRS ServiceLevel = "StandardZRS" + ServiceLevelUltra ServiceLevel = "Ultra" +) + +func PossibleValuesForServiceLevel() []string { + return []string{ + string(ServiceLevelPremium), + string(ServiceLevelStandard), + string(ServiceLevelStandardZRS), + string(ServiceLevelUltra), + } +} + +func parseServiceLevel(input string) (*ServiceLevel, error) { + vals := map[string]ServiceLevel{ + "premium": ServiceLevelPremium, + "standard": ServiceLevelStandard, + "standardzrs": ServiceLevelStandardZRS, + "ultra": ServiceLevelUltra, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ServiceLevel(input) + return &out, nil +} + +type VolumeStorageToNetworkProximity string + +const ( + VolumeStorageToNetworkProximityDefault VolumeStorageToNetworkProximity = "Default" + VolumeStorageToNetworkProximityTOne VolumeStorageToNetworkProximity = "T1" + VolumeStorageToNetworkProximityTTwo VolumeStorageToNetworkProximity = "T2" +) + +func PossibleValuesForVolumeStorageToNetworkProximity() []string { + return []string{ + string(VolumeStorageToNetworkProximityDefault), + string(VolumeStorageToNetworkProximityTOne), + string(VolumeStorageToNetworkProximityTTwo), + } +} + +func parseVolumeStorageToNetworkProximity(input string) (*VolumeStorageToNetworkProximity, error) { + vals := map[string]VolumeStorageToNetworkProximity{ + "default": VolumeStorageToNetworkProximityDefault, + "t1": VolumeStorageToNetworkProximityTOne, + "t2": VolumeStorageToNetworkProximityTTwo, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VolumeStorageToNetworkProximity(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/id_capacitypool.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/id_capacitypool.go new file mode 100644 index 000000000000..06f8b4531bd9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/id_capacitypool.go @@ -0,0 +1,137 @@ +package volumes + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = CapacityPoolId{} + +// CapacityPoolId is a struct representing the Resource ID for a Capacity Pool +type CapacityPoolId struct { + SubscriptionId string + ResourceGroupName string + AccountName string + PoolName string +} + +// NewCapacityPoolID returns a new CapacityPoolId struct +func NewCapacityPoolID(subscriptionId string, resourceGroupName string, accountName string, poolName string) CapacityPoolId { + return CapacityPoolId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AccountName: accountName, + PoolName: poolName, + } +} + +// ParseCapacityPoolID parses 'input' into a CapacityPoolId +func ParseCapacityPoolID(input string) (*CapacityPoolId, error) { + parser := resourceids.NewParserFromResourceIdType(CapacityPoolId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := CapacityPoolId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { + return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseCapacityPoolIDInsensitively parses 'input' case-insensitively into a CapacityPoolId +// note: this method should only be used for API response data and not user input +func ParseCapacityPoolIDInsensitively(input string) (*CapacityPoolId, error) { + parser := resourceids.NewParserFromResourceIdType(CapacityPoolId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := CapacityPoolId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { + return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateCapacityPoolID checks that 'input' can be parsed as a Capacity Pool ID +func ValidateCapacityPoolID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseCapacityPoolID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Capacity Pool ID +func (id CapacityPoolId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/capacityPools/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName, id.PoolName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Capacity Pool ID +func (id CapacityPoolId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("accountName", "accountValue"), + resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), + resourceids.UserSpecifiedSegment("poolName", "poolValue"), + } +} + +// String returns a human-readable description of this Capacity Pool ID +func (id CapacityPoolId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Account Name: %q", id.AccountName), + fmt.Sprintf("Pool Name: %q", id.PoolName), + } + return fmt.Sprintf("Capacity Pool (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/id_volume.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/id_volume.go new file mode 100644 index 000000000000..d4e93b387a44 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/id_volume.go @@ -0,0 +1,150 @@ +package volumes + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = VolumeId{} + +// VolumeId is a struct representing the Resource ID for a Volume +type VolumeId struct { + SubscriptionId string + ResourceGroupName string + AccountName string + PoolName string + VolumeName string +} + +// NewVolumeID returns a new VolumeId struct +func NewVolumeID(subscriptionId string, resourceGroupName string, accountName string, poolName string, volumeName string) VolumeId { + return VolumeId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AccountName: accountName, + PoolName: poolName, + VolumeName: volumeName, + } +} + +// ParseVolumeID parses 'input' into a VolumeId +func ParseVolumeID(input string) (*VolumeId, error) { + parser := resourceids.NewParserFromResourceIdType(VolumeId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VolumeId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { + return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) + } + + if id.VolumeName, ok = parsed.Parsed["volumeName"]; !ok { + return nil, fmt.Errorf("the segment 'volumeName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseVolumeIDInsensitively parses 'input' case-insensitively into a VolumeId +// note: this method should only be used for API response data and not user input +func ParseVolumeIDInsensitively(input string) (*VolumeId, error) { + parser := resourceids.NewParserFromResourceIdType(VolumeId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VolumeId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { + return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) + } + + if id.VolumeName, ok = parsed.Parsed["volumeName"]; !ok { + return nil, fmt.Errorf("the segment 'volumeName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateVolumeID checks that 'input' can be parsed as a Volume ID +func ValidateVolumeID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseVolumeID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Volume ID +func (id VolumeId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/capacityPools/%s/volumes/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName, id.PoolName, id.VolumeName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Volume ID +func (id VolumeId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("accountName", "accountValue"), + resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), + resourceids.UserSpecifiedSegment("poolName", "poolValue"), + resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), + resourceids.UserSpecifiedSegment("volumeName", "volumeValue"), + } +} + +// String returns a human-readable description of this Volume ID +func (id VolumeId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Account Name: %q", id.AccountName), + fmt.Sprintf("Pool Name: %q", id.PoolName), + fmt.Sprintf("Volume Name: %q", id.VolumeName), + } + return fmt.Sprintf("Volume (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_createorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_createorupdate_autorest.go new file mode 100644 index 000000000000..ae61c0fe91ec --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_createorupdate_autorest.go @@ -0,0 +1,79 @@ +package volumes + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// CreateOrUpdate ... +func (c VolumesClient) CreateOrUpdate(ctx context.Context, id VolumeId, input Volume) (result CreateOrUpdateOperationResponse, err error) { + req, err := c.preparerForCreateOrUpdate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = c.senderForCreateOrUpdate(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "CreateOrUpdate", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed +func (c VolumesClient) CreateOrUpdateThenPoll(ctx context.Context, id VolumeId, input Volume) error { + result, err := c.CreateOrUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing CreateOrUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after CreateOrUpdate: %+v", err) + } + + return nil +} + +// preparerForCreateOrUpdate prepares the CreateOrUpdate request. +func (c VolumesClient) preparerForCreateOrUpdate(ctx context.Context, id VolumeId, input Volume) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForCreateOrUpdate sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (c VolumesClient) senderForCreateOrUpdate(ctx context.Context, req *http.Request) (future CreateOrUpdateOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_delete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_delete_autorest.go new file mode 100644 index 000000000000..1b97fdf87abf --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_delete_autorest.go @@ -0,0 +1,107 @@ +package volumes + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +type DeleteOperationOptions struct { + ForceDelete *bool +} + +func DefaultDeleteOperationOptions() DeleteOperationOptions { + return DeleteOperationOptions{} +} + +func (o DeleteOperationOptions) toHeaders() map[string]interface{} { + out := make(map[string]interface{}) + + return out +} + +func (o DeleteOperationOptions) toQueryString() map[string]interface{} { + out := make(map[string]interface{}) + + if o.ForceDelete != nil { + out["forceDelete"] = *o.ForceDelete + } + + return out +} + +// Delete ... +func (c VolumesClient) Delete(ctx context.Context, id VolumeId, options DeleteOperationOptions) (result DeleteOperationResponse, err error) { + req, err := c.preparerForDelete(ctx, id, options) + if err != nil { + err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = c.senderForDelete(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "Delete", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// DeleteThenPoll performs Delete then polls until it's completed +func (c VolumesClient) DeleteThenPoll(ctx context.Context, id VolumeId, options DeleteOperationOptions) error { + result, err := c.Delete(ctx, id, options) + if err != nil { + return fmt.Errorf("performing Delete: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after Delete: %+v", err) + } + + return nil +} + +// preparerForDelete prepares the Delete request. +func (c VolumesClient) preparerForDelete(ctx context.Context, id VolumeId, options DeleteOperationOptions) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + for k, v := range options.toQueryString() { + queryParameters[k] = autorest.Encode("query", v) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithHeaders(options.toHeaders()), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForDelete sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (c VolumesClient) senderForDelete(ctx context.Context, req *http.Request) (future DeleteOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_get_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_get_autorest.go new file mode 100644 index 000000000000..f35ab8d36ba5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_get_autorest.go @@ -0,0 +1,67 @@ +package volumes + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetOperationResponse struct { + HttpResponse *http.Response + Model *Volume +} + +// Get ... +func (c VolumesClient) Get(ctx context.Context, id VolumeId) (result GetOperationResponse, err error) { + req, err := c.preparerForGet(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "Get", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "Get", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForGet(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "Get", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForGet prepares the Get request. +func (c VolumesClient) preparerForGet(ctx context.Context, id VolumeId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForGet handles the response to the Get request. The method always +// closes the http.Response Body. +func (c VolumesClient) responderForGet(resp *http.Response) (result GetOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_list_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_list_autorest.go new file mode 100644 index 000000000000..40c311905e59 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_list_autorest.go @@ -0,0 +1,186 @@ +package volumes + +import ( + "context" + "fmt" + "net/http" + "net/url" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListOperationResponse struct { + HttpResponse *http.Response + Model *[]Volume + + nextLink *string + nextPageFunc func(ctx context.Context, nextLink string) (ListOperationResponse, error) +} + +type ListCompleteResult struct { + Items []Volume +} + +func (r ListOperationResponse) HasMore() bool { + return r.nextLink != nil +} + +func (r ListOperationResponse) LoadMore(ctx context.Context) (resp ListOperationResponse, err error) { + if !r.HasMore() { + err = fmt.Errorf("no more pages returned") + return + } + return r.nextPageFunc(ctx, *r.nextLink) +} + +// List ... +func (c VolumesClient) List(ctx context.Context, id CapacityPoolId) (resp ListOperationResponse, err error) { + req, err := c.preparerForList(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "List", nil, "Failure preparing request") + return + } + + resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "List", resp.HttpResponse, "Failure sending request") + return + } + + resp, err = c.responderForList(resp.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "List", resp.HttpResponse, "Failure responding to request") + return + } + return +} + +// ListComplete retrieves all of the results into a single object +func (c VolumesClient) ListComplete(ctx context.Context, id CapacityPoolId) (ListCompleteResult, error) { + return c.ListCompleteMatchingPredicate(ctx, id, VolumeOperationPredicate{}) +} + +// ListCompleteMatchingPredicate retrieves all of the results and then applied the predicate +func (c VolumesClient) ListCompleteMatchingPredicate(ctx context.Context, id CapacityPoolId, predicate VolumeOperationPredicate) (resp ListCompleteResult, err error) { + items := make([]Volume, 0) + + page, err := c.List(ctx, id) + if err != nil { + err = fmt.Errorf("loading the initial page: %+v", err) + return + } + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + for page.HasMore() { + page, err = page.LoadMore(ctx) + if err != nil { + err = fmt.Errorf("loading the next page: %+v", err) + return + } + + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + } + + out := ListCompleteResult{ + Items: items, + } + return out, nil +} + +// preparerForList prepares the List request. +func (c VolumesClient) preparerForList(ctx context.Context, id CapacityPoolId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/volumes", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// preparerForListWithNextLink prepares the List request with the given nextLink token. +func (c VolumesClient) preparerForListWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { + uri, err := url.Parse(nextLink) + if err != nil { + return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) + } + queryParameters := map[string]interface{}{} + for k, v := range uri.Query() { + if len(v) == 0 { + continue + } + val := v[0] + val = autorest.Encode("query", val) + queryParameters[k] = val + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(uri.Path), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForList handles the response to the List request. The method always +// closes the http.Response Body. +func (c VolumesClient) responderForList(resp *http.Response) (result ListOperationResponse, err error) { + type page struct { + Values []Volume `json:"value"` + NextLink *string `json:"nextLink"` + } + var respObj page + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&respObj), + autorest.ByClosing()) + result.HttpResponse = resp + result.Model = &respObj.Values + result.nextLink = respObj.NextLink + if respObj.NextLink != nil { + result.nextPageFunc = func(ctx context.Context, nextLink string) (result ListOperationResponse, err error) { + req, err := c.preparerForListWithNextLink(ctx, nextLink) + if err != nil { + err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "List", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "List", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForList(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "List", result.HttpResponse, "Failure responding to request") + return + } + + return + } + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_update_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_update_autorest.go new file mode 100644 index 000000000000..7e6872e1513e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_update_autorest.go @@ -0,0 +1,79 @@ +package volumes + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpdateOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// Update ... +func (c VolumesClient) Update(ctx context.Context, id VolumeId, input VolumePatch) (result UpdateOperationResponse, err error) { + req, err := c.preparerForUpdate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "Update", nil, "Failure preparing request") + return + } + + result, err = c.senderForUpdate(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "Update", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// UpdateThenPoll performs Update then polls until it's completed +func (c VolumesClient) UpdateThenPoll(ctx context.Context, id VolumeId, input VolumePatch) error { + result, err := c.Update(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Update: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after Update: %+v", err) + } + + return nil +} + +// preparerForUpdate prepares the Update request. +func (c VolumesClient) preparerForUpdate(ctx context.Context, id VolumeId, input VolumePatch) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForUpdate sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (c VolumesClient) senderForUpdate(ctx context.Context, req *http.Request) (future UpdateOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_exportpolicyrule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_exportpolicyrule.go new file mode 100644 index 000000000000..9b059c747578 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_exportpolicyrule.go @@ -0,0 +1,22 @@ +package volumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExportPolicyRule struct { + AllowedClients *string `json:"allowedClients,omitempty"` + ChownMode *ChownMode `json:"chownMode,omitempty"` + Cifs *bool `json:"cifs,omitempty"` + HasRootAccess *bool `json:"hasRootAccess,omitempty"` + Kerberos5ReadOnly *bool `json:"kerberos5ReadOnly,omitempty"` + Kerberos5ReadWrite *bool `json:"kerberos5ReadWrite,omitempty"` + Kerberos5iReadOnly *bool `json:"kerberos5iReadOnly,omitempty"` + Kerberos5iReadWrite *bool `json:"kerberos5iReadWrite,omitempty"` + Kerberos5pReadOnly *bool `json:"kerberos5pReadOnly,omitempty"` + Kerberos5pReadWrite *bool `json:"kerberos5pReadWrite,omitempty"` + Nfsv3 *bool `json:"nfsv3,omitempty"` + Nfsv41 *bool `json:"nfsv41,omitempty"` + RuleIndex *int64 `json:"ruleIndex,omitempty"` + UnixReadOnly *bool `json:"unixReadOnly,omitempty"` + UnixReadWrite *bool `json:"unixReadWrite,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_mounttargetproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_mounttargetproperties.go new file mode 100644 index 000000000000..b92b9edb4154 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_mounttargetproperties.go @@ -0,0 +1,11 @@ +package volumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MountTargetProperties struct { + FileSystemId string `json:"fileSystemId"` + IpAddress *string `json:"ipAddress,omitempty"` + MountTargetId *string `json:"mountTargetId,omitempty"` + SmbServerFqdn *string `json:"smbServerFqdn,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_placementkeyvaluepairs.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_placementkeyvaluepairs.go new file mode 100644 index 000000000000..588e9729c1e4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_placementkeyvaluepairs.go @@ -0,0 +1,9 @@ +package volumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PlacementKeyValuePairs struct { + Key string `json:"key"` + Value string `json:"value"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_replicationobject.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_replicationobject.go new file mode 100644 index 000000000000..b7d6873811e2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_replicationobject.go @@ -0,0 +1,12 @@ +package volumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ReplicationObject struct { + EndpointType *EndpointType `json:"endpointType,omitempty"` + RemoteVolumeRegion *string `json:"remoteVolumeRegion,omitempty"` + RemoteVolumeResourceId string `json:"remoteVolumeResourceId"` + ReplicationId *string `json:"replicationId,omitempty"` + ReplicationSchedule *ReplicationSchedule `json:"replicationSchedule,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volume.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volume.go new file mode 100644 index 000000000000..f92955c95e93 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volume.go @@ -0,0 +1,19 @@ +package volumes + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Volume struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties VolumeProperties `json:"properties"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumebackupproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumebackupproperties.go new file mode 100644 index 000000000000..1de25f15e330 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumebackupproperties.go @@ -0,0 +1,11 @@ +package volumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeBackupProperties struct { + BackupEnabled *bool `json:"backupEnabled,omitempty"` + BackupPolicyId *string `json:"backupPolicyId,omitempty"` + PolicyEnforced *bool `json:"policyEnforced,omitempty"` + VaultId *string `json:"vaultId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepatch.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepatch.go new file mode 100644 index 000000000000..b39ea01aee89 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepatch.go @@ -0,0 +1,13 @@ +package volumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumePatch struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *VolumePatchProperties `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepatchproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepatchproperties.go new file mode 100644 index 000000000000..ed4479ca252b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepatchproperties.go @@ -0,0 +1,16 @@ +package volumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumePatchProperties struct { + DataProtection *VolumePatchPropertiesDataProtection `json:"dataProtection,omitempty"` + DefaultGroupQuotaInKiBs *int64 `json:"defaultGroupQuotaInKiBs,omitempty"` + DefaultUserQuotaInKiBs *int64 `json:"defaultUserQuotaInKiBs,omitempty"` + ExportPolicy *VolumePatchPropertiesExportPolicy `json:"exportPolicy,omitempty"` + IsDefaultQuotaEnabled *bool `json:"isDefaultQuotaEnabled,omitempty"` + ServiceLevel *ServiceLevel `json:"serviceLevel,omitempty"` + ThroughputMibps *float64 `json:"throughputMibps,omitempty"` + UnixPermissions *string `json:"unixPermissions,omitempty"` + UsageThreshold *int64 `json:"usageThreshold,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepatchpropertiesdataprotection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepatchpropertiesdataprotection.go new file mode 100644 index 000000000000..8c9edc10ff72 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepatchpropertiesdataprotection.go @@ -0,0 +1,9 @@ +package volumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumePatchPropertiesDataProtection struct { + Backup *VolumeBackupProperties `json:"backup,omitempty"` + Snapshot *VolumeSnapshotProperties `json:"snapshot,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepatchpropertiesexportpolicy.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepatchpropertiesexportpolicy.go new file mode 100644 index 000000000000..ae83a5fc1b4f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepatchpropertiesexportpolicy.go @@ -0,0 +1,8 @@ +package volumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumePatchPropertiesExportPolicy struct { + Rules *[]ExportPolicyRule `json:"rules,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumeproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumeproperties.go new file mode 100644 index 000000000000..6ae23e00b8da --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumeproperties.go @@ -0,0 +1,49 @@ +package volumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeProperties struct { + AvsDataStore *AvsDataStore `json:"avsDataStore,omitempty"` + BackupId *string `json:"backupId,omitempty"` + BaremetalTenantId *string `json:"baremetalTenantId,omitempty"` + CapacityPoolResourceId *string `json:"capacityPoolResourceId,omitempty"` + CloneProgress *int64 `json:"cloneProgress,omitempty"` + CoolAccess *bool `json:"coolAccess,omitempty"` + CoolnessPeriod *int64 `json:"coolnessPeriod,omitempty"` + CreationToken string `json:"creationToken"` + DataProtection *VolumePropertiesDataProtection `json:"dataProtection,omitempty"` + DefaultGroupQuotaInKiBs *int64 `json:"defaultGroupQuotaInKiBs,omitempty"` + DefaultUserQuotaInKiBs *int64 `json:"defaultUserQuotaInKiBs,omitempty"` + EnableSubvolumes *EnableSubvolumes `json:"enableSubvolumes,omitempty"` + EncryptionKeySource *string `json:"encryptionKeySource,omitempty"` + ExportPolicy *VolumePropertiesExportPolicy `json:"exportPolicy,omitempty"` + FileSystemId *string `json:"fileSystemId,omitempty"` + IsDefaultQuotaEnabled *bool `json:"isDefaultQuotaEnabled,omitempty"` + IsRestoring *bool `json:"isRestoring,omitempty"` + KerberosEnabled *bool `json:"kerberosEnabled,omitempty"` + LdapEnabled *bool `json:"ldapEnabled,omitempty"` + MaximumNumberOfFiles *int64 `json:"maximumNumberOfFiles,omitempty"` + MountTargets *[]MountTargetProperties `json:"mountTargets,omitempty"` + NetworkFeatures *NetworkFeatures `json:"networkFeatures,omitempty"` + NetworkSiblingSetId *string `json:"networkSiblingSetId,omitempty"` + PlacementRules *[]PlacementKeyValuePairs `json:"placementRules,omitempty"` + ProtocolTypes *[]string `json:"protocolTypes,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + ProximityPlacementGroup *string `json:"proximityPlacementGroup,omitempty"` + SecurityStyle *SecurityStyle `json:"securityStyle,omitempty"` + ServiceLevel *ServiceLevel `json:"serviceLevel,omitempty"` + SmbContinuouslyAvailable *bool `json:"smbContinuouslyAvailable,omitempty"` + SmbEncryption *bool `json:"smbEncryption,omitempty"` + SnapshotDirectoryVisible *bool `json:"snapshotDirectoryVisible,omitempty"` + SnapshotId *string `json:"snapshotId,omitempty"` + StorageToNetworkProximity *VolumeStorageToNetworkProximity `json:"storageToNetworkProximity,omitempty"` + SubnetId string `json:"subnetId"` + T2Network *string `json:"t2Network,omitempty"` + ThroughputMibps *float64 `json:"throughputMibps,omitempty"` + UnixPermissions *string `json:"unixPermissions,omitempty"` + UsageThreshold int64 `json:"usageThreshold"` + VolumeGroupName *string `json:"volumeGroupName,omitempty"` + VolumeSpecName *string `json:"volumeSpecName,omitempty"` + VolumeType *string `json:"volumeType,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepropertiesdataprotection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepropertiesdataprotection.go new file mode 100644 index 000000000000..28163c70a51c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepropertiesdataprotection.go @@ -0,0 +1,10 @@ +package volumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumePropertiesDataProtection struct { + Backup *VolumeBackupProperties `json:"backup,omitempty"` + Replication *ReplicationObject `json:"replication,omitempty"` + Snapshot *VolumeSnapshotProperties `json:"snapshot,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepropertiesexportpolicy.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepropertiesexportpolicy.go new file mode 100644 index 000000000000..fda5f4739dee --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepropertiesexportpolicy.go @@ -0,0 +1,8 @@ +package volumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumePropertiesExportPolicy struct { + Rules *[]ExportPolicyRule `json:"rules,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumesnapshotproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumesnapshotproperties.go new file mode 100644 index 000000000000..48aba2acce0d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumesnapshotproperties.go @@ -0,0 +1,8 @@ +package volumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeSnapshotProperties struct { + SnapshotPolicyId *string `json:"snapshotPolicyId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/predicates.go new file mode 100644 index 000000000000..536d6a70dc81 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/predicates.go @@ -0,0 +1,34 @@ +package volumes + +type VolumeOperationPredicate struct { + Etag *string + Id *string + Location *string + Name *string + Type *string +} + +func (p VolumeOperationPredicate) Matches(input Volume) bool { + + if p.Etag != nil && (input.Etag == nil && *p.Etag != *input.Etag) { + return false + } + + if p.Id != nil && (input.Id == nil && *p.Id != *input.Id) { + return false + } + + if p.Location != nil && *p.Location != input.Location { + return false + } + + if p.Name != nil && (input.Name == nil && *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil && *p.Type != *input.Type) { + return false + } + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/version.go new file mode 100644 index 000000000000..55ac8a54fde6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/version.go @@ -0,0 +1,12 @@ +package volumes + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2021-10-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/volumes/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/README.md new file mode 100644 index 000000000000..037bd15af1bb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/README.md @@ -0,0 +1,106 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication` Documentation + +The `volumesreplication` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2021-10-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication" +``` + + +### Client Initialization + +```go +client := volumesreplication.NewVolumesReplicationClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VolumesReplicationClient.VolumesAuthorizeReplication` + +```go +ctx := context.TODO() +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue") + +payload := volumesreplication.AuthorizeRequest{ + // ... +} + + +if err := client.VolumesAuthorizeReplicationThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VolumesReplicationClient.VolumesBreakReplication` + +```go +ctx := context.TODO() +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue") + +payload := volumesreplication.BreakReplicationRequest{ + // ... +} + + +if err := client.VolumesBreakReplicationThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VolumesReplicationClient.VolumesDeleteReplication` + +```go +ctx := context.TODO() +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue") + +if err := client.VolumesDeleteReplicationThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VolumesReplicationClient.VolumesReInitializeReplication` + +```go +ctx := context.TODO() +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue") + +if err := client.VolumesReInitializeReplicationThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VolumesReplicationClient.VolumesReplicationStatus` + +```go +ctx := context.TODO() +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue") + +read, err := client.VolumesReplicationStatus(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VolumesReplicationClient.VolumesResyncReplication` + +```go +ctx := context.TODO() +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue") + +if err := client.VolumesResyncReplicationThenPoll(ctx, id); err != nil { + // handle the error +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/client.go new file mode 100644 index 000000000000..64a4d559d37e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/client.go @@ -0,0 +1,18 @@ +package volumesreplication + +import "github.com/Azure/go-autorest/autorest" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumesReplicationClient struct { + Client autorest.Client + baseUri string +} + +func NewVolumesReplicationClientWithBaseURI(endpoint string) VolumesReplicationClient { + return VolumesReplicationClient{ + Client: autorest.NewClientWithUserAgent(userAgent()), + baseUri: endpoint, + } +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/constants.go new file mode 100644 index 000000000000..6b67c17d5884 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/constants.go @@ -0,0 +1,65 @@ +package volumesreplication + +import "strings" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MirrorState string + +const ( + MirrorStateBroken MirrorState = "Broken" + MirrorStateMirrored MirrorState = "Mirrored" + MirrorStateUninitialized MirrorState = "Uninitialized" +) + +func PossibleValuesForMirrorState() []string { + return []string{ + string(MirrorStateBroken), + string(MirrorStateMirrored), + string(MirrorStateUninitialized), + } +} + +func parseMirrorState(input string) (*MirrorState, error) { + vals := map[string]MirrorState{ + "broken": MirrorStateBroken, + "mirrored": MirrorStateMirrored, + "uninitialized": MirrorStateUninitialized, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MirrorState(input) + return &out, nil +} + +type RelationshipStatus string + +const ( + RelationshipStatusIdle RelationshipStatus = "Idle" + RelationshipStatusTransferring RelationshipStatus = "Transferring" +) + +func PossibleValuesForRelationshipStatus() []string { + return []string{ + string(RelationshipStatusIdle), + string(RelationshipStatusTransferring), + } +} + +func parseRelationshipStatus(input string) (*RelationshipStatus, error) { + vals := map[string]RelationshipStatus{ + "idle": RelationshipStatusIdle, + "transferring": RelationshipStatusTransferring, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RelationshipStatus(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/id_volume.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/id_volume.go new file mode 100644 index 000000000000..c88adaf98587 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/id_volume.go @@ -0,0 +1,150 @@ +package volumesreplication + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = VolumeId{} + +// VolumeId is a struct representing the Resource ID for a Volume +type VolumeId struct { + SubscriptionId string + ResourceGroupName string + AccountName string + PoolName string + VolumeName string +} + +// NewVolumeID returns a new VolumeId struct +func NewVolumeID(subscriptionId string, resourceGroupName string, accountName string, poolName string, volumeName string) VolumeId { + return VolumeId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AccountName: accountName, + PoolName: poolName, + VolumeName: volumeName, + } +} + +// ParseVolumeID parses 'input' into a VolumeId +func ParseVolumeID(input string) (*VolumeId, error) { + parser := resourceids.NewParserFromResourceIdType(VolumeId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VolumeId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { + return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) + } + + if id.VolumeName, ok = parsed.Parsed["volumeName"]; !ok { + return nil, fmt.Errorf("the segment 'volumeName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseVolumeIDInsensitively parses 'input' case-insensitively into a VolumeId +// note: this method should only be used for API response data and not user input +func ParseVolumeIDInsensitively(input string) (*VolumeId, error) { + parser := resourceids.NewParserFromResourceIdType(VolumeId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VolumeId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { + return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) + } + + if id.VolumeName, ok = parsed.Parsed["volumeName"]; !ok { + return nil, fmt.Errorf("the segment 'volumeName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateVolumeID checks that 'input' can be parsed as a Volume ID +func ValidateVolumeID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseVolumeID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Volume ID +func (id VolumeId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/capacityPools/%s/volumes/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName, id.PoolName, id.VolumeName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Volume ID +func (id VolumeId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("accountName", "accountValue"), + resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), + resourceids.UserSpecifiedSegment("poolName", "poolValue"), + resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), + resourceids.UserSpecifiedSegment("volumeName", "volumeValue"), + } +} + +// String returns a human-readable description of this Volume ID +func (id VolumeId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Account Name: %q", id.AccountName), + fmt.Sprintf("Pool Name: %q", id.PoolName), + fmt.Sprintf("Volume Name: %q", id.VolumeName), + } + return fmt.Sprintf("Volume (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesauthorizereplication_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesauthorizereplication_autorest.go new file mode 100644 index 000000000000..76b9f035e73f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesauthorizereplication_autorest.go @@ -0,0 +1,79 @@ +package volumesreplication + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumesAuthorizeReplicationOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// VolumesAuthorizeReplication ... +func (c VolumesReplicationClient) VolumesAuthorizeReplication(ctx context.Context, id VolumeId, input AuthorizeRequest) (result VolumesAuthorizeReplicationOperationResponse, err error) { + req, err := c.preparerForVolumesAuthorizeReplication(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesAuthorizeReplication", nil, "Failure preparing request") + return + } + + result, err = c.senderForVolumesAuthorizeReplication(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesAuthorizeReplication", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// VolumesAuthorizeReplicationThenPoll performs VolumesAuthorizeReplication then polls until it's completed +func (c VolumesReplicationClient) VolumesAuthorizeReplicationThenPoll(ctx context.Context, id VolumeId, input AuthorizeRequest) error { + result, err := c.VolumesAuthorizeReplication(ctx, id, input) + if err != nil { + return fmt.Errorf("performing VolumesAuthorizeReplication: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after VolumesAuthorizeReplication: %+v", err) + } + + return nil +} + +// preparerForVolumesAuthorizeReplication prepares the VolumesAuthorizeReplication request. +func (c VolumesReplicationClient) preparerForVolumesAuthorizeReplication(ctx context.Context, id VolumeId, input AuthorizeRequest) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/authorizeReplication", id.ID())), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForVolumesAuthorizeReplication sends the VolumesAuthorizeReplication request. The method will close the +// http.Response Body if it receives an error. +func (c VolumesReplicationClient) senderForVolumesAuthorizeReplication(ctx context.Context, req *http.Request) (future VolumesAuthorizeReplicationOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesbreakreplication_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesbreakreplication_autorest.go new file mode 100644 index 000000000000..2d1739198e38 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesbreakreplication_autorest.go @@ -0,0 +1,79 @@ +package volumesreplication + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumesBreakReplicationOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// VolumesBreakReplication ... +func (c VolumesReplicationClient) VolumesBreakReplication(ctx context.Context, id VolumeId, input BreakReplicationRequest) (result VolumesBreakReplicationOperationResponse, err error) { + req, err := c.preparerForVolumesBreakReplication(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesBreakReplication", nil, "Failure preparing request") + return + } + + result, err = c.senderForVolumesBreakReplication(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesBreakReplication", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// VolumesBreakReplicationThenPoll performs VolumesBreakReplication then polls until it's completed +func (c VolumesReplicationClient) VolumesBreakReplicationThenPoll(ctx context.Context, id VolumeId, input BreakReplicationRequest) error { + result, err := c.VolumesBreakReplication(ctx, id, input) + if err != nil { + return fmt.Errorf("performing VolumesBreakReplication: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after VolumesBreakReplication: %+v", err) + } + + return nil +} + +// preparerForVolumesBreakReplication prepares the VolumesBreakReplication request. +func (c VolumesReplicationClient) preparerForVolumesBreakReplication(ctx context.Context, id VolumeId, input BreakReplicationRequest) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/breakReplication", id.ID())), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForVolumesBreakReplication sends the VolumesBreakReplication request. The method will close the +// http.Response Body if it receives an error. +func (c VolumesReplicationClient) senderForVolumesBreakReplication(ctx context.Context, req *http.Request) (future VolumesBreakReplicationOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesdeletereplication_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesdeletereplication_autorest.go new file mode 100644 index 000000000000..6dd32453b2de --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesdeletereplication_autorest.go @@ -0,0 +1,78 @@ +package volumesreplication + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumesDeleteReplicationOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// VolumesDeleteReplication ... +func (c VolumesReplicationClient) VolumesDeleteReplication(ctx context.Context, id VolumeId) (result VolumesDeleteReplicationOperationResponse, err error) { + req, err := c.preparerForVolumesDeleteReplication(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesDeleteReplication", nil, "Failure preparing request") + return + } + + result, err = c.senderForVolumesDeleteReplication(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesDeleteReplication", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// VolumesDeleteReplicationThenPoll performs VolumesDeleteReplication then polls until it's completed +func (c VolumesReplicationClient) VolumesDeleteReplicationThenPoll(ctx context.Context, id VolumeId) error { + result, err := c.VolumesDeleteReplication(ctx, id) + if err != nil { + return fmt.Errorf("performing VolumesDeleteReplication: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after VolumesDeleteReplication: %+v", err) + } + + return nil +} + +// preparerForVolumesDeleteReplication prepares the VolumesDeleteReplication request. +func (c VolumesReplicationClient) preparerForVolumesDeleteReplication(ctx context.Context, id VolumeId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/deleteReplication", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForVolumesDeleteReplication sends the VolumesDeleteReplication request. The method will close the +// http.Response Body if it receives an error. +func (c VolumesReplicationClient) senderForVolumesDeleteReplication(ctx context.Context, req *http.Request) (future VolumesDeleteReplicationOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesreinitializereplication_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesreinitializereplication_autorest.go new file mode 100644 index 000000000000..f894605753fa --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesreinitializereplication_autorest.go @@ -0,0 +1,78 @@ +package volumesreplication + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumesReInitializeReplicationOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// VolumesReInitializeReplication ... +func (c VolumesReplicationClient) VolumesReInitializeReplication(ctx context.Context, id VolumeId) (result VolumesReInitializeReplicationOperationResponse, err error) { + req, err := c.preparerForVolumesReInitializeReplication(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesReInitializeReplication", nil, "Failure preparing request") + return + } + + result, err = c.senderForVolumesReInitializeReplication(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesReInitializeReplication", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// VolumesReInitializeReplicationThenPoll performs VolumesReInitializeReplication then polls until it's completed +func (c VolumesReplicationClient) VolumesReInitializeReplicationThenPoll(ctx context.Context, id VolumeId) error { + result, err := c.VolumesReInitializeReplication(ctx, id) + if err != nil { + return fmt.Errorf("performing VolumesReInitializeReplication: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after VolumesReInitializeReplication: %+v", err) + } + + return nil +} + +// preparerForVolumesReInitializeReplication prepares the VolumesReInitializeReplication request. +func (c VolumesReplicationClient) preparerForVolumesReInitializeReplication(ctx context.Context, id VolumeId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/reinitializeReplication", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForVolumesReInitializeReplication sends the VolumesReInitializeReplication request. The method will close the +// http.Response Body if it receives an error. +func (c VolumesReplicationClient) senderForVolumesReInitializeReplication(ctx context.Context, req *http.Request) (future VolumesReInitializeReplicationOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesreplicationstatus_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesreplicationstatus_autorest.go new file mode 100644 index 000000000000..12b0382b0cd4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesreplicationstatus_autorest.go @@ -0,0 +1,68 @@ +package volumesreplication + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumesReplicationStatusOperationResponse struct { + HttpResponse *http.Response + Model *ReplicationStatus +} + +// VolumesReplicationStatus ... +func (c VolumesReplicationClient) VolumesReplicationStatus(ctx context.Context, id VolumeId) (result VolumesReplicationStatusOperationResponse, err error) { + req, err := c.preparerForVolumesReplicationStatus(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesReplicationStatus", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesReplicationStatus", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForVolumesReplicationStatus(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesReplicationStatus", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForVolumesReplicationStatus prepares the VolumesReplicationStatus request. +func (c VolumesReplicationClient) preparerForVolumesReplicationStatus(ctx context.Context, id VolumeId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/replicationStatus", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForVolumesReplicationStatus handles the response to the VolumesReplicationStatus request. The method always +// closes the http.Response Body. +func (c VolumesReplicationClient) responderForVolumesReplicationStatus(resp *http.Response) (result VolumesReplicationStatusOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesresyncreplication_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesresyncreplication_autorest.go new file mode 100644 index 000000000000..05f303966fa5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesresyncreplication_autorest.go @@ -0,0 +1,78 @@ +package volumesreplication + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumesResyncReplicationOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// VolumesResyncReplication ... +func (c VolumesReplicationClient) VolumesResyncReplication(ctx context.Context, id VolumeId) (result VolumesResyncReplicationOperationResponse, err error) { + req, err := c.preparerForVolumesResyncReplication(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesResyncReplication", nil, "Failure preparing request") + return + } + + result, err = c.senderForVolumesResyncReplication(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesResyncReplication", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// VolumesResyncReplicationThenPoll performs VolumesResyncReplication then polls until it's completed +func (c VolumesReplicationClient) VolumesResyncReplicationThenPoll(ctx context.Context, id VolumeId) error { + result, err := c.VolumesResyncReplication(ctx, id) + if err != nil { + return fmt.Errorf("performing VolumesResyncReplication: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after VolumesResyncReplication: %+v", err) + } + + return nil +} + +// preparerForVolumesResyncReplication prepares the VolumesResyncReplication request. +func (c VolumesReplicationClient) preparerForVolumesResyncReplication(ctx context.Context, id VolumeId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/resyncReplication", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForVolumesResyncReplication sends the VolumesResyncReplication request. The method will close the +// http.Response Body if it receives an error. +func (c VolumesReplicationClient) senderForVolumesResyncReplication(ctx context.Context, req *http.Request) (future VolumesResyncReplicationOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/model_authorizerequest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/model_authorizerequest.go new file mode 100644 index 000000000000..ff1cefa31efa --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/model_authorizerequest.go @@ -0,0 +1,8 @@ +package volumesreplication + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AuthorizeRequest struct { + RemoteVolumeResourceId *string `json:"remoteVolumeResourceId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/model_breakreplicationrequest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/model_breakreplicationrequest.go new file mode 100644 index 000000000000..b6a0a179a9c6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/model_breakreplicationrequest.go @@ -0,0 +1,8 @@ +package volumesreplication + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BreakReplicationRequest struct { + ForceBreakReplication *bool `json:"forceBreakReplication,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/model_replicationstatus.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/model_replicationstatus.go new file mode 100644 index 000000000000..2a79dddf7a40 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/model_replicationstatus.go @@ -0,0 +1,12 @@ +package volumesreplication + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ReplicationStatus struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Healthy *bool `json:"healthy,omitempty"` + MirrorState *MirrorState `json:"mirrorState,omitempty"` + RelationshipStatus *RelationshipStatus `json:"relationshipStatus,omitempty"` + TotalProgress *string `json:"totalProgress,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/version.go new file mode 100644 index 000000000000..5a6266022a22 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/version.go @@ -0,0 +1,12 @@ +package volumesreplication + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2021-10-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/volumesreplication/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/README.md new file mode 100644 index 000000000000..a96a742cad70 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/README.md @@ -0,0 +1,99 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools` Documentation + +The `capacitypools` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2022-01-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools" +``` + + +### Client Initialization + +```go +client := capacitypools.NewCapacityPoolsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `CapacityPoolsClient.PoolsCreateOrUpdate` + +```go +ctx := context.TODO() +id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue") + +payload := capacitypools.CapacityPool{ + // ... +} + + +if err := client.PoolsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `CapacityPoolsClient.PoolsDelete` + +```go +ctx := context.TODO() +id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue") + +if err := client.PoolsDeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `CapacityPoolsClient.PoolsGet` + +```go +ctx := context.TODO() +id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue") + +read, err := client.PoolsGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CapacityPoolsClient.PoolsList` + +```go +ctx := context.TODO() +id := capacitypools.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") + +// alternatively `client.PoolsList(ctx, id)` can be used to do batched pagination +items, err := client.PoolsListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `CapacityPoolsClient.PoolsUpdate` + +```go +ctx := context.TODO() +id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue") + +payload := capacitypools.CapacityPoolPatch{ + // ... +} + + +if err := client.PoolsUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/client.go new file mode 100644 index 000000000000..d31b6b301a25 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/client.go @@ -0,0 +1,18 @@ +package capacitypools + +import "github.com/Azure/go-autorest/autorest" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CapacityPoolsClient struct { + Client autorest.Client + baseUri string +} + +func NewCapacityPoolsClientWithBaseURI(endpoint string) CapacityPoolsClient { + return CapacityPoolsClient{ + Client: autorest.NewClientWithUserAgent(userAgent()), + baseUri: endpoint, + } +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/constants.go new file mode 100644 index 000000000000..4856e8e79bc3 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/constants.go @@ -0,0 +1,96 @@ +package capacitypools + +import "strings" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type EncryptionType string + +const ( + EncryptionTypeDouble EncryptionType = "Double" + EncryptionTypeSingle EncryptionType = "Single" +) + +func PossibleValuesForEncryptionType() []string { + return []string{ + string(EncryptionTypeDouble), + string(EncryptionTypeSingle), + } +} + +func parseEncryptionType(input string) (*EncryptionType, error) { + vals := map[string]EncryptionType{ + "double": EncryptionTypeDouble, + "single": EncryptionTypeSingle, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := EncryptionType(input) + return &out, nil +} + +type QosType string + +const ( + QosTypeAuto QosType = "Auto" + QosTypeManual QosType = "Manual" +) + +func PossibleValuesForQosType() []string { + return []string{ + string(QosTypeAuto), + string(QosTypeManual), + } +} + +func parseQosType(input string) (*QosType, error) { + vals := map[string]QosType{ + "auto": QosTypeAuto, + "manual": QosTypeManual, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := QosType(input) + return &out, nil +} + +type ServiceLevel string + +const ( + ServiceLevelPremium ServiceLevel = "Premium" + ServiceLevelStandard ServiceLevel = "Standard" + ServiceLevelStandardZRS ServiceLevel = "StandardZRS" + ServiceLevelUltra ServiceLevel = "Ultra" +) + +func PossibleValuesForServiceLevel() []string { + return []string{ + string(ServiceLevelPremium), + string(ServiceLevelStandard), + string(ServiceLevelStandardZRS), + string(ServiceLevelUltra), + } +} + +func parseServiceLevel(input string) (*ServiceLevel, error) { + vals := map[string]ServiceLevel{ + "premium": ServiceLevelPremium, + "standard": ServiceLevelStandard, + "standardzrs": ServiceLevelStandardZRS, + "ultra": ServiceLevelUltra, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ServiceLevel(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/id_capacitypool.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/id_capacitypool.go new file mode 100644 index 000000000000..a50e29408397 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/id_capacitypool.go @@ -0,0 +1,137 @@ +package capacitypools + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = CapacityPoolId{} + +// CapacityPoolId is a struct representing the Resource ID for a Capacity Pool +type CapacityPoolId struct { + SubscriptionId string + ResourceGroupName string + AccountName string + PoolName string +} + +// NewCapacityPoolID returns a new CapacityPoolId struct +func NewCapacityPoolID(subscriptionId string, resourceGroupName string, accountName string, poolName string) CapacityPoolId { + return CapacityPoolId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AccountName: accountName, + PoolName: poolName, + } +} + +// ParseCapacityPoolID parses 'input' into a CapacityPoolId +func ParseCapacityPoolID(input string) (*CapacityPoolId, error) { + parser := resourceids.NewParserFromResourceIdType(CapacityPoolId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := CapacityPoolId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { + return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseCapacityPoolIDInsensitively parses 'input' case-insensitively into a CapacityPoolId +// note: this method should only be used for API response data and not user input +func ParseCapacityPoolIDInsensitively(input string) (*CapacityPoolId, error) { + parser := resourceids.NewParserFromResourceIdType(CapacityPoolId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := CapacityPoolId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { + return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateCapacityPoolID checks that 'input' can be parsed as a Capacity Pool ID +func ValidateCapacityPoolID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseCapacityPoolID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Capacity Pool ID +func (id CapacityPoolId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/capacityPools/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName, id.PoolName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Capacity Pool ID +func (id CapacityPoolId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("accountName", "accountValue"), + resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), + resourceids.UserSpecifiedSegment("poolName", "poolValue"), + } +} + +// String returns a human-readable description of this Capacity Pool ID +func (id CapacityPoolId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Account Name: %q", id.AccountName), + fmt.Sprintf("Pool Name: %q", id.PoolName), + } + return fmt.Sprintf("Capacity Pool (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/id_netappaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/id_netappaccount.go new file mode 100644 index 000000000000..86bd7fcada46 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/id_netappaccount.go @@ -0,0 +1,124 @@ +package capacitypools + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = NetAppAccountId{} + +// NetAppAccountId is a struct representing the Resource ID for a Net App Account +type NetAppAccountId struct { + SubscriptionId string + ResourceGroupName string + AccountName string +} + +// NewNetAppAccountID returns a new NetAppAccountId struct +func NewNetAppAccountID(subscriptionId string, resourceGroupName string, accountName string) NetAppAccountId { + return NetAppAccountId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AccountName: accountName, + } +} + +// ParseNetAppAccountID parses 'input' into a NetAppAccountId +func ParseNetAppAccountID(input string) (*NetAppAccountId, error) { + parser := resourceids.NewParserFromResourceIdType(NetAppAccountId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := NetAppAccountId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseNetAppAccountIDInsensitively parses 'input' case-insensitively into a NetAppAccountId +// note: this method should only be used for API response data and not user input +func ParseNetAppAccountIDInsensitively(input string) (*NetAppAccountId, error) { + parser := resourceids.NewParserFromResourceIdType(NetAppAccountId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := NetAppAccountId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateNetAppAccountID checks that 'input' can be parsed as a Net App Account ID +func ValidateNetAppAccountID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseNetAppAccountID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Net App Account ID +func (id NetAppAccountId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Net App Account ID +func (id NetAppAccountId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("accountName", "accountValue"), + } +} + +// String returns a human-readable description of this Net App Account ID +func (id NetAppAccountId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Account Name: %q", id.AccountName), + } + return fmt.Sprintf("Net App Account (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/method_poolscreateorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/method_poolscreateorupdate_autorest.go new file mode 100644 index 000000000000..72891f7b9dfb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/method_poolscreateorupdate_autorest.go @@ -0,0 +1,79 @@ +package capacitypools + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PoolsCreateOrUpdateOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// PoolsCreateOrUpdate ... +func (c CapacityPoolsClient) PoolsCreateOrUpdate(ctx context.Context, id CapacityPoolId, input CapacityPool) (result PoolsCreateOrUpdateOperationResponse, err error) { + req, err := c.preparerForPoolsCreateOrUpdate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsCreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = c.senderForPoolsCreateOrUpdate(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsCreateOrUpdate", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// PoolsCreateOrUpdateThenPoll performs PoolsCreateOrUpdate then polls until it's completed +func (c CapacityPoolsClient) PoolsCreateOrUpdateThenPoll(ctx context.Context, id CapacityPoolId, input CapacityPool) error { + result, err := c.PoolsCreateOrUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing PoolsCreateOrUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after PoolsCreateOrUpdate: %+v", err) + } + + return nil +} + +// preparerForPoolsCreateOrUpdate prepares the PoolsCreateOrUpdate request. +func (c CapacityPoolsClient) preparerForPoolsCreateOrUpdate(ctx context.Context, id CapacityPoolId, input CapacityPool) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForPoolsCreateOrUpdate sends the PoolsCreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (c CapacityPoolsClient) senderForPoolsCreateOrUpdate(ctx context.Context, req *http.Request) (future PoolsCreateOrUpdateOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/method_poolsdelete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/method_poolsdelete_autorest.go new file mode 100644 index 000000000000..61d0e6104b15 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/method_poolsdelete_autorest.go @@ -0,0 +1,78 @@ +package capacitypools + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PoolsDeleteOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// PoolsDelete ... +func (c CapacityPoolsClient) PoolsDelete(ctx context.Context, id CapacityPoolId) (result PoolsDeleteOperationResponse, err error) { + req, err := c.preparerForPoolsDelete(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsDelete", nil, "Failure preparing request") + return + } + + result, err = c.senderForPoolsDelete(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsDelete", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// PoolsDeleteThenPoll performs PoolsDelete then polls until it's completed +func (c CapacityPoolsClient) PoolsDeleteThenPoll(ctx context.Context, id CapacityPoolId) error { + result, err := c.PoolsDelete(ctx, id) + if err != nil { + return fmt.Errorf("performing PoolsDelete: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after PoolsDelete: %+v", err) + } + + return nil +} + +// preparerForPoolsDelete prepares the PoolsDelete request. +func (c CapacityPoolsClient) preparerForPoolsDelete(ctx context.Context, id CapacityPoolId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForPoolsDelete sends the PoolsDelete request. The method will close the +// http.Response Body if it receives an error. +func (c CapacityPoolsClient) senderForPoolsDelete(ctx context.Context, req *http.Request) (future PoolsDeleteOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/method_poolsget_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/method_poolsget_autorest.go new file mode 100644 index 000000000000..d2725693da9d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/method_poolsget_autorest.go @@ -0,0 +1,67 @@ +package capacitypools + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PoolsGetOperationResponse struct { + HttpResponse *http.Response + Model *CapacityPool +} + +// PoolsGet ... +func (c CapacityPoolsClient) PoolsGet(ctx context.Context, id CapacityPoolId) (result PoolsGetOperationResponse, err error) { + req, err := c.preparerForPoolsGet(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsGet", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsGet", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForPoolsGet(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsGet", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForPoolsGet prepares the PoolsGet request. +func (c CapacityPoolsClient) preparerForPoolsGet(ctx context.Context, id CapacityPoolId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForPoolsGet handles the response to the PoolsGet request. The method always +// closes the http.Response Body. +func (c CapacityPoolsClient) responderForPoolsGet(resp *http.Response) (result PoolsGetOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/method_poolslist_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/method_poolslist_autorest.go new file mode 100644 index 000000000000..25c06a45e9bd --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/method_poolslist_autorest.go @@ -0,0 +1,186 @@ +package capacitypools + +import ( + "context" + "fmt" + "net/http" + "net/url" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PoolsListOperationResponse struct { + HttpResponse *http.Response + Model *[]CapacityPool + + nextLink *string + nextPageFunc func(ctx context.Context, nextLink string) (PoolsListOperationResponse, error) +} + +type PoolsListCompleteResult struct { + Items []CapacityPool +} + +func (r PoolsListOperationResponse) HasMore() bool { + return r.nextLink != nil +} + +func (r PoolsListOperationResponse) LoadMore(ctx context.Context) (resp PoolsListOperationResponse, err error) { + if !r.HasMore() { + err = fmt.Errorf("no more pages returned") + return + } + return r.nextPageFunc(ctx, *r.nextLink) +} + +// PoolsList ... +func (c CapacityPoolsClient) PoolsList(ctx context.Context, id NetAppAccountId) (resp PoolsListOperationResponse, err error) { + req, err := c.preparerForPoolsList(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsList", nil, "Failure preparing request") + return + } + + resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsList", resp.HttpResponse, "Failure sending request") + return + } + + resp, err = c.responderForPoolsList(resp.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsList", resp.HttpResponse, "Failure responding to request") + return + } + return +} + +// PoolsListComplete retrieves all of the results into a single object +func (c CapacityPoolsClient) PoolsListComplete(ctx context.Context, id NetAppAccountId) (PoolsListCompleteResult, error) { + return c.PoolsListCompleteMatchingPredicate(ctx, id, CapacityPoolOperationPredicate{}) +} + +// PoolsListCompleteMatchingPredicate retrieves all of the results and then applied the predicate +func (c CapacityPoolsClient) PoolsListCompleteMatchingPredicate(ctx context.Context, id NetAppAccountId, predicate CapacityPoolOperationPredicate) (resp PoolsListCompleteResult, err error) { + items := make([]CapacityPool, 0) + + page, err := c.PoolsList(ctx, id) + if err != nil { + err = fmt.Errorf("loading the initial page: %+v", err) + return + } + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + for page.HasMore() { + page, err = page.LoadMore(ctx) + if err != nil { + err = fmt.Errorf("loading the next page: %+v", err) + return + } + + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + } + + out := PoolsListCompleteResult{ + Items: items, + } + return out, nil +} + +// preparerForPoolsList prepares the PoolsList request. +func (c CapacityPoolsClient) preparerForPoolsList(ctx context.Context, id NetAppAccountId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/capacityPools", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// preparerForPoolsListWithNextLink prepares the PoolsList request with the given nextLink token. +func (c CapacityPoolsClient) preparerForPoolsListWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { + uri, err := url.Parse(nextLink) + if err != nil { + return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) + } + queryParameters := map[string]interface{}{} + for k, v := range uri.Query() { + if len(v) == 0 { + continue + } + val := v[0] + val = autorest.Encode("query", val) + queryParameters[k] = val + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(uri.Path), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForPoolsList handles the response to the PoolsList request. The method always +// closes the http.Response Body. +func (c CapacityPoolsClient) responderForPoolsList(resp *http.Response) (result PoolsListOperationResponse, err error) { + type page struct { + Values []CapacityPool `json:"value"` + NextLink *string `json:"nextLink"` + } + var respObj page + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&respObj), + autorest.ByClosing()) + result.HttpResponse = resp + result.Model = &respObj.Values + result.nextLink = respObj.NextLink + if respObj.NextLink != nil { + result.nextPageFunc = func(ctx context.Context, nextLink string) (result PoolsListOperationResponse, err error) { + req, err := c.preparerForPoolsListWithNextLink(ctx, nextLink) + if err != nil { + err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsList", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsList", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForPoolsList(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsList", result.HttpResponse, "Failure responding to request") + return + } + + return + } + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/method_poolsupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/method_poolsupdate_autorest.go new file mode 100644 index 000000000000..680bc19748a1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/method_poolsupdate_autorest.go @@ -0,0 +1,79 @@ +package capacitypools + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PoolsUpdateOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// PoolsUpdate ... +func (c CapacityPoolsClient) PoolsUpdate(ctx context.Context, id CapacityPoolId, input CapacityPoolPatch) (result PoolsUpdateOperationResponse, err error) { + req, err := c.preparerForPoolsUpdate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsUpdate", nil, "Failure preparing request") + return + } + + result, err = c.senderForPoolsUpdate(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsUpdate", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// PoolsUpdateThenPoll performs PoolsUpdate then polls until it's completed +func (c CapacityPoolsClient) PoolsUpdateThenPoll(ctx context.Context, id CapacityPoolId, input CapacityPoolPatch) error { + result, err := c.PoolsUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing PoolsUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after PoolsUpdate: %+v", err) + } + + return nil +} + +// preparerForPoolsUpdate prepares the PoolsUpdate request. +func (c CapacityPoolsClient) preparerForPoolsUpdate(ctx context.Context, id CapacityPoolId, input CapacityPoolPatch) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForPoolsUpdate sends the PoolsUpdate request. The method will close the +// http.Response Body if it receives an error. +func (c CapacityPoolsClient) senderForPoolsUpdate(ctx context.Context, req *http.Request) (future PoolsUpdateOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/model_capacitypool.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/model_capacitypool.go new file mode 100644 index 000000000000..f5d6f1ea86df --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/model_capacitypool.go @@ -0,0 +1,19 @@ +package capacitypools + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CapacityPool struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties PoolProperties `json:"properties"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/model_capacitypoolpatch.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/model_capacitypoolpatch.go new file mode 100644 index 000000000000..46abcde6b330 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/model_capacitypoolpatch.go @@ -0,0 +1,13 @@ +package capacitypools + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CapacityPoolPatch struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *PoolPatchProperties `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/model_poolpatchproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/model_poolpatchproperties.go new file mode 100644 index 000000000000..071dba445599 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/model_poolpatchproperties.go @@ -0,0 +1,9 @@ +package capacitypools + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PoolPatchProperties struct { + QosType *QosType `json:"qosType,omitempty"` + Size *int64 `json:"size,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/model_poolproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/model_poolproperties.go new file mode 100644 index 000000000000..a1fee733fb48 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/model_poolproperties.go @@ -0,0 +1,16 @@ +package capacitypools + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PoolProperties struct { + CoolAccess *bool `json:"coolAccess,omitempty"` + EncryptionType *EncryptionType `json:"encryptionType,omitempty"` + PoolId *string `json:"poolId,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + QosType *QosType `json:"qosType,omitempty"` + ServiceLevel ServiceLevel `json:"serviceLevel"` + Size int64 `json:"size"` + TotalThroughputMibps *float64 `json:"totalThroughputMibps,omitempty"` + UtilizedThroughputMibps *float64 `json:"utilizedThroughputMibps,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/predicates.go new file mode 100644 index 000000000000..67e2199aa2cd --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/predicates.go @@ -0,0 +1,34 @@ +package capacitypools + +type CapacityPoolOperationPredicate struct { + Etag *string + Id *string + Location *string + Name *string + Type *string +} + +func (p CapacityPoolOperationPredicate) Matches(input CapacityPool) bool { + + if p.Etag != nil && (input.Etag == nil && *p.Etag != *input.Etag) { + return false + } + + if p.Id != nil && (input.Id == nil && *p.Id != *input.Id) { + return false + } + + if p.Location != nil && *p.Location != input.Location { + return false + } + + if p.Name != nil && (input.Name == nil && *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil && *p.Type != *input.Type) { + return false + } + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/version.go new file mode 100644 index 000000000000..f1cfc7ecf174 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/version.go @@ -0,0 +1,12 @@ +package capacitypools + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-01-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/capacitypools/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/README.md new file mode 100644 index 000000000000..737a4fa9b00b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/README.md @@ -0,0 +1,116 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts` Documentation + +The `netappaccounts` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2022-01-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts" +``` + + +### Client Initialization + +```go +client := netappaccounts.NewNetAppAccountsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `NetAppAccountsClient.AccountsCreateOrUpdate` + +```go +ctx := context.TODO() +id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") + +payload := netappaccounts.NetAppAccount{ + // ... +} + + +if err := client.AccountsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `NetAppAccountsClient.AccountsDelete` + +```go +ctx := context.TODO() +id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") + +if err := client.AccountsDeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `NetAppAccountsClient.AccountsGet` + +```go +ctx := context.TODO() +id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") + +read, err := client.AccountsGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `NetAppAccountsClient.AccountsList` + +```go +ctx := context.TODO() +id := netappaccounts.NewResourceGroupID() + +// alternatively `client.AccountsList(ctx, id)` can be used to do batched pagination +items, err := client.AccountsListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `NetAppAccountsClient.AccountsListBySubscription` + +```go +ctx := context.TODO() +id := netappaccounts.NewSubscriptionID() + +// alternatively `client.AccountsListBySubscription(ctx, id)` can be used to do batched pagination +items, err := client.AccountsListBySubscriptionComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `NetAppAccountsClient.AccountsUpdate` + +```go +ctx := context.TODO() +id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") + +payload := netappaccounts.NetAppAccountPatch{ + // ... +} + + +if err := client.AccountsUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/client.go new file mode 100644 index 000000000000..1a10ce8e9b65 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/client.go @@ -0,0 +1,18 @@ +package netappaccounts + +import "github.com/Azure/go-autorest/autorest" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetAppAccountsClient struct { + Client autorest.Client + baseUri string +} + +func NewNetAppAccountsClientWithBaseURI(endpoint string) NetAppAccountsClient { + return NetAppAccountsClient{ + Client: autorest.NewClientWithUserAgent(userAgent()), + baseUri: endpoint, + } +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/constants.go new file mode 100644 index 000000000000..6e41970873a4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/constants.go @@ -0,0 +1,43 @@ +package netappaccounts + +import "strings" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ActiveDirectoryStatus string + +const ( + ActiveDirectoryStatusCreated ActiveDirectoryStatus = "Created" + ActiveDirectoryStatusDeleted ActiveDirectoryStatus = "Deleted" + ActiveDirectoryStatusError ActiveDirectoryStatus = "Error" + ActiveDirectoryStatusInUse ActiveDirectoryStatus = "InUse" + ActiveDirectoryStatusUpdating ActiveDirectoryStatus = "Updating" +) + +func PossibleValuesForActiveDirectoryStatus() []string { + return []string{ + string(ActiveDirectoryStatusCreated), + string(ActiveDirectoryStatusDeleted), + string(ActiveDirectoryStatusError), + string(ActiveDirectoryStatusInUse), + string(ActiveDirectoryStatusUpdating), + } +} + +func parseActiveDirectoryStatus(input string) (*ActiveDirectoryStatus, error) { + vals := map[string]ActiveDirectoryStatus{ + "created": ActiveDirectoryStatusCreated, + "deleted": ActiveDirectoryStatusDeleted, + "error": ActiveDirectoryStatusError, + "inuse": ActiveDirectoryStatusInUse, + "updating": ActiveDirectoryStatusUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ActiveDirectoryStatus(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/id_netappaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/id_netappaccount.go new file mode 100644 index 000000000000..68e53f4815fc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/id_netappaccount.go @@ -0,0 +1,124 @@ +package netappaccounts + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = NetAppAccountId{} + +// NetAppAccountId is a struct representing the Resource ID for a Net App Account +type NetAppAccountId struct { + SubscriptionId string + ResourceGroupName string + AccountName string +} + +// NewNetAppAccountID returns a new NetAppAccountId struct +func NewNetAppAccountID(subscriptionId string, resourceGroupName string, accountName string) NetAppAccountId { + return NetAppAccountId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AccountName: accountName, + } +} + +// ParseNetAppAccountID parses 'input' into a NetAppAccountId +func ParseNetAppAccountID(input string) (*NetAppAccountId, error) { + parser := resourceids.NewParserFromResourceIdType(NetAppAccountId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := NetAppAccountId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseNetAppAccountIDInsensitively parses 'input' case-insensitively into a NetAppAccountId +// note: this method should only be used for API response data and not user input +func ParseNetAppAccountIDInsensitively(input string) (*NetAppAccountId, error) { + parser := resourceids.NewParserFromResourceIdType(NetAppAccountId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := NetAppAccountId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateNetAppAccountID checks that 'input' can be parsed as a Net App Account ID +func ValidateNetAppAccountID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseNetAppAccountID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Net App Account ID +func (id NetAppAccountId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Net App Account ID +func (id NetAppAccountId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("accountName", "accountValue"), + } +} + +// String returns a human-readable description of this Net App Account ID +func (id NetAppAccountId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Account Name: %q", id.AccountName), + } + return fmt.Sprintf("Net App Account (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountscreateorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountscreateorupdate_autorest.go new file mode 100644 index 000000000000..b192ede4f692 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountscreateorupdate_autorest.go @@ -0,0 +1,79 @@ +package netappaccounts + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AccountsCreateOrUpdateOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// AccountsCreateOrUpdate ... +func (c NetAppAccountsClient) AccountsCreateOrUpdate(ctx context.Context, id NetAppAccountId, input NetAppAccount) (result AccountsCreateOrUpdateOperationResponse, err error) { + req, err := c.preparerForAccountsCreateOrUpdate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsCreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = c.senderForAccountsCreateOrUpdate(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsCreateOrUpdate", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// AccountsCreateOrUpdateThenPoll performs AccountsCreateOrUpdate then polls until it's completed +func (c NetAppAccountsClient) AccountsCreateOrUpdateThenPoll(ctx context.Context, id NetAppAccountId, input NetAppAccount) error { + result, err := c.AccountsCreateOrUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing AccountsCreateOrUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after AccountsCreateOrUpdate: %+v", err) + } + + return nil +} + +// preparerForAccountsCreateOrUpdate prepares the AccountsCreateOrUpdate request. +func (c NetAppAccountsClient) preparerForAccountsCreateOrUpdate(ctx context.Context, id NetAppAccountId, input NetAppAccount) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForAccountsCreateOrUpdate sends the AccountsCreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (c NetAppAccountsClient) senderForAccountsCreateOrUpdate(ctx context.Context, req *http.Request) (future AccountsCreateOrUpdateOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountsdelete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountsdelete_autorest.go new file mode 100644 index 000000000000..4506db44c634 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountsdelete_autorest.go @@ -0,0 +1,78 @@ +package netappaccounts + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AccountsDeleteOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// AccountsDelete ... +func (c NetAppAccountsClient) AccountsDelete(ctx context.Context, id NetAppAccountId) (result AccountsDeleteOperationResponse, err error) { + req, err := c.preparerForAccountsDelete(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsDelete", nil, "Failure preparing request") + return + } + + result, err = c.senderForAccountsDelete(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsDelete", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// AccountsDeleteThenPoll performs AccountsDelete then polls until it's completed +func (c NetAppAccountsClient) AccountsDeleteThenPoll(ctx context.Context, id NetAppAccountId) error { + result, err := c.AccountsDelete(ctx, id) + if err != nil { + return fmt.Errorf("performing AccountsDelete: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after AccountsDelete: %+v", err) + } + + return nil +} + +// preparerForAccountsDelete prepares the AccountsDelete request. +func (c NetAppAccountsClient) preparerForAccountsDelete(ctx context.Context, id NetAppAccountId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForAccountsDelete sends the AccountsDelete request. The method will close the +// http.Response Body if it receives an error. +func (c NetAppAccountsClient) senderForAccountsDelete(ctx context.Context, req *http.Request) (future AccountsDeleteOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountsget_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountsget_autorest.go new file mode 100644 index 000000000000..1c1edc04ccfb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountsget_autorest.go @@ -0,0 +1,67 @@ +package netappaccounts + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AccountsGetOperationResponse struct { + HttpResponse *http.Response + Model *NetAppAccount +} + +// AccountsGet ... +func (c NetAppAccountsClient) AccountsGet(ctx context.Context, id NetAppAccountId) (result AccountsGetOperationResponse, err error) { + req, err := c.preparerForAccountsGet(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsGet", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsGet", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForAccountsGet(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsGet", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForAccountsGet prepares the AccountsGet request. +func (c NetAppAccountsClient) preparerForAccountsGet(ctx context.Context, id NetAppAccountId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForAccountsGet handles the response to the AccountsGet request. The method always +// closes the http.Response Body. +func (c NetAppAccountsClient) responderForAccountsGet(resp *http.Response) (result AccountsGetOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountslist_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountslist_autorest.go new file mode 100644 index 000000000000..dd93604fbcd5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountslist_autorest.go @@ -0,0 +1,187 @@ +package netappaccounts + +import ( + "context" + "fmt" + "net/http" + "net/url" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AccountsListOperationResponse struct { + HttpResponse *http.Response + Model *[]NetAppAccount + + nextLink *string + nextPageFunc func(ctx context.Context, nextLink string) (AccountsListOperationResponse, error) +} + +type AccountsListCompleteResult struct { + Items []NetAppAccount +} + +func (r AccountsListOperationResponse) HasMore() bool { + return r.nextLink != nil +} + +func (r AccountsListOperationResponse) LoadMore(ctx context.Context) (resp AccountsListOperationResponse, err error) { + if !r.HasMore() { + err = fmt.Errorf("no more pages returned") + return + } + return r.nextPageFunc(ctx, *r.nextLink) +} + +// AccountsList ... +func (c NetAppAccountsClient) AccountsList(ctx context.Context, id commonids.ResourceGroupId) (resp AccountsListOperationResponse, err error) { + req, err := c.preparerForAccountsList(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsList", nil, "Failure preparing request") + return + } + + resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsList", resp.HttpResponse, "Failure sending request") + return + } + + resp, err = c.responderForAccountsList(resp.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsList", resp.HttpResponse, "Failure responding to request") + return + } + return +} + +// AccountsListComplete retrieves all of the results into a single object +func (c NetAppAccountsClient) AccountsListComplete(ctx context.Context, id commonids.ResourceGroupId) (AccountsListCompleteResult, error) { + return c.AccountsListCompleteMatchingPredicate(ctx, id, NetAppAccountOperationPredicate{}) +} + +// AccountsListCompleteMatchingPredicate retrieves all of the results and then applied the predicate +func (c NetAppAccountsClient) AccountsListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate NetAppAccountOperationPredicate) (resp AccountsListCompleteResult, err error) { + items := make([]NetAppAccount, 0) + + page, err := c.AccountsList(ctx, id) + if err != nil { + err = fmt.Errorf("loading the initial page: %+v", err) + return + } + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + for page.HasMore() { + page, err = page.LoadMore(ctx) + if err != nil { + err = fmt.Errorf("loading the next page: %+v", err) + return + } + + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + } + + out := AccountsListCompleteResult{ + Items: items, + } + return out, nil +} + +// preparerForAccountsList prepares the AccountsList request. +func (c NetAppAccountsClient) preparerForAccountsList(ctx context.Context, id commonids.ResourceGroupId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/providers/Microsoft.NetApp/netAppAccounts", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// preparerForAccountsListWithNextLink prepares the AccountsList request with the given nextLink token. +func (c NetAppAccountsClient) preparerForAccountsListWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { + uri, err := url.Parse(nextLink) + if err != nil { + return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) + } + queryParameters := map[string]interface{}{} + for k, v := range uri.Query() { + if len(v) == 0 { + continue + } + val := v[0] + val = autorest.Encode("query", val) + queryParameters[k] = val + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(uri.Path), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForAccountsList handles the response to the AccountsList request. The method always +// closes the http.Response Body. +func (c NetAppAccountsClient) responderForAccountsList(resp *http.Response) (result AccountsListOperationResponse, err error) { + type page struct { + Values []NetAppAccount `json:"value"` + NextLink *string `json:"nextLink"` + } + var respObj page + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&respObj), + autorest.ByClosing()) + result.HttpResponse = resp + result.Model = &respObj.Values + result.nextLink = respObj.NextLink + if respObj.NextLink != nil { + result.nextPageFunc = func(ctx context.Context, nextLink string) (result AccountsListOperationResponse, err error) { + req, err := c.preparerForAccountsListWithNextLink(ctx, nextLink) + if err != nil { + err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsList", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsList", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForAccountsList(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsList", result.HttpResponse, "Failure responding to request") + return + } + + return + } + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountslistbysubscription_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountslistbysubscription_autorest.go new file mode 100644 index 000000000000..bd65578f1751 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountslistbysubscription_autorest.go @@ -0,0 +1,187 @@ +package netappaccounts + +import ( + "context" + "fmt" + "net/http" + "net/url" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AccountsListBySubscriptionOperationResponse struct { + HttpResponse *http.Response + Model *[]NetAppAccount + + nextLink *string + nextPageFunc func(ctx context.Context, nextLink string) (AccountsListBySubscriptionOperationResponse, error) +} + +type AccountsListBySubscriptionCompleteResult struct { + Items []NetAppAccount +} + +func (r AccountsListBySubscriptionOperationResponse) HasMore() bool { + return r.nextLink != nil +} + +func (r AccountsListBySubscriptionOperationResponse) LoadMore(ctx context.Context) (resp AccountsListBySubscriptionOperationResponse, err error) { + if !r.HasMore() { + err = fmt.Errorf("no more pages returned") + return + } + return r.nextPageFunc(ctx, *r.nextLink) +} + +// AccountsListBySubscription ... +func (c NetAppAccountsClient) AccountsListBySubscription(ctx context.Context, id commonids.SubscriptionId) (resp AccountsListBySubscriptionOperationResponse, err error) { + req, err := c.preparerForAccountsListBySubscription(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsListBySubscription", nil, "Failure preparing request") + return + } + + resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsListBySubscription", resp.HttpResponse, "Failure sending request") + return + } + + resp, err = c.responderForAccountsListBySubscription(resp.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsListBySubscription", resp.HttpResponse, "Failure responding to request") + return + } + return +} + +// AccountsListBySubscriptionComplete retrieves all of the results into a single object +func (c NetAppAccountsClient) AccountsListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId) (AccountsListBySubscriptionCompleteResult, error) { + return c.AccountsListBySubscriptionCompleteMatchingPredicate(ctx, id, NetAppAccountOperationPredicate{}) +} + +// AccountsListBySubscriptionCompleteMatchingPredicate retrieves all of the results and then applied the predicate +func (c NetAppAccountsClient) AccountsListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate NetAppAccountOperationPredicate) (resp AccountsListBySubscriptionCompleteResult, err error) { + items := make([]NetAppAccount, 0) + + page, err := c.AccountsListBySubscription(ctx, id) + if err != nil { + err = fmt.Errorf("loading the initial page: %+v", err) + return + } + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + for page.HasMore() { + page, err = page.LoadMore(ctx) + if err != nil { + err = fmt.Errorf("loading the next page: %+v", err) + return + } + + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + } + + out := AccountsListBySubscriptionCompleteResult{ + Items: items, + } + return out, nil +} + +// preparerForAccountsListBySubscription prepares the AccountsListBySubscription request. +func (c NetAppAccountsClient) preparerForAccountsListBySubscription(ctx context.Context, id commonids.SubscriptionId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/providers/Microsoft.NetApp/netAppAccounts", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// preparerForAccountsListBySubscriptionWithNextLink prepares the AccountsListBySubscription request with the given nextLink token. +func (c NetAppAccountsClient) preparerForAccountsListBySubscriptionWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { + uri, err := url.Parse(nextLink) + if err != nil { + return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) + } + queryParameters := map[string]interface{}{} + for k, v := range uri.Query() { + if len(v) == 0 { + continue + } + val := v[0] + val = autorest.Encode("query", val) + queryParameters[k] = val + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(uri.Path), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForAccountsListBySubscription handles the response to the AccountsListBySubscription request. The method always +// closes the http.Response Body. +func (c NetAppAccountsClient) responderForAccountsListBySubscription(resp *http.Response) (result AccountsListBySubscriptionOperationResponse, err error) { + type page struct { + Values []NetAppAccount `json:"value"` + NextLink *string `json:"nextLink"` + } + var respObj page + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&respObj), + autorest.ByClosing()) + result.HttpResponse = resp + result.Model = &respObj.Values + result.nextLink = respObj.NextLink + if respObj.NextLink != nil { + result.nextPageFunc = func(ctx context.Context, nextLink string) (result AccountsListBySubscriptionOperationResponse, err error) { + req, err := c.preparerForAccountsListBySubscriptionWithNextLink(ctx, nextLink) + if err != nil { + err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsListBySubscription", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsListBySubscription", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForAccountsListBySubscription(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsListBySubscription", result.HttpResponse, "Failure responding to request") + return + } + + return + } + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountsupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountsupdate_autorest.go new file mode 100644 index 000000000000..8ed5cd37c4ce --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountsupdate_autorest.go @@ -0,0 +1,79 @@ +package netappaccounts + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AccountsUpdateOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// AccountsUpdate ... +func (c NetAppAccountsClient) AccountsUpdate(ctx context.Context, id NetAppAccountId, input NetAppAccountPatch) (result AccountsUpdateOperationResponse, err error) { + req, err := c.preparerForAccountsUpdate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsUpdate", nil, "Failure preparing request") + return + } + + result, err = c.senderForAccountsUpdate(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsUpdate", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// AccountsUpdateThenPoll performs AccountsUpdate then polls until it's completed +func (c NetAppAccountsClient) AccountsUpdateThenPoll(ctx context.Context, id NetAppAccountId, input NetAppAccountPatch) error { + result, err := c.AccountsUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing AccountsUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after AccountsUpdate: %+v", err) + } + + return nil +} + +// preparerForAccountsUpdate prepares the AccountsUpdate request. +func (c NetAppAccountsClient) preparerForAccountsUpdate(ctx context.Context, id NetAppAccountId, input NetAppAccountPatch) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForAccountsUpdate sends the AccountsUpdate request. The method will close the +// http.Response Body if it receives an error. +func (c NetAppAccountsClient) senderForAccountsUpdate(ctx context.Context, req *http.Request) (future AccountsUpdateOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/model_accountencryption.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/model_accountencryption.go new file mode 100644 index 000000000000..39a9282ce500 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/model_accountencryption.go @@ -0,0 +1,8 @@ +package netappaccounts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AccountEncryption struct { + KeySource *string `json:"keySource,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/model_accountproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/model_accountproperties.go new file mode 100644 index 000000000000..b158b47fc946 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/model_accountproperties.go @@ -0,0 +1,10 @@ +package netappaccounts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AccountProperties struct { + ActiveDirectories *[]ActiveDirectory `json:"activeDirectories,omitempty"` + Encryption *AccountEncryption `json:"encryption,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/model_activedirectory.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/model_activedirectory.go new file mode 100644 index 000000000000..da90d13da0a4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/model_activedirectory.go @@ -0,0 +1,29 @@ +package netappaccounts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ActiveDirectory struct { + ActiveDirectoryId *string `json:"activeDirectoryId,omitempty"` + AdName *string `json:"adName,omitempty"` + Administrators *[]string `json:"administrators,omitempty"` + AesEncryption *bool `json:"aesEncryption,omitempty"` + AllowLocalNfsUsersWithLdap *bool `json:"allowLocalNfsUsersWithLdap,omitempty"` + BackupOperators *[]string `json:"backupOperators,omitempty"` + Dns *string `json:"dns,omitempty"` + Domain *string `json:"domain,omitempty"` + EncryptDCConnections *bool `json:"encryptDCConnections,omitempty"` + KdcIP *string `json:"kdcIP,omitempty"` + LdapOverTLS *bool `json:"ldapOverTLS,omitempty"` + LdapSearchScope *LdapSearchScopeOpt `json:"ldapSearchScope,omitempty"` + LdapSigning *bool `json:"ldapSigning,omitempty"` + OrganizationalUnit *string `json:"organizationalUnit,omitempty"` + Password *string `json:"password,omitempty"` + SecurityOperators *[]string `json:"securityOperators,omitempty"` + ServerRootCACertificate *string `json:"serverRootCACertificate,omitempty"` + Site *string `json:"site,omitempty"` + SmbServerName *string `json:"smbServerName,omitempty"` + Status *ActiveDirectoryStatus `json:"status,omitempty"` + StatusDetails *string `json:"statusDetails,omitempty"` + Username *string `json:"username,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/model_ldapsearchscopeopt.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/model_ldapsearchscopeopt.go new file mode 100644 index 000000000000..c476b0f0875f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/model_ldapsearchscopeopt.go @@ -0,0 +1,10 @@ +package netappaccounts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type LdapSearchScopeOpt struct { + GroupDN *string `json:"groupDN,omitempty"` + GroupMembershipFilter *string `json:"groupMembershipFilter,omitempty"` + UserDN *string `json:"userDN,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/model_netappaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/model_netappaccount.go new file mode 100644 index 000000000000..ec2ed4aa10c5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/model_netappaccount.go @@ -0,0 +1,19 @@ +package netappaccounts + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetAppAccount struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties *AccountProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/model_netappaccountpatch.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/model_netappaccountpatch.go new file mode 100644 index 000000000000..d3c6c1efcc20 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/model_netappaccountpatch.go @@ -0,0 +1,13 @@ +package netappaccounts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetAppAccountPatch struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *AccountProperties `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/predicates.go new file mode 100644 index 000000000000..cc139fd85c4a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/predicates.go @@ -0,0 +1,34 @@ +package netappaccounts + +type NetAppAccountOperationPredicate struct { + Etag *string + Id *string + Location *string + Name *string + Type *string +} + +func (p NetAppAccountOperationPredicate) Matches(input NetAppAccount) bool { + + if p.Etag != nil && (input.Etag == nil && *p.Etag != *input.Etag) { + return false + } + + if p.Id != nil && (input.Id == nil && *p.Id != *input.Id) { + return false + } + + if p.Location != nil && *p.Location != input.Location { + return false + } + + if p.Name != nil && (input.Name == nil && *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil && *p.Type != *input.Type) { + return false + } + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/version.go new file mode 100644 index 000000000000..01165f564b31 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/version.go @@ -0,0 +1,12 @@ +package netappaccounts + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-01-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/netappaccounts/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/README.md new file mode 100644 index 000000000000..6c1526c48129 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/README.md @@ -0,0 +1,102 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy` Documentation + +The `snapshotpolicy` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2022-01-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy" +``` + + +### Client Initialization + +```go +client := snapshotpolicy.NewSnapshotPolicyClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `SnapshotPolicyClient.SnapshotPoliciesCreate` + +```go +ctx := context.TODO() +id := snapshotpolicy.NewSnapshotPoliciesID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "snapshotPolicyValue") + +payload := snapshotpolicy.SnapshotPolicy{ + // ... +} + + +read, err := client.SnapshotPoliciesCreate(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `SnapshotPolicyClient.SnapshotPoliciesDelete` + +```go +ctx := context.TODO() +id := snapshotpolicy.NewSnapshotPoliciesID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "snapshotPolicyValue") + +if err := client.SnapshotPoliciesDeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `SnapshotPolicyClient.SnapshotPoliciesGet` + +```go +ctx := context.TODO() +id := snapshotpolicy.NewSnapshotPoliciesID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "snapshotPolicyValue") + +read, err := client.SnapshotPoliciesGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `SnapshotPolicyClient.SnapshotPoliciesList` + +```go +ctx := context.TODO() +id := snapshotpolicy.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") + +read, err := client.SnapshotPoliciesList(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `SnapshotPolicyClient.SnapshotPoliciesUpdate` + +```go +ctx := context.TODO() +id := snapshotpolicy.NewSnapshotPoliciesID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "snapshotPolicyValue") + +payload := snapshotpolicy.SnapshotPolicyPatch{ + // ... +} + + +if err := client.SnapshotPoliciesUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/client.go new file mode 100644 index 000000000000..63c20fd6ea4d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/client.go @@ -0,0 +1,18 @@ +package snapshotpolicy + +import "github.com/Azure/go-autorest/autorest" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SnapshotPolicyClient struct { + Client autorest.Client + baseUri string +} + +func NewSnapshotPolicyClientWithBaseURI(endpoint string) SnapshotPolicyClient { + return SnapshotPolicyClient{ + Client: autorest.NewClientWithUserAgent(userAgent()), + baseUri: endpoint, + } +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/id_netappaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/id_netappaccount.go new file mode 100644 index 000000000000..726c28f92e9c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/id_netappaccount.go @@ -0,0 +1,124 @@ +package snapshotpolicy + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = NetAppAccountId{} + +// NetAppAccountId is a struct representing the Resource ID for a Net App Account +type NetAppAccountId struct { + SubscriptionId string + ResourceGroupName string + AccountName string +} + +// NewNetAppAccountID returns a new NetAppAccountId struct +func NewNetAppAccountID(subscriptionId string, resourceGroupName string, accountName string) NetAppAccountId { + return NetAppAccountId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AccountName: accountName, + } +} + +// ParseNetAppAccountID parses 'input' into a NetAppAccountId +func ParseNetAppAccountID(input string) (*NetAppAccountId, error) { + parser := resourceids.NewParserFromResourceIdType(NetAppAccountId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := NetAppAccountId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseNetAppAccountIDInsensitively parses 'input' case-insensitively into a NetAppAccountId +// note: this method should only be used for API response data and not user input +func ParseNetAppAccountIDInsensitively(input string) (*NetAppAccountId, error) { + parser := resourceids.NewParserFromResourceIdType(NetAppAccountId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := NetAppAccountId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateNetAppAccountID checks that 'input' can be parsed as a Net App Account ID +func ValidateNetAppAccountID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseNetAppAccountID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Net App Account ID +func (id NetAppAccountId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Net App Account ID +func (id NetAppAccountId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("accountName", "accountValue"), + } +} + +// String returns a human-readable description of this Net App Account ID +func (id NetAppAccountId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Account Name: %q", id.AccountName), + } + return fmt.Sprintf("Net App Account (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/id_snapshotpolicies.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/id_snapshotpolicies.go new file mode 100644 index 000000000000..f0662d3bf339 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/id_snapshotpolicies.go @@ -0,0 +1,137 @@ +package snapshotpolicy + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = SnapshotPoliciesId{} + +// SnapshotPoliciesId is a struct representing the Resource ID for a Snapshot Policies +type SnapshotPoliciesId struct { + SubscriptionId string + ResourceGroupName string + AccountName string + SnapshotPolicyName string +} + +// NewSnapshotPoliciesID returns a new SnapshotPoliciesId struct +func NewSnapshotPoliciesID(subscriptionId string, resourceGroupName string, accountName string, snapshotPolicyName string) SnapshotPoliciesId { + return SnapshotPoliciesId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AccountName: accountName, + SnapshotPolicyName: snapshotPolicyName, + } +} + +// ParseSnapshotPoliciesID parses 'input' into a SnapshotPoliciesId +func ParseSnapshotPoliciesID(input string) (*SnapshotPoliciesId, error) { + parser := resourceids.NewParserFromResourceIdType(SnapshotPoliciesId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := SnapshotPoliciesId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + if id.SnapshotPolicyName, ok = parsed.Parsed["snapshotPolicyName"]; !ok { + return nil, fmt.Errorf("the segment 'snapshotPolicyName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseSnapshotPoliciesIDInsensitively parses 'input' case-insensitively into a SnapshotPoliciesId +// note: this method should only be used for API response data and not user input +func ParseSnapshotPoliciesIDInsensitively(input string) (*SnapshotPoliciesId, error) { + parser := resourceids.NewParserFromResourceIdType(SnapshotPoliciesId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := SnapshotPoliciesId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + if id.SnapshotPolicyName, ok = parsed.Parsed["snapshotPolicyName"]; !ok { + return nil, fmt.Errorf("the segment 'snapshotPolicyName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateSnapshotPoliciesID checks that 'input' can be parsed as a Snapshot Policies ID +func ValidateSnapshotPoliciesID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseSnapshotPoliciesID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Snapshot Policies ID +func (id SnapshotPoliciesId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/snapshotPolicies/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName, id.SnapshotPolicyName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Snapshot Policies ID +func (id SnapshotPoliciesId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("accountName", "accountValue"), + resourceids.StaticSegment("staticSnapshotPolicies", "snapshotPolicies", "snapshotPolicies"), + resourceids.UserSpecifiedSegment("snapshotPolicyName", "snapshotPolicyValue"), + } +} + +// String returns a human-readable description of this Snapshot Policies ID +func (id SnapshotPoliciesId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Account Name: %q", id.AccountName), + fmt.Sprintf("Snapshot Policy Name: %q", id.SnapshotPolicyName), + } + return fmt.Sprintf("Snapshot Policies (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/method_snapshotpoliciescreate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/method_snapshotpoliciescreate_autorest.go new file mode 100644 index 000000000000..43d25be8b167 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/method_snapshotpoliciescreate_autorest.go @@ -0,0 +1,68 @@ +package snapshotpolicy + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SnapshotPoliciesCreateOperationResponse struct { + HttpResponse *http.Response + Model *SnapshotPolicy +} + +// SnapshotPoliciesCreate ... +func (c SnapshotPolicyClient) SnapshotPoliciesCreate(ctx context.Context, id SnapshotPoliciesId, input SnapshotPolicy) (result SnapshotPoliciesCreateOperationResponse, err error) { + req, err := c.preparerForSnapshotPoliciesCreate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesCreate", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesCreate", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForSnapshotPoliciesCreate(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesCreate", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForSnapshotPoliciesCreate prepares the SnapshotPoliciesCreate request. +func (c SnapshotPolicyClient) preparerForSnapshotPoliciesCreate(ctx context.Context, id SnapshotPoliciesId, input SnapshotPolicy) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForSnapshotPoliciesCreate handles the response to the SnapshotPoliciesCreate request. The method always +// closes the http.Response Body. +func (c SnapshotPolicyClient) responderForSnapshotPoliciesCreate(resp *http.Response) (result SnapshotPoliciesCreateOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/method_snapshotpoliciesdelete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/method_snapshotpoliciesdelete_autorest.go new file mode 100644 index 000000000000..0b2ba8905215 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/method_snapshotpoliciesdelete_autorest.go @@ -0,0 +1,78 @@ +package snapshotpolicy + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SnapshotPoliciesDeleteOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// SnapshotPoliciesDelete ... +func (c SnapshotPolicyClient) SnapshotPoliciesDelete(ctx context.Context, id SnapshotPoliciesId) (result SnapshotPoliciesDeleteOperationResponse, err error) { + req, err := c.preparerForSnapshotPoliciesDelete(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesDelete", nil, "Failure preparing request") + return + } + + result, err = c.senderForSnapshotPoliciesDelete(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesDelete", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// SnapshotPoliciesDeleteThenPoll performs SnapshotPoliciesDelete then polls until it's completed +func (c SnapshotPolicyClient) SnapshotPoliciesDeleteThenPoll(ctx context.Context, id SnapshotPoliciesId) error { + result, err := c.SnapshotPoliciesDelete(ctx, id) + if err != nil { + return fmt.Errorf("performing SnapshotPoliciesDelete: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after SnapshotPoliciesDelete: %+v", err) + } + + return nil +} + +// preparerForSnapshotPoliciesDelete prepares the SnapshotPoliciesDelete request. +func (c SnapshotPolicyClient) preparerForSnapshotPoliciesDelete(ctx context.Context, id SnapshotPoliciesId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForSnapshotPoliciesDelete sends the SnapshotPoliciesDelete request. The method will close the +// http.Response Body if it receives an error. +func (c SnapshotPolicyClient) senderForSnapshotPoliciesDelete(ctx context.Context, req *http.Request) (future SnapshotPoliciesDeleteOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/method_snapshotpoliciesget_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/method_snapshotpoliciesget_autorest.go new file mode 100644 index 000000000000..26d3741d8b6c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/method_snapshotpoliciesget_autorest.go @@ -0,0 +1,67 @@ +package snapshotpolicy + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SnapshotPoliciesGetOperationResponse struct { + HttpResponse *http.Response + Model *SnapshotPolicy +} + +// SnapshotPoliciesGet ... +func (c SnapshotPolicyClient) SnapshotPoliciesGet(ctx context.Context, id SnapshotPoliciesId) (result SnapshotPoliciesGetOperationResponse, err error) { + req, err := c.preparerForSnapshotPoliciesGet(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesGet", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesGet", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForSnapshotPoliciesGet(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesGet", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForSnapshotPoliciesGet prepares the SnapshotPoliciesGet request. +func (c SnapshotPolicyClient) preparerForSnapshotPoliciesGet(ctx context.Context, id SnapshotPoliciesId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForSnapshotPoliciesGet handles the response to the SnapshotPoliciesGet request. The method always +// closes the http.Response Body. +func (c SnapshotPolicyClient) responderForSnapshotPoliciesGet(resp *http.Response) (result SnapshotPoliciesGetOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/method_snapshotpolicieslist_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/method_snapshotpolicieslist_autorest.go new file mode 100644 index 000000000000..b9f36c35c96f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/method_snapshotpolicieslist_autorest.go @@ -0,0 +1,68 @@ +package snapshotpolicy + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SnapshotPoliciesListOperationResponse struct { + HttpResponse *http.Response + Model *SnapshotPoliciesList +} + +// SnapshotPoliciesList ... +func (c SnapshotPolicyClient) SnapshotPoliciesList(ctx context.Context, id NetAppAccountId) (result SnapshotPoliciesListOperationResponse, err error) { + req, err := c.preparerForSnapshotPoliciesList(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesList", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesList", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForSnapshotPoliciesList(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesList", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForSnapshotPoliciesList prepares the SnapshotPoliciesList request. +func (c SnapshotPolicyClient) preparerForSnapshotPoliciesList(ctx context.Context, id NetAppAccountId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/snapshotPolicies", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForSnapshotPoliciesList handles the response to the SnapshotPoliciesList request. The method always +// closes the http.Response Body. +func (c SnapshotPolicyClient) responderForSnapshotPoliciesList(resp *http.Response) (result SnapshotPoliciesListOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/method_snapshotpoliciesupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/method_snapshotpoliciesupdate_autorest.go new file mode 100644 index 000000000000..eea75a1378c0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/method_snapshotpoliciesupdate_autorest.go @@ -0,0 +1,79 @@ +package snapshotpolicy + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SnapshotPoliciesUpdateOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// SnapshotPoliciesUpdate ... +func (c SnapshotPolicyClient) SnapshotPoliciesUpdate(ctx context.Context, id SnapshotPoliciesId, input SnapshotPolicyPatch) (result SnapshotPoliciesUpdateOperationResponse, err error) { + req, err := c.preparerForSnapshotPoliciesUpdate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesUpdate", nil, "Failure preparing request") + return + } + + result, err = c.senderForSnapshotPoliciesUpdate(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesUpdate", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// SnapshotPoliciesUpdateThenPoll performs SnapshotPoliciesUpdate then polls until it's completed +func (c SnapshotPolicyClient) SnapshotPoliciesUpdateThenPoll(ctx context.Context, id SnapshotPoliciesId, input SnapshotPolicyPatch) error { + result, err := c.SnapshotPoliciesUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing SnapshotPoliciesUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after SnapshotPoliciesUpdate: %+v", err) + } + + return nil +} + +// preparerForSnapshotPoliciesUpdate prepares the SnapshotPoliciesUpdate request. +func (c SnapshotPolicyClient) preparerForSnapshotPoliciesUpdate(ctx context.Context, id SnapshotPoliciesId, input SnapshotPolicyPatch) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForSnapshotPoliciesUpdate sends the SnapshotPoliciesUpdate request. The method will close the +// http.Response Body if it receives an error. +func (c SnapshotPolicyClient) senderForSnapshotPoliciesUpdate(ctx context.Context, req *http.Request) (future SnapshotPoliciesUpdateOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_dailyschedule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_dailyschedule.go new file mode 100644 index 000000000000..bdafb72e6e09 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_dailyschedule.go @@ -0,0 +1,11 @@ +package snapshotpolicy + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DailySchedule struct { + Hour *int64 `json:"hour,omitempty"` + Minute *int64 `json:"minute,omitempty"` + SnapshotsToKeep *int64 `json:"snapshotsToKeep,omitempty"` + UsedBytes *int64 `json:"usedBytes,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_hourlyschedule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_hourlyschedule.go new file mode 100644 index 000000000000..a1e5d0fa0283 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_hourlyschedule.go @@ -0,0 +1,10 @@ +package snapshotpolicy + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HourlySchedule struct { + Minute *int64 `json:"minute,omitempty"` + SnapshotsToKeep *int64 `json:"snapshotsToKeep,omitempty"` + UsedBytes *int64 `json:"usedBytes,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_monthlyschedule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_monthlyschedule.go new file mode 100644 index 000000000000..02cbcad6a592 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_monthlyschedule.go @@ -0,0 +1,12 @@ +package snapshotpolicy + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MonthlySchedule struct { + DaysOfMonth *string `json:"daysOfMonth,omitempty"` + Hour *int64 `json:"hour,omitempty"` + Minute *int64 `json:"minute,omitempty"` + SnapshotsToKeep *int64 `json:"snapshotsToKeep,omitempty"` + UsedBytes *int64 `json:"usedBytes,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_snapshotpolicieslist.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_snapshotpolicieslist.go new file mode 100644 index 000000000000..910e2519adbe --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_snapshotpolicieslist.go @@ -0,0 +1,8 @@ +package snapshotpolicy + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SnapshotPoliciesList struct { + Value *[]SnapshotPolicy `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_snapshotpolicy.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_snapshotpolicy.go new file mode 100644 index 000000000000..310cfaaf1bb9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_snapshotpolicy.go @@ -0,0 +1,19 @@ +package snapshotpolicy + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SnapshotPolicy struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties SnapshotPolicyProperties `json:"properties"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_snapshotpolicypatch.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_snapshotpolicypatch.go new file mode 100644 index 000000000000..76df9be172b9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_snapshotpolicypatch.go @@ -0,0 +1,13 @@ +package snapshotpolicy + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SnapshotPolicyPatch struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *SnapshotPolicyProperties `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_snapshotpolicyproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_snapshotpolicyproperties.go new file mode 100644 index 000000000000..fb4fb0fcb05a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_snapshotpolicyproperties.go @@ -0,0 +1,13 @@ +package snapshotpolicy + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SnapshotPolicyProperties struct { + DailySchedule *DailySchedule `json:"dailySchedule,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + HourlySchedule *HourlySchedule `json:"hourlySchedule,omitempty"` + MonthlySchedule *MonthlySchedule `json:"monthlySchedule,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + WeeklySchedule *WeeklySchedule `json:"weeklySchedule,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_weeklyschedule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_weeklyschedule.go new file mode 100644 index 000000000000..128ece7ef5ef --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_weeklyschedule.go @@ -0,0 +1,12 @@ +package snapshotpolicy + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WeeklySchedule struct { + Day *string `json:"day,omitempty"` + Hour *int64 `json:"hour,omitempty"` + Minute *int64 `json:"minute,omitempty"` + SnapshotsToKeep *int64 `json:"snapshotsToKeep,omitempty"` + UsedBytes *int64 `json:"usedBytes,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/version.go new file mode 100644 index 000000000000..86df4353d7db --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/version.go @@ -0,0 +1,12 @@ +package snapshotpolicy + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-01-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/snapshotpolicy/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/README.md new file mode 100644 index 000000000000..9eb7671f8828 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/README.md @@ -0,0 +1,111 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots` Documentation + +The `snapshots` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2022-01-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots" +``` + + +### Client Initialization + +```go +client := snapshots.NewSnapshotsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `SnapshotsClient.Create` + +```go +ctx := context.TODO() +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue", "snapshotValue") + +payload := snapshots.Snapshot{ + // ... +} + + +if err := client.CreateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `SnapshotsClient.Delete` + +```go +ctx := context.TODO() +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue", "snapshotValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `SnapshotsClient.Get` + +```go +ctx := context.TODO() +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue", "snapshotValue") + +read, err := client.Get(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `SnapshotsClient.List` + +```go +ctx := context.TODO() +id := snapshots.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue") + +read, err := client.List(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `SnapshotsClient.RestoreFiles` + +```go +ctx := context.TODO() +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue", "snapshotValue") + +payload := snapshots.SnapshotRestoreFiles{ + // ... +} + + +if err := client.RestoreFilesThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `SnapshotsClient.Update` + +```go +ctx := context.TODO() +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue", "snapshotValue") +var payload interface{} + +if err := client.UpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/client.go new file mode 100644 index 000000000000..62d2a1323835 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/client.go @@ -0,0 +1,18 @@ +package snapshots + +import "github.com/Azure/go-autorest/autorest" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SnapshotsClient struct { + Client autorest.Client + baseUri string +} + +func NewSnapshotsClientWithBaseURI(endpoint string) SnapshotsClient { + return SnapshotsClient{ + Client: autorest.NewClientWithUserAgent(userAgent()), + baseUri: endpoint, + } +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/id_snapshot.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/id_snapshot.go new file mode 100644 index 000000000000..d38fb8cb8f01 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/id_snapshot.go @@ -0,0 +1,163 @@ +package snapshots + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = SnapshotId{} + +// SnapshotId is a struct representing the Resource ID for a Snapshot +type SnapshotId struct { + SubscriptionId string + ResourceGroupName string + AccountName string + PoolName string + VolumeName string + SnapshotName string +} + +// NewSnapshotID returns a new SnapshotId struct +func NewSnapshotID(subscriptionId string, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) SnapshotId { + return SnapshotId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AccountName: accountName, + PoolName: poolName, + VolumeName: volumeName, + SnapshotName: snapshotName, + } +} + +// ParseSnapshotID parses 'input' into a SnapshotId +func ParseSnapshotID(input string) (*SnapshotId, error) { + parser := resourceids.NewParserFromResourceIdType(SnapshotId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := SnapshotId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { + return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) + } + + if id.VolumeName, ok = parsed.Parsed["volumeName"]; !ok { + return nil, fmt.Errorf("the segment 'volumeName' was not found in the resource id %q", input) + } + + if id.SnapshotName, ok = parsed.Parsed["snapshotName"]; !ok { + return nil, fmt.Errorf("the segment 'snapshotName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseSnapshotIDInsensitively parses 'input' case-insensitively into a SnapshotId +// note: this method should only be used for API response data and not user input +func ParseSnapshotIDInsensitively(input string) (*SnapshotId, error) { + parser := resourceids.NewParserFromResourceIdType(SnapshotId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := SnapshotId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { + return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) + } + + if id.VolumeName, ok = parsed.Parsed["volumeName"]; !ok { + return nil, fmt.Errorf("the segment 'volumeName' was not found in the resource id %q", input) + } + + if id.SnapshotName, ok = parsed.Parsed["snapshotName"]; !ok { + return nil, fmt.Errorf("the segment 'snapshotName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateSnapshotID checks that 'input' can be parsed as a Snapshot ID +func ValidateSnapshotID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseSnapshotID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Snapshot ID +func (id SnapshotId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/capacityPools/%s/volumes/%s/snapshots/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName, id.PoolName, id.VolumeName, id.SnapshotName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Snapshot ID +func (id SnapshotId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("accountName", "accountValue"), + resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), + resourceids.UserSpecifiedSegment("poolName", "poolValue"), + resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), + resourceids.UserSpecifiedSegment("volumeName", "volumeValue"), + resourceids.StaticSegment("staticSnapshots", "snapshots", "snapshots"), + resourceids.UserSpecifiedSegment("snapshotName", "snapshotValue"), + } +} + +// String returns a human-readable description of this Snapshot ID +func (id SnapshotId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Account Name: %q", id.AccountName), + fmt.Sprintf("Pool Name: %q", id.PoolName), + fmt.Sprintf("Volume Name: %q", id.VolumeName), + fmt.Sprintf("Snapshot Name: %q", id.SnapshotName), + } + return fmt.Sprintf("Snapshot (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/id_volume.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/id_volume.go new file mode 100644 index 000000000000..c5cc73e141c7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/id_volume.go @@ -0,0 +1,150 @@ +package snapshots + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = VolumeId{} + +// VolumeId is a struct representing the Resource ID for a Volume +type VolumeId struct { + SubscriptionId string + ResourceGroupName string + AccountName string + PoolName string + VolumeName string +} + +// NewVolumeID returns a new VolumeId struct +func NewVolumeID(subscriptionId string, resourceGroupName string, accountName string, poolName string, volumeName string) VolumeId { + return VolumeId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AccountName: accountName, + PoolName: poolName, + VolumeName: volumeName, + } +} + +// ParseVolumeID parses 'input' into a VolumeId +func ParseVolumeID(input string) (*VolumeId, error) { + parser := resourceids.NewParserFromResourceIdType(VolumeId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VolumeId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { + return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) + } + + if id.VolumeName, ok = parsed.Parsed["volumeName"]; !ok { + return nil, fmt.Errorf("the segment 'volumeName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseVolumeIDInsensitively parses 'input' case-insensitively into a VolumeId +// note: this method should only be used for API response data and not user input +func ParseVolumeIDInsensitively(input string) (*VolumeId, error) { + parser := resourceids.NewParserFromResourceIdType(VolumeId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VolumeId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { + return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) + } + + if id.VolumeName, ok = parsed.Parsed["volumeName"]; !ok { + return nil, fmt.Errorf("the segment 'volumeName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateVolumeID checks that 'input' can be parsed as a Volume ID +func ValidateVolumeID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseVolumeID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Volume ID +func (id VolumeId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/capacityPools/%s/volumes/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName, id.PoolName, id.VolumeName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Volume ID +func (id VolumeId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("accountName", "accountValue"), + resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), + resourceids.UserSpecifiedSegment("poolName", "poolValue"), + resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), + resourceids.UserSpecifiedSegment("volumeName", "volumeValue"), + } +} + +// String returns a human-readable description of this Volume ID +func (id VolumeId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Account Name: %q", id.AccountName), + fmt.Sprintf("Pool Name: %q", id.PoolName), + fmt.Sprintf("Volume Name: %q", id.VolumeName), + } + return fmt.Sprintf("Volume (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_create_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_create_autorest.go new file mode 100644 index 000000000000..90b33471adef --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_create_autorest.go @@ -0,0 +1,79 @@ +package snapshots + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// Create ... +func (c SnapshotsClient) Create(ctx context.Context, id SnapshotId, input Snapshot) (result CreateOperationResponse, err error) { + req, err := c.preparerForCreate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = c.senderForCreate(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "Create", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// CreateThenPoll performs Create then polls until it's completed +func (c SnapshotsClient) CreateThenPoll(ctx context.Context, id SnapshotId, input Snapshot) error { + result, err := c.Create(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Create: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after Create: %+v", err) + } + + return nil +} + +// preparerForCreate prepares the Create request. +func (c SnapshotsClient) preparerForCreate(ctx context.Context, id SnapshotId, input Snapshot) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForCreate sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (c SnapshotsClient) senderForCreate(ctx context.Context, req *http.Request) (future CreateOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_delete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_delete_autorest.go new file mode 100644 index 000000000000..55f7d9d07967 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_delete_autorest.go @@ -0,0 +1,78 @@ +package snapshots + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// Delete ... +func (c SnapshotsClient) Delete(ctx context.Context, id SnapshotId) (result DeleteOperationResponse, err error) { + req, err := c.preparerForDelete(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = c.senderForDelete(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "Delete", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// DeleteThenPoll performs Delete then polls until it's completed +func (c SnapshotsClient) DeleteThenPoll(ctx context.Context, id SnapshotId) error { + result, err := c.Delete(ctx, id) + if err != nil { + return fmt.Errorf("performing Delete: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after Delete: %+v", err) + } + + return nil +} + +// preparerForDelete prepares the Delete request. +func (c SnapshotsClient) preparerForDelete(ctx context.Context, id SnapshotId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForDelete sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (c SnapshotsClient) senderForDelete(ctx context.Context, req *http.Request) (future DeleteOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_get_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_get_autorest.go new file mode 100644 index 000000000000..4764bf6f0606 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_get_autorest.go @@ -0,0 +1,67 @@ +package snapshots + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetOperationResponse struct { + HttpResponse *http.Response + Model *Snapshot +} + +// Get ... +func (c SnapshotsClient) Get(ctx context.Context, id SnapshotId) (result GetOperationResponse, err error) { + req, err := c.preparerForGet(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "Get", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "Get", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForGet(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "Get", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForGet prepares the Get request. +func (c SnapshotsClient) preparerForGet(ctx context.Context, id SnapshotId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForGet handles the response to the Get request. The method always +// closes the http.Response Body. +func (c SnapshotsClient) responderForGet(resp *http.Response) (result GetOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_list_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_list_autorest.go new file mode 100644 index 000000000000..5d2f714bdc1f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_list_autorest.go @@ -0,0 +1,68 @@ +package snapshots + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListOperationResponse struct { + HttpResponse *http.Response + Model *SnapshotsList +} + +// List ... +func (c SnapshotsClient) List(ctx context.Context, id VolumeId) (result ListOperationResponse, err error) { + req, err := c.preparerForList(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "List", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "List", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForList(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "List", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForList prepares the List request. +func (c SnapshotsClient) preparerForList(ctx context.Context, id VolumeId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/snapshots", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForList handles the response to the List request. The method always +// closes the http.Response Body. +func (c SnapshotsClient) responderForList(resp *http.Response) (result ListOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_restorefiles_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_restorefiles_autorest.go new file mode 100644 index 000000000000..18ef248aa733 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_restorefiles_autorest.go @@ -0,0 +1,79 @@ +package snapshots + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RestoreFilesOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// RestoreFiles ... +func (c SnapshotsClient) RestoreFiles(ctx context.Context, id SnapshotId, input SnapshotRestoreFiles) (result RestoreFilesOperationResponse, err error) { + req, err := c.preparerForRestoreFiles(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "RestoreFiles", nil, "Failure preparing request") + return + } + + result, err = c.senderForRestoreFiles(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "RestoreFiles", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// RestoreFilesThenPoll performs RestoreFiles then polls until it's completed +func (c SnapshotsClient) RestoreFilesThenPoll(ctx context.Context, id SnapshotId, input SnapshotRestoreFiles) error { + result, err := c.RestoreFiles(ctx, id, input) + if err != nil { + return fmt.Errorf("performing RestoreFiles: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after RestoreFiles: %+v", err) + } + + return nil +} + +// preparerForRestoreFiles prepares the RestoreFiles request. +func (c SnapshotsClient) preparerForRestoreFiles(ctx context.Context, id SnapshotId, input SnapshotRestoreFiles) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/restoreFiles", id.ID())), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForRestoreFiles sends the RestoreFiles request. The method will close the +// http.Response Body if it receives an error. +func (c SnapshotsClient) senderForRestoreFiles(ctx context.Context, req *http.Request) (future RestoreFilesOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_update_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_update_autorest.go new file mode 100644 index 000000000000..f96261c20b0b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_update_autorest.go @@ -0,0 +1,79 @@ +package snapshots + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpdateOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// Update ... +func (c SnapshotsClient) Update(ctx context.Context, id SnapshotId, input interface{}) (result UpdateOperationResponse, err error) { + req, err := c.preparerForUpdate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = c.senderForUpdate(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "Update", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// UpdateThenPoll performs Update then polls until it's completed +func (c SnapshotsClient) UpdateThenPoll(ctx context.Context, id SnapshotId, input interface{}) error { + result, err := c.Update(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Update: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after Update: %+v", err) + } + + return nil +} + +// preparerForUpdate prepares the Update request. +func (c SnapshotsClient) preparerForUpdate(ctx context.Context, id SnapshotId, input interface{}) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForUpdate sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (c SnapshotsClient) senderForUpdate(ctx context.Context, req *http.Request) (future UpdateOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/model_snapshot.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/model_snapshot.go new file mode 100644 index 000000000000..996c7160dd19 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/model_snapshot.go @@ -0,0 +1,12 @@ +package snapshots + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Snapshot struct { + Id *string `json:"id,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties *SnapshotProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/model_snapshotproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/model_snapshotproperties.go new file mode 100644 index 000000000000..fe60537eaaa9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/model_snapshotproperties.go @@ -0,0 +1,28 @@ +package snapshots + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SnapshotProperties struct { + Created *string `json:"created,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + SnapshotId *string `json:"snapshotId,omitempty"` +} + +func (o *SnapshotProperties) GetCreatedAsTime() (*time.Time, error) { + if o.Created == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Created, "2006-01-02T15:04:05Z07:00") +} + +func (o *SnapshotProperties) SetCreatedAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Created = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/model_snapshotrestorefiles.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/model_snapshotrestorefiles.go new file mode 100644 index 000000000000..de80d971dcf6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/model_snapshotrestorefiles.go @@ -0,0 +1,9 @@ +package snapshots + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SnapshotRestoreFiles struct { + DestinationPath *string `json:"destinationPath,omitempty"` + FilePaths []string `json:"filePaths"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/model_snapshotslist.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/model_snapshotslist.go new file mode 100644 index 000000000000..bf283b0d2ac6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/model_snapshotslist.go @@ -0,0 +1,8 @@ +package snapshots + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SnapshotsList struct { + Value *[]Snapshot `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/version.go new file mode 100644 index 000000000000..7835a752c20c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/version.go @@ -0,0 +1,12 @@ +package snapshots + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-01-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/snapshots/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/README.md new file mode 100644 index 000000000000..f733a433557a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/README.md @@ -0,0 +1,81 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups` Documentation + +The `volumegroups` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2022-01-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups" +``` + + +### Client Initialization + +```go +client := volumegroups.NewVolumeGroupsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VolumeGroupsClient.VolumeGroupsCreate` + +```go +ctx := context.TODO() +id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "volumeGroupValue") + +payload := volumegroups.VolumeGroupDetails{ + // ... +} + + +if err := client.VolumeGroupsCreateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VolumeGroupsClient.VolumeGroupsDelete` + +```go +ctx := context.TODO() +id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "volumeGroupValue") + +if err := client.VolumeGroupsDeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VolumeGroupsClient.VolumeGroupsGet` + +```go +ctx := context.TODO() +id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "volumeGroupValue") + +read, err := client.VolumeGroupsGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VolumeGroupsClient.VolumeGroupsListByNetAppAccount` + +```go +ctx := context.TODO() +id := volumegroups.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") + +read, err := client.VolumeGroupsListByNetAppAccount(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/client.go new file mode 100644 index 000000000000..c7beab84b9a1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/client.go @@ -0,0 +1,18 @@ +package volumegroups + +import "github.com/Azure/go-autorest/autorest" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupsClient struct { + Client autorest.Client + baseUri string +} + +func NewVolumeGroupsClientWithBaseURI(endpoint string) VolumeGroupsClient { + return VolumeGroupsClient{ + Client: autorest.NewClientWithUserAgent(userAgent()), + baseUri: endpoint, + } +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/constants.go new file mode 100644 index 000000000000..6eb9b8afe4fb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/constants.go @@ -0,0 +1,320 @@ +package volumegroups + +import "strings" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ApplicationType string + +const ( + ApplicationTypeSAPNegativeHANA ApplicationType = "SAP-HANA" +) + +func PossibleValuesForApplicationType() []string { + return []string{ + string(ApplicationTypeSAPNegativeHANA), + } +} + +func parseApplicationType(input string) (*ApplicationType, error) { + vals := map[string]ApplicationType{ + "sap-hana": ApplicationTypeSAPNegativeHANA, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ApplicationType(input) + return &out, nil +} + +type AvsDataStore string + +const ( + AvsDataStoreDisabled AvsDataStore = "Disabled" + AvsDataStoreEnabled AvsDataStore = "Enabled" +) + +func PossibleValuesForAvsDataStore() []string { + return []string{ + string(AvsDataStoreDisabled), + string(AvsDataStoreEnabled), + } +} + +func parseAvsDataStore(input string) (*AvsDataStore, error) { + vals := map[string]AvsDataStore{ + "disabled": AvsDataStoreDisabled, + "enabled": AvsDataStoreEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AvsDataStore(input) + return &out, nil +} + +type ChownMode string + +const ( + ChownModeRestricted ChownMode = "Restricted" + ChownModeUnrestricted ChownMode = "Unrestricted" +) + +func PossibleValuesForChownMode() []string { + return []string{ + string(ChownModeRestricted), + string(ChownModeUnrestricted), + } +} + +func parseChownMode(input string) (*ChownMode, error) { + vals := map[string]ChownMode{ + "restricted": ChownModeRestricted, + "unrestricted": ChownModeUnrestricted, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ChownMode(input) + return &out, nil +} + +type EnableSubvolumes string + +const ( + EnableSubvolumesDisabled EnableSubvolumes = "Disabled" + EnableSubvolumesEnabled EnableSubvolumes = "Enabled" +) + +func PossibleValuesForEnableSubvolumes() []string { + return []string{ + string(EnableSubvolumesDisabled), + string(EnableSubvolumesEnabled), + } +} + +func parseEnableSubvolumes(input string) (*EnableSubvolumes, error) { + vals := map[string]EnableSubvolumes{ + "disabled": EnableSubvolumesDisabled, + "enabled": EnableSubvolumesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := EnableSubvolumes(input) + return &out, nil +} + +type EncryptionKeySource string + +const ( + EncryptionKeySourceMicrosoftPointNetApp EncryptionKeySource = "Microsoft.NetApp" +) + +func PossibleValuesForEncryptionKeySource() []string { + return []string{ + string(EncryptionKeySourceMicrosoftPointNetApp), + } +} + +func parseEncryptionKeySource(input string) (*EncryptionKeySource, error) { + vals := map[string]EncryptionKeySource{ + "microsoft.netapp": EncryptionKeySourceMicrosoftPointNetApp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := EncryptionKeySource(input) + return &out, nil +} + +type EndpointType string + +const ( + EndpointTypeDst EndpointType = "dst" + EndpointTypeSrc EndpointType = "src" +) + +func PossibleValuesForEndpointType() []string { + return []string{ + string(EndpointTypeDst), + string(EndpointTypeSrc), + } +} + +func parseEndpointType(input string) (*EndpointType, error) { + vals := map[string]EndpointType{ + "dst": EndpointTypeDst, + "src": EndpointTypeSrc, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := EndpointType(input) + return &out, nil +} + +type NetworkFeatures string + +const ( + NetworkFeaturesBasic NetworkFeatures = "Basic" + NetworkFeaturesStandard NetworkFeatures = "Standard" +) + +func PossibleValuesForNetworkFeatures() []string { + return []string{ + string(NetworkFeaturesBasic), + string(NetworkFeaturesStandard), + } +} + +func parseNetworkFeatures(input string) (*NetworkFeatures, error) { + vals := map[string]NetworkFeatures{ + "basic": NetworkFeaturesBasic, + "standard": NetworkFeaturesStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkFeatures(input) + return &out, nil +} + +type ReplicationSchedule string + +const ( + ReplicationScheduleDaily ReplicationSchedule = "daily" + ReplicationScheduleHourly ReplicationSchedule = "hourly" + ReplicationScheduleOneZerominutely ReplicationSchedule = "_10minutely" +) + +func PossibleValuesForReplicationSchedule() []string { + return []string{ + string(ReplicationScheduleDaily), + string(ReplicationScheduleHourly), + string(ReplicationScheduleOneZerominutely), + } +} + +func parseReplicationSchedule(input string) (*ReplicationSchedule, error) { + vals := map[string]ReplicationSchedule{ + "daily": ReplicationScheduleDaily, + "hourly": ReplicationScheduleHourly, + "_10minutely": ReplicationScheduleOneZerominutely, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ReplicationSchedule(input) + return &out, nil +} + +type SecurityStyle string + +const ( + SecurityStyleNtfs SecurityStyle = "ntfs" + SecurityStyleUnix SecurityStyle = "unix" +) + +func PossibleValuesForSecurityStyle() []string { + return []string{ + string(SecurityStyleNtfs), + string(SecurityStyleUnix), + } +} + +func parseSecurityStyle(input string) (*SecurityStyle, error) { + vals := map[string]SecurityStyle{ + "ntfs": SecurityStyleNtfs, + "unix": SecurityStyleUnix, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityStyle(input) + return &out, nil +} + +type ServiceLevel string + +const ( + ServiceLevelPremium ServiceLevel = "Premium" + ServiceLevelStandard ServiceLevel = "Standard" + ServiceLevelStandardZRS ServiceLevel = "StandardZRS" + ServiceLevelUltra ServiceLevel = "Ultra" +) + +func PossibleValuesForServiceLevel() []string { + return []string{ + string(ServiceLevelPremium), + string(ServiceLevelStandard), + string(ServiceLevelStandardZRS), + string(ServiceLevelUltra), + } +} + +func parseServiceLevel(input string) (*ServiceLevel, error) { + vals := map[string]ServiceLevel{ + "premium": ServiceLevelPremium, + "standard": ServiceLevelStandard, + "standardzrs": ServiceLevelStandardZRS, + "ultra": ServiceLevelUltra, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ServiceLevel(input) + return &out, nil +} + +type VolumeStorageToNetworkProximity string + +const ( + VolumeStorageToNetworkProximityDefault VolumeStorageToNetworkProximity = "Default" + VolumeStorageToNetworkProximityTOne VolumeStorageToNetworkProximity = "T1" + VolumeStorageToNetworkProximityTTwo VolumeStorageToNetworkProximity = "T2" +) + +func PossibleValuesForVolumeStorageToNetworkProximity() []string { + return []string{ + string(VolumeStorageToNetworkProximityDefault), + string(VolumeStorageToNetworkProximityTOne), + string(VolumeStorageToNetworkProximityTTwo), + } +} + +func parseVolumeStorageToNetworkProximity(input string) (*VolumeStorageToNetworkProximity, error) { + vals := map[string]VolumeStorageToNetworkProximity{ + "default": VolumeStorageToNetworkProximityDefault, + "t1": VolumeStorageToNetworkProximityTOne, + "t2": VolumeStorageToNetworkProximityTTwo, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VolumeStorageToNetworkProximity(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/id_netappaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/id_netappaccount.go new file mode 100644 index 000000000000..7b31002a4246 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/id_netappaccount.go @@ -0,0 +1,124 @@ +package volumegroups + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = NetAppAccountId{} + +// NetAppAccountId is a struct representing the Resource ID for a Net App Account +type NetAppAccountId struct { + SubscriptionId string + ResourceGroupName string + AccountName string +} + +// NewNetAppAccountID returns a new NetAppAccountId struct +func NewNetAppAccountID(subscriptionId string, resourceGroupName string, accountName string) NetAppAccountId { + return NetAppAccountId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AccountName: accountName, + } +} + +// ParseNetAppAccountID parses 'input' into a NetAppAccountId +func ParseNetAppAccountID(input string) (*NetAppAccountId, error) { + parser := resourceids.NewParserFromResourceIdType(NetAppAccountId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := NetAppAccountId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseNetAppAccountIDInsensitively parses 'input' case-insensitively into a NetAppAccountId +// note: this method should only be used for API response data and not user input +func ParseNetAppAccountIDInsensitively(input string) (*NetAppAccountId, error) { + parser := resourceids.NewParserFromResourceIdType(NetAppAccountId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := NetAppAccountId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateNetAppAccountID checks that 'input' can be parsed as a Net App Account ID +func ValidateNetAppAccountID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseNetAppAccountID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Net App Account ID +func (id NetAppAccountId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Net App Account ID +func (id NetAppAccountId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("accountName", "accountValue"), + } +} + +// String returns a human-readable description of this Net App Account ID +func (id NetAppAccountId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Account Name: %q", id.AccountName), + } + return fmt.Sprintf("Net App Account (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/id_volumegroup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/id_volumegroup.go new file mode 100644 index 000000000000..a49d03263509 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/id_volumegroup.go @@ -0,0 +1,137 @@ +package volumegroups + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = VolumeGroupId{} + +// VolumeGroupId is a struct representing the Resource ID for a Volume Group +type VolumeGroupId struct { + SubscriptionId string + ResourceGroupName string + AccountName string + VolumeGroupName string +} + +// NewVolumeGroupID returns a new VolumeGroupId struct +func NewVolumeGroupID(subscriptionId string, resourceGroupName string, accountName string, volumeGroupName string) VolumeGroupId { + return VolumeGroupId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AccountName: accountName, + VolumeGroupName: volumeGroupName, + } +} + +// ParseVolumeGroupID parses 'input' into a VolumeGroupId +func ParseVolumeGroupID(input string) (*VolumeGroupId, error) { + parser := resourceids.NewParserFromResourceIdType(VolumeGroupId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VolumeGroupId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + if id.VolumeGroupName, ok = parsed.Parsed["volumeGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'volumeGroupName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseVolumeGroupIDInsensitively parses 'input' case-insensitively into a VolumeGroupId +// note: this method should only be used for API response data and not user input +func ParseVolumeGroupIDInsensitively(input string) (*VolumeGroupId, error) { + parser := resourceids.NewParserFromResourceIdType(VolumeGroupId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VolumeGroupId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + if id.VolumeGroupName, ok = parsed.Parsed["volumeGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'volumeGroupName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateVolumeGroupID checks that 'input' can be parsed as a Volume Group ID +func ValidateVolumeGroupID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseVolumeGroupID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Volume Group ID +func (id VolumeGroupId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/volumeGroups/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName, id.VolumeGroupName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Volume Group ID +func (id VolumeGroupId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("accountName", "accountValue"), + resourceids.StaticSegment("staticVolumeGroups", "volumeGroups", "volumeGroups"), + resourceids.UserSpecifiedSegment("volumeGroupName", "volumeGroupValue"), + } +} + +// String returns a human-readable description of this Volume Group ID +func (id VolumeGroupId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Account Name: %q", id.AccountName), + fmt.Sprintf("Volume Group Name: %q", id.VolumeGroupName), + } + return fmt.Sprintf("Volume Group (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupscreate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupscreate_autorest.go new file mode 100644 index 000000000000..ee9616617b30 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupscreate_autorest.go @@ -0,0 +1,79 @@ +package volumegroups + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupsCreateOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// VolumeGroupsCreate ... +func (c VolumeGroupsClient) VolumeGroupsCreate(ctx context.Context, id VolumeGroupId, input VolumeGroupDetails) (result VolumeGroupsCreateOperationResponse, err error) { + req, err := c.preparerForVolumeGroupsCreate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsCreate", nil, "Failure preparing request") + return + } + + result, err = c.senderForVolumeGroupsCreate(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsCreate", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// VolumeGroupsCreateThenPoll performs VolumeGroupsCreate then polls until it's completed +func (c VolumeGroupsClient) VolumeGroupsCreateThenPoll(ctx context.Context, id VolumeGroupId, input VolumeGroupDetails) error { + result, err := c.VolumeGroupsCreate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing VolumeGroupsCreate: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after VolumeGroupsCreate: %+v", err) + } + + return nil +} + +// preparerForVolumeGroupsCreate prepares the VolumeGroupsCreate request. +func (c VolumeGroupsClient) preparerForVolumeGroupsCreate(ctx context.Context, id VolumeGroupId, input VolumeGroupDetails) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForVolumeGroupsCreate sends the VolumeGroupsCreate request. The method will close the +// http.Response Body if it receives an error. +func (c VolumeGroupsClient) senderForVolumeGroupsCreate(ctx context.Context, req *http.Request) (future VolumeGroupsCreateOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupsdelete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupsdelete_autorest.go new file mode 100644 index 000000000000..b3cba81e1756 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupsdelete_autorest.go @@ -0,0 +1,78 @@ +package volumegroups + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupsDeleteOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// VolumeGroupsDelete ... +func (c VolumeGroupsClient) VolumeGroupsDelete(ctx context.Context, id VolumeGroupId) (result VolumeGroupsDeleteOperationResponse, err error) { + req, err := c.preparerForVolumeGroupsDelete(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsDelete", nil, "Failure preparing request") + return + } + + result, err = c.senderForVolumeGroupsDelete(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsDelete", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// VolumeGroupsDeleteThenPoll performs VolumeGroupsDelete then polls until it's completed +func (c VolumeGroupsClient) VolumeGroupsDeleteThenPoll(ctx context.Context, id VolumeGroupId) error { + result, err := c.VolumeGroupsDelete(ctx, id) + if err != nil { + return fmt.Errorf("performing VolumeGroupsDelete: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after VolumeGroupsDelete: %+v", err) + } + + return nil +} + +// preparerForVolumeGroupsDelete prepares the VolumeGroupsDelete request. +func (c VolumeGroupsClient) preparerForVolumeGroupsDelete(ctx context.Context, id VolumeGroupId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForVolumeGroupsDelete sends the VolumeGroupsDelete request. The method will close the +// http.Response Body if it receives an error. +func (c VolumeGroupsClient) senderForVolumeGroupsDelete(ctx context.Context, req *http.Request) (future VolumeGroupsDeleteOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupsget_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupsget_autorest.go new file mode 100644 index 000000000000..d52a1f2e8c2e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupsget_autorest.go @@ -0,0 +1,67 @@ +package volumegroups + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupsGetOperationResponse struct { + HttpResponse *http.Response + Model *VolumeGroupDetails +} + +// VolumeGroupsGet ... +func (c VolumeGroupsClient) VolumeGroupsGet(ctx context.Context, id VolumeGroupId) (result VolumeGroupsGetOperationResponse, err error) { + req, err := c.preparerForVolumeGroupsGet(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsGet", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsGet", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForVolumeGroupsGet(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsGet", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForVolumeGroupsGet prepares the VolumeGroupsGet request. +func (c VolumeGroupsClient) preparerForVolumeGroupsGet(ctx context.Context, id VolumeGroupId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForVolumeGroupsGet handles the response to the VolumeGroupsGet request. The method always +// closes the http.Response Body. +func (c VolumeGroupsClient) responderForVolumeGroupsGet(resp *http.Response) (result VolumeGroupsGetOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupslistbynetappaccount_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupslistbynetappaccount_autorest.go new file mode 100644 index 000000000000..92517aeaf6f2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupslistbynetappaccount_autorest.go @@ -0,0 +1,68 @@ +package volumegroups + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupsListByNetAppAccountOperationResponse struct { + HttpResponse *http.Response + Model *VolumeGroupList +} + +// VolumeGroupsListByNetAppAccount ... +func (c VolumeGroupsClient) VolumeGroupsListByNetAppAccount(ctx context.Context, id NetAppAccountId) (result VolumeGroupsListByNetAppAccountOperationResponse, err error) { + req, err := c.preparerForVolumeGroupsListByNetAppAccount(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsListByNetAppAccount", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsListByNetAppAccount", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForVolumeGroupsListByNetAppAccount(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsListByNetAppAccount", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForVolumeGroupsListByNetAppAccount prepares the VolumeGroupsListByNetAppAccount request. +func (c VolumeGroupsClient) preparerForVolumeGroupsListByNetAppAccount(ctx context.Context, id NetAppAccountId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/volumeGroups", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForVolumeGroupsListByNetAppAccount handles the response to the VolumeGroupsListByNetAppAccount request. The method always +// closes the http.Response Body. +func (c VolumeGroupsClient) responderForVolumeGroupsListByNetAppAccount(resp *http.Response) (result VolumeGroupsListByNetAppAccountOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_exportpolicyrule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_exportpolicyrule.go new file mode 100644 index 000000000000..e17395ba1a77 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_exportpolicyrule.go @@ -0,0 +1,22 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExportPolicyRule struct { + AllowedClients *string `json:"allowedClients,omitempty"` + ChownMode *ChownMode `json:"chownMode,omitempty"` + Cifs *bool `json:"cifs,omitempty"` + HasRootAccess *bool `json:"hasRootAccess,omitempty"` + Kerberos5ReadOnly *bool `json:"kerberos5ReadOnly,omitempty"` + Kerberos5ReadWrite *bool `json:"kerberos5ReadWrite,omitempty"` + Kerberos5iReadOnly *bool `json:"kerberos5iReadOnly,omitempty"` + Kerberos5iReadWrite *bool `json:"kerberos5iReadWrite,omitempty"` + Kerberos5pReadOnly *bool `json:"kerberos5pReadOnly,omitempty"` + Kerberos5pReadWrite *bool `json:"kerberos5pReadWrite,omitempty"` + Nfsv3 *bool `json:"nfsv3,omitempty"` + Nfsv41 *bool `json:"nfsv41,omitempty"` + RuleIndex *int64 `json:"ruleIndex,omitempty"` + UnixReadOnly *bool `json:"unixReadOnly,omitempty"` + UnixReadWrite *bool `json:"unixReadWrite,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_mounttargetproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_mounttargetproperties.go new file mode 100644 index 000000000000..c59cc0dbf3e7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_mounttargetproperties.go @@ -0,0 +1,11 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MountTargetProperties struct { + FileSystemId string `json:"fileSystemId"` + IpAddress *string `json:"ipAddress,omitempty"` + MountTargetId *string `json:"mountTargetId,omitempty"` + SmbServerFqdn *string `json:"smbServerFqdn,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_placementkeyvaluepairs.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_placementkeyvaluepairs.go new file mode 100644 index 000000000000..1714b1662a1d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_placementkeyvaluepairs.go @@ -0,0 +1,9 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PlacementKeyValuePairs struct { + Key string `json:"key"` + Value string `json:"value"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_replicationobject.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_replicationobject.go new file mode 100644 index 000000000000..6d145aa00798 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_replicationobject.go @@ -0,0 +1,12 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ReplicationObject struct { + EndpointType *EndpointType `json:"endpointType,omitempty"` + RemoteVolumeRegion *string `json:"remoteVolumeRegion,omitempty"` + RemoteVolumeResourceId string `json:"remoteVolumeResourceId"` + ReplicationId *string `json:"replicationId,omitempty"` + ReplicationSchedule *ReplicationSchedule `json:"replicationSchedule,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumebackupproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumebackupproperties.go new file mode 100644 index 000000000000..1141229b560a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumebackupproperties.go @@ -0,0 +1,11 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeBackupProperties struct { + BackupEnabled *bool `json:"backupEnabled,omitempty"` + BackupPolicyId *string `json:"backupPolicyId,omitempty"` + PolicyEnforced *bool `json:"policyEnforced,omitempty"` + VaultId *string `json:"vaultId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroup.go new file mode 100644 index 000000000000..5e4df7bb9c04 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroup.go @@ -0,0 +1,12 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroup struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *VolumeGroupListProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupdetails.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupdetails.go new file mode 100644 index 000000000000..5f01af82c0f7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupdetails.go @@ -0,0 +1,12 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupDetails struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *VolumeGroupProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegrouplist.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegrouplist.go new file mode 100644 index 000000000000..447c6e6e8588 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegrouplist.go @@ -0,0 +1,8 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupList struct { + Value *[]VolumeGroup `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegrouplistproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegrouplistproperties.go new file mode 100644 index 000000000000..5788ee516fc1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegrouplistproperties.go @@ -0,0 +1,9 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupListProperties struct { + GroupMetaData *VolumeGroupMetaData `json:"groupMetaData,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupmetadata.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupmetadata.go new file mode 100644 index 000000000000..30441c6826d5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupmetadata.go @@ -0,0 +1,13 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupMetaData struct { + ApplicationIdentifier *string `json:"applicationIdentifier,omitempty"` + ApplicationType *ApplicationType `json:"applicationType,omitempty"` + DeploymentSpecId *string `json:"deploymentSpecId,omitempty"` + GlobalPlacementRules *[]PlacementKeyValuePairs `json:"globalPlacementRules,omitempty"` + GroupDescription *string `json:"groupDescription,omitempty"` + VolumesCount *int64 `json:"volumesCount,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupproperties.go new file mode 100644 index 000000000000..0bab153b397e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupproperties.go @@ -0,0 +1,10 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupProperties struct { + GroupMetaData *VolumeGroupMetaData `json:"groupMetaData,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + Volumes *[]VolumeGroupVolumeProperties `json:"volumes,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupvolumeproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupvolumeproperties.go new file mode 100644 index 000000000000..61bbdab9ce3e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupvolumeproperties.go @@ -0,0 +1,12 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupVolumeProperties struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties VolumeProperties `json:"properties"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumeproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumeproperties.go new file mode 100644 index 000000000000..357c68e318fa --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumeproperties.go @@ -0,0 +1,50 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeProperties struct { + AvsDataStore *AvsDataStore `json:"avsDataStore,omitempty"` + BackupId *string `json:"backupId,omitempty"` + BaremetalTenantId *string `json:"baremetalTenantId,omitempty"` + CapacityPoolResourceId *string `json:"capacityPoolResourceId,omitempty"` + CloneProgress *int64 `json:"cloneProgress,omitempty"` + CoolAccess *bool `json:"coolAccess,omitempty"` + CoolnessPeriod *int64 `json:"coolnessPeriod,omitempty"` + CreationToken string `json:"creationToken"` + DataProtection *VolumePropertiesDataProtection `json:"dataProtection,omitempty"` + DefaultGroupQuotaInKiBs *int64 `json:"defaultGroupQuotaInKiBs,omitempty"` + DefaultUserQuotaInKiBs *int64 `json:"defaultUserQuotaInKiBs,omitempty"` + EnableSubvolumes *EnableSubvolumes `json:"enableSubvolumes,omitempty"` + Encrypted *bool `json:"encrypted,omitempty"` + EncryptionKeySource *EncryptionKeySource `json:"encryptionKeySource,omitempty"` + ExportPolicy *VolumePropertiesExportPolicy `json:"exportPolicy,omitempty"` + FileSystemId *string `json:"fileSystemId,omitempty"` + IsDefaultQuotaEnabled *bool `json:"isDefaultQuotaEnabled,omitempty"` + IsRestoring *bool `json:"isRestoring,omitempty"` + KerberosEnabled *bool `json:"kerberosEnabled,omitempty"` + LdapEnabled *bool `json:"ldapEnabled,omitempty"` + MaximumNumberOfFiles *int64 `json:"maximumNumberOfFiles,omitempty"` + MountTargets *[]MountTargetProperties `json:"mountTargets,omitempty"` + NetworkFeatures *NetworkFeatures `json:"networkFeatures,omitempty"` + NetworkSiblingSetId *string `json:"networkSiblingSetId,omitempty"` + PlacementRules *[]PlacementKeyValuePairs `json:"placementRules,omitempty"` + ProtocolTypes *[]string `json:"protocolTypes,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + ProximityPlacementGroup *string `json:"proximityPlacementGroup,omitempty"` + SecurityStyle *SecurityStyle `json:"securityStyle,omitempty"` + ServiceLevel *ServiceLevel `json:"serviceLevel,omitempty"` + SmbContinuouslyAvailable *bool `json:"smbContinuouslyAvailable,omitempty"` + SmbEncryption *bool `json:"smbEncryption,omitempty"` + SnapshotDirectoryVisible *bool `json:"snapshotDirectoryVisible,omitempty"` + SnapshotId *string `json:"snapshotId,omitempty"` + StorageToNetworkProximity *VolumeStorageToNetworkProximity `json:"storageToNetworkProximity,omitempty"` + SubnetId string `json:"subnetId"` + T2Network *string `json:"t2Network,omitempty"` + ThroughputMibps *float64 `json:"throughputMibps,omitempty"` + UnixPermissions *string `json:"unixPermissions,omitempty"` + UsageThreshold int64 `json:"usageThreshold"` + VolumeGroupName *string `json:"volumeGroupName,omitempty"` + VolumeSpecName *string `json:"volumeSpecName,omitempty"` + VolumeType *string `json:"volumeType,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumepropertiesdataprotection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumepropertiesdataprotection.go new file mode 100644 index 000000000000..5cde3ecbaacc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumepropertiesdataprotection.go @@ -0,0 +1,10 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumePropertiesDataProtection struct { + Backup *VolumeBackupProperties `json:"backup,omitempty"` + Replication *ReplicationObject `json:"replication,omitempty"` + Snapshot *VolumeSnapshotProperties `json:"snapshot,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumepropertiesexportpolicy.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumepropertiesexportpolicy.go new file mode 100644 index 000000000000..227c8586d6f2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumepropertiesexportpolicy.go @@ -0,0 +1,8 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumePropertiesExportPolicy struct { + Rules *[]ExportPolicyRule `json:"rules,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumesnapshotproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumesnapshotproperties.go new file mode 100644 index 000000000000..a3f5011da3b0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumesnapshotproperties.go @@ -0,0 +1,8 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeSnapshotProperties struct { + SnapshotPolicyId *string `json:"snapshotPolicyId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/version.go new file mode 100644 index 000000000000..a2c68d24f1a6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/version.go @@ -0,0 +1,12 @@ +package volumegroups + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-01-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/volumegroups/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/README.md new file mode 100644 index 000000000000..e5b1f822c355 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/README.md @@ -0,0 +1,99 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes` Documentation + +The `volumes` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2022-01-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes" +``` + + +### Client Initialization + +```go +client := volumes.NewVolumesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VolumesClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue") + +payload := volumes.Volume{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VolumesClient.Delete` + +```go +ctx := context.TODO() +id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue") + +if err := client.DeleteThenPoll(ctx, id, volumes.DefaultDeleteOperationOptions()); err != nil { + // handle the error +} +``` + + +### Example Usage: `VolumesClient.Get` + +```go +ctx := context.TODO() +id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue") + +read, err := client.Get(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VolumesClient.List` + +```go +ctx := context.TODO() +id := volumes.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue") + +// alternatively `client.List(ctx, id)` can be used to do batched pagination +items, err := client.ListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `VolumesClient.Update` + +```go +ctx := context.TODO() +id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue") + +payload := volumes.VolumePatch{ + // ... +} + + +if err := client.UpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/client.go new file mode 100644 index 000000000000..d0a40573bf00 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/client.go @@ -0,0 +1,18 @@ +package volumes + +import "github.com/Azure/go-autorest/autorest" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumesClient struct { + Client autorest.Client + baseUri string +} + +func NewVolumesClientWithBaseURI(endpoint string) VolumesClient { + return VolumesClient{ + Client: autorest.NewClientWithUserAgent(userAgent()), + baseUri: endpoint, + } +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/constants.go new file mode 100644 index 000000000000..8455d065d5a2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/constants.go @@ -0,0 +1,295 @@ +package volumes + +import "strings" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AvsDataStore string + +const ( + AvsDataStoreDisabled AvsDataStore = "Disabled" + AvsDataStoreEnabled AvsDataStore = "Enabled" +) + +func PossibleValuesForAvsDataStore() []string { + return []string{ + string(AvsDataStoreDisabled), + string(AvsDataStoreEnabled), + } +} + +func parseAvsDataStore(input string) (*AvsDataStore, error) { + vals := map[string]AvsDataStore{ + "disabled": AvsDataStoreDisabled, + "enabled": AvsDataStoreEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AvsDataStore(input) + return &out, nil +} + +type ChownMode string + +const ( + ChownModeRestricted ChownMode = "Restricted" + ChownModeUnrestricted ChownMode = "Unrestricted" +) + +func PossibleValuesForChownMode() []string { + return []string{ + string(ChownModeRestricted), + string(ChownModeUnrestricted), + } +} + +func parseChownMode(input string) (*ChownMode, error) { + vals := map[string]ChownMode{ + "restricted": ChownModeRestricted, + "unrestricted": ChownModeUnrestricted, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ChownMode(input) + return &out, nil +} + +type EnableSubvolumes string + +const ( + EnableSubvolumesDisabled EnableSubvolumes = "Disabled" + EnableSubvolumesEnabled EnableSubvolumes = "Enabled" +) + +func PossibleValuesForEnableSubvolumes() []string { + return []string{ + string(EnableSubvolumesDisabled), + string(EnableSubvolumesEnabled), + } +} + +func parseEnableSubvolumes(input string) (*EnableSubvolumes, error) { + vals := map[string]EnableSubvolumes{ + "disabled": EnableSubvolumesDisabled, + "enabled": EnableSubvolumesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := EnableSubvolumes(input) + return &out, nil +} + +type EncryptionKeySource string + +const ( + EncryptionKeySourceMicrosoftPointNetApp EncryptionKeySource = "Microsoft.NetApp" +) + +func PossibleValuesForEncryptionKeySource() []string { + return []string{ + string(EncryptionKeySourceMicrosoftPointNetApp), + } +} + +func parseEncryptionKeySource(input string) (*EncryptionKeySource, error) { + vals := map[string]EncryptionKeySource{ + "microsoft.netapp": EncryptionKeySourceMicrosoftPointNetApp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := EncryptionKeySource(input) + return &out, nil +} + +type EndpointType string + +const ( + EndpointTypeDst EndpointType = "dst" + EndpointTypeSrc EndpointType = "src" +) + +func PossibleValuesForEndpointType() []string { + return []string{ + string(EndpointTypeDst), + string(EndpointTypeSrc), + } +} + +func parseEndpointType(input string) (*EndpointType, error) { + vals := map[string]EndpointType{ + "dst": EndpointTypeDst, + "src": EndpointTypeSrc, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := EndpointType(input) + return &out, nil +} + +type NetworkFeatures string + +const ( + NetworkFeaturesBasic NetworkFeatures = "Basic" + NetworkFeaturesStandard NetworkFeatures = "Standard" +) + +func PossibleValuesForNetworkFeatures() []string { + return []string{ + string(NetworkFeaturesBasic), + string(NetworkFeaturesStandard), + } +} + +func parseNetworkFeatures(input string) (*NetworkFeatures, error) { + vals := map[string]NetworkFeatures{ + "basic": NetworkFeaturesBasic, + "standard": NetworkFeaturesStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkFeatures(input) + return &out, nil +} + +type ReplicationSchedule string + +const ( + ReplicationScheduleDaily ReplicationSchedule = "daily" + ReplicationScheduleHourly ReplicationSchedule = "hourly" + ReplicationScheduleOneZerominutely ReplicationSchedule = "_10minutely" +) + +func PossibleValuesForReplicationSchedule() []string { + return []string{ + string(ReplicationScheduleDaily), + string(ReplicationScheduleHourly), + string(ReplicationScheduleOneZerominutely), + } +} + +func parseReplicationSchedule(input string) (*ReplicationSchedule, error) { + vals := map[string]ReplicationSchedule{ + "daily": ReplicationScheduleDaily, + "hourly": ReplicationScheduleHourly, + "_10minutely": ReplicationScheduleOneZerominutely, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ReplicationSchedule(input) + return &out, nil +} + +type SecurityStyle string + +const ( + SecurityStyleNtfs SecurityStyle = "ntfs" + SecurityStyleUnix SecurityStyle = "unix" +) + +func PossibleValuesForSecurityStyle() []string { + return []string{ + string(SecurityStyleNtfs), + string(SecurityStyleUnix), + } +} + +func parseSecurityStyle(input string) (*SecurityStyle, error) { + vals := map[string]SecurityStyle{ + "ntfs": SecurityStyleNtfs, + "unix": SecurityStyleUnix, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityStyle(input) + return &out, nil +} + +type ServiceLevel string + +const ( + ServiceLevelPremium ServiceLevel = "Premium" + ServiceLevelStandard ServiceLevel = "Standard" + ServiceLevelStandardZRS ServiceLevel = "StandardZRS" + ServiceLevelUltra ServiceLevel = "Ultra" +) + +func PossibleValuesForServiceLevel() []string { + return []string{ + string(ServiceLevelPremium), + string(ServiceLevelStandard), + string(ServiceLevelStandardZRS), + string(ServiceLevelUltra), + } +} + +func parseServiceLevel(input string) (*ServiceLevel, error) { + vals := map[string]ServiceLevel{ + "premium": ServiceLevelPremium, + "standard": ServiceLevelStandard, + "standardzrs": ServiceLevelStandardZRS, + "ultra": ServiceLevelUltra, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ServiceLevel(input) + return &out, nil +} + +type VolumeStorageToNetworkProximity string + +const ( + VolumeStorageToNetworkProximityDefault VolumeStorageToNetworkProximity = "Default" + VolumeStorageToNetworkProximityTOne VolumeStorageToNetworkProximity = "T1" + VolumeStorageToNetworkProximityTTwo VolumeStorageToNetworkProximity = "T2" +) + +func PossibleValuesForVolumeStorageToNetworkProximity() []string { + return []string{ + string(VolumeStorageToNetworkProximityDefault), + string(VolumeStorageToNetworkProximityTOne), + string(VolumeStorageToNetworkProximityTTwo), + } +} + +func parseVolumeStorageToNetworkProximity(input string) (*VolumeStorageToNetworkProximity, error) { + vals := map[string]VolumeStorageToNetworkProximity{ + "default": VolumeStorageToNetworkProximityDefault, + "t1": VolumeStorageToNetworkProximityTOne, + "t2": VolumeStorageToNetworkProximityTTwo, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VolumeStorageToNetworkProximity(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/id_capacitypool.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/id_capacitypool.go new file mode 100644 index 000000000000..06f8b4531bd9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/id_capacitypool.go @@ -0,0 +1,137 @@ +package volumes + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = CapacityPoolId{} + +// CapacityPoolId is a struct representing the Resource ID for a Capacity Pool +type CapacityPoolId struct { + SubscriptionId string + ResourceGroupName string + AccountName string + PoolName string +} + +// NewCapacityPoolID returns a new CapacityPoolId struct +func NewCapacityPoolID(subscriptionId string, resourceGroupName string, accountName string, poolName string) CapacityPoolId { + return CapacityPoolId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AccountName: accountName, + PoolName: poolName, + } +} + +// ParseCapacityPoolID parses 'input' into a CapacityPoolId +func ParseCapacityPoolID(input string) (*CapacityPoolId, error) { + parser := resourceids.NewParserFromResourceIdType(CapacityPoolId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := CapacityPoolId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { + return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseCapacityPoolIDInsensitively parses 'input' case-insensitively into a CapacityPoolId +// note: this method should only be used for API response data and not user input +func ParseCapacityPoolIDInsensitively(input string) (*CapacityPoolId, error) { + parser := resourceids.NewParserFromResourceIdType(CapacityPoolId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := CapacityPoolId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { + return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateCapacityPoolID checks that 'input' can be parsed as a Capacity Pool ID +func ValidateCapacityPoolID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseCapacityPoolID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Capacity Pool ID +func (id CapacityPoolId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/capacityPools/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName, id.PoolName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Capacity Pool ID +func (id CapacityPoolId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("accountName", "accountValue"), + resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), + resourceids.UserSpecifiedSegment("poolName", "poolValue"), + } +} + +// String returns a human-readable description of this Capacity Pool ID +func (id CapacityPoolId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Account Name: %q", id.AccountName), + fmt.Sprintf("Pool Name: %q", id.PoolName), + } + return fmt.Sprintf("Capacity Pool (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/id_volume.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/id_volume.go new file mode 100644 index 000000000000..d4e93b387a44 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/id_volume.go @@ -0,0 +1,150 @@ +package volumes + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = VolumeId{} + +// VolumeId is a struct representing the Resource ID for a Volume +type VolumeId struct { + SubscriptionId string + ResourceGroupName string + AccountName string + PoolName string + VolumeName string +} + +// NewVolumeID returns a new VolumeId struct +func NewVolumeID(subscriptionId string, resourceGroupName string, accountName string, poolName string, volumeName string) VolumeId { + return VolumeId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AccountName: accountName, + PoolName: poolName, + VolumeName: volumeName, + } +} + +// ParseVolumeID parses 'input' into a VolumeId +func ParseVolumeID(input string) (*VolumeId, error) { + parser := resourceids.NewParserFromResourceIdType(VolumeId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VolumeId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { + return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) + } + + if id.VolumeName, ok = parsed.Parsed["volumeName"]; !ok { + return nil, fmt.Errorf("the segment 'volumeName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseVolumeIDInsensitively parses 'input' case-insensitively into a VolumeId +// note: this method should only be used for API response data and not user input +func ParseVolumeIDInsensitively(input string) (*VolumeId, error) { + parser := resourceids.NewParserFromResourceIdType(VolumeId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VolumeId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { + return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) + } + + if id.VolumeName, ok = parsed.Parsed["volumeName"]; !ok { + return nil, fmt.Errorf("the segment 'volumeName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateVolumeID checks that 'input' can be parsed as a Volume ID +func ValidateVolumeID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseVolumeID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Volume ID +func (id VolumeId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/capacityPools/%s/volumes/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName, id.PoolName, id.VolumeName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Volume ID +func (id VolumeId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("accountName", "accountValue"), + resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), + resourceids.UserSpecifiedSegment("poolName", "poolValue"), + resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), + resourceids.UserSpecifiedSegment("volumeName", "volumeValue"), + } +} + +// String returns a human-readable description of this Volume ID +func (id VolumeId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Account Name: %q", id.AccountName), + fmt.Sprintf("Pool Name: %q", id.PoolName), + fmt.Sprintf("Volume Name: %q", id.VolumeName), + } + return fmt.Sprintf("Volume (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/method_createorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/method_createorupdate_autorest.go new file mode 100644 index 000000000000..ae61c0fe91ec --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/method_createorupdate_autorest.go @@ -0,0 +1,79 @@ +package volumes + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// CreateOrUpdate ... +func (c VolumesClient) CreateOrUpdate(ctx context.Context, id VolumeId, input Volume) (result CreateOrUpdateOperationResponse, err error) { + req, err := c.preparerForCreateOrUpdate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = c.senderForCreateOrUpdate(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "CreateOrUpdate", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed +func (c VolumesClient) CreateOrUpdateThenPoll(ctx context.Context, id VolumeId, input Volume) error { + result, err := c.CreateOrUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing CreateOrUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after CreateOrUpdate: %+v", err) + } + + return nil +} + +// preparerForCreateOrUpdate prepares the CreateOrUpdate request. +func (c VolumesClient) preparerForCreateOrUpdate(ctx context.Context, id VolumeId, input Volume) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForCreateOrUpdate sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (c VolumesClient) senderForCreateOrUpdate(ctx context.Context, req *http.Request) (future CreateOrUpdateOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/method_delete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/method_delete_autorest.go new file mode 100644 index 000000000000..1b97fdf87abf --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/method_delete_autorest.go @@ -0,0 +1,107 @@ +package volumes + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +type DeleteOperationOptions struct { + ForceDelete *bool +} + +func DefaultDeleteOperationOptions() DeleteOperationOptions { + return DeleteOperationOptions{} +} + +func (o DeleteOperationOptions) toHeaders() map[string]interface{} { + out := make(map[string]interface{}) + + return out +} + +func (o DeleteOperationOptions) toQueryString() map[string]interface{} { + out := make(map[string]interface{}) + + if o.ForceDelete != nil { + out["forceDelete"] = *o.ForceDelete + } + + return out +} + +// Delete ... +func (c VolumesClient) Delete(ctx context.Context, id VolumeId, options DeleteOperationOptions) (result DeleteOperationResponse, err error) { + req, err := c.preparerForDelete(ctx, id, options) + if err != nil { + err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = c.senderForDelete(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "Delete", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// DeleteThenPoll performs Delete then polls until it's completed +func (c VolumesClient) DeleteThenPoll(ctx context.Context, id VolumeId, options DeleteOperationOptions) error { + result, err := c.Delete(ctx, id, options) + if err != nil { + return fmt.Errorf("performing Delete: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after Delete: %+v", err) + } + + return nil +} + +// preparerForDelete prepares the Delete request. +func (c VolumesClient) preparerForDelete(ctx context.Context, id VolumeId, options DeleteOperationOptions) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + for k, v := range options.toQueryString() { + queryParameters[k] = autorest.Encode("query", v) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithHeaders(options.toHeaders()), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForDelete sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (c VolumesClient) senderForDelete(ctx context.Context, req *http.Request) (future DeleteOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/method_get_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/method_get_autorest.go new file mode 100644 index 000000000000..f35ab8d36ba5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/method_get_autorest.go @@ -0,0 +1,67 @@ +package volumes + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetOperationResponse struct { + HttpResponse *http.Response + Model *Volume +} + +// Get ... +func (c VolumesClient) Get(ctx context.Context, id VolumeId) (result GetOperationResponse, err error) { + req, err := c.preparerForGet(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "Get", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "Get", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForGet(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "Get", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForGet prepares the Get request. +func (c VolumesClient) preparerForGet(ctx context.Context, id VolumeId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForGet handles the response to the Get request. The method always +// closes the http.Response Body. +func (c VolumesClient) responderForGet(resp *http.Response) (result GetOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/method_list_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/method_list_autorest.go new file mode 100644 index 000000000000..40c311905e59 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/method_list_autorest.go @@ -0,0 +1,186 @@ +package volumes + +import ( + "context" + "fmt" + "net/http" + "net/url" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListOperationResponse struct { + HttpResponse *http.Response + Model *[]Volume + + nextLink *string + nextPageFunc func(ctx context.Context, nextLink string) (ListOperationResponse, error) +} + +type ListCompleteResult struct { + Items []Volume +} + +func (r ListOperationResponse) HasMore() bool { + return r.nextLink != nil +} + +func (r ListOperationResponse) LoadMore(ctx context.Context) (resp ListOperationResponse, err error) { + if !r.HasMore() { + err = fmt.Errorf("no more pages returned") + return + } + return r.nextPageFunc(ctx, *r.nextLink) +} + +// List ... +func (c VolumesClient) List(ctx context.Context, id CapacityPoolId) (resp ListOperationResponse, err error) { + req, err := c.preparerForList(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "List", nil, "Failure preparing request") + return + } + + resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "List", resp.HttpResponse, "Failure sending request") + return + } + + resp, err = c.responderForList(resp.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "List", resp.HttpResponse, "Failure responding to request") + return + } + return +} + +// ListComplete retrieves all of the results into a single object +func (c VolumesClient) ListComplete(ctx context.Context, id CapacityPoolId) (ListCompleteResult, error) { + return c.ListCompleteMatchingPredicate(ctx, id, VolumeOperationPredicate{}) +} + +// ListCompleteMatchingPredicate retrieves all of the results and then applied the predicate +func (c VolumesClient) ListCompleteMatchingPredicate(ctx context.Context, id CapacityPoolId, predicate VolumeOperationPredicate) (resp ListCompleteResult, err error) { + items := make([]Volume, 0) + + page, err := c.List(ctx, id) + if err != nil { + err = fmt.Errorf("loading the initial page: %+v", err) + return + } + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + for page.HasMore() { + page, err = page.LoadMore(ctx) + if err != nil { + err = fmt.Errorf("loading the next page: %+v", err) + return + } + + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + } + + out := ListCompleteResult{ + Items: items, + } + return out, nil +} + +// preparerForList prepares the List request. +func (c VolumesClient) preparerForList(ctx context.Context, id CapacityPoolId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/volumes", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// preparerForListWithNextLink prepares the List request with the given nextLink token. +func (c VolumesClient) preparerForListWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { + uri, err := url.Parse(nextLink) + if err != nil { + return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) + } + queryParameters := map[string]interface{}{} + for k, v := range uri.Query() { + if len(v) == 0 { + continue + } + val := v[0] + val = autorest.Encode("query", val) + queryParameters[k] = val + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(uri.Path), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForList handles the response to the List request. The method always +// closes the http.Response Body. +func (c VolumesClient) responderForList(resp *http.Response) (result ListOperationResponse, err error) { + type page struct { + Values []Volume `json:"value"` + NextLink *string `json:"nextLink"` + } + var respObj page + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&respObj), + autorest.ByClosing()) + result.HttpResponse = resp + result.Model = &respObj.Values + result.nextLink = respObj.NextLink + if respObj.NextLink != nil { + result.nextPageFunc = func(ctx context.Context, nextLink string) (result ListOperationResponse, err error) { + req, err := c.preparerForListWithNextLink(ctx, nextLink) + if err != nil { + err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "List", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "List", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForList(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "List", result.HttpResponse, "Failure responding to request") + return + } + + return + } + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/method_update_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/method_update_autorest.go new file mode 100644 index 000000000000..7e6872e1513e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/method_update_autorest.go @@ -0,0 +1,79 @@ +package volumes + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpdateOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// Update ... +func (c VolumesClient) Update(ctx context.Context, id VolumeId, input VolumePatch) (result UpdateOperationResponse, err error) { + req, err := c.preparerForUpdate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "Update", nil, "Failure preparing request") + return + } + + result, err = c.senderForUpdate(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "Update", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// UpdateThenPoll performs Update then polls until it's completed +func (c VolumesClient) UpdateThenPoll(ctx context.Context, id VolumeId, input VolumePatch) error { + result, err := c.Update(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Update: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after Update: %+v", err) + } + + return nil +} + +// preparerForUpdate prepares the Update request. +func (c VolumesClient) preparerForUpdate(ctx context.Context, id VolumeId, input VolumePatch) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForUpdate sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (c VolumesClient) senderForUpdate(ctx context.Context, req *http.Request) (future UpdateOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_exportpolicyrule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_exportpolicyrule.go new file mode 100644 index 000000000000..9b059c747578 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_exportpolicyrule.go @@ -0,0 +1,22 @@ +package volumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExportPolicyRule struct { + AllowedClients *string `json:"allowedClients,omitempty"` + ChownMode *ChownMode `json:"chownMode,omitempty"` + Cifs *bool `json:"cifs,omitempty"` + HasRootAccess *bool `json:"hasRootAccess,omitempty"` + Kerberos5ReadOnly *bool `json:"kerberos5ReadOnly,omitempty"` + Kerberos5ReadWrite *bool `json:"kerberos5ReadWrite,omitempty"` + Kerberos5iReadOnly *bool `json:"kerberos5iReadOnly,omitempty"` + Kerberos5iReadWrite *bool `json:"kerberos5iReadWrite,omitempty"` + Kerberos5pReadOnly *bool `json:"kerberos5pReadOnly,omitempty"` + Kerberos5pReadWrite *bool `json:"kerberos5pReadWrite,omitempty"` + Nfsv3 *bool `json:"nfsv3,omitempty"` + Nfsv41 *bool `json:"nfsv41,omitempty"` + RuleIndex *int64 `json:"ruleIndex,omitempty"` + UnixReadOnly *bool `json:"unixReadOnly,omitempty"` + UnixReadWrite *bool `json:"unixReadWrite,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_mounttargetproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_mounttargetproperties.go new file mode 100644 index 000000000000..b92b9edb4154 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_mounttargetproperties.go @@ -0,0 +1,11 @@ +package volumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MountTargetProperties struct { + FileSystemId string `json:"fileSystemId"` + IpAddress *string `json:"ipAddress,omitempty"` + MountTargetId *string `json:"mountTargetId,omitempty"` + SmbServerFqdn *string `json:"smbServerFqdn,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_placementkeyvaluepairs.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_placementkeyvaluepairs.go new file mode 100644 index 000000000000..588e9729c1e4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_placementkeyvaluepairs.go @@ -0,0 +1,9 @@ +package volumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PlacementKeyValuePairs struct { + Key string `json:"key"` + Value string `json:"value"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_replicationobject.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_replicationobject.go new file mode 100644 index 000000000000..b7d6873811e2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_replicationobject.go @@ -0,0 +1,12 @@ +package volumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ReplicationObject struct { + EndpointType *EndpointType `json:"endpointType,omitempty"` + RemoteVolumeRegion *string `json:"remoteVolumeRegion,omitempty"` + RemoteVolumeResourceId string `json:"remoteVolumeResourceId"` + ReplicationId *string `json:"replicationId,omitempty"` + ReplicationSchedule *ReplicationSchedule `json:"replicationSchedule,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volume.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volume.go new file mode 100644 index 000000000000..b9dc943c95bd --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volume.go @@ -0,0 +1,20 @@ +package volumes + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Volume struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties VolumeProperties `json:"properties"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` + Zones *[]string `json:"zones,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumebackupproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumebackupproperties.go new file mode 100644 index 000000000000..1de25f15e330 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumebackupproperties.go @@ -0,0 +1,11 @@ +package volumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeBackupProperties struct { + BackupEnabled *bool `json:"backupEnabled,omitempty"` + BackupPolicyId *string `json:"backupPolicyId,omitempty"` + PolicyEnforced *bool `json:"policyEnforced,omitempty"` + VaultId *string `json:"vaultId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepatch.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepatch.go new file mode 100644 index 000000000000..b39ea01aee89 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepatch.go @@ -0,0 +1,13 @@ +package volumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumePatch struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *VolumePatchProperties `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepatchproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepatchproperties.go new file mode 100644 index 000000000000..ed4479ca252b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepatchproperties.go @@ -0,0 +1,16 @@ +package volumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumePatchProperties struct { + DataProtection *VolumePatchPropertiesDataProtection `json:"dataProtection,omitempty"` + DefaultGroupQuotaInKiBs *int64 `json:"defaultGroupQuotaInKiBs,omitempty"` + DefaultUserQuotaInKiBs *int64 `json:"defaultUserQuotaInKiBs,omitempty"` + ExportPolicy *VolumePatchPropertiesExportPolicy `json:"exportPolicy,omitempty"` + IsDefaultQuotaEnabled *bool `json:"isDefaultQuotaEnabled,omitempty"` + ServiceLevel *ServiceLevel `json:"serviceLevel,omitempty"` + ThroughputMibps *float64 `json:"throughputMibps,omitempty"` + UnixPermissions *string `json:"unixPermissions,omitempty"` + UsageThreshold *int64 `json:"usageThreshold,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepatchpropertiesdataprotection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepatchpropertiesdataprotection.go new file mode 100644 index 000000000000..8c9edc10ff72 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepatchpropertiesdataprotection.go @@ -0,0 +1,9 @@ +package volumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumePatchPropertiesDataProtection struct { + Backup *VolumeBackupProperties `json:"backup,omitempty"` + Snapshot *VolumeSnapshotProperties `json:"snapshot,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepatchpropertiesexportpolicy.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepatchpropertiesexportpolicy.go new file mode 100644 index 000000000000..ae83a5fc1b4f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepatchpropertiesexportpolicy.go @@ -0,0 +1,8 @@ +package volumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumePatchPropertiesExportPolicy struct { + Rules *[]ExportPolicyRule `json:"rules,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumeproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumeproperties.go new file mode 100644 index 000000000000..01cceff7a1dc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumeproperties.go @@ -0,0 +1,50 @@ +package volumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeProperties struct { + AvsDataStore *AvsDataStore `json:"avsDataStore,omitempty"` + BackupId *string `json:"backupId,omitempty"` + BaremetalTenantId *string `json:"baremetalTenantId,omitempty"` + CapacityPoolResourceId *string `json:"capacityPoolResourceId,omitempty"` + CloneProgress *int64 `json:"cloneProgress,omitempty"` + CoolAccess *bool `json:"coolAccess,omitempty"` + CoolnessPeriod *int64 `json:"coolnessPeriod,omitempty"` + CreationToken string `json:"creationToken"` + DataProtection *VolumePropertiesDataProtection `json:"dataProtection,omitempty"` + DefaultGroupQuotaInKiBs *int64 `json:"defaultGroupQuotaInKiBs,omitempty"` + DefaultUserQuotaInKiBs *int64 `json:"defaultUserQuotaInKiBs,omitempty"` + EnableSubvolumes *EnableSubvolumes `json:"enableSubvolumes,omitempty"` + Encrypted *bool `json:"encrypted,omitempty"` + EncryptionKeySource *EncryptionKeySource `json:"encryptionKeySource,omitempty"` + ExportPolicy *VolumePropertiesExportPolicy `json:"exportPolicy,omitempty"` + FileSystemId *string `json:"fileSystemId,omitempty"` + IsDefaultQuotaEnabled *bool `json:"isDefaultQuotaEnabled,omitempty"` + IsRestoring *bool `json:"isRestoring,omitempty"` + KerberosEnabled *bool `json:"kerberosEnabled,omitempty"` + LdapEnabled *bool `json:"ldapEnabled,omitempty"` + MaximumNumberOfFiles *int64 `json:"maximumNumberOfFiles,omitempty"` + MountTargets *[]MountTargetProperties `json:"mountTargets,omitempty"` + NetworkFeatures *NetworkFeatures `json:"networkFeatures,omitempty"` + NetworkSiblingSetId *string `json:"networkSiblingSetId,omitempty"` + PlacementRules *[]PlacementKeyValuePairs `json:"placementRules,omitempty"` + ProtocolTypes *[]string `json:"protocolTypes,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + ProximityPlacementGroup *string `json:"proximityPlacementGroup,omitempty"` + SecurityStyle *SecurityStyle `json:"securityStyle,omitempty"` + ServiceLevel *ServiceLevel `json:"serviceLevel,omitempty"` + SmbContinuouslyAvailable *bool `json:"smbContinuouslyAvailable,omitempty"` + SmbEncryption *bool `json:"smbEncryption,omitempty"` + SnapshotDirectoryVisible *bool `json:"snapshotDirectoryVisible,omitempty"` + SnapshotId *string `json:"snapshotId,omitempty"` + StorageToNetworkProximity *VolumeStorageToNetworkProximity `json:"storageToNetworkProximity,omitempty"` + SubnetId string `json:"subnetId"` + T2Network *string `json:"t2Network,omitempty"` + ThroughputMibps *float64 `json:"throughputMibps,omitempty"` + UnixPermissions *string `json:"unixPermissions,omitempty"` + UsageThreshold int64 `json:"usageThreshold"` + VolumeGroupName *string `json:"volumeGroupName,omitempty"` + VolumeSpecName *string `json:"volumeSpecName,omitempty"` + VolumeType *string `json:"volumeType,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepropertiesdataprotection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepropertiesdataprotection.go new file mode 100644 index 000000000000..28163c70a51c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepropertiesdataprotection.go @@ -0,0 +1,10 @@ +package volumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumePropertiesDataProtection struct { + Backup *VolumeBackupProperties `json:"backup,omitempty"` + Replication *ReplicationObject `json:"replication,omitempty"` + Snapshot *VolumeSnapshotProperties `json:"snapshot,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepropertiesexportpolicy.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepropertiesexportpolicy.go new file mode 100644 index 000000000000..fda5f4739dee --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepropertiesexportpolicy.go @@ -0,0 +1,8 @@ +package volumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumePropertiesExportPolicy struct { + Rules *[]ExportPolicyRule `json:"rules,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumesnapshotproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumesnapshotproperties.go new file mode 100644 index 000000000000..48aba2acce0d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumesnapshotproperties.go @@ -0,0 +1,8 @@ +package volumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeSnapshotProperties struct { + SnapshotPolicyId *string `json:"snapshotPolicyId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/predicates.go new file mode 100644 index 000000000000..536d6a70dc81 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/predicates.go @@ -0,0 +1,34 @@ +package volumes + +type VolumeOperationPredicate struct { + Etag *string + Id *string + Location *string + Name *string + Type *string +} + +func (p VolumeOperationPredicate) Matches(input Volume) bool { + + if p.Etag != nil && (input.Etag == nil && *p.Etag != *input.Etag) { + return false + } + + if p.Id != nil && (input.Id == nil && *p.Id != *input.Id) { + return false + } + + if p.Location != nil && *p.Location != input.Location { + return false + } + + if p.Name != nil && (input.Name == nil && *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil && *p.Type != *input.Type) { + return false + } + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/version.go new file mode 100644 index 000000000000..985665c9fcc2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/version.go @@ -0,0 +1,12 @@ +package volumes + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-01-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/volumes/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/README.md new file mode 100644 index 000000000000..d3b6a530cdd8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/README.md @@ -0,0 +1,122 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication` Documentation + +The `volumesreplication` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2022-01-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication" +``` + + +### Client Initialization + +```go +client := volumesreplication.NewVolumesReplicationClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VolumesReplicationClient.VolumesAuthorizeReplication` + +```go +ctx := context.TODO() +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue") + +payload := volumesreplication.AuthorizeRequest{ + // ... +} + + +if err := client.VolumesAuthorizeReplicationThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VolumesReplicationClient.VolumesBreakReplication` + +```go +ctx := context.TODO() +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue") + +payload := volumesreplication.BreakReplicationRequest{ + // ... +} + + +if err := client.VolumesBreakReplicationThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VolumesReplicationClient.VolumesDeleteReplication` + +```go +ctx := context.TODO() +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue") + +if err := client.VolumesDeleteReplicationThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VolumesReplicationClient.VolumesListReplications` + +```go +ctx := context.TODO() +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue") + +read, err := client.VolumesListReplications(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VolumesReplicationClient.VolumesReInitializeReplication` + +```go +ctx := context.TODO() +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue") + +if err := client.VolumesReInitializeReplicationThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VolumesReplicationClient.VolumesReplicationStatus` + +```go +ctx := context.TODO() +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue") + +read, err := client.VolumesReplicationStatus(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VolumesReplicationClient.VolumesResyncReplication` + +```go +ctx := context.TODO() +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue") + +if err := client.VolumesResyncReplicationThenPoll(ctx, id); err != nil { + // handle the error +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/client.go new file mode 100644 index 000000000000..64a4d559d37e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/client.go @@ -0,0 +1,18 @@ +package volumesreplication + +import "github.com/Azure/go-autorest/autorest" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumesReplicationClient struct { + Client autorest.Client + baseUri string +} + +func NewVolumesReplicationClientWithBaseURI(endpoint string) VolumesReplicationClient { + return VolumesReplicationClient{ + Client: autorest.NewClientWithUserAgent(userAgent()), + baseUri: endpoint, + } +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/constants.go new file mode 100644 index 000000000000..a82a488bb410 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/constants.go @@ -0,0 +1,124 @@ +package volumesreplication + +import "strings" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type EndpointType string + +const ( + EndpointTypeDst EndpointType = "dst" + EndpointTypeSrc EndpointType = "src" +) + +func PossibleValuesForEndpointType() []string { + return []string{ + string(EndpointTypeDst), + string(EndpointTypeSrc), + } +} + +func parseEndpointType(input string) (*EndpointType, error) { + vals := map[string]EndpointType{ + "dst": EndpointTypeDst, + "src": EndpointTypeSrc, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := EndpointType(input) + return &out, nil +} + +type MirrorState string + +const ( + MirrorStateBroken MirrorState = "Broken" + MirrorStateMirrored MirrorState = "Mirrored" + MirrorStateUninitialized MirrorState = "Uninitialized" +) + +func PossibleValuesForMirrorState() []string { + return []string{ + string(MirrorStateBroken), + string(MirrorStateMirrored), + string(MirrorStateUninitialized), + } +} + +func parseMirrorState(input string) (*MirrorState, error) { + vals := map[string]MirrorState{ + "broken": MirrorStateBroken, + "mirrored": MirrorStateMirrored, + "uninitialized": MirrorStateUninitialized, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MirrorState(input) + return &out, nil +} + +type RelationshipStatus string + +const ( + RelationshipStatusIdle RelationshipStatus = "Idle" + RelationshipStatusTransferring RelationshipStatus = "Transferring" +) + +func PossibleValuesForRelationshipStatus() []string { + return []string{ + string(RelationshipStatusIdle), + string(RelationshipStatusTransferring), + } +} + +func parseRelationshipStatus(input string) (*RelationshipStatus, error) { + vals := map[string]RelationshipStatus{ + "idle": RelationshipStatusIdle, + "transferring": RelationshipStatusTransferring, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RelationshipStatus(input) + return &out, nil +} + +type ReplicationSchedule string + +const ( + ReplicationScheduleDaily ReplicationSchedule = "daily" + ReplicationScheduleHourly ReplicationSchedule = "hourly" + ReplicationScheduleOneZerominutely ReplicationSchedule = "_10minutely" +) + +func PossibleValuesForReplicationSchedule() []string { + return []string{ + string(ReplicationScheduleDaily), + string(ReplicationScheduleHourly), + string(ReplicationScheduleOneZerominutely), + } +} + +func parseReplicationSchedule(input string) (*ReplicationSchedule, error) { + vals := map[string]ReplicationSchedule{ + "daily": ReplicationScheduleDaily, + "hourly": ReplicationScheduleHourly, + "_10minutely": ReplicationScheduleOneZerominutely, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ReplicationSchedule(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/id_volume.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/id_volume.go new file mode 100644 index 000000000000..c88adaf98587 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/id_volume.go @@ -0,0 +1,150 @@ +package volumesreplication + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = VolumeId{} + +// VolumeId is a struct representing the Resource ID for a Volume +type VolumeId struct { + SubscriptionId string + ResourceGroupName string + AccountName string + PoolName string + VolumeName string +} + +// NewVolumeID returns a new VolumeId struct +func NewVolumeID(subscriptionId string, resourceGroupName string, accountName string, poolName string, volumeName string) VolumeId { + return VolumeId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AccountName: accountName, + PoolName: poolName, + VolumeName: volumeName, + } +} + +// ParseVolumeID parses 'input' into a VolumeId +func ParseVolumeID(input string) (*VolumeId, error) { + parser := resourceids.NewParserFromResourceIdType(VolumeId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VolumeId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { + return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) + } + + if id.VolumeName, ok = parsed.Parsed["volumeName"]; !ok { + return nil, fmt.Errorf("the segment 'volumeName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseVolumeIDInsensitively parses 'input' case-insensitively into a VolumeId +// note: this method should only be used for API response data and not user input +func ParseVolumeIDInsensitively(input string) (*VolumeId, error) { + parser := resourceids.NewParserFromResourceIdType(VolumeId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VolumeId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { + return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + } + + if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { + return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) + } + + if id.VolumeName, ok = parsed.Parsed["volumeName"]; !ok { + return nil, fmt.Errorf("the segment 'volumeName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateVolumeID checks that 'input' can be parsed as a Volume ID +func ValidateVolumeID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseVolumeID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Volume ID +func (id VolumeId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/capacityPools/%s/volumes/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName, id.PoolName, id.VolumeName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Volume ID +func (id VolumeId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("accountName", "accountValue"), + resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), + resourceids.UserSpecifiedSegment("poolName", "poolValue"), + resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), + resourceids.UserSpecifiedSegment("volumeName", "volumeValue"), + } +} + +// String returns a human-readable description of this Volume ID +func (id VolumeId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Account Name: %q", id.AccountName), + fmt.Sprintf("Pool Name: %q", id.PoolName), + fmt.Sprintf("Volume Name: %q", id.VolumeName), + } + return fmt.Sprintf("Volume (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesauthorizereplication_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesauthorizereplication_autorest.go new file mode 100644 index 000000000000..76b9f035e73f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesauthorizereplication_autorest.go @@ -0,0 +1,79 @@ +package volumesreplication + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumesAuthorizeReplicationOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// VolumesAuthorizeReplication ... +func (c VolumesReplicationClient) VolumesAuthorizeReplication(ctx context.Context, id VolumeId, input AuthorizeRequest) (result VolumesAuthorizeReplicationOperationResponse, err error) { + req, err := c.preparerForVolumesAuthorizeReplication(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesAuthorizeReplication", nil, "Failure preparing request") + return + } + + result, err = c.senderForVolumesAuthorizeReplication(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesAuthorizeReplication", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// VolumesAuthorizeReplicationThenPoll performs VolumesAuthorizeReplication then polls until it's completed +func (c VolumesReplicationClient) VolumesAuthorizeReplicationThenPoll(ctx context.Context, id VolumeId, input AuthorizeRequest) error { + result, err := c.VolumesAuthorizeReplication(ctx, id, input) + if err != nil { + return fmt.Errorf("performing VolumesAuthorizeReplication: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after VolumesAuthorizeReplication: %+v", err) + } + + return nil +} + +// preparerForVolumesAuthorizeReplication prepares the VolumesAuthorizeReplication request. +func (c VolumesReplicationClient) preparerForVolumesAuthorizeReplication(ctx context.Context, id VolumeId, input AuthorizeRequest) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/authorizeReplication", id.ID())), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForVolumesAuthorizeReplication sends the VolumesAuthorizeReplication request. The method will close the +// http.Response Body if it receives an error. +func (c VolumesReplicationClient) senderForVolumesAuthorizeReplication(ctx context.Context, req *http.Request) (future VolumesAuthorizeReplicationOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesbreakreplication_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesbreakreplication_autorest.go new file mode 100644 index 000000000000..2d1739198e38 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesbreakreplication_autorest.go @@ -0,0 +1,79 @@ +package volumesreplication + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumesBreakReplicationOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// VolumesBreakReplication ... +func (c VolumesReplicationClient) VolumesBreakReplication(ctx context.Context, id VolumeId, input BreakReplicationRequest) (result VolumesBreakReplicationOperationResponse, err error) { + req, err := c.preparerForVolumesBreakReplication(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesBreakReplication", nil, "Failure preparing request") + return + } + + result, err = c.senderForVolumesBreakReplication(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesBreakReplication", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// VolumesBreakReplicationThenPoll performs VolumesBreakReplication then polls until it's completed +func (c VolumesReplicationClient) VolumesBreakReplicationThenPoll(ctx context.Context, id VolumeId, input BreakReplicationRequest) error { + result, err := c.VolumesBreakReplication(ctx, id, input) + if err != nil { + return fmt.Errorf("performing VolumesBreakReplication: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after VolumesBreakReplication: %+v", err) + } + + return nil +} + +// preparerForVolumesBreakReplication prepares the VolumesBreakReplication request. +func (c VolumesReplicationClient) preparerForVolumesBreakReplication(ctx context.Context, id VolumeId, input BreakReplicationRequest) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/breakReplication", id.ID())), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForVolumesBreakReplication sends the VolumesBreakReplication request. The method will close the +// http.Response Body if it receives an error. +func (c VolumesReplicationClient) senderForVolumesBreakReplication(ctx context.Context, req *http.Request) (future VolumesBreakReplicationOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesdeletereplication_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesdeletereplication_autorest.go new file mode 100644 index 000000000000..6dd32453b2de --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesdeletereplication_autorest.go @@ -0,0 +1,78 @@ +package volumesreplication + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumesDeleteReplicationOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// VolumesDeleteReplication ... +func (c VolumesReplicationClient) VolumesDeleteReplication(ctx context.Context, id VolumeId) (result VolumesDeleteReplicationOperationResponse, err error) { + req, err := c.preparerForVolumesDeleteReplication(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesDeleteReplication", nil, "Failure preparing request") + return + } + + result, err = c.senderForVolumesDeleteReplication(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesDeleteReplication", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// VolumesDeleteReplicationThenPoll performs VolumesDeleteReplication then polls until it's completed +func (c VolumesReplicationClient) VolumesDeleteReplicationThenPoll(ctx context.Context, id VolumeId) error { + result, err := c.VolumesDeleteReplication(ctx, id) + if err != nil { + return fmt.Errorf("performing VolumesDeleteReplication: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after VolumesDeleteReplication: %+v", err) + } + + return nil +} + +// preparerForVolumesDeleteReplication prepares the VolumesDeleteReplication request. +func (c VolumesReplicationClient) preparerForVolumesDeleteReplication(ctx context.Context, id VolumeId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/deleteReplication", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForVolumesDeleteReplication sends the VolumesDeleteReplication request. The method will close the +// http.Response Body if it receives an error. +func (c VolumesReplicationClient) senderForVolumesDeleteReplication(ctx context.Context, req *http.Request) (future VolumesDeleteReplicationOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumeslistreplications_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumeslistreplications_autorest.go new file mode 100644 index 000000000000..7bfeef216c20 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumeslistreplications_autorest.go @@ -0,0 +1,68 @@ +package volumesreplication + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumesListReplicationsOperationResponse struct { + HttpResponse *http.Response + Model *ListReplications +} + +// VolumesListReplications ... +func (c VolumesReplicationClient) VolumesListReplications(ctx context.Context, id VolumeId) (result VolumesListReplicationsOperationResponse, err error) { + req, err := c.preparerForVolumesListReplications(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesListReplications", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesListReplications", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForVolumesListReplications(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesListReplications", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForVolumesListReplications prepares the VolumesListReplications request. +func (c VolumesReplicationClient) preparerForVolumesListReplications(ctx context.Context, id VolumeId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/listReplications", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForVolumesListReplications handles the response to the VolumesListReplications request. The method always +// closes the http.Response Body. +func (c VolumesReplicationClient) responderForVolumesListReplications(resp *http.Response) (result VolumesListReplicationsOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesreinitializereplication_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesreinitializereplication_autorest.go new file mode 100644 index 000000000000..f894605753fa --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesreinitializereplication_autorest.go @@ -0,0 +1,78 @@ +package volumesreplication + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumesReInitializeReplicationOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// VolumesReInitializeReplication ... +func (c VolumesReplicationClient) VolumesReInitializeReplication(ctx context.Context, id VolumeId) (result VolumesReInitializeReplicationOperationResponse, err error) { + req, err := c.preparerForVolumesReInitializeReplication(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesReInitializeReplication", nil, "Failure preparing request") + return + } + + result, err = c.senderForVolumesReInitializeReplication(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesReInitializeReplication", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// VolumesReInitializeReplicationThenPoll performs VolumesReInitializeReplication then polls until it's completed +func (c VolumesReplicationClient) VolumesReInitializeReplicationThenPoll(ctx context.Context, id VolumeId) error { + result, err := c.VolumesReInitializeReplication(ctx, id) + if err != nil { + return fmt.Errorf("performing VolumesReInitializeReplication: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after VolumesReInitializeReplication: %+v", err) + } + + return nil +} + +// preparerForVolumesReInitializeReplication prepares the VolumesReInitializeReplication request. +func (c VolumesReplicationClient) preparerForVolumesReInitializeReplication(ctx context.Context, id VolumeId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/reinitializeReplication", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForVolumesReInitializeReplication sends the VolumesReInitializeReplication request. The method will close the +// http.Response Body if it receives an error. +func (c VolumesReplicationClient) senderForVolumesReInitializeReplication(ctx context.Context, req *http.Request) (future VolumesReInitializeReplicationOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesreplicationstatus_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesreplicationstatus_autorest.go new file mode 100644 index 000000000000..12b0382b0cd4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesreplicationstatus_autorest.go @@ -0,0 +1,68 @@ +package volumesreplication + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumesReplicationStatusOperationResponse struct { + HttpResponse *http.Response + Model *ReplicationStatus +} + +// VolumesReplicationStatus ... +func (c VolumesReplicationClient) VolumesReplicationStatus(ctx context.Context, id VolumeId) (result VolumesReplicationStatusOperationResponse, err error) { + req, err := c.preparerForVolumesReplicationStatus(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesReplicationStatus", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesReplicationStatus", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForVolumesReplicationStatus(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesReplicationStatus", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForVolumesReplicationStatus prepares the VolumesReplicationStatus request. +func (c VolumesReplicationClient) preparerForVolumesReplicationStatus(ctx context.Context, id VolumeId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/replicationStatus", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForVolumesReplicationStatus handles the response to the VolumesReplicationStatus request. The method always +// closes the http.Response Body. +func (c VolumesReplicationClient) responderForVolumesReplicationStatus(resp *http.Response) (result VolumesReplicationStatusOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesresyncreplication_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesresyncreplication_autorest.go new file mode 100644 index 000000000000..05f303966fa5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesresyncreplication_autorest.go @@ -0,0 +1,78 @@ +package volumesreplication + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumesResyncReplicationOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// VolumesResyncReplication ... +func (c VolumesReplicationClient) VolumesResyncReplication(ctx context.Context, id VolumeId) (result VolumesResyncReplicationOperationResponse, err error) { + req, err := c.preparerForVolumesResyncReplication(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesResyncReplication", nil, "Failure preparing request") + return + } + + result, err = c.senderForVolumesResyncReplication(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesResyncReplication", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// VolumesResyncReplicationThenPoll performs VolumesResyncReplication then polls until it's completed +func (c VolumesReplicationClient) VolumesResyncReplicationThenPoll(ctx context.Context, id VolumeId) error { + result, err := c.VolumesResyncReplication(ctx, id) + if err != nil { + return fmt.Errorf("performing VolumesResyncReplication: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after VolumesResyncReplication: %+v", err) + } + + return nil +} + +// preparerForVolumesResyncReplication prepares the VolumesResyncReplication request. +func (c VolumesReplicationClient) preparerForVolumesResyncReplication(ctx context.Context, id VolumeId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/resyncReplication", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForVolumesResyncReplication sends the VolumesResyncReplication request. The method will close the +// http.Response Body if it receives an error. +func (c VolumesReplicationClient) senderForVolumesResyncReplication(ctx context.Context, req *http.Request) (future VolumesResyncReplicationOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/model_authorizerequest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/model_authorizerequest.go new file mode 100644 index 000000000000..ff1cefa31efa --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/model_authorizerequest.go @@ -0,0 +1,8 @@ +package volumesreplication + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AuthorizeRequest struct { + RemoteVolumeResourceId *string `json:"remoteVolumeResourceId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/model_breakreplicationrequest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/model_breakreplicationrequest.go new file mode 100644 index 000000000000..b6a0a179a9c6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/model_breakreplicationrequest.go @@ -0,0 +1,8 @@ +package volumesreplication + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BreakReplicationRequest struct { + ForceBreakReplication *bool `json:"forceBreakReplication,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/model_listreplications.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/model_listreplications.go new file mode 100644 index 000000000000..7929ea4ace49 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/model_listreplications.go @@ -0,0 +1,8 @@ +package volumesreplication + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListReplications struct { + Value *[]Replication `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/model_replication.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/model_replication.go new file mode 100644 index 000000000000..06e345fdb5e6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/model_replication.go @@ -0,0 +1,11 @@ +package volumesreplication + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Replication struct { + EndpointType *EndpointType `json:"endpointType,omitempty"` + RemoteVolumeRegion *string `json:"remoteVolumeRegion,omitempty"` + RemoteVolumeResourceId string `json:"remoteVolumeResourceId"` + ReplicationSchedule *ReplicationSchedule `json:"replicationSchedule,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/model_replicationstatus.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/model_replicationstatus.go new file mode 100644 index 000000000000..2a79dddf7a40 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/model_replicationstatus.go @@ -0,0 +1,12 @@ +package volumesreplication + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ReplicationStatus struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Healthy *bool `json:"healthy,omitempty"` + MirrorState *MirrorState `json:"mirrorState,omitempty"` + RelationshipStatus *RelationshipStatus `json:"relationshipStatus,omitempty"` + TotalProgress *string `json:"totalProgress,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/version.go new file mode 100644 index 000000000000..0090e82b73bc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/version.go @@ -0,0 +1,12 @@ +package volumesreplication + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-01-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/volumesreplication/%s", defaultApiVersion) +} diff --git a/vendor/golang.org/x/crypto/curve25519/curve25519.go b/vendor/golang.org/x/crypto/curve25519/curve25519.go index cda3fdd3540d..bc62161d6e42 100644 --- a/vendor/golang.org/x/crypto/curve25519/curve25519.go +++ b/vendor/golang.org/x/crypto/curve25519/curve25519.go @@ -9,7 +9,8 @@ package curve25519 // import "golang.org/x/crypto/curve25519" import ( "crypto/subtle" - "fmt" + "errors" + "strconv" "golang.org/x/crypto/curve25519/internal/field" ) @@ -124,10 +125,10 @@ func X25519(scalar, point []byte) ([]byte, error) { func x25519(dst *[32]byte, scalar, point []byte) ([]byte, error) { var in [32]byte if l := len(scalar); l != 32 { - return nil, fmt.Errorf("bad scalar length: %d, expected %d", l, 32) + return nil, errors.New("bad scalar length: " + strconv.Itoa(l) + ", expected 32") } if l := len(point); l != 32 { - return nil, fmt.Errorf("bad point length: %d, expected %d", l, 32) + return nil, errors.New("bad point length: " + strconv.Itoa(l) + ", expected 32") } copy(in[:], scalar) if &point[0] == &Basepoint[0] { @@ -138,7 +139,7 @@ func x25519(dst *[32]byte, scalar, point []byte) ([]byte, error) { copy(base[:], point) ScalarMult(dst, &in, &base) if subtle.ConstantTimeCompare(dst[:], zero[:]) == 1 { - return nil, fmt.Errorf("bad input point: low order point") + return nil, errors.New("bad input point: low order point") } } return dst[:], nil diff --git a/vendor/modules.txt b/vendor/modules.txt index dbda48ba9fbe..ffb99a51a2d3 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -101,7 +101,7 @@ github.com/Azure/go-autorest ## explicit; go 1.15 github.com/Azure/go-autorest/autorest github.com/Azure/go-autorest/autorest/azure -# github.com/Azure/go-autorest/autorest/adal v0.9.18 +# github.com/Azure/go-autorest/autorest/adal v0.9.20 ## explicit; go 1.15 github.com/Azure/go-autorest/autorest/adal # github.com/Azure/go-autorest/autorest/azure/cli v0.4.5 @@ -149,7 +149,7 @@ github.com/fatih/color # github.com/gofrs/uuid v4.0.0+incompatible ## explicit github.com/gofrs/uuid -# github.com/golang-jwt/jwt/v4 v4.4.1 +# github.com/golang-jwt/jwt/v4 v4.4.2 ## explicit; go 1.16 github.com/golang-jwt/jwt/v4 # github.com/golang/protobuf v1.5.2 @@ -174,7 +174,7 @@ github.com/google/uuid # github.com/hashicorp/errwrap v1.1.0 ## explicit github.com/hashicorp/errwrap -# github.com/hashicorp/go-azure-helpers v0.37.0 +# github.com/hashicorp/go-azure-helpers v0.38.0 ## explicit; go 1.17 github.com/hashicorp/go-azure-helpers/authentication github.com/hashicorp/go-azure-helpers/lang/dates @@ -245,7 +245,13 @@ github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication +github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools +github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts +github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy +github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups +github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes +github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication github.com/hashicorp/go-azure-sdk/resource-manager/notificationhubs/2017-04-01/namespaces github.com/hashicorp/go-azure-sdk/resource-manager/notificationhubs/2017-04-01/notificationhubs github.com/hashicorp/go-azure-sdk/resource-manager/policyinsights/2021-10-01/policyinsights @@ -494,7 +500,7 @@ github.com/zclconf/go-cty/cty/function/stdlib github.com/zclconf/go-cty/cty/gocty github.com/zclconf/go-cty/cty/json github.com/zclconf/go-cty/cty/set -# golang.org/x/crypto v0.0.0-20220517005047-85d78b3ac167 +# golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d ## explicit; go 1.17 golang.org/x/crypto/blowfish golang.org/x/crypto/cast5 From cde1591116d059e652c3fd0fc6bc151135f91fe0 Mon Sep 17 00:00:00 2001 From: Paulo Date: Fri, 15 Jul 2022 15:33:14 -0700 Subject: [PATCH 11/83] fixing client and removing tags --- internal/services/netapp/client/client.go | 14 +++++++------- .../netapp/netapp_volume_group_resource.go | 16 ---------------- 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/internal/services/netapp/client/client.go b/internal/services/netapp/client/client.go index 4c640edc193a..7b4cda3d84a0 100644 --- a/internal/services/netapp/client/client.go +++ b/internal/services/netapp/client/client.go @@ -1,13 +1,13 @@ package client import ( - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication" "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/netapp/netapp_volume_group_resource.go b/internal/services/netapp/netapp_volume_group_resource.go index 7f1ff4ae02ca..3ed33c59be0d 100644 --- a/internal/services/netapp/netapp_volume_group_resource.go +++ b/internal/services/netapp/netapp_volume_group_resource.go @@ -7,7 +7,6 @@ import ( "time" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" - "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" @@ -28,7 +27,6 @@ type NetAppVolumeGroupModel struct { ApplicationType string `tfschema:"application_type"` ApplicationIdentifier string `tfschema:"application_identifier"` DeploymentSpecId string `tfschema:"deployment_spec_id"` - Tags map[string]interface{} `tfschema:"tags"` Volumes []NetAppVolumeGroupVolume `tfschema:"volume"` } @@ -104,18 +102,6 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { Schema: netAppVolumeGroupVolumeSchema(), }, }, - - // Can't use tags.Schema since there is no patch available - "tags": { - Type: pluginsdk.TypeMap, - Optional: true, - ForceNew: true, - Elem: &pluginsdk.Schema{ - Type: pluginsdk.TypeString, - }, - }, - - //"tags": commonschema.Tags(), } } @@ -172,7 +158,6 @@ func (r NetAppVolumeGroupResource) Create() sdk.ResourceFunc { }, Volumes: volumeList, }, - Tags: tags.Expand(model.Tags), } err = client.VolumeGroupsCreateThenPoll(ctx, id, parameters) @@ -224,7 +209,6 @@ func (r NetAppVolumeGroupResource) Read() sdk.ResourceFunc { AccountName: id.AccountName, Location: location.NormalizeNilable(existing.Model.Location), ResourceGroupName: id.ResourceGroupName, - Tags: tags.Flatten(existing.Model.Tags), } if props := existing.Model.Properties; props != nil { From 17dd569baa5084c64a1a292bc7a55caca46f74c7 Mon Sep 17 00:00:00 2001 From: Paulo Date: Mon, 18 Jul 2022 14:06:12 -0700 Subject: [PATCH 12/83] WIP --- internal/services/netapp/netapp_volume.go | 26 ++++++++++++++++--- .../netapp/netapp_volume_group_resource.go | 4 ++- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/internal/services/netapp/netapp_volume.go b/internal/services/netapp/netapp_volume.go index 641c9f9dc60b..26e13227e0e9 100644 --- a/internal/services/netapp/netapp_volume.go +++ b/internal/services/netapp/netapp_volume.go @@ -553,7 +553,7 @@ func expandNetAppVolumeGroupVolumes(input []NetAppVolumeGroupVolume, id volumegr return &results, nil } -func flattenNetAppVolumeGroupVolumes(input *[]volumegroups.VolumeGroupVolumeProperties) ([]NetAppVolumeGroupVolume, error) { +func flattenNetAppVolumeGroupVolumes(input *[]volumegroups.VolumeGroupVolumeProperties, state []NetAppVolumeGroupVolume) ([]NetAppVolumeGroupVolume, error) { results := make([]NetAppVolumeGroupVolume, 0) if len(*input) == 0 || input == nil { @@ -561,15 +561,23 @@ func flattenNetAppVolumeGroupVolumes(input *[]volumegroups.VolumeGroupVolumeProp } for _, item := range *input { - volumeGroupVolume := NetAppVolumeGroupVolume{} + volumeName := getResourceNameString(item.Name) + stateVolumeIndex := getVolumeIndexbyName(state, volumeName) - volumeGroupVolume.Name = getResourceNameString(item.Name) + volumeGroupVolume := NetAppVolumeGroupVolume{} props := item.Properties + volumeGroupVolume.Name = volumeName volumeGroupVolume.VolumePath = props.CreationToken volumeGroupVolume.ServiceLevel = string(*props.ServiceLevel) - volumeGroupVolume.SubnetId = props.SubnetId + + subnetId := state[stateVolumeIndex].SubnetId + volumeGroupVolume.SubnetId = subnetId + + capacityPoolId := state[stateVolumeIndex].CapacityPoolId + volumeGroupVolume.CapacityPoolId = capacityPoolId + volumeGroupVolume.NetworkFeatures = getNetworkFeaturesString(props.NetworkFeatures) volumeGroupVolume.Protocols = *props.ProtocolTypes volumeGroupVolume.SecurityStyle = string(*props.SecurityStyle) @@ -708,3 +716,13 @@ func getResourceNameString(input *string) string { return strings.Split(*input, "/")[segments-1] } + +func getVolumeIndexbyName(input []NetAppVolumeGroupVolume, volumeName string) int { + for i, item := range input { + if item.Name == volumeName { + return i + } + } + + return -1 +} diff --git a/internal/services/netapp/netapp_volume_group_resource.go b/internal/services/netapp/netapp_volume_group_resource.go index 3ed33c59be0d..2eb4a4c06959 100644 --- a/internal/services/netapp/netapp_volume_group_resource.go +++ b/internal/services/netapp/netapp_volume_group_resource.go @@ -215,8 +215,10 @@ func (r NetAppVolumeGroupResource) Read() sdk.ResourceFunc { model.GroupDescription = utils.NormalizeNilableString(props.GroupMetaData.GroupDescription) model.ApplicationIdentifier = utils.NormalizeNilableString(props.GroupMetaData.ApplicationIdentifier) model.DeploymentSpecId = utils.NormalizeNilableString(props.GroupMetaData.DeploymentSpecId) + model.ApplicationType = string(*props.GroupMetaData.ApplicationType) + model.DeploymentSpecId = state.DeploymentSpecId - volumes, err := flattenNetAppVolumeGroupVolumes(props.Volumes) + volumes, err := flattenNetAppVolumeGroupVolumes(props.Volumes, state.Volumes) if err != nil { return fmt.Errorf("setting `volume`: %+v", err) } From d8937c4ba778fae83a35ff76caa304c50a58d9e3 Mon Sep 17 00:00:00 2001 From: Paulo Date: Mon, 18 Jul 2022 18:55:38 -0700 Subject: [PATCH 13/83] WIP: adding missing properties to flatten function --- internal/services/netapp/netapp_volume.go | 13 +- .../netapp/netapp_volume_group_resource.go | 281 +++++++++++++++++- 2 files changed, 286 insertions(+), 8 deletions(-) diff --git a/internal/services/netapp/netapp_volume.go b/internal/services/netapp/netapp_volume.go index 26e13227e0e9..4f323b8def3e 100644 --- a/internal/services/netapp/netapp_volume.go +++ b/internal/services/netapp/netapp_volume.go @@ -571,18 +571,17 @@ func flattenNetAppVolumeGroupVolumes(input *[]volumegroups.VolumeGroupVolumeProp volumeGroupVolume.Name = volumeName volumeGroupVolume.VolumePath = props.CreationToken volumeGroupVolume.ServiceLevel = string(*props.ServiceLevel) - - subnetId := state[stateVolumeIndex].SubnetId - volumeGroupVolume.SubnetId = subnetId - - capacityPoolId := state[stateVolumeIndex].CapacityPoolId - volumeGroupVolume.CapacityPoolId = capacityPoolId - + volumeGroupVolume.SubnetId = utils.NormalizeNilableString(&state[stateVolumeIndex].SubnetId) + volumeGroupVolume.CapacityPoolId = utils.NormalizeNilableString(&state[stateVolumeIndex].CapacityPoolId) volumeGroupVolume.NetworkFeatures = getNetworkFeaturesString(props.NetworkFeatures) volumeGroupVolume.Protocols = *props.ProtocolTypes volumeGroupVolume.SecurityStyle = string(*props.SecurityStyle) volumeGroupVolume.SnapshotDirectoryVisible = *props.SnapshotDirectoryVisible volumeGroupVolume.ThroughputInMibps = float64(*props.ThroughputMibps) + volumeGroupVolume.CreateFromSnapshotResourceId = utils.NormalizeNilableString(&state[stateVolumeIndex].CreateFromSnapshotResourceId) + volumeGroupVolume.Tags = *item.Tags + volumeGroupVolume.ProximityPlacementGroupId = utils.NormalizeNilableString(props.ProximityPlacementGroup) + volumeGroupVolume.VolumeSpecName = string(*props.VolumeSpecName) if int64(props.UsageThreshold) > 0 { usageThreshold := int64(props.UsageThreshold) / 1073741824 diff --git a/internal/services/netapp/netapp_volume_group_resource.go b/internal/services/netapp/netapp_volume_group_resource.go index 2eb4a4c06959..88b7ffc1a11e 100644 --- a/internal/services/netapp/netapp_volume_group_resource.go +++ b/internal/services/netapp/netapp_volume_group_resource.go @@ -6,12 +6,16 @@ import ( "net/http" "time" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots" "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" + "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" netAppValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/netapp/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/suppress" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" ) @@ -99,7 +103,282 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { MinItems: 5, MaxItems: 5, Elem: &pluginsdk.Resource{ - Schema: netAppVolumeGroupVolumeSchema(), + //Schema: netAppVolumeGroupVolumeSchema(), + Schema: map[string]*pluginsdk.Schema{ + "name": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: netAppValidate.VolumeName, + }, + + "capacity_pool_id": { + Type: pluginsdk.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + DiffSuppressFunc: suppress.CaseDifference, + ValidateFunc: azure.ValidateResourceID, + }, + + "proximity_placement_group_id": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + DiffSuppressFunc: suppress.CaseDifference, + ValidateFunc: azure.ValidateResourceID, + }, + + "volume_spec_name": { + Type: pluginsdk.TypeString, + Required: true, + }, + + "volume_path": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: netAppValidate.VolumePath, + }, + + "service_level": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.StringInSlice([]string{ + string(volumegroups.ServiceLevelPremium), + string(volumegroups.ServiceLevelStandard), + string(volumegroups.ServiceLevelUltra), + }, false), + }, + + "subnet_id": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: azure.ValidateResourceID, + }, + + "create_from_snapshot_resource_id": { + Type: pluginsdk.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + ValidateFunc: snapshots.ValidateSnapshotID, + }, + + "network_features": { + Type: pluginsdk.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + ValidateFunc: validation.StringInSlice([]string{ + string(volumegroups.NetworkFeaturesBasic), + string(volumegroups.NetworkFeaturesStandard), + }, false), + }, + + "protocols": { + Type: pluginsdk.TypeSet, + ForceNew: true, + Optional: true, + Computed: true, + MaxItems: 2, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeString, + ValidateFunc: validation.StringInSlice([]string{ + "NFSv3", + "NFSv4.1", + "CIFS", + }, false), + }, + }, + + "security_style": { + Type: pluginsdk.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + ValidateFunc: validation.StringInSlice([]string{ + "Unix", // Using hardcoded values instead of SDK enum since no matter what case is passed, + "Ntfs", // ANF changes casing to Pascal case in the backend. Please refer to https://github.com/Azure/azure-sdk-for-go/issues/14684 + }, false), + }, + + "storage_quota_in_gb": { + Type: pluginsdk.TypeInt, + Required: true, + ValidateFunc: validation.IntBetween(100, 102400), + }, + + "throughput_in_mibps": { + Type: pluginsdk.TypeFloat, + Optional: true, + Computed: true, + }, + + "export_policy_rule": { + Type: pluginsdk.TypeList, + Optional: true, + MaxItems: 5, + Elem: &pluginsdk.Resource{ + Schema: map[string]*pluginsdk.Schema{ + "rule_index": { + Type: pluginsdk.TypeInt, + Required: true, + ValidateFunc: validation.IntBetween(1, 5), + }, + + "allowed_clients": { + Type: pluginsdk.TypeSet, + Required: true, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeString, + ValidateFunc: validate.CIDR, + }, + }, + + "protocols_enabled": { + Type: pluginsdk.TypeList, + Optional: true, + Computed: true, + MaxItems: 1, + MinItems: 1, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeString, + ValidateFunc: validation.StringInSlice([]string{ + "NFSv3", + "NFSv4.1", + "CIFS", + }, false), + }, + }, + + "unix_read_only": { + Type: pluginsdk.TypeBool, + Optional: true, + Computed: true, + }, + + "unix_read_write": { + Type: pluginsdk.TypeBool, + Optional: true, + Computed: true, + }, + + "root_access_enabled": { + Type: pluginsdk.TypeBool, + Optional: true, + Computed: true, + }, + + "kerberos5_read_only": { + Type: pluginsdk.TypeBool, + Optional: true, + Computed: true, + }, + + "kerberos5_read_write": { + Type: pluginsdk.TypeBool, + Optional: true, + Computed: true, + }, + + "kerberos5i_read_only": { + Type: pluginsdk.TypeBool, + Optional: true, + Computed: true, + }, + + "kerberos5i_read_write": { + Type: pluginsdk.TypeBool, + Optional: true, + Computed: true, + }, + + "kerberos5p_read_only": { + Type: pluginsdk.TypeBool, + Optional: true, + Computed: true, + }, + + "kerberos5p_read_write": { + Type: pluginsdk.TypeBool, + Optional: true, + Computed: true, + }, + }, + }, + }, + + "tags": commonschema.Tags(), + + "mount_ip_addresses": { + Type: pluginsdk.TypeList, + Computed: true, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeString, + }, + }, + + "snapshot_directory_visible": { + Type: pluginsdk.TypeBool, + Optional: true, + Computed: true, + }, + + "data_protection_replication": { + Type: pluginsdk.TypeList, + Optional: true, + MaxItems: 1, + ForceNew: true, + Elem: &pluginsdk.Resource{ + Schema: map[string]*pluginsdk.Schema{ + "endpoint_type": { + Type: pluginsdk.TypeString, + Optional: true, + Default: "dst", + ValidateFunc: validation.StringInSlice([]string{ + "dst", + }, false), + }, + + "remote_volume_location": azure.SchemaLocation(), + + "remote_volume_resource_id": { + Type: pluginsdk.TypeString, + Required: true, + ValidateFunc: azure.ValidateResourceID, + }, + + "replication_frequency": { + Type: pluginsdk.TypeString, + Required: true, + ValidateFunc: validation.StringInSlice([]string{ + "10minutes", + "daily", + "hourly", + }, false), + }, + }, + }, + }, + + "data_protection_snapshot_policy": { + Type: pluginsdk.TypeList, + Optional: true, + MaxItems: 1, + Elem: &pluginsdk.Resource{ + Schema: map[string]*pluginsdk.Schema{ + "snapshot_policy_id": { + Type: pluginsdk.TypeString, + Required: true, + ValidateFunc: azure.ValidateResourceID, + }, + }, + }, + }, + }, }, }, } From 5bcfb986a5f34a4b8ee0847bcf0101d81c79bc5a Mon Sep 17 00:00:00 2001 From: Paulo Date: Tue, 19 Jul 2022 10:32:09 -0700 Subject: [PATCH 14/83] Setting type set back --- internal/services/netapp/netapp_volume_group_resource.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/services/netapp/netapp_volume_group_resource.go b/internal/services/netapp/netapp_volume_group_resource.go index 88b7ffc1a11e..b63d03c99efd 100644 --- a/internal/services/netapp/netapp_volume_group_resource.go +++ b/internal/services/netapp/netapp_volume_group_resource.go @@ -97,7 +97,7 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { }, "volume": { - Type: pluginsdk.TypeList, + Type: pluginsdk.TypeSet, Required: true, ForceNew: true, MinItems: 5, From 2e1b6b6e470918c709353d5bbb157fab0fcc7467 Mon Sep 17 00:00:00 2001 From: Paulo Date: Thu, 21 Jul 2022 11:52:26 -0700 Subject: [PATCH 15/83] WIP: making all lists being Set and removing al computed attributes and bare-minimum resource config --- internal/services/netapp/netapp_volume.go | 461 +----------------- .../netapp/netapp_volume_group_resource.go | 174 ++----- .../netapp_volume_group_resource_test.go | 40 +- .../services/netapp/netapp_volume_resource.go | 276 ++++++++++- 4 files changed, 375 insertions(+), 576 deletions(-) diff --git a/internal/services/netapp/netapp_volume.go b/internal/services/netapp/netapp_volume.go index 4f323b8def3e..559d9691857b 100644 --- a/internal/services/netapp/netapp_volume.go +++ b/internal/services/netapp/netapp_volume.go @@ -4,365 +4,33 @@ import ( "fmt" "strings" - "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots" "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes" - "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" - "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" - netAppValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/netapp/validate" - "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" - "github.com/hashicorp/terraform-provider-azurerm/internal/tf/suppress" - "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" ) -func netAppVolumeCommonSchema() map[string]*pluginsdk.Schema { - return map[string]*pluginsdk.Schema{ - "name": { - Type: pluginsdk.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: netAppValidate.VolumeName, - }, - - "volume_path": { - Type: pluginsdk.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: netAppValidate.VolumePath, - }, - - "service_level": { - Type: pluginsdk.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validation.StringInSlice([]string{ - string(volumes.ServiceLevelPremium), - string(volumes.ServiceLevelStandard), - string(volumes.ServiceLevelUltra), - }, false), - }, - - "subnet_id": { - Type: pluginsdk.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: azure.ValidateResourceID, - }, - - "create_from_snapshot_resource_id": { - Type: pluginsdk.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ValidateFunc: snapshots.ValidateSnapshotID, - }, - - "network_features": { - Type: pluginsdk.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ValidateFunc: validation.StringInSlice([]string{ - string(volumes.NetworkFeaturesBasic), - string(volumes.NetworkFeaturesStandard), - }, false), - }, - - "protocols": { - Type: pluginsdk.TypeSet, - ForceNew: true, - Optional: true, - Computed: true, - MaxItems: 2, - Elem: &pluginsdk.Schema{ - Type: pluginsdk.TypeString, - ValidateFunc: validation.StringInSlice([]string{ - "NFSv3", - "NFSv4.1", - "CIFS", - }, false), - }, - }, - - "security_style": { - Type: pluginsdk.TypeString, - Optional: true, - ForceNew: true, - Computed: true, - ValidateFunc: validation.StringInSlice([]string{ - "Unix", // Using hardcoded values instead of SDK enum since no matter what case is passed, - "Ntfs", // ANF changes casing to Pascal case in the backend. Please refer to https://github.com/Azure/azure-sdk-for-go/issues/14684 - }, false), - }, - - "storage_quota_in_gb": { - Type: pluginsdk.TypeInt, - Required: true, - ValidateFunc: validation.IntBetween(100, 102400), - }, - - "throughput_in_mibps": { - Type: pluginsdk.TypeFloat, - Optional: true, - Computed: true, - }, - - "export_policy_rule": { - Type: pluginsdk.TypeList, - Optional: true, - MaxItems: 5, - Elem: &pluginsdk.Resource{ - Schema: map[string]*pluginsdk.Schema{ - "rule_index": { - Type: pluginsdk.TypeInt, - Required: true, - ValidateFunc: validation.IntBetween(1, 5), - }, - - "allowed_clients": { - Type: pluginsdk.TypeSet, - Required: true, - Elem: &pluginsdk.Schema{ - Type: pluginsdk.TypeString, - ValidateFunc: validate.CIDR, - }, - }, - - "protocols_enabled": { - Type: pluginsdk.TypeList, - Optional: true, - Computed: true, - MaxItems: 1, - MinItems: 1, - Elem: &pluginsdk.Schema{ - Type: pluginsdk.TypeString, - ValidateFunc: validation.StringInSlice([]string{ - "NFSv3", - "NFSv4.1", - "CIFS", - }, false), - }, - }, - - "unix_read_only": { - Type: pluginsdk.TypeBool, - Optional: true, - Computed: true, - }, - - "unix_read_write": { - Type: pluginsdk.TypeBool, - Optional: true, - Computed: true, - }, - - "root_access_enabled": { - Type: pluginsdk.TypeBool, - Optional: true, - Computed: true, - }, - - "kerberos5_read_only": { - Type: pluginsdk.TypeBool, - Optional: true, - Computed: true, - }, - - "kerberos5_read_write": { - Type: pluginsdk.TypeBool, - Optional: true, - Computed: true, - }, - - "kerberos5i_read_only": { - Type: pluginsdk.TypeBool, - Optional: true, - Computed: true, - }, - - "kerberos5i_read_write": { - Type: pluginsdk.TypeBool, - Optional: true, - Computed: true, - }, - - "kerberos5p_read_only": { - Type: pluginsdk.TypeBool, - Optional: true, - Computed: true, - }, - - "kerberos5p_read_write": { - Type: pluginsdk.TypeBool, - Optional: true, - Computed: true, - }, - }, - }, - }, - - "tags": commonschema.Tags(), - - "mount_ip_addresses": { - Type: pluginsdk.TypeList, - Computed: true, - Elem: &pluginsdk.Schema{ - Type: pluginsdk.TypeString, - }, - }, - - "snapshot_directory_visible": { - Type: pluginsdk.TypeBool, - Optional: true, - Computed: true, - }, - - "data_protection_replication": { - Type: pluginsdk.TypeList, - Optional: true, - MaxItems: 1, - ForceNew: true, - Elem: &pluginsdk.Resource{ - Schema: map[string]*pluginsdk.Schema{ - "endpoint_type": { - Type: pluginsdk.TypeString, - Optional: true, - Default: "dst", - ValidateFunc: validation.StringInSlice([]string{ - "dst", - }, false), - }, - - "remote_volume_location": azure.SchemaLocation(), - - "remote_volume_resource_id": { - Type: pluginsdk.TypeString, - Required: true, - ValidateFunc: azure.ValidateResourceID, - }, - - "replication_frequency": { - Type: pluginsdk.TypeString, - Required: true, - ValidateFunc: validation.StringInSlice([]string{ - "10minutes", - "daily", - "hourly", - }, false), - }, - }, - }, - }, - - "data_protection_snapshot_policy": { - Type: pluginsdk.TypeList, - Optional: true, - MaxItems: 1, - Elem: &pluginsdk.Resource{ - Schema: map[string]*pluginsdk.Schema{ - "snapshot_policy_id": { - Type: pluginsdk.TypeString, - Required: true, - ValidateFunc: azure.ValidateResourceID, - }, - }, - }, - }, - } -} - -func netAppVolumeSchema() map[string]*pluginsdk.Schema { - return mergeSchemas(netAppVolumeCommonSchema(), map[string]*pluginsdk.Schema{ - "resource_group_name": azure.SchemaResourceGroupName(), - - "location": azure.SchemaLocation(), - - "account_name": { - Type: pluginsdk.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: netAppValidate.AccountName, - }, - - "pool_name": { - Type: pluginsdk.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: netAppValidate.PoolName, - }, - }) -} - -func netAppVolumeGroupVolumeSchema() map[string]*pluginsdk.Schema { - return mergeSchemas(netAppVolumeCommonSchema(), map[string]*pluginsdk.Schema{ - "capacity_pool_id": { - Type: pluginsdk.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - DiffSuppressFunc: suppress.CaseDifference, - ValidateFunc: azure.ValidateResourceID, - }, - - "proximity_placement_group_id": { - Type: pluginsdk.TypeString, - Required: true, - ForceNew: true, - DiffSuppressFunc: suppress.CaseDifference, - ValidateFunc: azure.ValidateResourceID, - }, - - "volume_spec_name": { - Type: pluginsdk.TypeString, - Required: true, - ForceNew: true, - }, - }) -} - -func mergeSchemas(schemas ...map[string]*pluginsdk.Schema) map[string]*pluginsdk.Schema { - - result := map[string]*pluginsdk.Schema{} - - for _, schema := range schemas { - for k, v := range schema { - if result[k] == nil { - result[k] = v - } - } - } - - return result -} - type NetAppVolumeGroupVolume struct { - Name string `tfschema:"name"` - VolumePath string `tfschema:"volume_path"` - ServiceLevel string `tfschema:"service_level"` - SubnetId string `tfschema:"subnet_id"` - CreateFromSnapshotResourceId string `tfschema:"create_from_snapshot_resource_id"` - NetworkFeatures string `tfschema:"network_features"` - Protocols []string `tfschema:"protocols"` - SecurityStyle string `tfschema:"security_style"` - StorageQuotaInGB int64 `tfschema:"storage_quota_in_gb"` - ThroughputInMibps float64 `tfschema:"throughput_in_mibps"` - Tags map[string]string `tfschema:"tags"` - MountIpAddresses []string `tfschema:"mount_ip_addresses"` - SnapshotDirectoryVisible bool `tfschema:"snapshot_directory_visible"` - CapacityPoolId string `tfschema:"capacity_pool_id"` - ProximityPlacementGroupId string `tfschema:"proximity_placement_group_id"` - VolumeSpecName string `tfschema:"volume_spec_name"` - ExportPolicy []ExportPolicyRule `tfschema:"export_policy_rule"` - DataProtectionReplication []DataProtectionReplication `tfschema:"data_protection_replication"` - DataProtectionSnapshotPolicy []DataProtectionSnapshotPolicy `tfschema:"data_protection_snapshot_policy"` + Name string `tfschema:"name"` + VolumePath string `tfschema:"volume_path"` + ServiceLevel string `tfschema:"service_level"` + SubnetId string `tfschema:"subnet_id"` + Protocols []string `tfschema:"protocols"` + SecurityStyle string `tfschema:"security_style"` + StorageQuotaInGB int64 `tfschema:"storage_quota_in_gb"` + ThroughputInMibps float64 `tfschema:"throughput_in_mibps"` + Tags map[string]string `tfschema:"tags"` + SnapshotDirectoryVisible bool `tfschema:"snapshot_directory_visible"` + CapacityPoolId string `tfschema:"capacity_pool_id"` + ProximityPlacementGroupId string `tfschema:"proximity_placement_group_id"` + VolumeSpecName string `tfschema:"volume_spec_name"` + ExportPolicy []ExportPolicyRule `tfschema:"export_policy_rule"` } type ExportPolicyRule struct { RuleIndex int `tfschema:"rule_index"` AllowedClients []string `tfschema:"allowed_clients"` - ProtocolsEnabled []string `tfschema:"protocols_enabled"` + CifsEnabled bool `tfschema:"cifs_enabled"` + Nfsv3Enabled bool `tfschema:"nfsv3_enabled"` + Nfsv41Enabled bool `tfschema:"nfsv41_enabled"` UnixReadOnly bool `tfschema:"unix_read_only"` UnixReadWrite bool `tfschema:"unix_read_write"` RootAccessEnabled bool `tfschema:"root_access_enabled"` @@ -394,30 +62,11 @@ func expandNetAppVolumeGroupExportPolicyRule(input []ExportPolicyRule) *volumegr results := make([]volumegroups.ExportPolicyRule, 0) for _, item := range input { - cifsEnabled := false - nfsv3Enabled := false - nfsv41Enabled := false - - if len(item.ProtocolsEnabled) != 0 { - for _, protocol := range item.ProtocolsEnabled { - if protocol != "" { - switch strings.ToLower(protocol) { - case "cifs": - cifsEnabled = true - case "nfsv3": - nfsv3Enabled = true - case "nfsv4.1": - nfsv41Enabled = true - } - } - } - } - result := volumegroups.ExportPolicyRule{ AllowedClients: utils.String(strings.Join(item.AllowedClients, ",")), - Cifs: utils.Bool(cifsEnabled), - Nfsv3: utils.Bool(nfsv3Enabled), - Nfsv41: utils.Bool(nfsv41Enabled), + Cifs: utils.Bool(item.CifsEnabled), + Nfsv3: utils.Bool(item.Nfsv3Enabled), + Nfsv41: utils.Bool(item.Nfsv41Enabled), RuleIndex: utils.Int64(int64(item.RuleIndex)), UnixReadOnly: utils.Bool(item.UnixReadOnly), UnixReadWrite: utils.Bool(item.UnixReadWrite), @@ -486,16 +135,7 @@ func expandNetAppVolumeGroupVolumes(input []NetAppVolumeGroupVolume, id volumegr serviceLevel := volumegroups.ServiceLevel(item.ServiceLevel) subnetID := item.SubnetId capacityPoolID := item.CapacityPoolId - - networkFeatures := volumegroups.NetworkFeatures(item.NetworkFeatures) - if networkFeatures == "" { - networkFeatures = volumegroups.NetworkFeaturesBasic - } - protocols := item.Protocols - if len(protocols) == 0 { - protocols = append(protocols, "NFSv3") - } // Handling security style property securityStyle := volumegroups.SecurityStyle(item.SecurityStyle) @@ -509,18 +149,6 @@ func expandNetAppVolumeGroupVolumes(input []NetAppVolumeGroupVolume, id volumegr storageQuotaInGB := int64(item.StorageQuotaInGB * 1073741824) exportPolicyRule := expandNetAppVolumeGroupExportPolicyRule(item.ExportPolicy) - dataProtectionReplication := expandNetAppVolumeGroupDataProtectionReplication(item.DataProtectionReplication) - dataProtectionSnapshotPolicy := expandNetAppVolumeGroupDataProtectionSnapshotPolicy(item.DataProtectionSnapshotPolicy) - - volumeType := "" - if dataProtectionReplication != nil && dataProtectionReplication.Replication != nil && strings.ToLower(string(*dataProtectionReplication.Replication.EndpointType)) == "dst" { - volumeType = "DataProtection" - } - - // Validating that snapshot policies are not being created in a data protection volume - if dataProtectionSnapshotPolicy != nil && volumeType != "" { - return &[]volumegroups.VolumeGroupVolumeProperties{}, fmt.Errorf("snapshot policy cannot be enabled on a data protection volume for %s", id) - } volumeProperties := &volumegroups.VolumeGroupVolumeProperties{ Name: utils.String(name), @@ -529,20 +157,13 @@ func expandNetAppVolumeGroupVolumes(input []NetAppVolumeGroupVolume, id volumegr CreationToken: volumePath, ServiceLevel: &serviceLevel, SubnetId: subnetID, - NetworkFeatures: &networkFeatures, ProtocolTypes: &protocols, SecurityStyle: &securityStyle, UsageThreshold: storageQuotaInGB, ExportPolicy: exportPolicyRule, - VolumeType: utils.String(volumeType), ThroughputMibps: utils.Float(float64(item.ThroughputInMibps)), ProximityPlacementGroup: utils.String(item.ProximityPlacementGroupId), VolumeSpecName: utils.String(item.VolumeSpecName), - DataProtection: &volumegroups.VolumePropertiesDataProtection{ - Replication: dataProtectionReplication.Replication, - Snapshot: dataProtectionSnapshotPolicy.Snapshot, - }, - SnapshotDirectoryVisible: &item.SnapshotDirectoryVisible, }, Tags: &item.Tags, } @@ -553,7 +174,7 @@ func expandNetAppVolumeGroupVolumes(input []NetAppVolumeGroupVolume, id volumegr return &results, nil } -func flattenNetAppVolumeGroupVolumes(input *[]volumegroups.VolumeGroupVolumeProperties, state []NetAppVolumeGroupVolume) ([]NetAppVolumeGroupVolume, error) { +func flattenNetAppVolumeGroupVolumes(input *[]volumegroups.VolumeGroupVolumeProperties) ([]NetAppVolumeGroupVolume, error) { results := make([]NetAppVolumeGroupVolume, 0) if len(*input) == 0 || input == nil { @@ -561,24 +182,19 @@ func flattenNetAppVolumeGroupVolumes(input *[]volumegroups.VolumeGroupVolumeProp } for _, item := range *input { - volumeName := getResourceNameString(item.Name) - stateVolumeIndex := getVolumeIndexbyName(state, volumeName) - volumeGroupVolume := NetAppVolumeGroupVolume{} props := item.Properties - volumeGroupVolume.Name = volumeName + volumeGroupVolume.Name = string(*item.Name) volumeGroupVolume.VolumePath = props.CreationToken volumeGroupVolume.ServiceLevel = string(*props.ServiceLevel) - volumeGroupVolume.SubnetId = utils.NormalizeNilableString(&state[stateVolumeIndex].SubnetId) - volumeGroupVolume.CapacityPoolId = utils.NormalizeNilableString(&state[stateVolumeIndex].CapacityPoolId) - volumeGroupVolume.NetworkFeatures = getNetworkFeaturesString(props.NetworkFeatures) + volumeGroupVolume.SubnetId = props.SubnetId + volumeGroupVolume.CapacityPoolId = utils.NormalizeNilableString(props.CapacityPoolResourceId) volumeGroupVolume.Protocols = *props.ProtocolTypes volumeGroupVolume.SecurityStyle = string(*props.SecurityStyle) volumeGroupVolume.SnapshotDirectoryVisible = *props.SnapshotDirectoryVisible volumeGroupVolume.ThroughputInMibps = float64(*props.ThroughputMibps) - volumeGroupVolume.CreateFromSnapshotResourceId = utils.NormalizeNilableString(&state[stateVolumeIndex].CreateFromSnapshotResourceId) volumeGroupVolume.Tags = *item.Tags volumeGroupVolume.ProximityPlacementGroupId = utils.NormalizeNilableString(props.ProximityPlacementGroup) volumeGroupVolume.VolumeSpecName = string(*props.VolumeSpecName) @@ -592,18 +208,6 @@ func flattenNetAppVolumeGroupVolumes(input *[]volumegroups.VolumeGroupVolumeProp volumeGroupVolume.ExportPolicy = flattenNetAppVolumeGroupVolumesExportPolicies(props.ExportPolicy.Rules) } - if props.MountTargets != nil && len(*props.MountTargets) > 0 { - volumeGroupVolume.MountIpAddresses = flattenNetAppVolumeGroupVolumesMountIpAddresses(props.MountTargets) - } - - if props.DataProtection != nil && props.DataProtection.Replication != nil { - volumeGroupVolume.DataProtectionReplication = flattenNetAppVolumeGroupVolumesDPReplication(props.DataProtection.Replication) - } - - if props.DataProtection != nil && props.DataProtection.Snapshot != nil { - volumeGroupVolume.DataProtectionSnapshotPolicy = flattenNetAppVolumeGroupVolumesDPSnapshotPolicy(props.DataProtection.Snapshot) - } - results = append(results, volumeGroupVolume) } @@ -622,19 +226,9 @@ func flattenNetAppVolumeGroupVolumesExportPolicies(input *[]volumegroups.ExportP rule.RuleIndex = int(*item.RuleIndex) rule.AllowedClients = strings.Split(*item.AllowedClients, ",") - - protocolsEnabled := []string{} - if *item.Cifs { - protocolsEnabled = append(protocolsEnabled, "CIFS") - } - if *item.Nfsv3 { - protocolsEnabled = append(protocolsEnabled, "NFSv3") - } - if *item.Nfsv41 { - protocolsEnabled = append(protocolsEnabled, "NFSv4.1") - } - rule.ProtocolsEnabled = protocolsEnabled - + rule.CifsEnabled = *item.Cifs + rule.Nfsv3Enabled = *item.Nfsv3 + rule.Nfsv41Enabled = *item.Nfsv41 rule.UnixReadOnly = *item.UnixReadOnly rule.UnixReadWrite = *item.UnixReadWrite rule.Kerberos5ReadOnly = *item.Kerberos5ReadOnly @@ -643,7 +237,6 @@ func flattenNetAppVolumeGroupVolumesExportPolicies(input *[]volumegroups.ExportP rule.Kerberos5iReadWrite = *item.Kerberos5iReadWrite rule.Kerberos5pReadOnly = *item.Kerberos5pReadOnly rule.Kerberos5pReadWrite = *item.Kerberos5pReadWrite - rule.RootAccessEnabled = *item.HasRootAccess results = append(results, rule) diff --git a/internal/services/netapp/netapp_volume_group_resource.go b/internal/services/netapp/netapp_volume_group_resource.go index b63d03c99efd..d341b9cd1c78 100644 --- a/internal/services/netapp/netapp_volume_group_resource.go +++ b/internal/services/netapp/netapp_volume_group_resource.go @@ -8,14 +8,12 @@ import ( "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots" "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" netAppValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/netapp/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" - "github.com/hashicorp/terraform-provider-azurerm/internal/tf/suppress" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" ) @@ -103,7 +101,6 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { MinItems: 5, MaxItems: 5, Elem: &pluginsdk.Resource{ - //Schema: netAppVolumeGroupVolumeSchema(), Schema: map[string]*pluginsdk.Schema{ "name": { Type: pluginsdk.TypeString, @@ -113,20 +110,17 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { }, "capacity_pool_id": { - Type: pluginsdk.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - DiffSuppressFunc: suppress.CaseDifference, - ValidateFunc: azure.ValidateResourceID, + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: azure.ValidateResourceID, }, "proximity_placement_group_id": { - Type: pluginsdk.TypeString, - Required: true, - ForceNew: true, - DiffSuppressFunc: suppress.CaseDifference, - ValidateFunc: azure.ValidateResourceID, + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: azure.ValidateResourceID, }, "volume_spec_name": { @@ -159,30 +153,10 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { ValidateFunc: azure.ValidateResourceID, }, - "create_from_snapshot_resource_id": { - Type: pluginsdk.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ValidateFunc: snapshots.ValidateSnapshotID, - }, - - "network_features": { - Type: pluginsdk.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ValidateFunc: validation.StringInSlice([]string{ - string(volumegroups.NetworkFeaturesBasic), - string(volumegroups.NetworkFeaturesStandard), - }, false), - }, - "protocols": { Type: pluginsdk.TypeSet, ForceNew: true, - Optional: true, - Computed: true, + Required: true, MaxItems: 2, Elem: &pluginsdk.Schema{ Type: pluginsdk.TypeString, @@ -196,9 +170,8 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { "security_style": { Type: pluginsdk.TypeString, - Optional: true, + Required: true, ForceNew: true, - Computed: true, ValidateFunc: validation.StringInSlice([]string{ "Unix", // Using hardcoded values instead of SDK enum since no matter what case is passed, "Ntfs", // ANF changes casing to Pascal case in the backend. Please refer to https://github.com/Azure/azure-sdk-for-go/issues/14684 @@ -213,13 +186,12 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { "throughput_in_mibps": { Type: pluginsdk.TypeFloat, - Optional: true, - Computed: true, + Required: true, }, "export_policy_rule": { - Type: pluginsdk.TypeList, - Optional: true, + Type: pluginsdk.TypeSet, + Required: true, MaxItems: 5, Elem: &pluginsdk.Resource{ Schema: map[string]*pluginsdk.Schema{ @@ -238,74 +210,64 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { }, }, - "protocols_enabled": { - Type: pluginsdk.TypeList, - Optional: true, - Computed: true, - MaxItems: 1, - MinItems: 1, - Elem: &pluginsdk.Schema{ - Type: pluginsdk.TypeString, - ValidateFunc: validation.StringInSlice([]string{ - "NFSv3", - "NFSv4.1", - "CIFS", - }, false), - }, + "cifs_enabled": { + Type: pluginsdk.TypeBool, + Required: true, + }, + + "nfsv3_enabled": { + Type: pluginsdk.TypeBool, + Required: true, + }, + + "nfsv41_enabled": { + Type: pluginsdk.TypeBool, + Required: true, }, "unix_read_only": { Type: pluginsdk.TypeBool, - Optional: true, - Computed: true, + Required: true, }, "unix_read_write": { Type: pluginsdk.TypeBool, - Optional: true, - Computed: true, + Required: true, }, "root_access_enabled": { Type: pluginsdk.TypeBool, - Optional: true, - Computed: true, + Required: true, }, "kerberos5_read_only": { Type: pluginsdk.TypeBool, - Optional: true, - Computed: true, + Required: true, }, "kerberos5_read_write": { Type: pluginsdk.TypeBool, - Optional: true, - Computed: true, + Required: true, }, "kerberos5i_read_only": { Type: pluginsdk.TypeBool, - Optional: true, - Computed: true, + Required: true, }, "kerberos5i_read_write": { Type: pluginsdk.TypeBool, - Optional: true, - Computed: true, + Required: true, }, "kerberos5p_read_only": { Type: pluginsdk.TypeBool, - Optional: true, - Computed: true, + Required: true, }, "kerberos5p_read_write": { Type: pluginsdk.TypeBool, - Optional: true, - Computed: true, + Required: true, }, }, }, @@ -313,70 +275,10 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { "tags": commonschema.Tags(), - "mount_ip_addresses": { - Type: pluginsdk.TypeList, - Computed: true, - Elem: &pluginsdk.Schema{ - Type: pluginsdk.TypeString, - }, - }, - "snapshot_directory_visible": { Type: pluginsdk.TypeBool, - Optional: true, - Computed: true, - }, - - "data_protection_replication": { - Type: pluginsdk.TypeList, - Optional: true, - MaxItems: 1, + Required: true, ForceNew: true, - Elem: &pluginsdk.Resource{ - Schema: map[string]*pluginsdk.Schema{ - "endpoint_type": { - Type: pluginsdk.TypeString, - Optional: true, - Default: "dst", - ValidateFunc: validation.StringInSlice([]string{ - "dst", - }, false), - }, - - "remote_volume_location": azure.SchemaLocation(), - - "remote_volume_resource_id": { - Type: pluginsdk.TypeString, - Required: true, - ValidateFunc: azure.ValidateResourceID, - }, - - "replication_frequency": { - Type: pluginsdk.TypeString, - Required: true, - ValidateFunc: validation.StringInSlice([]string{ - "10minutes", - "daily", - "hourly", - }, false), - }, - }, - }, - }, - - "data_protection_snapshot_policy": { - Type: pluginsdk.TypeList, - Optional: true, - MaxItems: 1, - Elem: &pluginsdk.Resource{ - Schema: map[string]*pluginsdk.Schema{ - "snapshot_policy_id": { - Type: pluginsdk.TypeString, - Required: true, - ValidateFunc: azure.ValidateResourceID, - }, - }, - }, }, }, }, @@ -390,7 +292,7 @@ func (r NetAppVolumeGroupResource) Attributes() map[string]*pluginsdk.Schema { TODO - This section is for `Computed: true` only items, i.e. useful values that are returned by the datasource that can be used as outputs or passed programmatically to other resources or data sources. - TODO (pmarques) - use this for first level attributes when Volume resource gets migrated to tfschema + NOTE: Not applicable for this resource type */ } } @@ -497,7 +399,7 @@ func (r NetAppVolumeGroupResource) Read() sdk.ResourceFunc { model.ApplicationType = string(*props.GroupMetaData.ApplicationType) model.DeploymentSpecId = state.DeploymentSpecId - volumes, err := flattenNetAppVolumeGroupVolumes(props.Volumes, state.Volumes) + volumes, err := flattenNetAppVolumeGroupVolumes(props.Volumes) if err != nil { return fmt.Errorf("setting `volume`: %+v", err) } diff --git a/internal/services/netapp/netapp_volume_group_resource_test.go b/internal/services/netapp/netapp_volume_group_resource_test.go index dcf0c1450f43..3239162cc1fe 100644 --- a/internal/services/netapp/netapp_volume_group_resource_test.go +++ b/internal/services/netapp/netapp_volume_group_resource_test.go @@ -74,13 +74,19 @@ resource "azurerm_netapp_volume_group" "test" { volume_spec_name = "data" storage_quota_in_gb = 1024 throughput_in_mibps = 24 + protocols = ["NFSv3"] + security_style = "Unix" + snapshot_directory_visible = false export_policy_rule { rule_index = 1 allowed_clients = ["0.0.0.0/0"] - protocols_enabled = ["NFSv3"] + cifs_enabled = false + nfsv3_enabled = true + nfsv41_enabled = false unix_read_only = false unix_read_write = true + root_access_enabled = false kerberos5_read_only = false kerberos5_read_write = false kerberos5i_read_only = false @@ -105,13 +111,19 @@ resource "azurerm_netapp_volume_group" "test" { volume_spec_name = "log" storage_quota_in_gb = 1024 throughput_in_mibps = 24 + protocols = ["NFSv3"] + security_style = "Unix" + snapshot_directory_visible = false export_policy_rule { rule_index = 1 allowed_clients = ["0.0.0.0/0"] - protocols_enabled = ["NFSv3"] + cifs_enabled = false + nfsv3_enabled = true + nfsv41_enabled = false unix_read_only = false unix_read_write = true + root_access_enabled = false kerberos5_read_only = false kerberos5_read_write = false kerberos5i_read_only = false @@ -136,13 +148,19 @@ resource "azurerm_netapp_volume_group" "test" { volume_spec_name = "shared" storage_quota_in_gb = 1024 throughput_in_mibps = 24 + protocols = ["NFSv3"] + security_style = "Unix" + snapshot_directory_visible = false export_policy_rule { rule_index = 1 allowed_clients = ["0.0.0.0/0"] - protocols_enabled = ["NFSv3"] + cifs_enabled = false + nfsv3_enabled = true + nfsv41_enabled = false unix_read_only = false unix_read_write = true + root_access_enabled = false kerberos5_read_only = false kerberos5_read_write = false kerberos5i_read_only = false @@ -167,13 +185,19 @@ resource "azurerm_netapp_volume_group" "test" { volume_spec_name = "data-backup" storage_quota_in_gb = 1024 throughput_in_mibps = 24 + protocols = ["NFSv3"] + security_style = "Unix" + snapshot_directory_visible = false export_policy_rule { rule_index = 1 allowed_clients = ["0.0.0.0/0"] - protocols_enabled = ["NFSv3"] + cifs_enabled = false + nfsv3_enabled = true + nfsv41_enabled = false unix_read_only = false unix_read_write = true + root_access_enabled = false kerberos5_read_only = false kerberos5_read_write = false kerberos5i_read_only = false @@ -198,13 +222,19 @@ resource "azurerm_netapp_volume_group" "test" { volume_spec_name = "log-backup" storage_quota_in_gb = 1024 throughput_in_mibps = 24 + protocols = ["NFSv3"] + security_style = "Unix" + snapshot_directory_visible = false export_policy_rule { rule_index = 1 allowed_clients = ["0.0.0.0/0"] - protocols_enabled = ["NFSv3"] + cifs_enabled = false + nfsv3_enabled = true + nfsv41_enabled = false unix_read_only = false unix_read_write = true + root_access_enabled = false kerberos5_read_only = false kerberos5_read_write = false kerberos5i_read_only = false diff --git a/internal/services/netapp/netapp_volume_resource.go b/internal/services/netapp/netapp_volume_resource.go index 1c99acea4cc5..9a39a972f4cc 100644 --- a/internal/services/netapp/netapp_volume_resource.go +++ b/internal/services/netapp/netapp_volume_resource.go @@ -9,6 +9,7 @@ import ( "time" "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots" @@ -16,8 +17,11 @@ import ( "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" + "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" + netAppValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/netapp/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" "github.com/hashicorp/terraform-provider-azurerm/utils" ) @@ -40,7 +44,277 @@ func resourceNetAppVolume() *pluginsdk.Resource { return err }), - Schema: netAppVolumeSchema(), + Schema: map[string]*pluginsdk.Schema{ + "resource_group_name": azure.SchemaResourceGroupName(), + + "location": azure.SchemaLocation(), + + "account_name": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: netAppValidate.AccountName, + }, + + "pool_name": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: netAppValidate.PoolName, + }, + + "name": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: netAppValidate.VolumeName, + }, + + "volume_path": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: netAppValidate.VolumePath, + }, + + "service_level": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.StringInSlice([]string{ + string(volumes.ServiceLevelPremium), + string(volumes.ServiceLevelStandard), + string(volumes.ServiceLevelUltra), + }, false), + }, + + "subnet_id": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: azure.ValidateResourceID, + }, + + "create_from_snapshot_resource_id": { + Type: pluginsdk.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + ValidateFunc: snapshots.ValidateSnapshotID, + }, + + "network_features": { + Type: pluginsdk.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + ValidateFunc: validation.StringInSlice([]string{ + string(volumes.NetworkFeaturesBasic), + string(volumes.NetworkFeaturesStandard), + }, false), + }, + + "protocols": { + Type: pluginsdk.TypeSet, + ForceNew: true, + Optional: true, + Computed: true, + MaxItems: 2, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeString, + ValidateFunc: validation.StringInSlice([]string{ + "NFSv3", + "NFSv4.1", + "CIFS", + }, false), + }, + }, + + "security_style": { + Type: pluginsdk.TypeString, + Optional: true, + ForceNew: true, + Computed: true, + ValidateFunc: validation.StringInSlice([]string{ + "Unix", // Using hardcoded values instead of SDK enum since no matter what case is passed, + "Ntfs", // ANF changes casing to Pascal case in the backend. Please refer to https://github.com/Azure/azure-sdk-for-go/issues/14684 + }, false), + }, + + "storage_quota_in_gb": { + Type: pluginsdk.TypeInt, + Required: true, + ValidateFunc: validation.IntBetween(100, 102400), + }, + + "throughput_in_mibps": { + Type: pluginsdk.TypeFloat, + Optional: true, + Computed: true, + }, + + "export_policy_rule": { + Type: pluginsdk.TypeList, + Optional: true, + MaxItems: 5, + Elem: &pluginsdk.Resource{ + Schema: map[string]*pluginsdk.Schema{ + "rule_index": { + Type: pluginsdk.TypeInt, + Required: true, + ValidateFunc: validation.IntBetween(1, 5), + }, + + "allowed_clients": { + Type: pluginsdk.TypeSet, + Required: true, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeString, + ValidateFunc: validate.CIDR, + }, + }, + + "protocols_enabled": { + Type: pluginsdk.TypeList, + Optional: true, + Computed: true, + MaxItems: 1, + MinItems: 1, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeString, + ValidateFunc: validation.StringInSlice([]string{ + "NFSv3", + "NFSv4.1", + "CIFS", + }, false), + }, + }, + + "unix_read_only": { + Type: pluginsdk.TypeBool, + Optional: true, + Computed: true, + }, + + "unix_read_write": { + Type: pluginsdk.TypeBool, + Optional: true, + Computed: true, + }, + + "root_access_enabled": { + Type: pluginsdk.TypeBool, + Optional: true, + Computed: true, + }, + + "kerberos5_read_only": { + Type: pluginsdk.TypeBool, + Optional: true, + Computed: true, + }, + + "kerberos5_read_write": { + Type: pluginsdk.TypeBool, + Optional: true, + Computed: true, + }, + + "kerberos5i_read_only": { + Type: pluginsdk.TypeBool, + Optional: true, + Computed: true, + }, + + "kerberos5i_read_write": { + Type: pluginsdk.TypeBool, + Optional: true, + Computed: true, + }, + + "kerberos5p_read_only": { + Type: pluginsdk.TypeBool, + Optional: true, + Computed: true, + }, + + "kerberos5p_read_write": { + Type: pluginsdk.TypeBool, + Optional: true, + Computed: true, + }, + }, + }, + }, + + "tags": commonschema.Tags(), + + "mount_ip_addresses": { + Type: pluginsdk.TypeList, + Computed: true, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeString, + }, + }, + + "snapshot_directory_visible": { + Type: pluginsdk.TypeBool, + Optional: true, + Computed: true, + }, + + "data_protection_replication": { + Type: pluginsdk.TypeList, + Optional: true, + MaxItems: 1, + ForceNew: true, + Elem: &pluginsdk.Resource{ + Schema: map[string]*pluginsdk.Schema{ + "endpoint_type": { + Type: pluginsdk.TypeString, + Optional: true, + Default: "dst", + ValidateFunc: validation.StringInSlice([]string{ + "dst", + }, false), + }, + + "remote_volume_location": azure.SchemaLocation(), + + "remote_volume_resource_id": { + Type: pluginsdk.TypeString, + Required: true, + ValidateFunc: azure.ValidateResourceID, + }, + + "replication_frequency": { + Type: pluginsdk.TypeString, + Required: true, + ValidateFunc: validation.StringInSlice([]string{ + "10minutes", + "daily", + "hourly", + }, false), + }, + }, + }, + }, + + "data_protection_snapshot_policy": { + Type: pluginsdk.TypeList, + Optional: true, + MaxItems: 1, + Elem: &pluginsdk.Resource{ + Schema: map[string]*pluginsdk.Schema{ + "snapshot_policy_id": { + Type: pluginsdk.TypeString, + Required: true, + ValidateFunc: azure.ValidateResourceID, + }, + }, + }, + }, + }, } } From 9c3c230b11b4762476bc2e051fbb6dff67954e96 Mon Sep 17 00:00:00 2001 From: Paulo Date: Fri, 22 Jul 2022 15:25:06 -0700 Subject: [PATCH 16/83] WIP: config hash function for set --- internal/services/netapp/netapp_volume.go | 32 +++---- .../netapp/netapp_volume_group_resource.go | 93 +++++++++++++++++-- .../netapp_volume_group_resource_test.go | 10 +- 3 files changed, 108 insertions(+), 27 deletions(-) diff --git a/internal/services/netapp/netapp_volume.go b/internal/services/netapp/netapp_volume.go index 559d9691857b..f0aae88dff7c 100644 --- a/internal/services/netapp/netapp_volume.go +++ b/internal/services/netapp/netapp_volume.go @@ -26,20 +26,20 @@ type NetAppVolumeGroupVolume struct { } type ExportPolicyRule struct { - RuleIndex int `tfschema:"rule_index"` - AllowedClients []string `tfschema:"allowed_clients"` - CifsEnabled bool `tfschema:"cifs_enabled"` - Nfsv3Enabled bool `tfschema:"nfsv3_enabled"` - Nfsv41Enabled bool `tfschema:"nfsv41_enabled"` - UnixReadOnly bool `tfschema:"unix_read_only"` - UnixReadWrite bool `tfschema:"unix_read_write"` - RootAccessEnabled bool `tfschema:"root_access_enabled"` - Kerberos5ReadOnly bool `tfschema:"kerberos5_read_only"` - Kerberos5ReadWrite bool `tfschema:"kerberos5_read_write"` - Kerberos5iReadOnly bool `tfschema:"kerberos5i_read_only"` - Kerberos5iReadWrite bool `tfschema:"kerberos5i_read_write"` - Kerberos5pReadOnly bool `tfschema:"kerberos5p_read_only"` - Kerberos5pReadWrite bool `tfschema:"kerberos5p_read_write"` + RuleIndex int `tfschema:"rule_index"` + AllowedClients string `tfschema:"allowed_clients"` + CifsEnabled bool `tfschema:"cifs_enabled"` + Nfsv3Enabled bool `tfschema:"nfsv3_enabled"` + Nfsv41Enabled bool `tfschema:"nfsv41_enabled"` + UnixReadOnly bool `tfschema:"unix_read_only"` + UnixReadWrite bool `tfschema:"unix_read_write"` + RootAccessEnabled bool `tfschema:"root_access_enabled"` + Kerberos5ReadOnly bool `tfschema:"kerberos5_read_only"` + Kerberos5ReadWrite bool `tfschema:"kerberos5_read_write"` + Kerberos5iReadOnly bool `tfschema:"kerberos5i_read_only"` + Kerberos5iReadWrite bool `tfschema:"kerberos5i_read_write"` + Kerberos5pReadOnly bool `tfschema:"kerberos5p_read_only"` + Kerberos5pReadWrite bool `tfschema:"kerberos5p_read_write"` } type DataProtectionReplication struct { @@ -63,7 +63,7 @@ func expandNetAppVolumeGroupExportPolicyRule(input []ExportPolicyRule) *volumegr for _, item := range input { result := volumegroups.ExportPolicyRule{ - AllowedClients: utils.String(strings.Join(item.AllowedClients, ",")), + AllowedClients: utils.String(item.AllowedClients), Cifs: utils.Bool(item.CifsEnabled), Nfsv3: utils.Bool(item.Nfsv3Enabled), Nfsv41: utils.Bool(item.Nfsv41Enabled), @@ -225,7 +225,7 @@ func flattenNetAppVolumeGroupVolumesExportPolicies(input *[]volumegroups.ExportP rule := ExportPolicyRule{} rule.RuleIndex = int(*item.RuleIndex) - rule.AllowedClients = strings.Split(*item.AllowedClients, ",") + rule.AllowedClients = *item.AllowedClients rule.CifsEnabled = *item.Cifs rule.Nfsv3Enabled = *item.Nfsv3 rule.Nfsv41Enabled = *item.Nfsv41 diff --git a/internal/services/netapp/netapp_volume_group_resource.go b/internal/services/netapp/netapp_volume_group_resource.go index d341b9cd1c78..53ed9ea58c17 100644 --- a/internal/services/netapp/netapp_volume_group_resource.go +++ b/internal/services/netapp/netapp_volume_group_resource.go @@ -1,6 +1,7 @@ package netapp import ( + "bytes" "context" "fmt" "net/http" @@ -10,7 +11,6 @@ import ( "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" - "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" netAppValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/netapp/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" @@ -202,12 +202,8 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { }, "allowed_clients": { - Type: pluginsdk.TypeSet, + Type: pluginsdk.TypeString, Required: true, - Elem: &pluginsdk.Schema{ - Type: pluginsdk.TypeString, - ValidateFunc: validate.CIDR, - }, }, "cifs_enabled": { @@ -282,10 +278,95 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { }, }, }, + Set: resourceVolumeGroupVolumeListHash, }, } } +func resourceVolumeGroupVolumeListHash(v interface{}) int { + var buf bytes.Buffer + + if m, ok := v.(map[string]interface{}); ok { + buf.WriteString(fmt.Sprintf("%s-", m["name"].(string))) + buf.WriteString(fmt.Sprintf("%s-", m["proximity_placement_group_id"].(string))) + buf.WriteString(fmt.Sprintf("%s-", m["volume_spec_name"].(string))) + buf.WriteString(fmt.Sprintf("%s-", m["volume_path"].(string))) + buf.WriteString(fmt.Sprintf("%s-", m["service_level"].(string))) + buf.WriteString(fmt.Sprintf("%s-", m["subnet_id"].(string))) + + if protocols, ok := m["protocols"].([]interface{}); ok { + for _, item := range protocols { + v := item.(string) + buf.WriteString(fmt.Sprintf("%s-", v)) + } + } + + buf.WriteString(fmt.Sprintf("%s-", m["security_style"].(string))) + buf.WriteString(fmt.Sprintf("%d-", m["storage_quota_in_gb"].(int))) + buf.WriteString(fmt.Sprintf("%f-", m["throughput_in_mibps"].(float64))) + buf.WriteString(fmt.Sprintf("%t-", m["snapshot_directory_visible"].(bool))) + + if exportPolicies, ok := m["export_policy_rule"].([]interface{}); ok { + for _, item := range exportPolicies { + v := item.(map[string]interface{}) + if ruleIndex, ok := v["rule_index"].(int); ok { + buf.WriteString(fmt.Sprintf("%d-", ruleIndex)) + } + if allowedClients, ok := v["allowed_clients"].(string); ok { + buf.WriteString(fmt.Sprintf("%s-", allowedClients)) + } + if cifsEnabled, ok := v["cifs_enabled"].(bool); ok { + buf.WriteString(fmt.Sprintf("%t-", cifsEnabled)) + } + if nfsv3Enabled, ok := v["nfsv3_enabled"].(bool); ok { + buf.WriteString(fmt.Sprintf("%t-", nfsv3Enabled)) + } + if nfsv41Enabled, ok := v["nfsv41_enabled"].(bool); ok { + buf.WriteString(fmt.Sprintf("%t-", nfsv41Enabled)) + } + if unixReadOnly, ok := v["unix_read_only"].(bool); ok { + buf.WriteString(fmt.Sprintf("%t-", unixReadOnly)) + } + if unixReadWrite, ok := v["unix_read_write"].(bool); ok { + buf.WriteString(fmt.Sprintf("%t-", unixReadWrite)) + } + if rootAccessEnabled, ok := v["root_access_enabled"].(bool); ok { + buf.WriteString(fmt.Sprintf("%t-", rootAccessEnabled)) + } + if kerberos5ReadOnly, ok := v["kerberos5_read_only"].(bool); ok { + buf.WriteString(fmt.Sprintf("%t-", kerberos5ReadOnly)) + } + if kerberos5ReadWrite, ok := v["kerberos5_read_write"].(bool); ok { + buf.WriteString(fmt.Sprintf("%t-", kerberos5ReadWrite)) + } + if kerberos5iReadOnly, ok := v["kerberos5i_read_only"].(bool); ok { + buf.WriteString(fmt.Sprintf("%t-", kerberos5iReadOnly)) + } + if kerberos5iReadWrite, ok := v["kerberos5i_read_write"].(bool); ok { + buf.WriteString(fmt.Sprintf("%t-", kerberos5iReadWrite)) + } + if kerberos5pReadOnly, ok := v["kerberos5p_read_only"].(bool); ok { + buf.WriteString(fmt.Sprintf("%t-", kerberos5pReadOnly)) + } + if kerberos5pReadWrite, ok := v["kerberos5p_read_write"].(bool); ok { + buf.WriteString(fmt.Sprintf("%t-", kerberos5pReadWrite)) + } + } + } + + if tags, ok := m["tags"].([]interface{}); ok { + for _, item := range tags { + i := item.(map[string]interface{}) + for k, v := range i { + buf.WriteString(fmt.Sprintf("%s-%s-", k, v)) + } + } + } + } + + return pluginsdk.HashString(buf.String()) +} + func (r NetAppVolumeGroupResource) Attributes() map[string]*pluginsdk.Schema { return map[string]*pluginsdk.Schema{ /* diff --git a/internal/services/netapp/netapp_volume_group_resource_test.go b/internal/services/netapp/netapp_volume_group_resource_test.go index 3239162cc1fe..05ad0184d769 100644 --- a/internal/services/netapp/netapp_volume_group_resource_test.go +++ b/internal/services/netapp/netapp_volume_group_resource_test.go @@ -80,7 +80,7 @@ resource "azurerm_netapp_volume_group" "test" { export_policy_rule { rule_index = 1 - allowed_clients = ["0.0.0.0/0"] + allowed_clients = "0.0.0.0/0" cifs_enabled = false nfsv3_enabled = true nfsv41_enabled = false @@ -117,7 +117,7 @@ resource "azurerm_netapp_volume_group" "test" { export_policy_rule { rule_index = 1 - allowed_clients = ["0.0.0.0/0"] + allowed_clients = "0.0.0.0/0" cifs_enabled = false nfsv3_enabled = true nfsv41_enabled = false @@ -154,7 +154,7 @@ resource "azurerm_netapp_volume_group" "test" { export_policy_rule { rule_index = 1 - allowed_clients = ["0.0.0.0/0"] + allowed_clients = "0.0.0.0/0" cifs_enabled = false nfsv3_enabled = true nfsv41_enabled = false @@ -191,7 +191,7 @@ resource "azurerm_netapp_volume_group" "test" { export_policy_rule { rule_index = 1 - allowed_clients = ["0.0.0.0/0"] + allowed_clients = "0.0.0.0/0" cifs_enabled = false nfsv3_enabled = true nfsv41_enabled = false @@ -228,7 +228,7 @@ resource "azurerm_netapp_volume_group" "test" { export_policy_rule { rule_index = 1 - allowed_clients = ["0.0.0.0/0"] + allowed_clients = "0.0.0.0/0" cifs_enabled = false nfsv3_enabled = true nfsv41_enabled = false From 7b4bfb911128cf5c2eb4a6e8d5d97d2019de7465 Mon Sep 17 00:00:00 2001 From: Paulo Date: Mon, 25 Jul 2022 17:16:42 -0700 Subject: [PATCH 17/83] WIP: adding snapshot policy support --- internal/services/netapp/netapp_volume.go | 295 ++++++++++++++++-- .../netapp/netapp_volume_group_resource.go | 140 ++++++++- .../netapp_volume_group_resource_test.go | 263 ++++++++++++++++ .../services/netapp/netapp_volume_resource.go | 128 -------- 4 files changed, 666 insertions(+), 160 deletions(-) diff --git a/internal/services/netapp/netapp_volume.go b/internal/services/netapp/netapp_volume.go index f0aae88dff7c..ee4de7bdaa13 100644 --- a/internal/services/netapp/netapp_volume.go +++ b/internal/services/netapp/netapp_volume.go @@ -1,28 +1,40 @@ package netapp import ( + "context" "fmt" + "net/http" + "strconv" "strings" + "time" + "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication" + "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" ) type NetAppVolumeGroupVolume struct { - Name string `tfschema:"name"` - VolumePath string `tfschema:"volume_path"` - ServiceLevel string `tfschema:"service_level"` - SubnetId string `tfschema:"subnet_id"` - Protocols []string `tfschema:"protocols"` - SecurityStyle string `tfschema:"security_style"` - StorageQuotaInGB int64 `tfschema:"storage_quota_in_gb"` - ThroughputInMibps float64 `tfschema:"throughput_in_mibps"` - Tags map[string]string `tfschema:"tags"` - SnapshotDirectoryVisible bool `tfschema:"snapshot_directory_visible"` - CapacityPoolId string `tfschema:"capacity_pool_id"` - ProximityPlacementGroupId string `tfschema:"proximity_placement_group_id"` - VolumeSpecName string `tfschema:"volume_spec_name"` - ExportPolicy []ExportPolicyRule `tfschema:"export_policy_rule"` + Name string `tfschema:"name"` + VolumePath string `tfschema:"volume_path"` + ServiceLevel string `tfschema:"service_level"` + SubnetId string `tfschema:"subnet_id"` + Protocols []string `tfschema:"protocols"` + SecurityStyle string `tfschema:"security_style"` + StorageQuotaInGB int64 `tfschema:"storage_quota_in_gb"` + ThroughputInMibps float64 `tfschema:"throughput_in_mibps"` + Tags map[string]string `tfschema:"tags"` + SnapshotDirectoryVisible bool `tfschema:"snapshot_directory_visible"` + CapacityPoolId string `tfschema:"capacity_pool_id"` + ProximityPlacementGroupId string `tfschema:"proximity_placement_group_id"` + VolumeSpecName string `tfschema:"volume_spec_name"` + ExportPolicy []ExportPolicyRule `tfschema:"export_policy_rule"` + MountIpAddresses []string `tfschema:"mount_ip_addresses"` + DataProtectionReplication []DataProtectionReplication `tfschema:"data_protection_replication"` + DataProtectionSnapshotPolicy []DataProtectionSnapshotPolicy `tfschema:"data_protection_snapshot_policy"` } type ExportPolicyRule struct { @@ -50,7 +62,7 @@ type DataProtectionReplication struct { } type DataProtectionSnapshotPolicy struct { - DataProtectionSnapshotPolicy string `tfschema:"data_protection_snapshot_policy"` + DataProtectionSnapshotPolicy string `tfschema:"snapshot_policy_id"` } func expandNetAppVolumeGroupExportPolicyRule(input []ExportPolicyRule) *volumegroups.VolumePropertiesExportPolicy { @@ -136,6 +148,7 @@ func expandNetAppVolumeGroupVolumes(input []NetAppVolumeGroupVolume, id volumegr subnetID := item.SubnetId capacityPoolID := item.CapacityPoolId protocols := item.Protocols + snapshotDirectoryVisible := item.SnapshotDirectoryVisible // Handling security style property securityStyle := volumegroups.SecurityStyle(item.SecurityStyle) @@ -149,21 +162,28 @@ func expandNetAppVolumeGroupVolumes(input []NetAppVolumeGroupVolume, id volumegr storageQuotaInGB := int64(item.StorageQuotaInGB * 1073741824) exportPolicyRule := expandNetAppVolumeGroupExportPolicyRule(item.ExportPolicy) + dataProtectionReplication := expandNetAppVolumeGroupDataProtectionReplication(item.DataProtectionReplication) + dataProtectionSnapshotPolicy := expandNetAppVolumeGroupDataProtectionSnapshotPolicy(item.DataProtectionSnapshotPolicy) volumeProperties := &volumegroups.VolumeGroupVolumeProperties{ Name: utils.String(name), Properties: volumegroups.VolumeProperties{ - CapacityPoolResourceId: utils.String(capacityPoolID), - CreationToken: volumePath, - ServiceLevel: &serviceLevel, - SubnetId: subnetID, - ProtocolTypes: &protocols, - SecurityStyle: &securityStyle, - UsageThreshold: storageQuotaInGB, - ExportPolicy: exportPolicyRule, - ThroughputMibps: utils.Float(float64(item.ThroughputInMibps)), - ProximityPlacementGroup: utils.String(item.ProximityPlacementGroupId), - VolumeSpecName: utils.String(item.VolumeSpecName), + CapacityPoolResourceId: utils.String(capacityPoolID), + CreationToken: volumePath, + ServiceLevel: &serviceLevel, + SubnetId: subnetID, + ProtocolTypes: &protocols, + SecurityStyle: &securityStyle, + UsageThreshold: storageQuotaInGB, + ExportPolicy: exportPolicyRule, + SnapshotDirectoryVisible: utils.Bool(snapshotDirectoryVisible), + ThroughputMibps: utils.Float(float64(item.ThroughputInMibps)), + ProximityPlacementGroup: utils.String(item.ProximityPlacementGroupId), + VolumeSpecName: utils.String(item.VolumeSpecName), + DataProtection: &volumegroups.VolumePropertiesDataProtection{ + Replication: dataProtectionReplication.Replication, + Snapshot: dataProtectionSnapshotPolicy.Snapshot, + }, }, Tags: &item.Tags, } @@ -186,7 +206,7 @@ func flattenNetAppVolumeGroupVolumes(input *[]volumegroups.VolumeGroupVolumeProp props := item.Properties - volumeGroupVolume.Name = string(*item.Name) + volumeGroupVolume.Name = getResourceNameString(item.Name) volumeGroupVolume.VolumePath = props.CreationToken volumeGroupVolume.ServiceLevel = string(*props.ServiceLevel) volumeGroupVolume.SubnetId = props.SubnetId @@ -208,6 +228,18 @@ func flattenNetAppVolumeGroupVolumes(input *[]volumegroups.VolumeGroupVolumeProp volumeGroupVolume.ExportPolicy = flattenNetAppVolumeGroupVolumesExportPolicies(props.ExportPolicy.Rules) } + if props.MountTargets != nil && len(*props.MountTargets) > 0 { + volumeGroupVolume.MountIpAddresses = flattenNetAppVolumeGroupVolumesMountIpAddresses(props.MountTargets) + } + + if props.DataProtection != nil && props.DataProtection.Replication != nil { + volumeGroupVolume.DataProtectionReplication = flattenNetAppVolumeGroupVolumesDPReplication(props.DataProtection.Replication) + } + + if props.DataProtection != nil && props.DataProtection.Snapshot != nil { + volumeGroupVolume.DataProtectionSnapshotPolicy = flattenNetAppVolumeGroupVolumesDPSnapshotPolicy(props.DataProtection.Snapshot) + } + results = append(results, volumeGroupVolume) } @@ -318,3 +350,212 @@ func getVolumeIndexbyName(input []NetAppVolumeGroupVolume, volumeName string) in return -1 } + +func deleteVolume(ctx context.Context, metadata sdk.ResourceMetaData, volumeId string) error { + client := metadata.Client.NetApp.VolumeClient + + id, err := volumes.ParseVolumeID(volumeId) + if err != nil { + return err + } + + existing, err := client.Get(ctx, *id) + if err != nil { + if existing.HttpResponse.StatusCode == http.StatusNotFound { + return metadata.MarkAsGone(id) + } + return fmt.Errorf("retrieving %s: %v", id, err) + } + + // Removing replication if present + dataProtectionReplication := existing.Model.Properties.DataProtection + + if dataProtectionReplication != nil && dataProtectionReplication.Replication != nil { + replicaVolumeId, err := volumesreplication.ParseVolumeID(id.ID()) + if err != nil { + return err + } + if dataProtectionReplication.Replication.EndpointType != nil && strings.ToLower(string(*dataProtectionReplication.Replication.EndpointType)) != "dst" { + // This is the case where primary volume started the deletion, in this case, to be consistent we will remove replication from secondary + replicaVolumeId, err = volumesreplication.ParseVolumeID(dataProtectionReplication.Replication.RemoteVolumeResourceId) + if err != nil { + return err + } + } + + replicationClient := metadata.Client.NetApp.VolumeReplicationClient + // Checking replication status before deletion, it need to be broken before proceeding with deletion + if res, err := replicationClient.VolumesReplicationStatus(ctx, *replicaVolumeId); err == nil { + // Wait for replication state = "mirrored" + if model := res.Model; model != nil { + if model.MirrorState != nil && strings.ToLower(string(*model.MirrorState)) == "uninitialized" { + if err := waitForReplMirrorState(ctx, replicationClient, *replicaVolumeId, "mirrored"); err != nil { + return fmt.Errorf("waiting for replica %s to become 'mirrored': %+v", *replicaVolumeId, err) + } + } + } + + // Breaking replication + if err = replicationClient.VolumesBreakReplicationThenPoll(ctx, *replicaVolumeId, volumesreplication.BreakReplicationRequest{ + ForceBreakReplication: utils.Bool(true), + }); err != nil { + return fmt.Errorf("breaking replication for %s: %+v", *replicaVolumeId, err) + } + + // Waiting for replication be in broken state + metadata.Logger.Infof("waiting for the replication of %s to be in broken state", *replicaVolumeId) + if err := waitForReplMirrorState(ctx, replicationClient, *replicaVolumeId, "broken"); err != nil { + return fmt.Errorf("waiting for the breaking of replication for %s: %+v", *replicaVolumeId, err) + } + } + + // Deleting replication and waiting for it to fully complete the operation + if err = replicationClient.VolumesDeleteReplicationThenPoll(ctx, *replicaVolumeId); err != nil { + return fmt.Errorf("deleting replicate %s: %+v", *replicaVolumeId, err) + } + + if err := waitForReplicationDeletion(ctx, replicationClient, *replicaVolumeId); err != nil { + return fmt.Errorf("waiting for the replica %s to be deleted: %+v", *replicaVolumeId, err) + } + } + + // Deleting volume and waiting for it fo fully complete the operation + if err = client.DeleteThenPoll(ctx, *id, volumes.DeleteOperationOptions{ + ForceDelete: utils.Bool(true), + }); err != nil { + return fmt.Errorf("deleting %s: %+v", *id, err) + } + + if err = waitForVolumeDeletion(ctx, client, *id); err != nil { + return fmt.Errorf("waiting for deletion of %s: %+v", *id, err) + } + + return nil +} + +func waitForReplMirrorState(ctx context.Context, client *volumesreplication.VolumesReplicationClient, id volumesreplication.VolumeId, desiredState string) error { + deadline, ok := ctx.Deadline() + if !ok { + return fmt.Errorf("context had no deadline") + } + stateConf := &pluginsdk.StateChangeConf{ + ContinuousTargetOccurence: 5, + Delay: 10 * time.Second, + MinTimeout: 10 * time.Second, + Pending: []string{"200"}, // 200 means mirror state is still Mirrored + Target: []string{"204"}, // 204 means mirror state is <> than Mirrored + Refresh: netappVolumeReplicationMirrorStateRefreshFunc(ctx, client, id, desiredState), + Timeout: time.Until(deadline), + } + + if _, err := stateConf.WaitForStateContext(ctx); err != nil { + return fmt.Errorf("waiting for %s to be in the state %q: %+v", id, desiredState, err) + } + + return nil +} + +func netappVolumeReplicationMirrorStateRefreshFunc(ctx context.Context, client *volumesreplication.VolumesReplicationClient, id volumesreplication.VolumeId, desiredState string) pluginsdk.StateRefreshFunc { + validStates := []string{"mirrored", "broken", "uninitialized"} + + return func() (interface{}, string, error) { + // Possible Mirror States to be used as desiredStates: + // mirrored, broken or uninitialized + if !utils.SliceContainsValue(validStates, strings.ToLower(desiredState)) { + return nil, "", fmt.Errorf("invalid desired mirror state was passed to check mirror replication state (%s), possible values: (%+v)", desiredState, volumesreplication.PossibleValuesForMirrorState()) + } + + res, err := client.VolumesReplicationStatus(ctx, id) + if err != nil { + if !response.WasNotFound(res.HttpResponse) { + return nil, "", fmt.Errorf("retrieving replication status information from %s: %s", id, err) + } + } + + // TODO: fix this refresh function to use strings instead of fake status codes + // Setting 200 as default response + response := 200 + if res.Model != nil && res.Model.MirrorState != nil && strings.EqualFold(string(*res.Model.MirrorState), desiredState) { + // return 204 if state matches desired state + response = 204 + } + + return res, strconv.Itoa(response), nil + } +} + +func waitForReplicationDeletion(ctx context.Context, client *volumesreplication.VolumesReplicationClient, id volumesreplication.VolumeId) error { + deadline, ok := ctx.Deadline() + if !ok { + return fmt.Errorf("context had no deadline") + } + + stateConf := &pluginsdk.StateChangeConf{ + ContinuousTargetOccurence: 5, + Delay: 10 * time.Second, + MinTimeout: 10 * time.Second, + Pending: []string{"200", "202", "400"}, // TODO: Remove 400 when bug is fixed on RP side, where replicationStatus returns 400 while it is in "Deleting" state + Target: []string{"404"}, + Refresh: netappVolumeReplicationStateRefreshFunc(ctx, client, id), + Timeout: time.Until(deadline), + } + + if _, err := stateConf.WaitForStateContext(ctx); err != nil { + return fmt.Errorf("waiting for Replication of %s to be deleted: %+v", id, err) + } + + return nil +} + +func netappVolumeReplicationStateRefreshFunc(ctx context.Context, client *volumesreplication.VolumesReplicationClient, id volumesreplication.VolumeId) pluginsdk.StateRefreshFunc { + return func() (interface{}, string, error) { + res, err := client.VolumesReplicationStatus(ctx, id) + if err != nil { + if httpResponse := res.HttpResponse; httpResponse != nil { + if httpResponse.StatusCode == 400 && (strings.Contains(strings.ToLower(err.Error()), "deleting") || strings.Contains(strings.ToLower(err.Error()), "volume replication missing or deleted")) { + // This error can be ignored until a bug is fixed on RP side that it is returning 400 while the replication is in "Deleting" process + // TODO: remove this workaround when above bug is fixed + } else if !response.WasNotFound(httpResponse) { + return nil, "", fmt.Errorf("retrieving replication status from %s: %s", id, err) + } + } + } + + return res, strconv.Itoa(res.HttpResponse.StatusCode), nil + } +} + +func waitForVolumeDeletion(ctx context.Context, client *volumes.VolumesClient, id volumes.VolumeId) error { + deadline, ok := ctx.Deadline() + if !ok { + return fmt.Errorf("context had no deadline") + } + stateConf := &pluginsdk.StateChangeConf{ + ContinuousTargetOccurence: 5, + Delay: 10 * time.Second, + MinTimeout: 10 * time.Second, + Pending: []string{"200", "202"}, + Target: []string{"204", "404"}, + Refresh: netappVolumeStateRefreshFunc(ctx, client, id), + Timeout: time.Until(deadline), + } + + if _, err := stateConf.WaitForStateContext(ctx); err != nil { + return fmt.Errorf("waiting for %s to be deleted: %+v", id, err) + } + + return nil +} + +func netappVolumeStateRefreshFunc(ctx context.Context, client *volumes.VolumesClient, id volumes.VolumeId) pluginsdk.StateRefreshFunc { + return func() (interface{}, string, error) { + res, err := client.Get(ctx, id) + if err != nil { + if !response.WasNotFound(res.HttpResponse) { + return nil, "", fmt.Errorf("retrieving %s: %s", id, err) + } + } + + return res, strconv.Itoa(res.HttpResponse.StatusCode), nil + } +} diff --git a/internal/services/netapp/netapp_volume_group_resource.go b/internal/services/netapp/netapp_volume_group_resource.go index 53ed9ea58c17..5bbe37020b9e 100644 --- a/internal/services/netapp/netapp_volume_group_resource.go +++ b/internal/services/netapp/netapp_volume_group_resource.go @@ -89,9 +89,10 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { "deployment_spec_id": { Type: pluginsdk.TypeString, - Required: true, + Optional: true, ForceNew: true, ValidateFunc: validation.IsUUID, + Default: "20542149-bfca-5618-1879-9863dc6767f1", }, "volume": { @@ -276,6 +277,66 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { Required: true, ForceNew: true, }, + + "mount_ip_addresses": { + Type: pluginsdk.TypeList, + Computed: true, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeString, + }, + }, + + "data_protection_replication": { + Type: pluginsdk.TypeList, + Optional: true, + MaxItems: 1, + ForceNew: true, + Elem: &pluginsdk.Resource{ + Schema: map[string]*pluginsdk.Schema{ + "endpoint_type": { + Type: pluginsdk.TypeString, + Optional: true, + Default: "dst", + ValidateFunc: validation.StringInSlice([]string{ + "dst", + }, false), + }, + + "remote_volume_location": azure.SchemaLocation(), + + "remote_volume_resource_id": { + Type: pluginsdk.TypeString, + Required: true, + ValidateFunc: azure.ValidateResourceID, + }, + + "replication_frequency": { + Type: pluginsdk.TypeString, + Required: true, + ValidateFunc: validation.StringInSlice([]string{ + "10minutes", + "daily", + "hourly", + }, false), + }, + }, + }, + }, + + "data_protection_snapshot_policy": { + Type: pluginsdk.TypeList, + Optional: true, + MaxItems: 1, + Elem: &pluginsdk.Resource{ + Schema: map[string]*pluginsdk.Schema{ + "snapshot_policy_id": { + Type: pluginsdk.TypeString, + Required: true, + ValidateFunc: azure.ValidateResourceID, + }, + }, + }, + }, }, }, Set: resourceVolumeGroupVolumeListHash, @@ -284,6 +345,8 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { } func resourceVolumeGroupVolumeListHash(v interface{}) int { + // Computed = true items must be out of this + var buf bytes.Buffer if m, ok := v.(map[string]interface{}); ok { @@ -292,7 +355,6 @@ func resourceVolumeGroupVolumeListHash(v interface{}) int { buf.WriteString(fmt.Sprintf("%s-", m["volume_spec_name"].(string))) buf.WriteString(fmt.Sprintf("%s-", m["volume_path"].(string))) buf.WriteString(fmt.Sprintf("%s-", m["service_level"].(string))) - buf.WriteString(fmt.Sprintf("%s-", m["subnet_id"].(string))) if protocols, ok := m["protocols"].([]interface{}); ok { for _, item := range protocols { @@ -362,6 +424,33 @@ func resourceVolumeGroupVolumeListHash(v interface{}) int { } } } + + if dpReplication, ok := m["data_protection_replication"].([]interface{}); ok { + for _, item := range dpReplication { + v := item.(map[string]interface{}) + if endpointType, ok := v["endpoint_type"].(string); ok { + buf.WriteString(fmt.Sprintf("%s-", endpointType)) + } + if remoteVolumeLocation, ok := v["remote_volume_location"].(string); ok { + buf.WriteString(fmt.Sprintf("%s-", remoteVolumeLocation)) + } + if remoteVolumeResourceId, ok := v["remote_volume_resource_id"].(string); ok { + buf.WriteString(fmt.Sprintf("%s-", remoteVolumeResourceId)) + } + if replicationFrequency, ok := v["replication_frequency"].(string); ok { + buf.WriteString(fmt.Sprintf("%s-", replicationFrequency)) + } + } + } + + if dpSnapshotPolicy, ok := m["data_protection_snapshot_policy"].([]interface{}); ok { + for _, item := range dpSnapshotPolicy { + v := item.(map[string]interface{}) + if snapshotPolicyId, ok := v["snapshot_policy_id"].(string); ok { + buf.WriteString(fmt.Sprintf("%s-", snapshotPolicyId)) + } + } + } } return pluginsdk.HashString(buf.String()) @@ -478,7 +567,17 @@ func (r NetAppVolumeGroupResource) Read() sdk.ResourceFunc { model.ApplicationIdentifier = utils.NormalizeNilableString(props.GroupMetaData.ApplicationIdentifier) model.DeploymentSpecId = utils.NormalizeNilableString(props.GroupMetaData.DeploymentSpecId) model.ApplicationType = string(*props.GroupMetaData.ApplicationType) - model.DeploymentSpecId = state.DeploymentSpecId + + if state.DeploymentSpecId != "" { + model.DeploymentSpecId = state.DeploymentSpecId + } else { + // Setting a default value here to overcome issue with SDK + // not returning this value back from Azure + // This is the only supported value for the time being and + // will be fixed by ANF team if it introduces a new SpecId + // option. + model.DeploymentSpecId = "20542149-bfca-5618-1879-9863dc6767f1" + } volumes, err := flattenNetAppVolumeGroupVolumes(props.Volumes) if err != nil { @@ -495,9 +594,40 @@ func (r NetAppVolumeGroupResource) Read() sdk.ResourceFunc { func (r NetAppVolumeGroupResource) Delete() sdk.ResourceFunc { return sdk.ResourceFunc{ - Timeout: 5 * time.Minute, + Timeout: 120 * time.Minute, Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { - // TODO - Delete Func + + client := metadata.Client.NetApp.VolumeGroupClient + + id, err := volumegroups.ParseVolumeGroupID(metadata.ResourceData.Id()) + if err != nil { + return err + } + + existing, err := client.VolumeGroupsGet(ctx, *id) + if err != nil { + if existing.HttpResponse.StatusCode == http.StatusNotFound { + return metadata.MarkAsGone(id) + } + return fmt.Errorf("retrieving %s: %v", id, err) + } + + // Removing volumes before deleting volume group + if props := existing.Model.Properties; props != nil { + if volumeList := props.Volumes; volumeList != nil { + for _, volume := range *volumeList { + if err := deleteVolume(ctx, metadata, *volume.Id); err != nil { + return fmt.Errorf("deleting `volume`: %+v", err) + } + } + } + } + + // Removing Volume Group + if err = client.VolumeGroupsDeleteThenPoll(ctx, *id); err != nil { + return fmt.Errorf("deleting %s: %+v", *id, err) + } + return nil }, } diff --git a/internal/services/netapp/netapp_volume_group_resource_test.go b/internal/services/netapp/netapp_volume_group_resource_test.go index 05ad0184d769..031544da2eac 100644 --- a/internal/services/netapp/netapp_volume_group_resource_test.go +++ b/internal/services/netapp/netapp_volume_group_resource_test.go @@ -31,6 +31,21 @@ func TestAccNetAppVolumeGroup_basic(t *testing.T) { }) } +func TestAccNetAppVolumeGroup_snapshotPolicy(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_netapp_volume_group", "test") + r := NetAppVolumeGroupResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.avgSnapshotPolicy(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + }) +} + func (t NetAppVolumeGroupResource) Exists(ctx context.Context, clients *clients.Client, state *terraform.InstanceState) (*bool, error) { id, err := volumegroups.ParseVolumeGroupID(state.ID) if err != nil { @@ -257,6 +272,254 @@ resource "azurerm_netapp_volume_group" "test" { `, template, data.RandomInteger) } +func (NetAppVolumeGroupResource) avgSnapshotPolicy(data acceptance.TestData) string { + template := NetAppVolumeGroupResource{}.templatePPG(data) + return fmt.Sprintf(` +%[1]s + +resource "azurerm_netapp_snapshot_policy" "test" { + name = "acctest-NetAppSnapshotPolicy-%[2]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + account_name = azurerm_netapp_account.test.name + enabled = true + + monthly_schedule { + snapshots_to_keep = 1 + days_of_month = [15, 30] + hour = 23 + minute = 30 + } + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } +} + +resource "azurerm_netapp_volume_group" "test" { + name = "acctest-NetAppVolumeGroup-%[2]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + account_name = azurerm_netapp_account.test.name + group_description = "Test volume group" + application_type = "SAP-HANA" + application_identifier = "TST" + deployment_spec_id = "20542149-bfca-5618-1879-9863dc6767f1" + + volume { + name = "acctest-NetAppVolume-1-%[2]d" + volume_path = "my-unique-file-path-1-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + proximity_placement_group_id = azurerm_proximity_placement_group.test.id + volume_spec_name = "data" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv3"] + security_style = "Unix" + snapshot_directory_visible = false + + export_policy_rule { + rule_index = 1 + allowed_clients = "0.0.0.0/0" + cifs_enabled = false + nfsv3_enabled = true + nfsv41_enabled = false + unix_read_only = false + unix_read_write = true + root_access_enabled = false + kerberos5_read_only = false + kerberos5_read_write = false + kerberos5i_read_only = false + kerberos5i_read_write = false + kerberos5p_read_only = false + kerberos5p_read_write = false + } + + data_protection_snapshot_policy { + snapshot_policy_id = azurerm_netapp_snapshot_policy.test.id + } + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } + } + + volume { + name = "acctest-NetAppVolume-2-%[2]d" + volume_path = "my-unique-file-path-2-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + proximity_placement_group_id = azurerm_proximity_placement_group.test.id + volume_spec_name = "log" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv3"] + security_style = "Unix" + snapshot_directory_visible = false + + export_policy_rule { + rule_index = 1 + allowed_clients = "0.0.0.0/0" + cifs_enabled = false + nfsv3_enabled = true + nfsv41_enabled = false + unix_read_only = false + unix_read_write = true + root_access_enabled = false + kerberos5_read_only = false + kerberos5_read_write = false + kerberos5i_read_only = false + kerberos5i_read_write = false + kerberos5p_read_only = false + kerberos5p_read_write = false + } + + data_protection_snapshot_policy { + snapshot_policy_id = azurerm_netapp_snapshot_policy.test.id + } + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } + } + + volume { + name = "acctest-NetAppVolume-3-%[2]d" + volume_path = "my-unique-file-path-3-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + proximity_placement_group_id = azurerm_proximity_placement_group.test.id + volume_spec_name = "shared" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv3"] + security_style = "Unix" + snapshot_directory_visible = false + + export_policy_rule { + rule_index = 1 + allowed_clients = "0.0.0.0/0" + cifs_enabled = false + nfsv3_enabled = true + nfsv41_enabled = false + unix_read_only = false + unix_read_write = true + root_access_enabled = false + kerberos5_read_only = false + kerberos5_read_write = false + kerberos5i_read_only = false + kerberos5i_read_write = false + kerberos5p_read_only = false + kerberos5p_read_write = false + } + + data_protection_snapshot_policy { + snapshot_policy_id = azurerm_netapp_snapshot_policy.test.id + } + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } + } + + volume { + name = "acctest-NetAppVolume-4-%[2]d" + volume_path = "my-unique-file-path-4-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + proximity_placement_group_id = azurerm_proximity_placement_group.test.id + volume_spec_name = "data-backup" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv3"] + security_style = "Unix" + snapshot_directory_visible = false + + export_policy_rule { + rule_index = 1 + allowed_clients = "0.0.0.0/0" + cifs_enabled = false + nfsv3_enabled = true + nfsv41_enabled = false + unix_read_only = false + unix_read_write = true + root_access_enabled = false + kerberos5_read_only = false + kerberos5_read_write = false + kerberos5i_read_only = false + kerberos5i_read_write = false + kerberos5p_read_only = false + kerberos5p_read_write = false + } + + data_protection_snapshot_policy { + snapshot_policy_id = azurerm_netapp_snapshot_policy.test.id + } + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } + } + + volume { + name = "acctest-NetAppVolume-5-%[2]d" + volume_path = "my-unique-file-path-5-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + proximity_placement_group_id = azurerm_proximity_placement_group.test.id + volume_spec_name = "log-backup" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv3"] + security_style = "Unix" + snapshot_directory_visible = false + + export_policy_rule { + rule_index = 1 + allowed_clients = "0.0.0.0/0" + cifs_enabled = false + nfsv3_enabled = true + nfsv41_enabled = false + unix_read_only = false + unix_read_write = true + root_access_enabled = false + kerberos5_read_only = false + kerberos5_read_write = false + kerberos5i_read_only = false + kerberos5i_read_write = false + kerberos5p_read_only = false + kerberos5p_read_write = false + } + + data_protection_snapshot_policy { + snapshot_policy_id = azurerm_netapp_snapshot_policy.test.id + } + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } + } + + depends_on = [ + azurerm_linux_virtual_machine.test, + azurerm_proximity_placement_group.test + ] +} +`, template, data.RandomInteger) +} + func (NetAppVolumeGroupResource) templatePPG(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { diff --git a/internal/services/netapp/netapp_volume_resource.go b/internal/services/netapp/netapp_volume_resource.go index 9a39a972f4cc..cb533602b8ce 100644 --- a/internal/services/netapp/netapp_volume_resource.go +++ b/internal/services/netapp/netapp_volume_resource.go @@ -4,7 +4,6 @@ import ( "context" "fmt" "log" - "strconv" "strings" "time" @@ -757,133 +756,6 @@ func waitForReplAuthorization(ctx context.Context, client *volumesreplication.Vo return nil } -func waitForReplMirrorState(ctx context.Context, client *volumesreplication.VolumesReplicationClient, id volumesreplication.VolumeId, desiredState string) error { - deadline, ok := ctx.Deadline() - if !ok { - return fmt.Errorf("context had no deadline") - } - stateConf := &pluginsdk.StateChangeConf{ - ContinuousTargetOccurence: 5, - Delay: 10 * time.Second, - MinTimeout: 10 * time.Second, - Pending: []string{"200"}, // 200 means mirror state is still Mirrored - Target: []string{"204"}, // 204 means mirror state is <> than Mirrored - Refresh: netappVolumeReplicationMirrorStateRefreshFunc(ctx, client, id, desiredState), - Timeout: time.Until(deadline), - } - - if _, err := stateConf.WaitForStateContext(ctx); err != nil { - return fmt.Errorf("waiting for %s to be in the state %q: %+v", id, desiredState, err) - } - - return nil -} - -func waitForReplicationDeletion(ctx context.Context, client *volumesreplication.VolumesReplicationClient, id volumesreplication.VolumeId) error { - deadline, ok := ctx.Deadline() - if !ok { - return fmt.Errorf("context had no deadline") - } - - stateConf := &pluginsdk.StateChangeConf{ - ContinuousTargetOccurence: 5, - Delay: 10 * time.Second, - MinTimeout: 10 * time.Second, - Pending: []string{"200", "202", "400"}, // TODO: Remove 400 when bug is fixed on RP side, where replicationStatus returns 400 while it is in "Deleting" state - Target: []string{"404"}, - Refresh: netappVolumeReplicationStateRefreshFunc(ctx, client, id), - Timeout: time.Until(deadline), - } - - if _, err := stateConf.WaitForStateContext(ctx); err != nil { - return fmt.Errorf("waiting for Replication of %s to be deleted: %+v", id, err) - } - - return nil -} - -func waitForVolumeDeletion(ctx context.Context, client *volumes.VolumesClient, id volumes.VolumeId) error { - deadline, ok := ctx.Deadline() - if !ok { - return fmt.Errorf("context had no deadline") - } - stateConf := &pluginsdk.StateChangeConf{ - ContinuousTargetOccurence: 5, - Delay: 10 * time.Second, - MinTimeout: 10 * time.Second, - Pending: []string{"200", "202"}, - Target: []string{"204", "404"}, - Refresh: netappVolumeStateRefreshFunc(ctx, client, id), - Timeout: time.Until(deadline), - } - - if _, err := stateConf.WaitForStateContext(ctx); err != nil { - return fmt.Errorf("waiting for %s to be deleted: %+v", id, err) - } - - return nil -} - -func netappVolumeStateRefreshFunc(ctx context.Context, client *volumes.VolumesClient, id volumes.VolumeId) pluginsdk.StateRefreshFunc { - return func() (interface{}, string, error) { - res, err := client.Get(ctx, id) - if err != nil { - if !response.WasNotFound(res.HttpResponse) { - return nil, "", fmt.Errorf("retrieving %s: %s", id, err) - } - } - - return res, strconv.Itoa(res.HttpResponse.StatusCode), nil - } -} - -func netappVolumeReplicationMirrorStateRefreshFunc(ctx context.Context, client *volumesreplication.VolumesReplicationClient, id volumesreplication.VolumeId, desiredState string) pluginsdk.StateRefreshFunc { - validStates := []string{"mirrored", "broken", "uninitialized"} - - return func() (interface{}, string, error) { - // Possible Mirror States to be used as desiredStates: - // mirrored, broken or uninitialized - if !utils.SliceContainsValue(validStates, strings.ToLower(desiredState)) { - return nil, "", fmt.Errorf("invalid desired mirror state was passed to check mirror replication state (%s), possible values: (%+v)", desiredState, volumesreplication.PossibleValuesForMirrorState()) - } - - res, err := client.VolumesReplicationStatus(ctx, id) - if err != nil { - if !response.WasNotFound(res.HttpResponse) { - return nil, "", fmt.Errorf("retrieving replication status information from %s: %s", id, err) - } - } - - // TODO: fix this refresh function to use strings instead of fake status codes - // Setting 200 as default response - response := 200 - if res.Model != nil && res.Model.MirrorState != nil && strings.EqualFold(string(*res.Model.MirrorState), desiredState) { - // return 204 if state matches desired state - response = 204 - } - - return res, strconv.Itoa(response), nil - } -} - -func netappVolumeReplicationStateRefreshFunc(ctx context.Context, client *volumesreplication.VolumesReplicationClient, id volumesreplication.VolumeId) pluginsdk.StateRefreshFunc { - return func() (interface{}, string, error) { - res, err := client.VolumesReplicationStatus(ctx, id) - if err != nil { - if httpResponse := res.HttpResponse; httpResponse != nil { - if httpResponse.StatusCode == 400 && (strings.Contains(strings.ToLower(err.Error()), "deleting") || strings.Contains(strings.ToLower(err.Error()), "volume replication missing or deleted")) { - // This error can be ignored until a bug is fixed on RP side that it is returning 400 while the replication is in "Deleting" process - // TODO: remove this workaround when above bug is fixed - } else if !response.WasNotFound(httpResponse) { - return nil, "", fmt.Errorf("retrieving replication status from %s: %s", id, err) - } - } - } - - return res, strconv.Itoa(res.HttpResponse.StatusCode), nil - } -} - func expandNetAppVolumeExportPolicyRule(input []interface{}) *volumes.VolumePropertiesExportPolicy { results := make([]volumes.ExportPolicyRule, 0) for _, item := range input { From e40ed3d0c79e939afb70c6cbef2edec822e1ba94 Mon Sep 17 00:00:00 2001 From: Paulo Date: Tue, 26 Jul 2022 17:10:36 -0700 Subject: [PATCH 18/83] WIP: snapshot id support --- internal/services/netapp/netapp_volume.go | 29 ++++++++++++++----- .../netapp/netapp_volume_group_resource.go | 2 +- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/internal/services/netapp/netapp_volume.go b/internal/services/netapp/netapp_volume.go index ee4de7bdaa13..9e163660d142 100644 --- a/internal/services/netapp/netapp_volume.go +++ b/internal/services/netapp/netapp_volume.go @@ -194,7 +194,7 @@ func expandNetAppVolumeGroupVolumes(input []NetAppVolumeGroupVolume, id volumegr return &results, nil } -func flattenNetAppVolumeGroupVolumes(input *[]volumegroups.VolumeGroupVolumeProperties) ([]NetAppVolumeGroupVolume, error) { +func flattenNetAppVolumeGroupVolumes(ctx context.Context, input *[]volumegroups.VolumeGroupVolumeProperties, metadata sdk.ResourceMetaData) ([]NetAppVolumeGroupVolume, error) { results := make([]NetAppVolumeGroupVolume, 0) if len(*input) == 0 || input == nil { @@ -232,12 +232,25 @@ func flattenNetAppVolumeGroupVolumes(input *[]volumegroups.VolumeGroupVolumeProp volumeGroupVolume.MountIpAddresses = flattenNetAppVolumeGroupVolumesMountIpAddresses(props.MountTargets) } - if props.DataProtection != nil && props.DataProtection.Replication != nil { - volumeGroupVolume.DataProtectionReplication = flattenNetAppVolumeGroupVolumesDPReplication(props.DataProtection.Replication) + // Getting volume resource directly from standalone volime + // since VolumeGroup Volumes don't return DataProtection information + volumeClient := metadata.Client.NetApp.VolumeClient + id, err := volumes.ParseVolumeID(*item.Id) + if err != nil { + return []NetAppVolumeGroupVolume{}, err + } + + standaloneVol, err := volumeClient.Get(ctx, *id) + if err != nil { + return []NetAppVolumeGroupVolume{}, fmt.Errorf("retrieving %s: %v", id, err) + } + + if standaloneVol.Model.Properties.DataProtection != nil && standaloneVol.Model.Properties.DataProtection.Replication != nil { + volumeGroupVolume.DataProtectionReplication = flattenNetAppVolumeGroupVolumesDPReplication(standaloneVol.Model.Properties.DataProtection.Replication) } - if props.DataProtection != nil && props.DataProtection.Snapshot != nil { - volumeGroupVolume.DataProtectionSnapshotPolicy = flattenNetAppVolumeGroupVolumesDPSnapshotPolicy(props.DataProtection.Snapshot) + if standaloneVol.Model.Properties.DataProtection != nil && standaloneVol.Model.Properties.DataProtection.Snapshot != nil { + volumeGroupVolume.DataProtectionSnapshotPolicy = flattenNetAppVolumeGroupVolumesDPSnapshotPolicy(standaloneVol.Model.Properties.DataProtection.Snapshot) } results = append(results, volumeGroupVolume) @@ -293,7 +306,7 @@ func flattenNetAppVolumeGroupVolumesMountIpAddresses(input *[]volumegroups.Mount return results } -func flattenNetAppVolumeGroupVolumesDPReplication(input *volumegroups.ReplicationObject) []DataProtectionReplication { +func flattenNetAppVolumeGroupVolumesDPReplication(input *volumes.ReplicationObject) []DataProtectionReplication { if input == nil { return []DataProtectionReplication{} } @@ -312,14 +325,14 @@ func flattenNetAppVolumeGroupVolumesDPReplication(input *volumegroups.Replicatio } } -func flattenNetAppVolumeGroupVolumesDPSnapshotPolicy(input *volumegroups.VolumeSnapshotProperties) []DataProtectionSnapshotPolicy { +func flattenNetAppVolumeGroupVolumesDPSnapshotPolicy(input *volumes.VolumeSnapshotProperties) []DataProtectionSnapshotPolicy { if input == nil { return []DataProtectionSnapshotPolicy{} } return []DataProtectionSnapshotPolicy{ { - DataProtectionSnapshotPolicy: *input.SnapshotPolicyId, + DataProtectionSnapshotPolicy: string(*input.SnapshotPolicyId), }, } } diff --git a/internal/services/netapp/netapp_volume_group_resource.go b/internal/services/netapp/netapp_volume_group_resource.go index 5bbe37020b9e..e987b23ab83f 100644 --- a/internal/services/netapp/netapp_volume_group_resource.go +++ b/internal/services/netapp/netapp_volume_group_resource.go @@ -579,7 +579,7 @@ func (r NetAppVolumeGroupResource) Read() sdk.ResourceFunc { model.DeploymentSpecId = "20542149-bfca-5618-1879-9863dc6767f1" } - volumes, err := flattenNetAppVolumeGroupVolumes(props.Volumes) + volumes, err := flattenNetAppVolumeGroupVolumes(ctx, props.Volumes, metadata) if err != nil { return fmt.Errorf("setting `volume`: %+v", err) } From 65da1b4bc9a30b3eb3f8832fdccf9644628726f3 Mon Sep 17 00:00:00 2001 From: Paulo Date: Wed, 3 Aug 2022 11:21:04 -0700 Subject: [PATCH 19/83] WIP: enabling CRR on AVG --- .../netapp/netapp_volume_group_resource.go | 225 +++-- .../netapp_volume_group_resource_test.go | 823 ++++++++++++++++-- ...tapp_volume.go => netapp_volume_helper.go} | 248 +++++- .../services/netapp/netapp_volume_resource.go | 248 +----- 4 files changed, 1140 insertions(+), 404 deletions(-) rename internal/services/netapp/{netapp_volume.go => netapp_volume_helper.go} (73%) diff --git a/internal/services/netapp/netapp_volume_group_resource.go b/internal/services/netapp/netapp_volume_group_resource.go index e987b23ab83f..6ce64d1e1334 100644 --- a/internal/services/netapp/netapp_volume_group_resource.go +++ b/internal/services/netapp/netapp_volume_group_resource.go @@ -4,12 +4,17 @@ import ( "bytes" "context" "fmt" + "log" "net/http" + "strings" "time" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" + "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" netAppValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/netapp/validate" @@ -88,21 +93,27 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { }, "deployment_spec_id": { - Type: pluginsdk.TypeString, - Optional: true, - ForceNew: true, - ValidateFunc: validation.IsUUID, - Default: "20542149-bfca-5618-1879-9863dc6767f1", + Type: pluginsdk.TypeString, + Optional: true, + ForceNew: true, + Default: "20542149-bfca-5618-1879-9863dc6767f1", + ValidateFunc: validation.StringInSlice([]string{ + "20542149-bfca-5618-1879-9863dc6767f1", + }, false), }, "volume": { Type: pluginsdk.TypeSet, Required: true, - ForceNew: true, MinItems: 5, MaxItems: 5, Elem: &pluginsdk.Resource{ Schema: map[string]*pluginsdk.Schema{ + "id": { + Type: pluginsdk.TypeString, + Computed: true, + }, + "name": { Type: pluginsdk.TypeString, Required: true, @@ -127,6 +138,13 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { "volume_spec_name": { Type: pluginsdk.TypeString, Required: true, + ValidateFunc: validation.StringInSlice([]string{ + "data", + "data-backup", + "log", + "log-backup", + "shared", + }, false), }, "volume_path": { @@ -158,13 +176,12 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { Type: pluginsdk.TypeSet, ForceNew: true, Required: true, - MaxItems: 2, + MaxItems: 1, Elem: &pluginsdk.Schema{ Type: pluginsdk.TypeString, ValidateFunc: validation.StringInSlice([]string{ "NFSv3", "NFSv4.1", - "CIFS", }, false), }, }, @@ -207,11 +224,6 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { Required: true, }, - "cifs_enabled": { - Type: pluginsdk.TypeBool, - Required: true, - }, - "nfsv3_enabled": { Type: pluginsdk.TypeBool, Required: true, @@ -236,36 +248,6 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { Type: pluginsdk.TypeBool, Required: true, }, - - "kerberos5_read_only": { - Type: pluginsdk.TypeBool, - Required: true, - }, - - "kerberos5_read_write": { - Type: pluginsdk.TypeBool, - Required: true, - }, - - "kerberos5i_read_only": { - Type: pluginsdk.TypeBool, - Required: true, - }, - - "kerberos5i_read_write": { - Type: pluginsdk.TypeBool, - Required: true, - }, - - "kerberos5p_read_only": { - Type: pluginsdk.TypeBool, - Required: true, - }, - - "kerberos5p_read_write": { - Type: pluginsdk.TypeBool, - Required: true, - }, }, }, }, @@ -377,9 +359,6 @@ func resourceVolumeGroupVolumeListHash(v interface{}) int { if allowedClients, ok := v["allowed_clients"].(string); ok { buf.WriteString(fmt.Sprintf("%s-", allowedClients)) } - if cifsEnabled, ok := v["cifs_enabled"].(bool); ok { - buf.WriteString(fmt.Sprintf("%t-", cifsEnabled)) - } if nfsv3Enabled, ok := v["nfsv3_enabled"].(bool); ok { buf.WriteString(fmt.Sprintf("%t-", nfsv3Enabled)) } @@ -395,24 +374,6 @@ func resourceVolumeGroupVolumeListHash(v interface{}) int { if rootAccessEnabled, ok := v["root_access_enabled"].(bool); ok { buf.WriteString(fmt.Sprintf("%t-", rootAccessEnabled)) } - if kerberos5ReadOnly, ok := v["kerberos5_read_only"].(bool); ok { - buf.WriteString(fmt.Sprintf("%t-", kerberos5ReadOnly)) - } - if kerberos5ReadWrite, ok := v["kerberos5_read_write"].(bool); ok { - buf.WriteString(fmt.Sprintf("%t-", kerberos5ReadWrite)) - } - if kerberos5iReadOnly, ok := v["kerberos5i_read_only"].(bool); ok { - buf.WriteString(fmt.Sprintf("%t-", kerberos5iReadOnly)) - } - if kerberos5iReadWrite, ok := v["kerberos5i_read_write"].(bool); ok { - buf.WriteString(fmt.Sprintf("%t-", kerberos5iReadWrite)) - } - if kerberos5pReadOnly, ok := v["kerberos5p_read_only"].(bool); ok { - buf.WriteString(fmt.Sprintf("%t-", kerberos5pReadOnly)) - } - if kerberos5pReadWrite, ok := v["kerberos5p_read_write"].(bool); ok { - buf.WriteString(fmt.Sprintf("%t-", kerberos5pReadWrite)) - } } } @@ -472,6 +433,8 @@ func (r NetAppVolumeGroupResource) Create() sdk.ResourceFunc { Timeout: 90 * time.Minute, Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { client := metadata.Client.NetApp.VolumeGroupClient + replicationClient := metadata.Client.NetApp.VolumeReplicationClient + subscriptionId := metadata.Client.Account.SubscriptionId var model NetAppVolumeGroupModel @@ -498,6 +461,18 @@ func (r NetAppVolumeGroupResource) Create() sdk.ResourceFunc { return err } + // Parse volume list to set secondary volumes for CRR + for i, volumeCrr := range *volumeList { + if volumeCrr.Properties.DataProtection != nil && + volumeCrr.Properties.DataProtection.Replication != nil && + *volumeCrr.Properties.DataProtection.Replication.EndpointType == volumegroups.EndpointTypeDst { + + // Modify volumeType as data protection type on main volumeList + // so it gets created correctly as data protection volume + (*volumeList)[i].Properties.VolumeType = utils.String("DataProtection") + } + } + parameters := volumegroups.VolumeGroupDetails{ Location: utils.String(location.Normalize(model.Location)), Properties: &volumegroups.VolumeGroupProperties{ @@ -522,6 +497,42 @@ func (r NetAppVolumeGroupResource) Create() sdk.ResourceFunc { // return err // } + // CRR - Authorizing secondaries from primary volumes + for _, volumeCrr := range *volumeList { + if volumeCrr.Properties.DataProtection != nil && + volumeCrr.Properties.DataProtection.Replication != nil && + *volumeCrr.Properties.DataProtection.Replication.EndpointType == volumegroups.EndpointTypeDst { + + // Getting secondary volume resource id + secondaryId := volumes.NewVolumeID(subscriptionId, + model.ResourceGroupName, + model.AccountName, + getResourceNameString(volumeCrr.Properties.CapacityPoolResourceId), + getResourceNameString(volumeCrr.Name), + ) + + // Getting primary resource id + primaryId, err := volumesreplication.ParseVolumeID(volumeCrr.Properties.DataProtection.Replication.RemoteVolumeResourceId) + if err != nil { + return err + } + + // Authorizing + if err = replicationClient.VolumesAuthorizeReplicationThenPoll(ctx, *primaryId, volumesreplication.AuthorizeRequest{ + RemoteVolumeResourceId: utils.String(secondaryId.ID()), + }, + ); err != nil { + return fmt.Errorf("cannot authorize volume replication: %v", err) + } + + // Wait for volume replication authorization to complete + log.Printf("[DEBUG] Waiting for replication authorization on %s to complete", id) + if err := waitForReplAuthorization(ctx, replicationClient, *primaryId); err != nil { + return err + } + } + } + metadata.SetID(id) return nil @@ -529,6 +540,92 @@ func (r NetAppVolumeGroupResource) Create() sdk.ResourceFunc { } } +func (r NetAppVolumeGroupResource) Update() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 120 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + volumeClient := metadata.Client.NetApp.VolumeClient + + id, err := volumes.ParseVolumeID(metadata.ResourceData.Id()) + if err != nil { + return err + } + + metadata.Logger.Infof("Decoding state for %s", id) + var state NetAppVolumeGroupModel + if err := metadata.Decode(&state); err != nil { + return err + } + + metadata.Logger.Infof("Updating %s", id) + + if metadata.ResourceData.HasChange("volume") { + + // Iterating over each volume and performing individual patch + for i := 0; i < metadata.ResourceData.Get("volume.#").(int); i++ { + + // Checking if individual volume has a change + volumeItem := fmt.Sprintf("volume.%v", i) + + if metadata.ResourceData.HasChange(volumeItem) { + + update := volumes.VolumePatch{ + Properties: &volumes.VolumePatchProperties{}, + } + + if metadata.ResourceData.HasChange(fmt.Sprintf("%v.storage_quota_in_gb", volumeItem)) { + storageQuotaInBytes := int64(metadata.ResourceData.Get(fmt.Sprintf("%v.storage_quota_in_gb", volumeItem)).(int) * 1073741824) + update.Properties.UsageThreshold = utils.Int64(storageQuotaInBytes) + } + + if metadata.ResourceData.HasChange(fmt.Sprintf("%v.export_policy_rule", volumeItem)) { + exportPolicyRuleRaw := metadata.ResourceData.Get(fmt.Sprintf("%v.export_policy_rule", volumeItem)).([]interface{}) + exportPolicyRule := expandNetAppVolumeGroupVolumeExportPolicyRulePatch(exportPolicyRuleRaw) + update.Properties.ExportPolicy = exportPolicyRule + } + + if metadata.ResourceData.HasChange(fmt.Sprintf("%v.data_protection_snapshot_policy", volumeItem)) { + // Validating that snapshot policies are not being created in a data protection volume + dataProtectionReplicationRaw := metadata.ResourceData.Get(fmt.Sprintf("%v.data_protection_replication", volumeItem)).([]interface{}) + dataProtectionReplication := expandNetAppVolumeDataProtectionReplication(dataProtectionReplicationRaw) + + if dataProtectionReplication != nil && dataProtectionReplication.Replication != nil && dataProtectionReplication.Replication.EndpointType != nil && strings.ToLower(string(*dataProtectionReplication.Replication.EndpointType)) == "dst" { + return fmt.Errorf("snapshot policy cannot be enabled on a data protection volume, %s", id) + } + + dataProtectionSnapshotPolicyRaw := metadata.ResourceData.Get(fmt.Sprintf("%v.data_protection_snapshot_policy", volumeItem)).([]interface{}) + dataProtectionSnapshotPolicy := expandNetAppVolumeDataProtectionSnapshotPolicyPatch(dataProtectionSnapshotPolicyRaw) + update.Properties.DataProtection = dataProtectionSnapshotPolicy + } + + if metadata.ResourceData.HasChange(fmt.Sprintf("%v.throughput_in_mibps", volumeItem)) { + throughputMibps := metadata.ResourceData.Get(fmt.Sprintf("%v.throughput_in_mibps", volumeItem)) + update.Properties.ThroughputMibps = utils.Float(throughputMibps.(float64)) + } + + if metadata.ResourceData.HasChange(fmt.Sprintf("%v.tags", volumeItem)) { + tagsRaw := metadata.ResourceData.Get(fmt.Sprintf("%v.tags", volumeItem)).(map[string]interface{}) + update.Tags = tags.Expand(tagsRaw) + } + + if err = volumeClient.UpdateThenPoll(ctx, *id, update); err != nil { + return fmt.Errorf("updating %s: %+v", id, err) + } + + // Wait for volume to complete update + if err := waitForVolumeCreateOrUpdate(ctx, volumeClient, *id); err != nil { + return err + } + + } + } + } + + return nil + }, + } +} + func (r NetAppVolumeGroupResource) Read() sdk.ResourceFunc { return sdk.ResourceFunc{ Timeout: 5 * time.Minute, diff --git a/internal/services/netapp/netapp_volume_group_resource_test.go b/internal/services/netapp/netapp_volume_group_resource_test.go index 031544da2eac..5cbed043e773 100644 --- a/internal/services/netapp/netapp_volume_group_resource_test.go +++ b/internal/services/netapp/netapp_volume_group_resource_test.go @@ -46,6 +46,44 @@ func TestAccNetAppVolumeGroup_snapshotPolicy(t *testing.T) { }) } +func TestAccNetAppVolumeGroup_volumeUpdates(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_netapp_volume_group", "test") + r := NetAppVolumeGroupResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + { + Config: r.updateVolumes(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + }) +} + +func TestAccNetAppVolumeGroup_crossRegionReplication(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_netapp_volume_group", "test_secondary") + r := NetAppVolumeGroupResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.crossRegionReplication(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("volume.0.data_protection_replication.0.endpoint_type").HasValue("dst"), + ), + }, + data.ImportStep(), + }) +} + func (t NetAppVolumeGroupResource) Exists(ctx context.Context, clients *clients.Client, state *terraform.InstanceState) (*bool, error) { id, err := volumegroups.ParseVolumeGroupID(state.ID) if err != nil { @@ -96,18 +134,11 @@ resource "azurerm_netapp_volume_group" "test" { export_policy_rule { rule_index = 1 allowed_clients = "0.0.0.0/0" - cifs_enabled = false nfsv3_enabled = true nfsv41_enabled = false unix_read_only = false unix_read_write = true root_access_enabled = false - kerberos5_read_only = false - kerberos5_read_write = false - kerberos5i_read_only = false - kerberos5i_read_write = false - kerberos5p_read_only = false - kerberos5p_read_write = false } tags = { @@ -133,18 +164,11 @@ resource "azurerm_netapp_volume_group" "test" { export_policy_rule { rule_index = 1 allowed_clients = "0.0.0.0/0" - cifs_enabled = false nfsv3_enabled = true nfsv41_enabled = false unix_read_only = false unix_read_write = true root_access_enabled = false - kerberos5_read_only = false - kerberos5_read_write = false - kerberos5i_read_only = false - kerberos5i_read_write = false - kerberos5p_read_only = false - kerberos5p_read_write = false } tags = { @@ -170,18 +194,11 @@ resource "azurerm_netapp_volume_group" "test" { export_policy_rule { rule_index = 1 allowed_clients = "0.0.0.0/0" - cifs_enabled = false nfsv3_enabled = true nfsv41_enabled = false unix_read_only = false unix_read_write = true root_access_enabled = false - kerberos5_read_only = false - kerberos5_read_write = false - kerberos5i_read_only = false - kerberos5i_read_write = false - kerberos5p_read_only = false - kerberos5p_read_write = false } tags = { @@ -207,18 +224,11 @@ resource "azurerm_netapp_volume_group" "test" { export_policy_rule { rule_index = 1 allowed_clients = "0.0.0.0/0" - cifs_enabled = false nfsv3_enabled = true nfsv41_enabled = false unix_read_only = false unix_read_write = true root_access_enabled = false - kerberos5_read_only = false - kerberos5_read_write = false - kerberos5i_read_only = false - kerberos5i_read_write = false - kerberos5p_read_only = false - kerberos5p_read_write = false } tags = { @@ -244,18 +254,11 @@ resource "azurerm_netapp_volume_group" "test" { export_policy_rule { rule_index = 1 allowed_clients = "0.0.0.0/0" - cifs_enabled = false nfsv3_enabled = true nfsv41_enabled = false unix_read_only = false unix_read_write = true root_access_enabled = false - kerberos5_read_only = false - kerberos5_read_write = false - kerberos5i_read_only = false - kerberos5i_read_write = false - kerberos5p_read_only = false - kerberos5p_read_write = false } tags = { @@ -324,18 +327,11 @@ resource "azurerm_netapp_volume_group" "test" { export_policy_rule { rule_index = 1 allowed_clients = "0.0.0.0/0" - cifs_enabled = false nfsv3_enabled = true nfsv41_enabled = false unix_read_only = false unix_read_write = true root_access_enabled = false - kerberos5_read_only = false - kerberos5_read_write = false - kerberos5i_read_only = false - kerberos5i_read_write = false - kerberos5p_read_only = false - kerberos5p_read_write = false } data_protection_snapshot_policy { @@ -365,18 +361,11 @@ resource "azurerm_netapp_volume_group" "test" { export_policy_rule { rule_index = 1 allowed_clients = "0.0.0.0/0" - cifs_enabled = false nfsv3_enabled = true nfsv41_enabled = false unix_read_only = false unix_read_write = true root_access_enabled = false - kerberos5_read_only = false - kerberos5_read_write = false - kerberos5i_read_only = false - kerberos5i_read_write = false - kerberos5p_read_only = false - kerberos5p_read_write = false } data_protection_snapshot_policy { @@ -406,18 +395,11 @@ resource "azurerm_netapp_volume_group" "test" { export_policy_rule { rule_index = 1 allowed_clients = "0.0.0.0/0" - cifs_enabled = false nfsv3_enabled = true nfsv41_enabled = false unix_read_only = false unix_read_write = true root_access_enabled = false - kerberos5_read_only = false - kerberos5_read_write = false - kerberos5i_read_only = false - kerberos5i_read_write = false - kerberos5p_read_only = false - kerberos5p_read_write = false } data_protection_snapshot_policy { @@ -447,18 +429,11 @@ resource "azurerm_netapp_volume_group" "test" { export_policy_rule { rule_index = 1 allowed_clients = "0.0.0.0/0" - cifs_enabled = false nfsv3_enabled = true nfsv41_enabled = false unix_read_only = false unix_read_write = true root_access_enabled = false - kerberos5_read_only = false - kerberos5_read_write = false - kerberos5i_read_only = false - kerberos5i_read_write = false - kerberos5p_read_only = false - kerberos5p_read_write = false } data_protection_snapshot_policy { @@ -488,18 +463,11 @@ resource "azurerm_netapp_volume_group" "test" { export_policy_rule { rule_index = 1 allowed_clients = "0.0.0.0/0" - cifs_enabled = false nfsv3_enabled = true nfsv41_enabled = false unix_read_only = false unix_read_write = true root_access_enabled = false - kerberos5_read_only = false - kerberos5_read_write = false - kerberos5i_read_only = false - kerberos5i_read_write = false - kerberos5p_read_only = false - kerberos5p_read_write = false } data_protection_snapshot_policy { @@ -520,6 +488,719 @@ resource "azurerm_netapp_volume_group" "test" { `, template, data.RandomInteger) } +func (NetAppVolumeGroupResource) updateVolumes(data acceptance.TestData) string { + template := NetAppVolumeGroupResource{}.templatePPG(data) + return fmt.Sprintf(` +%[1]s + +resource "azurerm_netapp_volume_group" "test" { + name = "acctest-NetAppVolumeGroup-%[2]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + account_name = azurerm_netapp_account.test.name + group_description = "Test volume group" + application_type = "SAP-HANA" + application_identifier = "TST" + deployment_spec_id = "20542149-bfca-5618-1879-9863dc6767f1" + + volume { + name = "acctest-NetAppVolume-1-%[2]d" + volume_path = "my-unique-file-path-1-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + proximity_placement_group_id = azurerm_proximity_placement_group.test.id + volume_spec_name = "data" + storage_quota_in_gb = 1200 + throughput_in_mibps = 24 + protocols = ["NFSv3"] + security_style = "Unix" + snapshot_directory_visible = false + + export_policy_rule { + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = true + nfsv41_enabled = false + unix_read_only = false + unix_read_write = true + root_access_enabled = false + } + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } + } + + volume { + name = "acctest-NetAppVolume-2-%[2]d" + volume_path = "my-unique-file-path-2-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + proximity_placement_group_id = azurerm_proximity_placement_group.test.id + volume_spec_name = "log" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv3"] + security_style = "Unix" + snapshot_directory_visible = false + + export_policy_rule { + rule_index = 1 + allowed_clients = "10.0.0.0/8" + nfsv3_enabled = true + nfsv41_enabled = false + unix_read_only = false + unix_read_write = true + root_access_enabled = false + } + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } + } + + volume { + name = "acctest-NetAppVolume-3-%[2]d" + volume_path = "my-unique-file-path-3-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + proximity_placement_group_id = azurerm_proximity_placement_group.test.id + volume_spec_name = "shared" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv3"] + security_style = "Unix" + snapshot_directory_visible = false + + export_policy_rule { + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = true + nfsv41_enabled = false + unix_read_only = false + unix_read_write = true + root_access_enabled = false + } + + tags = { + "CreatedOnDate" = "2022-07-27T12:00:00Z", + "SkipASMAzSecPack" = "true" + } + } + + volume { + name = "acctest-NetAppVolume-4-%[2]d" + volume_path = "my-unique-file-path-4-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + proximity_placement_group_id = azurerm_proximity_placement_group.test.id + volume_spec_name = "data-backup" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv3"] + security_style = "Unix" + snapshot_directory_visible = false + + export_policy_rule { + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = true + nfsv41_enabled = false + unix_read_only = false + unix_read_write = true + root_access_enabled = false + } + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } + } + + volume { + name = "acctest-NetAppVolume-5-%[2]d" + volume_path = "my-unique-file-path-5-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + proximity_placement_group_id = azurerm_proximity_placement_group.test.id + volume_spec_name = "log-backup" + storage_quota_in_gb = 1200 + throughput_in_mibps = 24 + protocols = ["NFSv3"] + security_style = "Unix" + snapshot_directory_visible = false + + export_policy_rule { + rule_index = 1 + allowed_clients = "192.168.0.0/24" + nfsv3_enabled = true + nfsv41_enabled = false + unix_read_only = false + unix_read_write = true + root_access_enabled = false + } + + tags = { + "CreatedOnDate" = "2022-07-28T11:00:00Z", + "SkipASMAzSecPack" = "true" + } + } + + depends_on = [ + azurerm_linux_virtual_machine.test, + azurerm_proximity_placement_group.test + ] +} +`, template, data.RandomInteger) +} + +func (NetAppVolumeGroupResource) crossRegionReplication(data acceptance.TestData) string { + template := NetAppVolumeGroupResource{}.templateForAvgCrossRegionReplication(data) + return fmt.Sprintf(` +%[1]s + +resource "azurerm_netapp_volume_group" "test_primary" { + name = "acctest-NetAppVolumeGroup-Primary-%[2]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + account_name = azurerm_netapp_account.test.name + group_description = "Test volume group" + application_type = "SAP-HANA" + application_identifier = "TST" + deployment_spec_id = "20542149-bfca-5618-1879-9863dc6767f1" + + volume { + name = "acctest-NetAppVolume-1-Primary-%[2]d" + volume_path = "my-unique-file-path-1-Primary-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + proximity_placement_group_id = azurerm_proximity_placement_group.test.id + volume_spec_name = "data" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv3"] + security_style = "Unix" + snapshot_directory_visible = false + + export_policy_rule { + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = true + nfsv41_enabled = false + unix_read_only = false + unix_read_write = true + root_access_enabled = false + } + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } + } + + volume { + name = "acctest-NetAppVolume-2-Primary-%[2]d" + volume_path = "my-unique-file-path-2-Primary-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + proximity_placement_group_id = azurerm_proximity_placement_group.test.id + volume_spec_name = "log" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv3"] + security_style = "Unix" + snapshot_directory_visible = false + + export_policy_rule { + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = true + nfsv41_enabled = false + unix_read_only = false + unix_read_write = true + root_access_enabled = false + } + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } + } + + volume { + name = "acctest-NetAppVolume-3-Primary-%[2]d" + volume_path = "my-unique-file-path-3-Primary-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + proximity_placement_group_id = azurerm_proximity_placement_group.test.id + volume_spec_name = "shared" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv3"] + security_style = "Unix" + snapshot_directory_visible = false + + export_policy_rule { + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = true + nfsv41_enabled = false + unix_read_only = false + unix_read_write = true + root_access_enabled = false + } + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } + } + + volume { + name = "acctest-NetAppVolume-4-Primary-%[2]d" + volume_path = "my-unique-file-path-4-Primary-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + proximity_placement_group_id = azurerm_proximity_placement_group.test.id + volume_spec_name = "data-backup" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv3"] + security_style = "Unix" + snapshot_directory_visible = false + + export_policy_rule { + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = true + nfsv41_enabled = false + unix_read_only = false + unix_read_write = true + root_access_enabled = false + } + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } + } + + volume { + name = "acctest-NetAppVolume-5-Primary-%[2]d" + volume_path = "my-unique-file-path-5-Primary-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + proximity_placement_group_id = azurerm_proximity_placement_group.test.id + volume_spec_name = "log-backup" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv3"] + security_style = "Unix" + snapshot_directory_visible = false + + export_policy_rule { + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = true + nfsv41_enabled = false + unix_read_only = false + unix_read_write = true + root_access_enabled = false + } + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } + } + + depends_on = [ + azurerm_linux_virtual_machine.test, + azurerm_proximity_placement_group.test + ] +} + +resource "azurerm_netapp_volume_group" "test_secondary" { + name = "acctest-NetAppVolumeGroup-Secondary-%[2]d" + location = %[3]s + resource_group_name = azurerm_resource_group.test.name + account_name = azurerm_netapp_account.test_secondary.name + group_description = "Test volume group" + application_type = "SAP-HANA" + application_identifier = "TST" + deployment_spec_id = "20542149-bfca-5618-1879-9863dc6767f1" + + volume { + name = "acctest-NetAppVolume-1-Secondary-%[2]d" + volume_path = "my-unique-file-path-1-Secondary-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test_secondary.id + subnet_id = azurerm_subnet.test_secondary.id + proximity_placement_group_id = azurerm_proximity_placement_group.test_secondary.id + volume_spec_name = "data" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv3"] + security_style = "Unix" + snapshot_directory_visible = false + + export_policy_rule { + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = true + nfsv41_enabled = false + unix_read_only = false + unix_read_write = true + root_access_enabled = false + } + + data_protection_replication { + endpoint_type = "dst" + remote_volume_location = azurerm_resource_group.test.location + remote_volume_resource_id = azurerm_netapp_volume_group.test_primary.volume.[0].id + replication_frequency = "10minutes" + } + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } + } + + volume { + name = "acctest-NetAppVolume-2-Secondary-%[2]d" + volume_path = "my-unique-file-path-2-Secondary-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test_secondary.id + subnet_id = azurerm_subnet.test_secondary.id + proximity_placement_group_id = azurerm_proximity_placement_group.test_secondary.id + volume_spec_name = "log" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv3"] + security_style = "Unix" + snapshot_directory_visible = false + + export_policy_rule { + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = true + nfsv41_enabled = false + unix_read_only = false + unix_read_write = true + root_access_enabled = false + } + + data_protection_replication { + endpoint_type = "dst" + remote_volume_location = azurerm_resource_group.test.location + remote_volume_resource_id = azurerm_netapp_volume_group.test_primary.volume.[1].id + replication_frequency = "10minutes" + } + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } + } + + volume { + name = "acctest-NetAppVolume-3-Secondary-%[2]d" + volume_path = "my-unique-file-path-3-Secondary-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test_secondary.id + subnet_id = azurerm_subnet.test_secondary.id + proximity_placement_group_id = azurerm_proximity_placement_group.test_secondary.id + volume_spec_name = "shared" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv3"] + security_style = "Unix" + snapshot_directory_visible = false + + export_policy_rule { + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = true + nfsv41_enabled = false + unix_read_only = false + unix_read_write = true + root_access_enabled = false + } + + data_protection_replication { + endpoint_type = "dst" + remote_volume_location = azurerm_resource_group.test.location + remote_volume_resource_id = azurerm_netapp_volume_group.test_primary.volume.[2].id + replication_frequency = "10minutes" + } + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } + } + + volume { + name = "acctest-NetAppVolume-4-Secondary-%[2]d" + volume_path = "my-unique-file-path-4-Secondary-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test_secondary.id + subnet_id = azurerm_subnet.test_secondary.id + proximity_placement_group_id = azurerm_proximity_placement_group.test_secondary.id + volume_spec_name = "data-backup" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv3"] + security_style = "Unix" + snapshot_directory_visible = false + + export_policy_rule { + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = true + nfsv41_enabled = false + unix_read_only = false + unix_read_write = true + root_access_enabled = false + } + + data_protection_replication { + endpoint_type = "dst" + remote_volume_location = azurerm_resource_group.test.location + remote_volume_resource_id = azurerm_netapp_volume_group.test_primary.volume.[3].id + replication_frequency = "10minutes" + } + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } + } + + volume { + name = "acctest-NetAppVolume-5-Secondary-%[2]d" + volume_path = "my-unique-file-path-5-Secondary-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test_secondary.id + subnet_id = azurerm_subnet.test_secondary.id + proximity_placement_group_id = azurerm_proximity_placement_group.test_secondary.id + volume_spec_name = "log-backup" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv3"] + security_style = "Unix" + snapshot_directory_visible = false + + export_policy_rule { + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = true + nfsv41_enabled = false + unix_read_only = false + unix_read_write = true + root_access_enabled = false + } + + data_protection_replication { + endpoint_type = "dst" + remote_volume_location = azurerm_resource_group.test.location + remote_volume_resource_id = azurerm_netapp_volume_group.test_primary.volume.[4].id + replication_frequency = "10minutes" + } + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } + } + + depends_on = [ + azurerm_linux_virtual_machine.test_secondary, + azurerm_proximity_placement_group.test_secondary, + + ] +} + +`, template, data.RandomInteger, "eastus2") +} + +func (r NetAppVolumeGroupResource) templateForAvgCrossRegionReplication(data acceptance.TestData) string { + template := NetAppVolumeGroupResource{}.templatePPG(data) + return fmt.Sprintf(` +%[1]s + +resource "azurerm_network_security_group" "test_secondary" { + name = "acctest-NSG-Secondary-%[2]d" + location = "%[3]s" + resource_group_name = azurerm_resource_group.test.name + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } +} + +resource "azurerm_virtual_network" "test_secondary" { + name = "acctest-VirtualNetwork-Secondary-%[2]d" + location = "%[3]s" + resource_group_name = azurerm_resource_group.test.name + address_space = ["10.6.0.0/16"] + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } +} + +resource "azurerm_subnet" "test_secondary" { + name = "acctest-DelegatedSubnet-%[2]d" + resource_group_name = azurerm_resource_group.test.name + virtual_network_name = azurerm_virtual_network.test_secondary.name + address_prefixes = ["10.6.2.0/24"] + + delegation { + name = "testdelegation" + + service_delegation { + name = "Microsoft.Netapp/volumes" + actions = ["Microsoft.Network/networkinterfaces/*", "Microsoft.Network/virtualNetworks/subnets/join/action"] + } + } +} + +resource "azurerm_subnet" "test1_secondary" { + name = "acctest-HostsSubnet-%[2]d" + resource_group_name = azurerm_resource_group.test.name + virtual_network_name = azurerm_virtual_network.test_secondary.name + address_prefixes = ["10.6.1.0/24"] +} + +resource "azurerm_subnet_network_security_group_association" "test_secondary" { + subnet_id = azurerm_subnet.test1_secondary.id + network_security_group_id = azurerm_network_security_group.test.id +} + +resource "azurerm_proximity_placement_group" "test_secondary" { + name = "acctest-PPG-Secondary-%[2]d" + location = "%[3]s" + resource_group_name = azurerm_resource_group.test.name + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } +} + +resource "azurerm_availability_set" "test_secondary" { + name = "acctest-avset-Secondary-%[2]d" + location = "%[3]s" + resource_group_name = azurerm_resource_group.test.name + + proximity_placement_group_id = azurerm_proximity_placement_group.test_secondary.id + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } +} + +resource "azurerm_network_interface" "test_secondary" { + name = "acctest-nic-Secondary-%[2]d" + resource_group_name = azurerm_resource_group.test.name + location = "%[3]s" + + ip_configuration { + name = "internal" + subnet_id = azurerm_subnet.test1_secondary.id + private_ip_address_allocation = "Dynamic" + } + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } +} + +resource "azurerm_linux_virtual_machine" "test_secondary" { + name = "acctest-vm-secondary-%[2]d" + resource_group_name = azurerm_resource_group.test.name + location = "%[3]s" + size = "Standard_M8ms" + admin_username = local.admin_username + admin_password = local.admin_password + disable_password_authentication = false + proximity_placement_group_id = azurerm_proximity_placement_group.test_secondary.id + availability_set_id = azurerm_availability_set.test_secondary.id + network_interface_ids = [ + azurerm_network_interface.test_secondary.id + ] + + source_image_reference { + publisher = "Canonical" + offer = "UbuntuServer" + sku = "18.04-LTS" + version = "latest" + } + + os_disk { + storage_account_type = "Standard_LRS" + caching = "ReadWrite" + } + + tags = { + "platformsettings.host_environment.service.platform_optedin_for_rootcerts" = "true", + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true", + "Owner" = "pmarques" + } +} + +resource "azurerm_netapp_account" "test_secondary" { + name = "acctest-NetAppAccount-Secondary-%[2]d" + location = "%[3]s" + resource_group_name = azurerm_resource_group.test.name + + depends_on = [ + azurerm_subnet.test_secondary, + azurerm_subnet.test1_secondary + ] + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } +} + +resource "azurerm_netapp_pool" "test_secondary" { + name = "acctest-NetAppPool-Secondary-%[2]d" + location = "%[3]s" + resource_group_name = azurerm_resource_group.test.name + account_name = azurerm_netapp_account.test_secondary.name + service_level = "Standard" + size_in_tb = 8 + qos_type = "Manual" + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } +} +`, template, data.RandomInteger, "eastus2") +} + func (NetAppVolumeGroupResource) templatePPG(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { @@ -703,5 +1384,5 @@ resource "azurerm_netapp_pool" "test" { "SkipASMAzSecPack" = "true" } } -`, data.RandomInteger, "westus") +`, data.RandomInteger, "westus2") } diff --git a/internal/services/netapp/netapp_volume.go b/internal/services/netapp/netapp_volume_helper.go similarity index 73% rename from internal/services/netapp/netapp_volume.go rename to internal/services/netapp/netapp_volume_helper.go index 9e163660d142..e7251b2af7e2 100644 --- a/internal/services/netapp/netapp_volume.go +++ b/internal/services/netapp/netapp_volume_helper.go @@ -18,6 +18,7 @@ import ( ) type NetAppVolumeGroupVolume struct { + Id string `tfschema:"id"` Name string `tfschema:"name"` VolumePath string `tfschema:"volume_path"` ServiceLevel string `tfschema:"service_level"` @@ -38,20 +39,13 @@ type NetAppVolumeGroupVolume struct { } type ExportPolicyRule struct { - RuleIndex int `tfschema:"rule_index"` - AllowedClients string `tfschema:"allowed_clients"` - CifsEnabled bool `tfschema:"cifs_enabled"` - Nfsv3Enabled bool `tfschema:"nfsv3_enabled"` - Nfsv41Enabled bool `tfschema:"nfsv41_enabled"` - UnixReadOnly bool `tfschema:"unix_read_only"` - UnixReadWrite bool `tfschema:"unix_read_write"` - RootAccessEnabled bool `tfschema:"root_access_enabled"` - Kerberos5ReadOnly bool `tfschema:"kerberos5_read_only"` - Kerberos5ReadWrite bool `tfschema:"kerberos5_read_write"` - Kerberos5iReadOnly bool `tfschema:"kerberos5i_read_only"` - Kerberos5iReadWrite bool `tfschema:"kerberos5i_read_write"` - Kerberos5pReadOnly bool `tfschema:"kerberos5p_read_only"` - Kerberos5pReadWrite bool `tfschema:"kerberos5p_read_write"` + RuleIndex int `tfschema:"rule_index"` + AllowedClients string `tfschema:"allowed_clients"` + Nfsv3Enabled bool `tfschema:"nfsv3_enabled"` + Nfsv41Enabled bool `tfschema:"nfsv41_enabled"` + UnixReadOnly bool `tfschema:"unix_read_only"` + UnixReadWrite bool `tfschema:"unix_read_write"` + RootAccessEnabled bool `tfschema:"root_access_enabled"` } type DataProtectionReplication struct { @@ -65,7 +59,7 @@ type DataProtectionSnapshotPolicy struct { DataProtectionSnapshotPolicy string `tfschema:"snapshot_policy_id"` } -func expandNetAppVolumeGroupExportPolicyRule(input []ExportPolicyRule) *volumegroups.VolumePropertiesExportPolicy { +func expandNetAppVolumeGroupVolumeExportPolicyRule(input []ExportPolicyRule) *volumegroups.VolumePropertiesExportPolicy { if len(input) == 0 || input == nil { return &volumegroups.VolumePropertiesExportPolicy{} @@ -74,21 +68,33 @@ func expandNetAppVolumeGroupExportPolicyRule(input []ExportPolicyRule) *volumegr results := make([]volumegroups.ExportPolicyRule, 0) for _, item := range input { + + // Hard-Coded values, for AVG these cannot be set diffrently + // they are not exposed as TF configuration + // but PUT request requires those fields to succeed + cifsEnabled := false + kerberos5ReadOnly := false + kerberos5ReadWrite := false + kerberos5iReadOnly := false + kerberos5iReadWrite := false + kerberos5pReadOnly := false + kerberos5pReadWrite := false + result := volumegroups.ExportPolicyRule{ AllowedClients: utils.String(item.AllowedClients), - Cifs: utils.Bool(item.CifsEnabled), + Cifs: utils.Bool(cifsEnabled), Nfsv3: utils.Bool(item.Nfsv3Enabled), Nfsv41: utils.Bool(item.Nfsv41Enabled), RuleIndex: utils.Int64(int64(item.RuleIndex)), UnixReadOnly: utils.Bool(item.UnixReadOnly), UnixReadWrite: utils.Bool(item.UnixReadWrite), HasRootAccess: utils.Bool(item.RootAccessEnabled), - Kerberos5ReadOnly: utils.Bool(item.Kerberos5ReadOnly), - Kerberos5ReadWrite: utils.Bool(item.Kerberos5ReadWrite), - Kerberos5iReadOnly: utils.Bool(item.Kerberos5iReadOnly), - Kerberos5iReadWrite: utils.Bool(item.Kerberos5iReadWrite), - Kerberos5pReadOnly: utils.Bool(item.Kerberos5pReadOnly), - Kerberos5pReadWrite: utils.Bool(item.Kerberos5ReadWrite), + Kerberos5ReadOnly: utils.Bool(kerberos5ReadOnly), + Kerberos5ReadWrite: utils.Bool(kerberos5ReadWrite), + Kerberos5iReadOnly: utils.Bool(kerberos5iReadOnly), + Kerberos5iReadWrite: utils.Bool(kerberos5iReadWrite), + Kerberos5pReadOnly: utils.Bool(kerberos5pReadOnly), + Kerberos5pReadWrite: utils.Bool(kerberos5pReadWrite), } results = append(results, result) @@ -161,7 +167,7 @@ func expandNetAppVolumeGroupVolumes(input []NetAppVolumeGroupVolume, id volumegr } storageQuotaInGB := int64(item.StorageQuotaInGB * 1073741824) - exportPolicyRule := expandNetAppVolumeGroupExportPolicyRule(item.ExportPolicy) + exportPolicyRule := expandNetAppVolumeGroupVolumeExportPolicyRule(item.ExportPolicy) dataProtectionReplication := expandNetAppVolumeGroupDataProtectionReplication(item.DataProtectionReplication) dataProtectionSnapshotPolicy := expandNetAppVolumeGroupDataProtectionSnapshotPolicy(item.DataProtectionSnapshotPolicy) @@ -253,6 +259,8 @@ func flattenNetAppVolumeGroupVolumes(ctx context.Context, input *[]volumegroups. volumeGroupVolume.DataProtectionSnapshotPolicy = flattenNetAppVolumeGroupVolumesDPSnapshotPolicy(standaloneVol.Model.Properties.DataProtection.Snapshot) } + volumeGroupVolume.Id = string(*standaloneVol.Model.Id) + results = append(results, volumeGroupVolume) } @@ -271,17 +279,10 @@ func flattenNetAppVolumeGroupVolumesExportPolicies(input *[]volumegroups.ExportP rule.RuleIndex = int(*item.RuleIndex) rule.AllowedClients = *item.AllowedClients - rule.CifsEnabled = *item.Cifs rule.Nfsv3Enabled = *item.Nfsv3 rule.Nfsv41Enabled = *item.Nfsv41 rule.UnixReadOnly = *item.UnixReadOnly rule.UnixReadWrite = *item.UnixReadWrite - rule.Kerberos5ReadOnly = *item.Kerberos5ReadOnly - rule.Kerberos5ReadWrite = *item.Kerberos5ReadWrite - rule.Kerberos5iReadOnly = *item.Kerberos5iReadOnly - rule.Kerberos5iReadWrite = *item.Kerberos5iReadWrite - rule.Kerberos5pReadOnly = *item.Kerberos5pReadOnly - rule.Kerberos5pReadWrite = *item.Kerberos5pReadWrite rule.RootAccessEnabled = *item.HasRootAccess results = append(results, rule) @@ -337,12 +338,137 @@ func flattenNetAppVolumeGroupVolumesDPSnapshotPolicy(input *volumes.VolumeSnapsh } } -func getNetworkFeaturesString(input *volumegroups.NetworkFeatures) string { - if input == nil { - return string(volumegroups.NetworkFeaturesBasic) +func expandNetAppVolumeGroupVolumeExportPolicyRulePatch(input []interface{}) *volumes.VolumePatchPropertiesExportPolicy { + results := make([]volumes.ExportPolicyRule, 0) + for _, item := range input { + if item != nil { + v := item.(map[string]interface{}) + ruleIndex := int64(v["rule_index"].(int)) + allowedClients := strings.Join(*utils.ExpandStringSlice(v["allowed_clients"].(*pluginsdk.Set).List()), ",") + + nfsv3Enabled := false + nfsv41Enabled := false + + // Hard-Coded values, for AVG these cannot be set diffrently + // they are not exposed as TF configuration + // but PUT request requires those fields to succeed + cifsEnabled := false + kerberos5ReadOnly := false + kerberos5ReadWrite := false + kerberos5iReadOnly := false + kerberos5iReadWrite := false + kerberos5pReadOnly := false + kerberos5pReadWrite := false + + if vpe := v["protocols_enabled"]; vpe != nil { + protocolsEnabled := vpe.([]interface{}) + if len(protocolsEnabled) != 0 { + for _, protocol := range protocolsEnabled { + if protocol != nil { + switch strings.ToLower(protocol.(string)) { + case "nfsv3": + nfsv3Enabled = true + case "nfsv4.1": + nfsv41Enabled = true + } + } + } + } + } + + unixReadOnly := v["unix_read_only"].(bool) + unixReadWrite := v["unix_read_write"].(bool) + rootAccessEnabled := v["root_access_enabled"].(bool) + + result := volumes.ExportPolicyRule{ + AllowedClients: utils.String(allowedClients), + Cifs: utils.Bool(cifsEnabled), + Nfsv3: utils.Bool(nfsv3Enabled), + Nfsv41: utils.Bool(nfsv41Enabled), + RuleIndex: utils.Int64(ruleIndex), + UnixReadOnly: utils.Bool(unixReadOnly), + UnixReadWrite: utils.Bool(unixReadWrite), + HasRootAccess: utils.Bool(rootAccessEnabled), + Kerberos5ReadOnly: utils.Bool(kerberos5ReadOnly), + Kerberos5ReadWrite: utils.Bool(kerberos5ReadWrite), + Kerberos5iReadOnly: utils.Bool(kerberos5iReadOnly), + Kerberos5iReadWrite: utils.Bool(kerberos5iReadWrite), + Kerberos5pReadOnly: utils.Bool(kerberos5pReadOnly), + Kerberos5pReadWrite: utils.Bool(kerberos5pReadWrite), + } + + results = append(results, result) + } + } + + return &volumes.VolumePatchPropertiesExportPolicy{ + Rules: &results, + } +} + +func expandNetAppVolumeDataProtectionReplication(input []interface{}) *volumes.VolumePropertiesDataProtection { + if len(input) == 0 || input[0] == nil { + return &volumes.VolumePropertiesDataProtection{} + } + + replicationObject := volumes.ReplicationObject{} + + replicationRaw := input[0].(map[string]interface{}) + + if v, ok := replicationRaw["endpoint_type"]; ok { + endpointType := volumes.EndpointType(v.(string)) + replicationObject.EndpointType = &endpointType + } + if v, ok := replicationRaw["remote_volume_location"]; ok { + replicationObject.RemoteVolumeRegion = utils.String(v.(string)) + } + if v, ok := replicationRaw["remote_volume_resource_id"]; ok { + replicationObject.RemoteVolumeResourceId = v.(string) + } + if v, ok := replicationRaw["replication_frequency"]; ok { + replicationSchedule := volumes.ReplicationSchedule(translateTFSchedule(v.(string))) + replicationObject.ReplicationSchedule = &replicationSchedule + } + + return &volumes.VolumePropertiesDataProtection{ + Replication: &replicationObject, + } +} + +func expandNetAppVolumeDataProtectionSnapshotPolicy(input []interface{}) *volumes.VolumePropertiesDataProtection { + if len(input) == 0 || input[0] == nil { + return &volumes.VolumePropertiesDataProtection{} + } + + snapshotObject := volumes.VolumeSnapshotProperties{} + + snapshotRaw := input[0].(map[string]interface{}) + + if v, ok := snapshotRaw["snapshot_policy_id"]; ok { + snapshotObject.SnapshotPolicyId = utils.String(v.(string)) + } + + return &volumes.VolumePropertiesDataProtection{ + Snapshot: &snapshotObject, + } +} + +func expandNetAppVolumeDataProtectionSnapshotPolicyPatch(input []interface{}) *volumes.VolumePatchPropertiesDataProtection { + if len(input) == 0 || input[0] == nil { + return &volumes.VolumePatchPropertiesDataProtection{} + } + + snapshotObject := volumes.VolumeSnapshotProperties{} + + snapshotRaw := input[0].(map[string]interface{}) + + if v, ok := snapshotRaw["snapshot_policy_id"]; ok { + snapshotObject.SnapshotPolicyId = utils.String(v.(string)) } - return string(*input) + return &volumes.VolumePatchPropertiesDataProtection{ + Snapshot: &snapshotObject, + } } func getResourceNameString(input *string) string { @@ -354,16 +480,6 @@ func getResourceNameString(input *string) string { return strings.Split(*input, "/")[segments-1] } -func getVolumeIndexbyName(input []NetAppVolumeGroupVolume, volumeName string) int { - for i, item := range input { - if item.Name == volumeName { - return i - } - } - - return -1 -} - func deleteVolume(ctx context.Context, metadata sdk.ResourceMetaData, volumeId string) error { client := metadata.Client.NetApp.VolumeClient @@ -560,6 +676,28 @@ func waitForVolumeDeletion(ctx context.Context, client *volumes.VolumesClient, i return nil } +func waitForVolumeCreateOrUpdate(ctx context.Context, client *volumes.VolumesClient, id volumes.VolumeId) error { + deadline, ok := ctx.Deadline() + if !ok { + return fmt.Errorf("context had no deadline") + } + stateConf := &pluginsdk.StateChangeConf{ + ContinuousTargetOccurence: 5, + Delay: 10 * time.Second, + MinTimeout: 10 * time.Second, + Pending: []string{"204", "404"}, + Target: []string{"200", "202"}, + Refresh: netappVolumeStateRefreshFunc(ctx, client, id), + Timeout: time.Until(deadline), + } + + if _, err := stateConf.WaitForStateContext(ctx); err != nil { + return fmt.Errorf("waiting for %s to finish creating: %+v", id, err) + } + + return nil +} + func netappVolumeStateRefreshFunc(ctx context.Context, client *volumes.VolumesClient, id volumes.VolumeId) pluginsdk.StateRefreshFunc { return func() (interface{}, string, error) { res, err := client.Get(ctx, id) @@ -572,3 +710,25 @@ func netappVolumeStateRefreshFunc(ctx context.Context, client *volumes.VolumesCl return res, strconv.Itoa(res.HttpResponse.StatusCode), nil } } + +func waitForReplAuthorization(ctx context.Context, client *volumesreplication.VolumesReplicationClient, id volumesreplication.VolumeId) error { + deadline, ok := ctx.Deadline() + if !ok { + return fmt.Errorf("context had no deadline") + } + stateConf := &pluginsdk.StateChangeConf{ + ContinuousTargetOccurence: 5, + Delay: 10 * time.Second, + MinTimeout: 10 * time.Second, + Pending: []string{"204", "404", "400"}, // TODO: Remove 400 when bug is fixed on RP side, where replicationStatus returns 400 at some point during authorization process + Target: []string{"200", "202"}, + Refresh: netappVolumeReplicationStateRefreshFunc(ctx, client, id), + Timeout: time.Until(deadline), + } + + if _, err := stateConf.WaitForStateContext(ctx); err != nil { + return fmt.Errorf("waiting for replication authorization %s to complete: %+v", id, err) + } + + return nil +} diff --git a/internal/services/netapp/netapp_volume_resource.go b/internal/services/netapp/netapp_volume_resource.go index cb533602b8ce..2312c4854b29 100644 --- a/internal/services/netapp/netapp_volume_resource.go +++ b/internal/services/netapp/netapp_volume_resource.go @@ -1,7 +1,6 @@ package netapp import ( - "context" "fmt" "log" "strings" @@ -206,42 +205,6 @@ func resourceNetAppVolume() *pluginsdk.Resource { Optional: true, Computed: true, }, - - "kerberos5_read_only": { - Type: pluginsdk.TypeBool, - Optional: true, - Computed: true, - }, - - "kerberos5_read_write": { - Type: pluginsdk.TypeBool, - Optional: true, - Computed: true, - }, - - "kerberos5i_read_only": { - Type: pluginsdk.TypeBool, - Optional: true, - Computed: true, - }, - - "kerberos5i_read_write": { - Type: pluginsdk.TypeBool, - Optional: true, - Computed: true, - }, - - "kerberos5p_read_only": { - Type: pluginsdk.TypeBool, - Optional: true, - Computed: true, - }, - - "kerberos5p_read_write": { - Type: pluginsdk.TypeBool, - Optional: true, - Computed: true, - }, }, }, }, @@ -712,50 +675,6 @@ func resourceNetAppVolumeDelete(d *pluginsdk.ResourceData, meta interface{}) err return nil } -func waitForVolumeCreateOrUpdate(ctx context.Context, client *volumes.VolumesClient, id volumes.VolumeId) error { - deadline, ok := ctx.Deadline() - if !ok { - return fmt.Errorf("context had no deadline") - } - stateConf := &pluginsdk.StateChangeConf{ - ContinuousTargetOccurence: 5, - Delay: 10 * time.Second, - MinTimeout: 10 * time.Second, - Pending: []string{"204", "404"}, - Target: []string{"200", "202"}, - Refresh: netappVolumeStateRefreshFunc(ctx, client, id), - Timeout: time.Until(deadline), - } - - if _, err := stateConf.WaitForStateContext(ctx); err != nil { - return fmt.Errorf("waiting for %s to finish creating: %+v", id, err) - } - - return nil -} - -func waitForReplAuthorization(ctx context.Context, client *volumesreplication.VolumesReplicationClient, id volumesreplication.VolumeId) error { - deadline, ok := ctx.Deadline() - if !ok { - return fmt.Errorf("context had no deadline") - } - stateConf := &pluginsdk.StateChangeConf{ - ContinuousTargetOccurence: 5, - Delay: 10 * time.Second, - MinTimeout: 10 * time.Second, - Pending: []string{"204", "404", "400"}, // TODO: Remove 400 when bug is fixed on RP side, where replicationStatus returns 400 at some point during authorization process - Target: []string{"200", "202"}, - Refresh: netappVolumeReplicationStateRefreshFunc(ctx, client, id), - Timeout: time.Until(deadline), - } - - if _, err := stateConf.WaitForStateContext(ctx); err != nil { - return fmt.Errorf("waiting for replication authorization %s to complete: %+v", id, err) - } - - return nil -} - func expandNetAppVolumeExportPolicyRule(input []interface{}) *volumes.VolumePropertiesExportPolicy { results := make([]volumes.ExportPolicyRule, 0) for _, item := range input { @@ -789,28 +708,16 @@ func expandNetAppVolumeExportPolicyRule(input []interface{}) *volumes.VolumeProp unixReadOnly := v["unix_read_only"].(bool) unixReadWrite := v["unix_read_write"].(bool) rootAccessEnabled := v["root_access_enabled"].(bool) - kerberos5ReadOnly := v["kerberos5_read_only"].(bool) - kerberos5ReadWrite := v["kerberos5_read_write"].(bool) - kerberos5iReadOnly := v["kerberos5i_read_only"].(bool) - kerberos5iReadWrite := v["kerberos5i_read_write"].(bool) - kerberos5pReadOnly := v["kerberos5p_read_only"].(bool) - kerberos5pReadWrite := v["kerberos5p_read_write"].(bool) result := volumes.ExportPolicyRule{ - AllowedClients: utils.String(allowedClients), - Cifs: utils.Bool(cifsEnabled), - Nfsv3: utils.Bool(nfsv3Enabled), - Nfsv41: utils.Bool(nfsv41Enabled), - RuleIndex: utils.Int64(ruleIndex), - UnixReadOnly: utils.Bool(unixReadOnly), - UnixReadWrite: utils.Bool(unixReadWrite), - HasRootAccess: utils.Bool(rootAccessEnabled), - Kerberos5ReadOnly: utils.Bool(kerberos5ReadOnly), - Kerberos5ReadWrite: utils.Bool(kerberos5ReadWrite), - Kerberos5iReadOnly: utils.Bool(kerberos5iReadOnly), - Kerberos5iReadWrite: utils.Bool(kerberos5iReadWrite), - Kerberos5pReadOnly: utils.Bool(kerberos5pReadOnly), - Kerberos5pReadWrite: utils.Bool(kerberos5pReadWrite), + AllowedClients: utils.String(allowedClients), + Cifs: utils.Bool(cifsEnabled), + Nfsv3: utils.Bool(nfsv3Enabled), + Nfsv41: utils.Bool(nfsv41Enabled), + RuleIndex: utils.Int64(ruleIndex), + UnixReadOnly: utils.Bool(unixReadOnly), + UnixReadWrite: utils.Bool(unixReadWrite), + HasRootAccess: utils.Bool(rootAccessEnabled), } results = append(results, result) @@ -830,9 +737,9 @@ func expandNetAppVolumeExportPolicyRulePatch(input []interface{}) *volumes.Volum ruleIndex := int64(v["rule_index"].(int)) allowedClients := strings.Join(*utils.ExpandStringSlice(v["allowed_clients"].(*pluginsdk.Set).List()), ",") - cifsEnabled := false nfsv3Enabled := false nfsv41Enabled := false + cifsEnabled := false if vpe := v["protocols_enabled"]; vpe != nil { protocolsEnabled := vpe.([]interface{}) @@ -840,8 +747,6 @@ func expandNetAppVolumeExportPolicyRulePatch(input []interface{}) *volumes.Volum for _, protocol := range protocolsEnabled { if protocol != nil { switch strings.ToLower(protocol.(string)) { - case "cifs": - cifsEnabled = true case "nfsv3": nfsv3Enabled = true case "nfsv4.1": @@ -855,28 +760,16 @@ func expandNetAppVolumeExportPolicyRulePatch(input []interface{}) *volumes.Volum unixReadOnly := v["unix_read_only"].(bool) unixReadWrite := v["unix_read_write"].(bool) rootAccessEnabled := v["root_access_enabled"].(bool) - kerberos5ReadOnly := v["kerberos5_read_only"].(bool) - kerberos5ReadWrite := v["kerberos5_read_write"].(bool) - kerberos5iReadOnly := v["kerberos5i_read_only"].(bool) - kerberos5iReadWrite := v["kerberos5i_read_write"].(bool) - kerberos5pReadOnly := v["kerberos5p_read_only"].(bool) - kerberos5pReadWrite := v["kerberos5p_read_write"].(bool) result := volumes.ExportPolicyRule{ - AllowedClients: utils.String(allowedClients), - Cifs: utils.Bool(cifsEnabled), - Nfsv3: utils.Bool(nfsv3Enabled), - Nfsv41: utils.Bool(nfsv41Enabled), - RuleIndex: utils.Int64(ruleIndex), - UnixReadOnly: utils.Bool(unixReadOnly), - UnixReadWrite: utils.Bool(unixReadWrite), - HasRootAccess: utils.Bool(rootAccessEnabled), - Kerberos5ReadOnly: utils.Bool(kerberos5ReadOnly), - Kerberos5ReadWrite: utils.Bool(kerberos5ReadWrite), - Kerberos5iReadOnly: utils.Bool(kerberos5iReadOnly), - Kerberos5iReadWrite: utils.Bool(kerberos5iReadWrite), - Kerberos5pReadOnly: utils.Bool(kerberos5pReadOnly), - Kerberos5pReadWrite: utils.Bool(kerberos5pReadWrite), + AllowedClients: utils.String(allowedClients), + Cifs: utils.Bool(cifsEnabled), + Nfsv3: utils.Bool(nfsv3Enabled), + Nfsv41: utils.Bool(nfsv41Enabled), + RuleIndex: utils.Int64(ruleIndex), + UnixReadOnly: utils.Bool(unixReadOnly), + UnixReadWrite: utils.Bool(unixReadWrite), + HasRootAccess: utils.Bool(rootAccessEnabled), } results = append(results, result) @@ -888,71 +781,6 @@ func expandNetAppVolumeExportPolicyRulePatch(input []interface{}) *volumes.Volum } } -func expandNetAppVolumeDataProtectionReplication(input []interface{}) *volumes.VolumePropertiesDataProtection { - if len(input) == 0 || input[0] == nil { - return &volumes.VolumePropertiesDataProtection{} - } - - replicationObject := volumes.ReplicationObject{} - - replicationRaw := input[0].(map[string]interface{}) - - if v, ok := replicationRaw["endpoint_type"]; ok { - endpointType := volumes.EndpointType(v.(string)) - replicationObject.EndpointType = &endpointType - } - if v, ok := replicationRaw["remote_volume_location"]; ok { - replicationObject.RemoteVolumeRegion = utils.String(v.(string)) - } - if v, ok := replicationRaw["remote_volume_resource_id"]; ok { - replicationObject.RemoteVolumeResourceId = v.(string) - } - if v, ok := replicationRaw["replication_frequency"]; ok { - replicationSchedule := volumes.ReplicationSchedule(translateTFSchedule(v.(string))) - replicationObject.ReplicationSchedule = &replicationSchedule - } - - return &volumes.VolumePropertiesDataProtection{ - Replication: &replicationObject, - } -} - -func expandNetAppVolumeDataProtectionSnapshotPolicy(input []interface{}) *volumes.VolumePropertiesDataProtection { - if len(input) == 0 || input[0] == nil { - return &volumes.VolumePropertiesDataProtection{} - } - - snapshotObject := volumes.VolumeSnapshotProperties{} - - snapshotRaw := input[0].(map[string]interface{}) - - if v, ok := snapshotRaw["snapshot_policy_id"]; ok { - snapshotObject.SnapshotPolicyId = utils.String(v.(string)) - } - - return &volumes.VolumePropertiesDataProtection{ - Snapshot: &snapshotObject, - } -} - -func expandNetAppVolumeDataProtectionSnapshotPolicyPatch(input []interface{}) *volumes.VolumePatchPropertiesDataProtection { - if len(input) == 0 || input[0] == nil { - return &volumes.VolumePatchPropertiesDataProtection{} - } - - snapshotObject := volumes.VolumeSnapshotProperties{} - - snapshotRaw := input[0].(map[string]interface{}) - - if v, ok := snapshotRaw["snapshot_policy_id"]; ok { - snapshotObject.SnapshotPolicyId = utils.String(v.(string)) - } - - return &volumes.VolumePatchPropertiesDataProtection{ - Snapshot: &snapshotObject, - } -} - func flattenNetAppVolumeExportPolicyRule(input *volumes.VolumePropertiesExportPolicy) []interface{} { results := make([]interface{}, 0) if input == nil || input.Rules == nil { @@ -997,44 +825,14 @@ func flattenNetAppVolumeExportPolicyRule(input *volumes.VolumePropertiesExportPo if v := item.HasRootAccess; v != nil { rootAccessEnabled = *v } - kerberos5ReadOnly := false - if v := item.Kerberos5ReadOnly; v != nil { - kerberos5ReadOnly = *v - } - kerberos5ReadWrite := false - if v := item.Kerberos5ReadWrite; v != nil { - kerberos5ReadWrite = *v - } - kerberos5iReadOnly := false - if v := item.Kerberos5iReadOnly; v != nil { - kerberos5iReadOnly = *v - } - kerberos5iReadWrite := false - if v := item.Kerberos5iReadWrite; v != nil { - kerberos5iReadWrite = *v - } - kerberos5pReadOnly := false - if v := item.Kerberos5pReadOnly; v != nil { - kerberos5pReadOnly = *v - } - kerberos5pReadWrite := false - if v := item.Kerberos5pReadWrite; v != nil { - kerberos5pReadWrite = *v - } result := map[string]interface{}{ - "rule_index": ruleIndex, - "allowed_clients": utils.FlattenStringSlice(&allowedClients), - "unix_read_only": unixReadOnly, - "unix_read_write": unixReadWrite, - "root_access_enabled": rootAccessEnabled, - "protocols_enabled": utils.FlattenStringSlice(&protocolsEnabled), - "kerberos5_read_only": kerberos5ReadOnly, - "kerberos5_read_write": kerberos5ReadWrite, - "kerberos5i_read_only": kerberos5iReadOnly, - "kerberos5i_read_write": kerberos5iReadWrite, - "kerberos5p_read_only": kerberos5pReadOnly, - "kerberos5p_read_write": kerberos5pReadWrite, + "rule_index": ruleIndex, + "allowed_clients": utils.FlattenStringSlice(&allowedClients), + "unix_read_only": unixReadOnly, + "unix_read_write": unixReadWrite, + "root_access_enabled": rootAccessEnabled, + "protocols_enabled": utils.FlattenStringSlice(&protocolsEnabled), } results = append(results, result) } From 45f7849c65cde699eb5b62fe7da20cd333656a05 Mon Sep 17 00:00:00 2001 From: Paulo Date: Wed, 3 Aug 2022 13:51:20 -0700 Subject: [PATCH 20/83] wip: updating the refernce to use tolist --- .../netapp/netapp_volume_group_resource_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/services/netapp/netapp_volume_group_resource_test.go b/internal/services/netapp/netapp_volume_group_resource_test.go index 5cbed043e773..d53c6159e160 100644 --- a/internal/services/netapp/netapp_volume_group_resource_test.go +++ b/internal/services/netapp/netapp_volume_group_resource_test.go @@ -869,7 +869,7 @@ resource "azurerm_netapp_volume_group" "test_secondary" { data_protection_replication { endpoint_type = "dst" remote_volume_location = azurerm_resource_group.test.location - remote_volume_resource_id = azurerm_netapp_volume_group.test_primary.volume.[0].id + remote_volume_resource_id = tolist(azurerm_netapp_volume_group.test_primary.volume)[0].id replication_frequency = "10minutes" } @@ -906,7 +906,7 @@ resource "azurerm_netapp_volume_group" "test_secondary" { data_protection_replication { endpoint_type = "dst" remote_volume_location = azurerm_resource_group.test.location - remote_volume_resource_id = azurerm_netapp_volume_group.test_primary.volume.[1].id + remote_volume_resource_id = tolist(azurerm_netapp_volume_group.test_primary.volume)[1].id replication_frequency = "10minutes" } @@ -943,7 +943,7 @@ resource "azurerm_netapp_volume_group" "test_secondary" { data_protection_replication { endpoint_type = "dst" remote_volume_location = azurerm_resource_group.test.location - remote_volume_resource_id = azurerm_netapp_volume_group.test_primary.volume.[2].id + remote_volume_resource_id = tolist(azurerm_netapp_volume_group.test_primary.volume)[2].id replication_frequency = "10minutes" } @@ -980,7 +980,7 @@ resource "azurerm_netapp_volume_group" "test_secondary" { data_protection_replication { endpoint_type = "dst" remote_volume_location = azurerm_resource_group.test.location - remote_volume_resource_id = azurerm_netapp_volume_group.test_primary.volume.[3].id + remote_volume_resource_id = tolist(azurerm_netapp_volume_group.test_primary.volume)[3].id replication_frequency = "10minutes" } @@ -1017,7 +1017,7 @@ resource "azurerm_netapp_volume_group" "test_secondary" { data_protection_replication { endpoint_type = "dst" remote_volume_location = azurerm_resource_group.test.location - remote_volume_resource_id = azurerm_netapp_volume_group.test_primary.volume.[4].id + remote_volume_resource_id = tolist(azurerm_netapp_volume_group.test_primary.volume)[4].id replication_frequency = "10minutes" } From 87f48d5376c990a5b1552f5654703a8373269f3e Mon Sep 17 00:00:00 2001 From: Paulo Date: Tue, 13 Dec 2022 10:37:40 -0700 Subject: [PATCH 21/83] WIP: AVG work with updated SDK and RP --- internal/provider/services.go | 1 + internal/services/netapp/client/client.go | 14 +- .../netapp/netapp_account_data_source.go | 2 +- .../netapp/netapp_account_resource.go | 2 +- .../netapp/netapp_account_resource_test.go | 2 +- .../netapp/netapp_pool_data_source.go | 2 +- .../services/netapp/netapp_pool_resource.go | 2 +- .../netapp/netapp_pool_resource_test.go | 2 +- .../netapp/netapp_snapshot_data_source.go | 2 +- .../netapp_snapshot_policy_data_source.go | 2 +- .../netapp/netapp_snapshot_policy_resource.go | 2 +- .../netapp/netapp_snapshot_policy_test.go | 2 +- .../netapp/netapp_volume_data_source.go | 2 +- .../netapp/netapp_volume_group_resource.go | 119 +------ .../netapp_volume_group_resource_test.go | 12 +- .../services/netapp/netapp_volume_helper.go | 10 +- .../netapp/netapp_volume_resource_test.go | 2 +- .../model_poolpatchproperties.go | 9 - .../2021-10-01/capacitypools/version.go | 12 - .../2021-10-01/netappaccounts/constants.go | 43 --- .../netappaccounts/model_accountproperties.go | 10 - .../netappaccounts/model_netappaccount.go | 19 -- .../2021-10-01/netappaccounts/version.go | 12 - .../netapp/2021-10-01/snapshots/README.md | 111 ------- .../netapp/2021-10-01/volumegroups/README.md | 81 ----- .../method_volumegroupsget_autorest.go | 67 ---- .../volumegroups/model_volumegroupdetails.go | 13 - .../volumegroups/model_volumeproperties.go | 49 --- .../netapp/2021-10-01/volumes/README.md | 99 ------ .../netapp/2021-10-01/volumes/constants.go | 270 ---------------- .../volumes/model_volumeproperties.go | 49 --- .../netapp/2021-10-01/volumes/version.go | 12 - .../2021-10-01/volumesreplication/README.md | 106 ------- .../volumesreplication/constants.go | 65 ---- .../netapp/2022-01-01/capacitypools/README.md | 99 ------ .../netapp/2022-01-01/capacitypools/client.go | 18 -- .../2022-01-01/capacitypools/constants.go | 96 ------ .../capacitypools/id_capacitypool.go | 137 -------- .../capacitypools/id_netappaccount.go | 124 -------- .../method_poolscreateorupdate_autorest.go | 79 ----- .../method_poolsdelete_autorest.go | 78 ----- .../capacitypools/method_poolsget_autorest.go | 67 ---- .../method_poolslist_autorest.go | 186 ----------- .../method_poolsupdate_autorest.go | 79 ----- .../capacitypools/model_capacitypool.go | 19 -- .../capacitypools/model_capacitypoolpatch.go | 13 - .../capacitypools/model_poolproperties.go | 16 - .../2022-01-01/capacitypools/predicates.go | 34 -- .../2022-01-01/netappaccounts/README.md | 116 ------- .../2022-01-01/netappaccounts/client.go | 18 -- .../2022-01-01/netappaccounts/constants.go | 43 --- .../netappaccounts/id_netappaccount.go | 124 -------- .../method_accountscreateorupdate_autorest.go | 79 ----- .../method_accountsdelete_autorest.go | 78 ----- .../method_accountsget_autorest.go | 67 ---- .../method_accountslist_autorest.go | 187 ----------- ...hod_accountslistbysubscription_autorest.go | 187 ----------- .../method_accountsupdate_autorest.go | 79 ----- .../netappaccounts/model_activedirectory.go | 29 -- .../model_ldapsearchscopeopt.go | 10 - .../netappaccounts/model_netappaccount.go | 19 -- .../model_netappaccountpatch.go | 13 - .../2022-01-01/netappaccounts/predicates.go | 34 -- .../2022-01-01/snapshotpolicy/README.md | 102 ------ .../2022-01-01/snapshotpolicy/client.go | 18 -- .../snapshotpolicy/id_netappaccount.go | 124 -------- .../snapshotpolicy/id_snapshotpolicies.go | 137 -------- .../method_snapshotpoliciescreate_autorest.go | 68 ---- .../method_snapshotpoliciesdelete_autorest.go | 78 ----- .../method_snapshotpoliciesget_autorest.go | 67 ---- .../method_snapshotpolicieslist_autorest.go | 68 ---- .../method_snapshotpoliciesupdate_autorest.go | 79 ----- .../snapshotpolicy/model_dailyschedule.go | 11 - .../snapshotpolicy/model_hourlyschedule.go | 10 - .../snapshotpolicy/model_monthlyschedule.go | 12 - .../model_snapshotpolicieslist.go | 8 - .../snapshotpolicy/model_snapshotpolicy.go | 19 -- .../model_snapshotpolicypatch.go | 13 - .../model_snapshotpolicyproperties.go | 13 - .../snapshotpolicy/model_weeklyschedule.go | 12 - .../2022-01-01/snapshotpolicy/version.go | 12 - .../netapp/2022-01-01/snapshots/client.go | 18 -- .../2022-01-01/snapshots/id_snapshot.go | 163 ---------- .../netapp/2022-01-01/snapshots/id_volume.go | 150 --------- .../snapshots/method_create_autorest.go | 79 ----- .../snapshots/method_delete_autorest.go | 78 ----- .../snapshots/method_get_autorest.go | 67 ---- .../snapshots/method_list_autorest.go | 68 ---- .../snapshots/method_restorefiles_autorest.go | 79 ----- .../snapshots/method_update_autorest.go | 79 ----- .../2022-01-01/snapshots/model_snapshot.go | 12 - .../snapshots/model_snapshotproperties.go | 28 -- .../snapshots/model_snapshotrestorefiles.go | 9 - .../snapshots/model_snapshotslist.go | 8 - .../netapp/2022-01-01/snapshots/version.go | 12 - .../netapp/2022-01-01/volumegroups/client.go | 18 -- .../volumegroups/id_netappaccount.go | 124 -------- .../2022-01-01/volumegroups/id_volumegroup.go | 137 -------- .../method_volumegroupscreate_autorest.go | 79 ----- .../method_volumegroupsdelete_autorest.go | 78 ----- ...olumegroupslistbynetappaccount_autorest.go | 68 ---- .../volumegroups/model_exportpolicyrule.go | 22 -- .../model_mounttargetproperties.go | 11 - .../model_placementkeyvaluepairs.go | 9 - .../volumegroups/model_replicationobject.go | 12 - .../model_volumebackupproperties.go | 11 - .../volumegroups/model_volumegroup.go | 12 - .../volumegroups/model_volumegrouplist.go | 8 - .../model_volumegrouplistproperties.go | 9 - .../volumegroups/model_volumegroupmetadata.go | 13 - .../model_volumegroupproperties.go | 10 - .../model_volumegroupvolumeproperties.go | 12 - .../volumegroups/model_volumeproperties.go | 50 --- .../model_volumepropertiesdataprotection.go | 10 - .../model_volumepropertiesexportpolicy.go | 8 - .../model_volumesnapshotproperties.go | 8 - .../netapp/2022-01-01/volumegroups/version.go | 12 - .../netapp/2022-01-01/volumes/client.go | 18 -- .../netapp/2022-01-01/volumes/constants.go | 295 ------------------ .../2022-01-01/volumes/id_capacitypool.go | 137 -------- .../netapp/2022-01-01/volumes/id_volume.go | 150 --------- .../volumes/method_createorupdate_autorest.go | 79 ----- .../volumes/method_delete_autorest.go | 107 ------- .../2022-01-01/volumes/method_get_autorest.go | 67 ---- .../volumes/method_list_autorest.go | 186 ----------- .../volumes/method_update_autorest.go | 79 ----- .../volumes/model_exportpolicyrule.go | 22 -- .../volumes/model_mounttargetproperties.go | 11 - .../volumes/model_placementkeyvaluepairs.go | 9 - .../volumes/model_replicationobject.go | 12 - .../netapp/2022-01-01/volumes/model_volume.go | 20 -- .../volumes/model_volumebackupproperties.go | 11 - .../2022-01-01/volumes/model_volumepatch.go | 13 - .../volumes/model_volumepatchproperties.go | 16 - ...del_volumepatchpropertiesdataprotection.go | 9 - ...model_volumepatchpropertiesexportpolicy.go | 8 - .../volumes/model_volumeproperties.go | 50 --- .../model_volumepropertiesdataprotection.go | 10 - .../model_volumepropertiesexportpolicy.go | 8 - .../volumes/model_volumesnapshotproperties.go | 8 - .../netapp/2022-01-01/volumes/predicates.go | 34 -- .../2022-01-01/volumesreplication/client.go | 18 -- .../volumesreplication/id_volume.go | 150 --------- ...od_volumesauthorizereplication_autorest.go | 79 ----- ...method_volumesbreakreplication_autorest.go | 79 ----- ...ethod_volumesdeletereplication_autorest.go | 78 ----- ...volumesreinitializereplication_autorest.go | 78 ----- ...ethod_volumesreplicationstatus_autorest.go | 68 ---- ...ethod_volumesresyncreplication_autorest.go | 78 ----- .../model_breakreplicationrequest.go | 8 - .../model_replicationstatus.go | 12 - .../2022-01-01/volumesreplication/version.go | 12 - .../capacitypools/README.md | 6 +- .../capacitypools/client.go | 0 .../capacitypools/constants.go | 0 .../capacitypools/id_capacitypool.go | 0 .../capacitypools/id_netappaccount.go | 0 .../method_poolscreateorupdate_autorest.go | 0 .../method_poolsdelete_autorest.go | 0 .../capacitypools/method_poolsget_autorest.go | 0 .../method_poolslist_autorest.go | 0 .../method_poolsupdate_autorest.go | 0 .../capacitypools/model_capacitypool.go | 0 .../capacitypools/model_capacitypoolpatch.go | 0 .../model_poolpatchproperties.go | 5 +- .../capacitypools/model_poolproperties.go | 0 .../capacitypools/predicates.go | 0 .../capacitypools/version.go | 2 +- .../netappaccounts/README.md | 18 +- .../netappaccounts/client.go | 0 .../2022-05-01/netappaccounts/constants.go | 108 +++++++ .../netappaccounts/id_netappaccount.go | 0 .../method_accountscreateorupdate_autorest.go | 0 .../method_accountsdelete_autorest.go | 0 .../method_accountsget_autorest.go | 0 .../method_accountslist_autorest.go | 0 ...hod_accountslistbysubscription_autorest.go | 0 ...ethod_accountsrenewcredentials_autorest.go | 78 +++++ .../method_accountsupdate_autorest.go | 0 .../netappaccounts/model_accountencryption.go | 4 +- .../netappaccounts/model_accountproperties.go | 1 + .../netappaccounts/model_activedirectory.go | 0 .../model_encryptionidentity.go} | 5 +- .../model_keyvaultproperties.go | 12 + .../model_ldapsearchscopeopt.go | 0 .../netappaccounts/model_netappaccount.go | 21 ++ .../model_netappaccountpatch.go | 0 .../netappaccounts/predicates.go | 0 .../netappaccounts/version.go | 2 +- .../snapshotpolicy/README.md | 6 +- .../snapshotpolicy/client.go | 0 .../snapshotpolicy/id_netappaccount.go | 0 .../snapshotpolicy/id_snapshotpolicy.go | 0 .../method_snapshotpoliciescreate_autorest.go | 0 .../method_snapshotpoliciesdelete_autorest.go | 0 .../method_snapshotpoliciesget_autorest.go | 0 .../method_snapshotpolicieslist_autorest.go | 0 .../method_snapshotpoliciesupdate_autorest.go | 0 .../snapshotpolicy/model_dailyschedule.go | 0 .../snapshotpolicy/model_hourlyschedule.go | 0 .../snapshotpolicy/model_monthlyschedule.go | 0 .../model_snapshotpolicieslist.go | 0 .../snapshotpolicy/model_snapshotpolicy.go | 0 .../model_snapshotpolicypatch.go | 0 .../model_snapshotpolicyproperties.go | 0 .../snapshotpolicy/model_weeklyschedule.go | 0 .../snapshotpolicy/version.go | 2 +- .../snapshots/README.md | 6 +- .../snapshots/client.go | 0 .../snapshots/id_snapshot.go | 0 .../snapshots/id_volume.go | 0 .../snapshots/method_create_autorest.go | 0 .../snapshots/method_delete_autorest.go | 0 .../snapshots/method_get_autorest.go | 0 .../snapshots/method_list_autorest.go | 0 .../snapshots/method_restorefiles_autorest.go | 0 .../snapshots/method_update_autorest.go | 0 .../snapshots/model_snapshot.go | 0 .../snapshots/model_snapshotproperties.go | 0 .../snapshots/model_snapshotrestorefiles.go | 0 .../snapshots/model_snapshotslist.go | 0 .../snapshots/version.go | 2 +- .../volumegroups/README.md | 6 +- .../volumegroups/client.go | 0 .../volumegroups/constants.go | 84 +++++ .../volumegroups/id_netappaccount.go | 0 .../volumegroups/id_volumegroup.go | 0 .../method_volumegroupscreate_autorest.go | 0 .../method_volumegroupsdelete_autorest.go | 0 .../method_volumegroupsget_autorest.go | 1 + ...olumegroupslistbynetappaccount_autorest.go | 1 + .../volumegroups/model_exportpolicyrule.go | 0 .../model_mounttargetproperties.go | 2 +- .../model_placementkeyvaluepairs.go | 0 .../volumegroups/model_replicationobject.go | 0 .../model_volumebackupproperties.go | 0 .../volumegroups/model_volumegroup.go | 0 .../volumegroups/model_volumegroupdetails.go | 0 .../volumegroups/model_volumegrouplist.go | 0 .../model_volumegrouplistproperties.go | 0 .../volumegroups/model_volumegroupmetadata.go | 0 .../model_volumegroupproperties.go | 0 .../model_volumegroupvolumeproperties.go | 0 .../volumegroups/model_volumeproperties.go | 54 ++++ .../model_volumepropertiesdataprotection.go | 0 .../model_volumepropertiesexportpolicy.go | 0 .../model_volumesnapshotproperties.go | 0 .../volumegroups/version.go | 2 +- .../volumes/README.md | 6 +- .../volumes/client.go | 0 .../volumes}/constants.go | 90 ++++-- .../volumes/id_capacitypool.go | 0 .../volumes/id_volume.go | 0 .../volumes/method_createorupdate_autorest.go | 0 .../volumes/method_delete_autorest.go | 0 .../volumes/method_get_autorest.go | 0 .../volumes/method_list_autorest.go | 0 .../volumes/method_update_autorest.go | 0 .../volumes/model_exportpolicyrule.go | 0 .../volumes/model_mounttargetproperties.go | 0 .../volumes/model_placementkeyvaluepairs.go | 0 .../volumes/model_replicationobject.go | 0 .../volumes/model_volume.go | 2 + .../volumes/model_volumebackupproperties.go | 0 .../volumes/model_volumepatch.go | 0 .../volumes/model_volumepatchproperties.go | 2 + ...del_volumepatchpropertiesdataprotection.go | 0 ...model_volumepatchpropertiesexportpolicy.go | 0 .../volumes/model_volumeproperties.go | 54 ++++ .../model_volumepropertiesdataprotection.go | 0 .../model_volumepropertiesexportpolicy.go | 0 .../volumes/model_volumesnapshotproperties.go | 0 .../volumes/predicates.go | 0 .../volumes/version.go | 2 +- .../volumesreplication/README.md | 23 +- .../volumesreplication/client.go | 0 .../volumesreplication/constants.go | 0 .../volumesreplication/id_volume.go | 0 ...od_volumesauthorizereplication_autorest.go | 0 ...method_volumesbreakreplication_autorest.go | 0 ...ethod_volumesdeletereplication_autorest.go | 0 ...method_volumeslistreplications_autorest.go | 1 + ..._volumesreestablishreplication_autorest.go | 79 +++++ ...volumesreinitializereplication_autorest.go | 0 ...ethod_volumesreplicationstatus_autorest.go | 0 ...ethod_volumesresyncreplication_autorest.go | 0 .../model_authorizerequest.go | 0 .../model_breakreplicationrequest.go | 0 .../model_listreplications.go | 0 .../model_reestablishreplicationrequest.go} | 4 +- .../volumesreplication/model_replication.go | 0 .../model_replicationstatus.go | 0 .../volumesreplication/version.go | 2 +- .../x/crypto/curve25519/curve25519.go | 9 +- 294 files changed, 671 insertions(+), 7807 deletions(-) delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/model_poolpatchproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/version.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/constants.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_accountproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_netappaccount.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/version.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/README.md delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/README.md delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupsget_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupdetails.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumeproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/README.md delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/constants.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumeproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/version.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/README.md delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/constants.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/README.md delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/client.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/constants.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/id_capacitypool.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/id_netappaccount.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/method_poolscreateorupdate_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/method_poolsdelete_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/method_poolsget_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/method_poolslist_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/method_poolsupdate_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/model_capacitypool.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/model_capacitypoolpatch.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/model_poolproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/predicates.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/README.md delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/client.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/constants.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/id_netappaccount.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountscreateorupdate_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountsdelete_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountsget_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountslist_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountslistbysubscription_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountsupdate_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/model_activedirectory.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/model_ldapsearchscopeopt.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/model_netappaccount.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/model_netappaccountpatch.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/predicates.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/README.md delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/client.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/id_netappaccount.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/id_snapshotpolicies.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/method_snapshotpoliciescreate_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/method_snapshotpoliciesdelete_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/method_snapshotpoliciesget_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/method_snapshotpolicieslist_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/method_snapshotpoliciesupdate_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_dailyschedule.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_hourlyschedule.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_monthlyschedule.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_snapshotpolicieslist.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_snapshotpolicy.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_snapshotpolicypatch.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_snapshotpolicyproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_weeklyschedule.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/version.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/client.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/id_snapshot.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/id_volume.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_create_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_delete_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_get_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_list_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_restorefiles_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_update_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/model_snapshot.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/model_snapshotproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/model_snapshotrestorefiles.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/model_snapshotslist.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/version.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/client.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/id_netappaccount.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/id_volumegroup.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupscreate_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupsdelete_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupslistbynetappaccount_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_exportpolicyrule.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_mounttargetproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_placementkeyvaluepairs.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_replicationobject.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumebackupproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroup.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegrouplist.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegrouplistproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupmetadata.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupvolumeproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumeproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumepropertiesdataprotection.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumepropertiesexportpolicy.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumesnapshotproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/version.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/client.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/constants.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/id_capacitypool.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/id_volume.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/method_createorupdate_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/method_delete_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/method_get_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/method_list_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/method_update_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_exportpolicyrule.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_mounttargetproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_placementkeyvaluepairs.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_replicationobject.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volume.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumebackupproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepatch.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepatchproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepatchpropertiesdataprotection.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepatchpropertiesexportpolicy.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumeproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepropertiesdataprotection.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepropertiesexportpolicy.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumesnapshotproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/predicates.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/client.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/id_volume.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesauthorizereplication_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesbreakreplication_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesdeletereplication_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesreinitializereplication_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesreplicationstatus_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesresyncreplication_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/model_breakreplicationrequest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/model_replicationstatus.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/version.go rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/capacitypools/README.md (95%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/capacitypools/client.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/capacitypools/constants.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/capacitypools/id_capacitypool.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/capacitypools/id_netappaccount.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/capacitypools/method_poolscreateorupdate_autorest.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/capacitypools/method_poolsdelete_autorest.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/capacitypools/method_poolsget_autorest.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/capacitypools/method_poolslist_autorest.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/capacitypools/method_poolsupdate_autorest.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/capacitypools/model_capacitypool.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/capacitypools/model_capacitypoolpatch.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2022-01-01 => 2022-05-01}/capacitypools/model_poolpatchproperties.go (60%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/capacitypools/model_poolproperties.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/capacitypools/predicates.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2022-01-01 => 2022-05-01}/capacitypools/version.go (88%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/netappaccounts/README.md (86%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/netappaccounts/client.go (100%) create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/constants.go rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/netappaccounts/id_netappaccount.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/netappaccounts/method_accountscreateorupdate_autorest.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/netappaccounts/method_accountsdelete_autorest.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/netappaccounts/method_accountsget_autorest.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/netappaccounts/method_accountslist_autorest.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/netappaccounts/method_accountslistbysubscription_autorest.go (100%) create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/method_accountsrenewcredentials_autorest.go rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/netappaccounts/method_accountsupdate_autorest.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2022-01-01 => 2022-05-01}/netappaccounts/model_accountencryption.go (50%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2022-01-01 => 2022-05-01}/netappaccounts/model_accountproperties.go (85%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/netappaccounts/model_activedirectory.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01/netappaccounts/model_accountencryption.go => 2022-05-01/netappaccounts/model_encryptionidentity.go} (52%) create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/model_keyvaultproperties.go rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/netappaccounts/model_ldapsearchscopeopt.go (100%) create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/model_netappaccount.go rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/netappaccounts/model_netappaccountpatch.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/netappaccounts/predicates.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2022-01-01 => 2022-05-01}/netappaccounts/version.go (88%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/snapshotpolicy/README.md (95%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/snapshotpolicy/client.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/snapshotpolicy/id_netappaccount.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/snapshotpolicy/id_snapshotpolicy.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/snapshotpolicy/method_snapshotpoliciescreate_autorest.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/snapshotpolicy/method_snapshotpoliciesdelete_autorest.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/snapshotpolicy/method_snapshotpoliciesget_autorest.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/snapshotpolicy/method_snapshotpolicieslist_autorest.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/snapshotpolicy/method_snapshotpoliciesupdate_autorest.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/snapshotpolicy/model_dailyschedule.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/snapshotpolicy/model_hourlyschedule.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/snapshotpolicy/model_monthlyschedule.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/snapshotpolicy/model_snapshotpolicieslist.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/snapshotpolicy/model_snapshotpolicy.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/snapshotpolicy/model_snapshotpolicypatch.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/snapshotpolicy/model_snapshotpolicyproperties.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/snapshotpolicy/model_weeklyschedule.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/snapshotpolicy/version.go (88%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2022-01-01 => 2022-05-01}/snapshots/README.md (96%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/snapshots/client.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/snapshots/id_snapshot.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/snapshots/id_volume.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/snapshots/method_create_autorest.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/snapshots/method_delete_autorest.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/snapshots/method_get_autorest.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/snapshots/method_list_autorest.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/snapshots/method_restorefiles_autorest.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/snapshots/method_update_autorest.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/snapshots/model_snapshot.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/snapshots/model_snapshotproperties.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/snapshots/model_snapshotrestorefiles.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/snapshots/model_snapshotslist.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/snapshots/version.go (88%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2022-01-01 => 2022-05-01}/volumegroups/README.md (94%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumegroups/client.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumegroups/constants.go (76%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumegroups/id_netappaccount.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumegroups/id_volumegroup.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumegroups/method_volumegroupscreate_autorest.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumegroups/method_volumegroupsdelete_autorest.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2022-01-01 => 2022-05-01}/volumegroups/method_volumegroupsget_autorest.go (99%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumegroups/method_volumegroupslistbynetappaccount_autorest.go (99%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumegroups/model_exportpolicyrule.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumegroups/model_mounttargetproperties.go (87%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumegroups/model_placementkeyvaluepairs.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumegroups/model_replicationobject.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumegroups/model_volumebackupproperties.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumegroups/model_volumegroup.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2022-01-01 => 2022-05-01}/volumegroups/model_volumegroupdetails.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumegroups/model_volumegrouplist.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumegroups/model_volumegrouplistproperties.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumegroups/model_volumegroupmetadata.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumegroups/model_volumegroupproperties.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumegroups/model_volumegroupvolumeproperties.go (100%) create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/model_volumeproperties.go rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumegroups/model_volumepropertiesdataprotection.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumegroups/model_volumepropertiesexportpolicy.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumegroups/model_volumesnapshotproperties.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumegroups/version.go (88%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2022-01-01 => 2022-05-01}/volumes/README.md (95%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumes/client.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2022-01-01/volumegroups => 2022-05-01/volumes}/constants.go (81%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumes/id_capacitypool.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumes/id_volume.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumes/method_createorupdate_autorest.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumes/method_delete_autorest.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumes/method_get_autorest.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumes/method_list_autorest.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumes/method_update_autorest.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumes/model_exportpolicyrule.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumes/model_mounttargetproperties.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumes/model_placementkeyvaluepairs.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumes/model_replicationobject.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumes/model_volume.go (85%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumes/model_volumebackupproperties.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumes/model_volumepatch.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumes/model_volumepatchproperties.go (85%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumes/model_volumepatchpropertiesdataprotection.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumes/model_volumepatchpropertiesexportpolicy.go (100%) create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/model_volumeproperties.go rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumes/model_volumepropertiesdataprotection.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumes/model_volumepropertiesexportpolicy.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumes/model_volumesnapshotproperties.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumes/predicates.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2022-01-01 => 2022-05-01}/volumes/version.go (88%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2022-01-01 => 2022-05-01}/volumesreplication/README.md (85%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumesreplication/client.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2022-01-01 => 2022-05-01}/volumesreplication/constants.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumesreplication/id_volume.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumesreplication/method_volumesauthorizereplication_autorest.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumesreplication/method_volumesbreakreplication_autorest.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumesreplication/method_volumesdeletereplication_autorest.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2022-01-01 => 2022-05-01}/volumesreplication/method_volumeslistreplications_autorest.go (99%) create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication/method_volumesreestablishreplication_autorest.go rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumesreplication/method_volumesreinitializereplication_autorest.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumesreplication/method_volumesreplicationstatus_autorest.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumesreplication/method_volumesresyncreplication_autorest.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumesreplication/model_authorizerequest.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumesreplication/model_breakreplicationrequest.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2022-01-01 => 2022-05-01}/volumesreplication/model_listreplications.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2022-01-01/volumesreplication/model_authorizerequest.go => 2022-05-01/volumesreplication/model_reestablishreplicationrequest.go} (64%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2022-01-01 => 2022-05-01}/volumesreplication/model_replication.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumesreplication/model_replicationstatus.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/{2021-10-01 => 2022-05-01}/volumesreplication/version.go (88%) diff --git a/internal/provider/services.go b/internal/provider/services.go index 5c859a6cc94e..265c8ffec301 100644 --- a/internal/provider/services.go +++ b/internal/provider/services.go @@ -143,6 +143,7 @@ func SupportedTypedServices() []sdk.TypedServiceRegistration { monitor.Registration{}, mssql.Registration{}, network.Registration{}, + netapp.Registration{}, nginx.Registration{}, policy.Registration{}, privatednsresolver.Registration{}, diff --git a/internal/services/netapp/client/client.go b/internal/services/netapp/client/client.go index 7b4cda3d84a0..b79fa849afbf 100644 --- a/internal/services/netapp/client/client.go +++ b/internal/services/netapp/client/client.go @@ -1,13 +1,13 @@ package client import ( - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/capacitypools" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshotpolicy" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshots" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication" "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/netapp/netapp_account_data_source.go b/internal/services/netapp/netapp_account_data_source.go index a54873d22da0..a804fd8ba80a 100644 --- a/internal/services/netapp/netapp_account_data_source.go +++ b/internal/services/netapp/netapp_account_data_source.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/netapp/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" diff --git a/internal/services/netapp/netapp_account_resource.go b/internal/services/netapp/netapp_account_resource.go index 4e273343d280..dff3b7e01f4f 100644 --- a/internal/services/netapp/netapp_account_resource.go +++ b/internal/services/netapp/netapp_account_resource.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" diff --git a/internal/services/netapp/netapp_account_resource_test.go b/internal/services/netapp/netapp_account_resource_test.go index b6e6ceb84a1d..0f28f9656e55 100644 --- a/internal/services/netapp/netapp_account_resource_test.go +++ b/internal/services/netapp/netapp_account_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts" "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" diff --git a/internal/services/netapp/netapp_pool_data_source.go b/internal/services/netapp/netapp_pool_data_source.go index 238f0607f807..4c0a99656dcb 100644 --- a/internal/services/netapp/netapp_pool_data_source.go +++ b/internal/services/netapp/netapp_pool_data_source.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/capacitypools" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/netapp/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" diff --git a/internal/services/netapp/netapp_pool_resource.go b/internal/services/netapp/netapp_pool_resource.go index ee97d5b9e636..907472cd8554 100644 --- a/internal/services/netapp/netapp_pool_resource.go +++ b/internal/services/netapp/netapp_pool_resource.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/capacitypools" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/netapp/netapp_pool_resource_test.go b/internal/services/netapp/netapp_pool_resource_test.go index 66164d538110..c42e83473ff7 100644 --- a/internal/services/netapp/netapp_pool_resource_test.go +++ b/internal/services/netapp/netapp_pool_resource_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/capacitypools" "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" diff --git a/internal/services/netapp/netapp_snapshot_data_source.go b/internal/services/netapp/netapp_snapshot_data_source.go index 65780eda6ef5..1ccd8ddcd11a 100644 --- a/internal/services/netapp/netapp_snapshot_data_source.go +++ b/internal/services/netapp/netapp_snapshot_data_source.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshots" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/netapp/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" diff --git a/internal/services/netapp/netapp_snapshot_policy_data_source.go b/internal/services/netapp/netapp_snapshot_policy_data_source.go index c7a3e299572c..df3a2729d724 100644 --- a/internal/services/netapp/netapp_snapshot_policy_data_source.go +++ b/internal/services/netapp/netapp_snapshot_policy_data_source.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshotpolicy" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/netapp/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tags" diff --git a/internal/services/netapp/netapp_snapshot_policy_resource.go b/internal/services/netapp/netapp_snapshot_policy_resource.go index 2c8434d0a5db..d7601c048ab7 100644 --- a/internal/services/netapp/netapp_snapshot_policy_resource.go +++ b/internal/services/netapp/netapp_snapshot_policy_resource.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshotpolicy" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/netapp/netapp_snapshot_policy_test.go b/internal/services/netapp/netapp_snapshot_policy_test.go index d1d36256b4c7..47a10d44e83a 100644 --- a/internal/services/netapp/netapp_snapshot_policy_test.go +++ b/internal/services/netapp/netapp_snapshot_policy_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshotpolicy" "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" diff --git a/internal/services/netapp/netapp_volume_data_source.go b/internal/services/netapp/netapp_volume_data_source.go index ff26b24dc424..ee0081f90c78 100644 --- a/internal/services/netapp/netapp_volume_data_source.go +++ b/internal/services/netapp/netapp_volume_data_source.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/netapp/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" diff --git a/internal/services/netapp/netapp_volume_group_resource.go b/internal/services/netapp/netapp_volume_group_resource.go index 6ce64d1e1334..87a233bb3ac0 100644 --- a/internal/services/netapp/netapp_volume_group_resource.go +++ b/internal/services/netapp/netapp_volume_group_resource.go @@ -1,7 +1,6 @@ package netapp import ( - "bytes" "context" "fmt" "log" @@ -12,9 +11,9 @@ import ( "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" netAppValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/netapp/validate" @@ -94,16 +93,15 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { "deployment_spec_id": { Type: pluginsdk.TypeString, - Optional: true, + Required: true, ForceNew: true, - Default: "20542149-bfca-5618-1879-9863dc6767f1", ValidateFunc: validation.StringInSlice([]string{ - "20542149-bfca-5618-1879-9863dc6767f1", + "20542149-bfca-5618-1879-9863dc6767f1", // SAP HANA Deployment Spec ID }, false), }, "volume": { - Type: pluginsdk.TypeSet, + Type: pluginsdk.TypeList, Required: true, MinItems: 5, MaxItems: 5, @@ -321,102 +319,10 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { }, }, }, - Set: resourceVolumeGroupVolumeListHash, }, } } -func resourceVolumeGroupVolumeListHash(v interface{}) int { - // Computed = true items must be out of this - - var buf bytes.Buffer - - if m, ok := v.(map[string]interface{}); ok { - buf.WriteString(fmt.Sprintf("%s-", m["name"].(string))) - buf.WriteString(fmt.Sprintf("%s-", m["proximity_placement_group_id"].(string))) - buf.WriteString(fmt.Sprintf("%s-", m["volume_spec_name"].(string))) - buf.WriteString(fmt.Sprintf("%s-", m["volume_path"].(string))) - buf.WriteString(fmt.Sprintf("%s-", m["service_level"].(string))) - - if protocols, ok := m["protocols"].([]interface{}); ok { - for _, item := range protocols { - v := item.(string) - buf.WriteString(fmt.Sprintf("%s-", v)) - } - } - - buf.WriteString(fmt.Sprintf("%s-", m["security_style"].(string))) - buf.WriteString(fmt.Sprintf("%d-", m["storage_quota_in_gb"].(int))) - buf.WriteString(fmt.Sprintf("%f-", m["throughput_in_mibps"].(float64))) - buf.WriteString(fmt.Sprintf("%t-", m["snapshot_directory_visible"].(bool))) - - if exportPolicies, ok := m["export_policy_rule"].([]interface{}); ok { - for _, item := range exportPolicies { - v := item.(map[string]interface{}) - if ruleIndex, ok := v["rule_index"].(int); ok { - buf.WriteString(fmt.Sprintf("%d-", ruleIndex)) - } - if allowedClients, ok := v["allowed_clients"].(string); ok { - buf.WriteString(fmt.Sprintf("%s-", allowedClients)) - } - if nfsv3Enabled, ok := v["nfsv3_enabled"].(bool); ok { - buf.WriteString(fmt.Sprintf("%t-", nfsv3Enabled)) - } - if nfsv41Enabled, ok := v["nfsv41_enabled"].(bool); ok { - buf.WriteString(fmt.Sprintf("%t-", nfsv41Enabled)) - } - if unixReadOnly, ok := v["unix_read_only"].(bool); ok { - buf.WriteString(fmt.Sprintf("%t-", unixReadOnly)) - } - if unixReadWrite, ok := v["unix_read_write"].(bool); ok { - buf.WriteString(fmt.Sprintf("%t-", unixReadWrite)) - } - if rootAccessEnabled, ok := v["root_access_enabled"].(bool); ok { - buf.WriteString(fmt.Sprintf("%t-", rootAccessEnabled)) - } - } - } - - if tags, ok := m["tags"].([]interface{}); ok { - for _, item := range tags { - i := item.(map[string]interface{}) - for k, v := range i { - buf.WriteString(fmt.Sprintf("%s-%s-", k, v)) - } - } - } - - if dpReplication, ok := m["data_protection_replication"].([]interface{}); ok { - for _, item := range dpReplication { - v := item.(map[string]interface{}) - if endpointType, ok := v["endpoint_type"].(string); ok { - buf.WriteString(fmt.Sprintf("%s-", endpointType)) - } - if remoteVolumeLocation, ok := v["remote_volume_location"].(string); ok { - buf.WriteString(fmt.Sprintf("%s-", remoteVolumeLocation)) - } - if remoteVolumeResourceId, ok := v["remote_volume_resource_id"].(string); ok { - buf.WriteString(fmt.Sprintf("%s-", remoteVolumeResourceId)) - } - if replicationFrequency, ok := v["replication_frequency"].(string); ok { - buf.WriteString(fmt.Sprintf("%s-", replicationFrequency)) - } - } - } - - if dpSnapshotPolicy, ok := m["data_protection_snapshot_policy"].([]interface{}); ok { - for _, item := range dpSnapshotPolicy { - v := item.(map[string]interface{}) - if snapshotPolicyId, ok := v["snapshot_policy_id"].(string); ok { - buf.WriteString(fmt.Sprintf("%s-", snapshotPolicyId)) - } - } - } - } - - return pluginsdk.HashString(buf.String()) -} - func (r NetAppVolumeGroupResource) Attributes() map[string]*pluginsdk.Schema { return map[string]*pluginsdk.Schema{ /* @@ -662,19 +568,8 @@ func (r NetAppVolumeGroupResource) Read() sdk.ResourceFunc { if props := existing.Model.Properties; props != nil { model.GroupDescription = utils.NormalizeNilableString(props.GroupMetaData.GroupDescription) model.ApplicationIdentifier = utils.NormalizeNilableString(props.GroupMetaData.ApplicationIdentifier) - model.DeploymentSpecId = utils.NormalizeNilableString(props.GroupMetaData.DeploymentSpecId) model.ApplicationType = string(*props.GroupMetaData.ApplicationType) - - if state.DeploymentSpecId != "" { - model.DeploymentSpecId = state.DeploymentSpecId - } else { - // Setting a default value here to overcome issue with SDK - // not returning this value back from Azure - // This is the only supported value for the time being and - // will be fixed by ANF team if it introduces a new SpecId - // option. - model.DeploymentSpecId = "20542149-bfca-5618-1879-9863dc6767f1" - } + model.DeploymentSpecId = utils.NormalizeNilableString(props.GroupMetaData.DeploymentSpecId) volumes, err := flattenNetAppVolumeGroupVolumes(ctx, props.Volumes, metadata) if err != nil { diff --git a/internal/services/netapp/netapp_volume_group_resource_test.go b/internal/services/netapp/netapp_volume_group_resource_test.go index d53c6159e160..a421ffb9d0eb 100644 --- a/internal/services/netapp/netapp_volume_group_resource_test.go +++ b/internal/services/netapp/netapp_volume_group_resource_test.go @@ -6,7 +6,7 @@ import ( "net/http" "testing" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" @@ -869,7 +869,7 @@ resource "azurerm_netapp_volume_group" "test_secondary" { data_protection_replication { endpoint_type = "dst" remote_volume_location = azurerm_resource_group.test.location - remote_volume_resource_id = tolist(azurerm_netapp_volume_group.test_primary.volume)[0].id + remote_volume_resource_id = azurerm_netapp_volume_group.test_primary.volume[0].id replication_frequency = "10minutes" } @@ -906,7 +906,7 @@ resource "azurerm_netapp_volume_group" "test_secondary" { data_protection_replication { endpoint_type = "dst" remote_volume_location = azurerm_resource_group.test.location - remote_volume_resource_id = tolist(azurerm_netapp_volume_group.test_primary.volume)[1].id + remote_volume_resource_id = azurerm_netapp_volume_group.test_primary.volume[1].id replication_frequency = "10minutes" } @@ -943,7 +943,7 @@ resource "azurerm_netapp_volume_group" "test_secondary" { data_protection_replication { endpoint_type = "dst" remote_volume_location = azurerm_resource_group.test.location - remote_volume_resource_id = tolist(azurerm_netapp_volume_group.test_primary.volume)[2].id + remote_volume_resource_id = azurerm_netapp_volume_group.test_primary.volume[2].id replication_frequency = "10minutes" } @@ -980,7 +980,7 @@ resource "azurerm_netapp_volume_group" "test_secondary" { data_protection_replication { endpoint_type = "dst" remote_volume_location = azurerm_resource_group.test.location - remote_volume_resource_id = tolist(azurerm_netapp_volume_group.test_primary.volume)[3].id + remote_volume_resource_id = azurerm_netapp_volume_group.test_primary.volume[3].id replication_frequency = "10minutes" } @@ -1017,7 +1017,7 @@ resource "azurerm_netapp_volume_group" "test_secondary" { data_protection_replication { endpoint_type = "dst" remote_volume_location = azurerm_resource_group.test.location - remote_volume_resource_id = tolist(azurerm_netapp_volume_group.test_primary.volume)[4].id + remote_volume_resource_id = azurerm_netapp_volume_group.test_primary.volume[4].id replication_frequency = "10minutes" } diff --git a/internal/services/netapp/netapp_volume_helper.go b/internal/services/netapp/netapp_volume_helper.go index e7251b2af7e2..c4edf7d0e438 100644 --- a/internal/services/netapp/netapp_volume_helper.go +++ b/internal/services/netapp/netapp_volume_helper.go @@ -9,9 +9,9 @@ import ( "time" "github.com/hashicorp/go-azure-helpers/lang/response" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" @@ -299,8 +299,8 @@ func flattenNetAppVolumeGroupVolumesMountIpAddresses(input *[]volumegroups.Mount } for _, item := range *input { - if item.IpAddress != nil { - results = append(results, *item.IpAddress) + if item.IPAddress != nil { + results = append(results, *item.IPAddress) } } diff --git a/internal/services/netapp/netapp_volume_resource_test.go b/internal/services/netapp/netapp_volume_resource_test.go index 932b1a17b14e..e9da8245e128 100644 --- a/internal/services/netapp/netapp_volume_resource_test.go +++ b/internal/services/netapp/netapp_volume_resource_test.go @@ -7,7 +7,7 @@ import ( "regexp" "testing" - "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes" "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" diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/model_poolpatchproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/model_poolpatchproperties.go deleted file mode 100644 index 071dba445599..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/model_poolpatchproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package capacitypools - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PoolPatchProperties struct { - QosType *QosType `json:"qosType,omitempty"` - Size *int64 `json:"size,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/version.go deleted file mode 100644 index c647e1604368..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package capacitypools - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-10-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/capacitypools/%s", defaultApiVersion) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/constants.go deleted file mode 100644 index 6e41970873a4..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/constants.go +++ /dev/null @@ -1,43 +0,0 @@ -package netappaccounts - -import "strings" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ActiveDirectoryStatus string - -const ( - ActiveDirectoryStatusCreated ActiveDirectoryStatus = "Created" - ActiveDirectoryStatusDeleted ActiveDirectoryStatus = "Deleted" - ActiveDirectoryStatusError ActiveDirectoryStatus = "Error" - ActiveDirectoryStatusInUse ActiveDirectoryStatus = "InUse" - ActiveDirectoryStatusUpdating ActiveDirectoryStatus = "Updating" -) - -func PossibleValuesForActiveDirectoryStatus() []string { - return []string{ - string(ActiveDirectoryStatusCreated), - string(ActiveDirectoryStatusDeleted), - string(ActiveDirectoryStatusError), - string(ActiveDirectoryStatusInUse), - string(ActiveDirectoryStatusUpdating), - } -} - -func parseActiveDirectoryStatus(input string) (*ActiveDirectoryStatus, error) { - vals := map[string]ActiveDirectoryStatus{ - "created": ActiveDirectoryStatusCreated, - "deleted": ActiveDirectoryStatusDeleted, - "error": ActiveDirectoryStatusError, - "inuse": ActiveDirectoryStatusInUse, - "updating": ActiveDirectoryStatusUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ActiveDirectoryStatus(input) - return &out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_accountproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_accountproperties.go deleted file mode 100644 index b158b47fc946..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_accountproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package netappaccounts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AccountProperties struct { - ActiveDirectories *[]ActiveDirectory `json:"activeDirectories,omitempty"` - Encryption *AccountEncryption `json:"encryption,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_netappaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_netappaccount.go deleted file mode 100644 index ec2ed4aa10c5..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_netappaccount.go +++ /dev/null @@ -1,19 +0,0 @@ -package netappaccounts - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetAppAccount struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Properties *AccountProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/version.go deleted file mode 100644 index 3de2667a1a82..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package netappaccounts - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-10-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/netappaccounts/%s", defaultApiVersion) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/README.md deleted file mode 100644 index e6d357e24b68..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/README.md +++ /dev/null @@ -1,111 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots` Documentation - -The `snapshots` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2021-10-01`). - -This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). - -### Import Path - -```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots" -``` - - -### Client Initialization - -```go -client := snapshots.NewSnapshotsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `SnapshotsClient.Create` - -```go -ctx := context.TODO() -id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue", "snapshotValue") - -payload := snapshots.Snapshot{ - // ... -} - - -if err := client.CreateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `SnapshotsClient.Delete` - -```go -ctx := context.TODO() -id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue", "snapshotValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `SnapshotsClient.Get` - -```go -ctx := context.TODO() -id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue", "snapshotValue") - -read, err := client.Get(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `SnapshotsClient.List` - -```go -ctx := context.TODO() -id := snapshots.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue") - -read, err := client.List(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `SnapshotsClient.RestoreFiles` - -```go -ctx := context.TODO() -id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue", "snapshotValue") - -payload := snapshots.SnapshotRestoreFiles{ - // ... -} - - -if err := client.RestoreFilesThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `SnapshotsClient.Update` - -```go -ctx := context.TODO() -id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue", "snapshotValue") -var payload interface{} - -if err := client.UpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/README.md deleted file mode 100644 index 607525434646..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/README.md +++ /dev/null @@ -1,81 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups` Documentation - -The `volumegroups` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2021-10-01`). - -This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). - -### Import Path - -```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups" -``` - - -### Client Initialization - -```go -client := volumegroups.NewVolumeGroupsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VolumeGroupsClient.VolumeGroupsCreate` - -```go -ctx := context.TODO() -id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "volumeGroupValue") - -payload := volumegroups.VolumeGroupDetails{ - // ... -} - - -if err := client.VolumeGroupsCreateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VolumeGroupsClient.VolumeGroupsDelete` - -```go -ctx := context.TODO() -id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "volumeGroupValue") - -if err := client.VolumeGroupsDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VolumeGroupsClient.VolumeGroupsGet` - -```go -ctx := context.TODO() -id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "volumeGroupValue") - -read, err := client.VolumeGroupsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VolumeGroupsClient.VolumeGroupsListByNetAppAccount` - -```go -ctx := context.TODO() -id := volumegroups.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") - -read, err := client.VolumeGroupsListByNetAppAccount(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupsget_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupsget_autorest.go deleted file mode 100644 index d52a1f2e8c2e..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupsget_autorest.go +++ /dev/null @@ -1,67 +0,0 @@ -package volumegroups - -import ( - "context" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeGroupsGetOperationResponse struct { - HttpResponse *http.Response - Model *VolumeGroupDetails -} - -// VolumeGroupsGet ... -func (c VolumeGroupsClient) VolumeGroupsGet(ctx context.Context, id VolumeGroupId) (result VolumeGroupsGetOperationResponse, err error) { - req, err := c.preparerForVolumeGroupsGet(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsGet", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsGet", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForVolumeGroupsGet(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsGet", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForVolumeGroupsGet prepares the VolumeGroupsGet request. -func (c VolumeGroupsClient) preparerForVolumeGroupsGet(ctx context.Context, id VolumeGroupId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForVolumeGroupsGet handles the response to the VolumeGroupsGet request. The method always -// closes the http.Response Body. -func (c VolumeGroupsClient) responderForVolumeGroupsGet(resp *http.Response) (result VolumeGroupsGetOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupdetails.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupdetails.go deleted file mode 100644 index 08e48e1d0e8f..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupdetails.go +++ /dev/null @@ -1,13 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeGroupDetails struct { - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VolumeGroupProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumeproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumeproperties.go deleted file mode 100644 index dc67a9543182..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumeproperties.go +++ /dev/null @@ -1,49 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeProperties struct { - AvsDataStore *AvsDataStore `json:"avsDataStore,omitempty"` - BackupId *string `json:"backupId,omitempty"` - BaremetalTenantId *string `json:"baremetalTenantId,omitempty"` - CapacityPoolResourceId *string `json:"capacityPoolResourceId,omitempty"` - CloneProgress *int64 `json:"cloneProgress,omitempty"` - CoolAccess *bool `json:"coolAccess,omitempty"` - CoolnessPeriod *int64 `json:"coolnessPeriod,omitempty"` - CreationToken string `json:"creationToken"` - DataProtection *VolumePropertiesDataProtection `json:"dataProtection,omitempty"` - DefaultGroupQuotaInKiBs *int64 `json:"defaultGroupQuotaInKiBs,omitempty"` - DefaultUserQuotaInKiBs *int64 `json:"defaultUserQuotaInKiBs,omitempty"` - EnableSubvolumes *EnableSubvolumes `json:"enableSubvolumes,omitempty"` - EncryptionKeySource *string `json:"encryptionKeySource,omitempty"` - ExportPolicy *VolumePropertiesExportPolicy `json:"exportPolicy,omitempty"` - FileSystemId *string `json:"fileSystemId,omitempty"` - IsDefaultQuotaEnabled *bool `json:"isDefaultQuotaEnabled,omitempty"` - IsRestoring *bool `json:"isRestoring,omitempty"` - KerberosEnabled *bool `json:"kerberosEnabled,omitempty"` - LdapEnabled *bool `json:"ldapEnabled,omitempty"` - MaximumNumberOfFiles *int64 `json:"maximumNumberOfFiles,omitempty"` - MountTargets *[]MountTargetProperties `json:"mountTargets,omitempty"` - NetworkFeatures *NetworkFeatures `json:"networkFeatures,omitempty"` - NetworkSiblingSetId *string `json:"networkSiblingSetId,omitempty"` - PlacementRules *[]PlacementKeyValuePairs `json:"placementRules,omitempty"` - ProtocolTypes *[]string `json:"protocolTypes,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` - ProximityPlacementGroup *string `json:"proximityPlacementGroup,omitempty"` - SecurityStyle *SecurityStyle `json:"securityStyle,omitempty"` - ServiceLevel *ServiceLevel `json:"serviceLevel,omitempty"` - SmbContinuouslyAvailable *bool `json:"smbContinuouslyAvailable,omitempty"` - SmbEncryption *bool `json:"smbEncryption,omitempty"` - SnapshotDirectoryVisible *bool `json:"snapshotDirectoryVisible,omitempty"` - SnapshotId *string `json:"snapshotId,omitempty"` - StorageToNetworkProximity *VolumeStorageToNetworkProximity `json:"storageToNetworkProximity,omitempty"` - SubnetId string `json:"subnetId"` - T2Network *string `json:"t2Network,omitempty"` - ThroughputMibps *float64 `json:"throughputMibps,omitempty"` - UnixPermissions *string `json:"unixPermissions,omitempty"` - UsageThreshold int64 `json:"usageThreshold"` - VolumeGroupName *string `json:"volumeGroupName,omitempty"` - VolumeSpecName *string `json:"volumeSpecName,omitempty"` - VolumeType *string `json:"volumeType,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/README.md deleted file mode 100644 index c42f7262724b..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/README.md +++ /dev/null @@ -1,99 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes` Documentation - -The `volumes` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2021-10-01`). - -This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). - -### Import Path - -```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes" -``` - - -### Client Initialization - -```go -client := volumes.NewVolumesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VolumesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue") - -payload := volumes.Volume{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VolumesClient.Delete` - -```go -ctx := context.TODO() -id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue") - -if err := client.DeleteThenPoll(ctx, id, volumes.DefaultDeleteOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `VolumesClient.Get` - -```go -ctx := context.TODO() -id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue") - -read, err := client.Get(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VolumesClient.List` - -```go -ctx := context.TODO() -id := volumes.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue") - -// alternatively `client.List(ctx, id)` can be used to do batched pagination -items, err := client.ListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VolumesClient.Update` - -```go -ctx := context.TODO() -id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue") - -payload := volumes.VolumePatch{ - // ... -} - - -if err := client.UpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/constants.go deleted file mode 100644 index 4c9bed0d63be..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/constants.go +++ /dev/null @@ -1,270 +0,0 @@ -package volumes - -import "strings" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AvsDataStore string - -const ( - AvsDataStoreDisabled AvsDataStore = "Disabled" - AvsDataStoreEnabled AvsDataStore = "Enabled" -) - -func PossibleValuesForAvsDataStore() []string { - return []string{ - string(AvsDataStoreDisabled), - string(AvsDataStoreEnabled), - } -} - -func parseAvsDataStore(input string) (*AvsDataStore, error) { - vals := map[string]AvsDataStore{ - "disabled": AvsDataStoreDisabled, - "enabled": AvsDataStoreEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AvsDataStore(input) - return &out, nil -} - -type ChownMode string - -const ( - ChownModeRestricted ChownMode = "Restricted" - ChownModeUnrestricted ChownMode = "Unrestricted" -) - -func PossibleValuesForChownMode() []string { - return []string{ - string(ChownModeRestricted), - string(ChownModeUnrestricted), - } -} - -func parseChownMode(input string) (*ChownMode, error) { - vals := map[string]ChownMode{ - "restricted": ChownModeRestricted, - "unrestricted": ChownModeUnrestricted, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ChownMode(input) - return &out, nil -} - -type EnableSubvolumes string - -const ( - EnableSubvolumesDisabled EnableSubvolumes = "Disabled" - EnableSubvolumesEnabled EnableSubvolumes = "Enabled" -) - -func PossibleValuesForEnableSubvolumes() []string { - return []string{ - string(EnableSubvolumesDisabled), - string(EnableSubvolumesEnabled), - } -} - -func parseEnableSubvolumes(input string) (*EnableSubvolumes, error) { - vals := map[string]EnableSubvolumes{ - "disabled": EnableSubvolumesDisabled, - "enabled": EnableSubvolumesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EnableSubvolumes(input) - return &out, nil -} - -type EndpointType string - -const ( - EndpointTypeDst EndpointType = "dst" - EndpointTypeSrc EndpointType = "src" -) - -func PossibleValuesForEndpointType() []string { - return []string{ - string(EndpointTypeDst), - string(EndpointTypeSrc), - } -} - -func parseEndpointType(input string) (*EndpointType, error) { - vals := map[string]EndpointType{ - "dst": EndpointTypeDst, - "src": EndpointTypeSrc, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EndpointType(input) - return &out, nil -} - -type NetworkFeatures string - -const ( - NetworkFeaturesBasic NetworkFeatures = "Basic" - NetworkFeaturesStandard NetworkFeatures = "Standard" -) - -func PossibleValuesForNetworkFeatures() []string { - return []string{ - string(NetworkFeaturesBasic), - string(NetworkFeaturesStandard), - } -} - -func parseNetworkFeatures(input string) (*NetworkFeatures, error) { - vals := map[string]NetworkFeatures{ - "basic": NetworkFeaturesBasic, - "standard": NetworkFeaturesStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkFeatures(input) - return &out, nil -} - -type ReplicationSchedule string - -const ( - ReplicationScheduleDaily ReplicationSchedule = "daily" - ReplicationScheduleHourly ReplicationSchedule = "hourly" - ReplicationScheduleOneZerominutely ReplicationSchedule = "_10minutely" -) - -func PossibleValuesForReplicationSchedule() []string { - return []string{ - string(ReplicationScheduleDaily), - string(ReplicationScheduleHourly), - string(ReplicationScheduleOneZerominutely), - } -} - -func parseReplicationSchedule(input string) (*ReplicationSchedule, error) { - vals := map[string]ReplicationSchedule{ - "daily": ReplicationScheduleDaily, - "hourly": ReplicationScheduleHourly, - "_10minutely": ReplicationScheduleOneZerominutely, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ReplicationSchedule(input) - return &out, nil -} - -type SecurityStyle string - -const ( - SecurityStyleNtfs SecurityStyle = "ntfs" - SecurityStyleUnix SecurityStyle = "unix" -) - -func PossibleValuesForSecurityStyle() []string { - return []string{ - string(SecurityStyleNtfs), - string(SecurityStyleUnix), - } -} - -func parseSecurityStyle(input string) (*SecurityStyle, error) { - vals := map[string]SecurityStyle{ - "ntfs": SecurityStyleNtfs, - "unix": SecurityStyleUnix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityStyle(input) - return &out, nil -} - -type ServiceLevel string - -const ( - ServiceLevelPremium ServiceLevel = "Premium" - ServiceLevelStandard ServiceLevel = "Standard" - ServiceLevelStandardZRS ServiceLevel = "StandardZRS" - ServiceLevelUltra ServiceLevel = "Ultra" -) - -func PossibleValuesForServiceLevel() []string { - return []string{ - string(ServiceLevelPremium), - string(ServiceLevelStandard), - string(ServiceLevelStandardZRS), - string(ServiceLevelUltra), - } -} - -func parseServiceLevel(input string) (*ServiceLevel, error) { - vals := map[string]ServiceLevel{ - "premium": ServiceLevelPremium, - "standard": ServiceLevelStandard, - "standardzrs": ServiceLevelStandardZRS, - "ultra": ServiceLevelUltra, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ServiceLevel(input) - return &out, nil -} - -type VolumeStorageToNetworkProximity string - -const ( - VolumeStorageToNetworkProximityDefault VolumeStorageToNetworkProximity = "Default" - VolumeStorageToNetworkProximityTOne VolumeStorageToNetworkProximity = "T1" - VolumeStorageToNetworkProximityTTwo VolumeStorageToNetworkProximity = "T2" -) - -func PossibleValuesForVolumeStorageToNetworkProximity() []string { - return []string{ - string(VolumeStorageToNetworkProximityDefault), - string(VolumeStorageToNetworkProximityTOne), - string(VolumeStorageToNetworkProximityTTwo), - } -} - -func parseVolumeStorageToNetworkProximity(input string) (*VolumeStorageToNetworkProximity, error) { - vals := map[string]VolumeStorageToNetworkProximity{ - "default": VolumeStorageToNetworkProximityDefault, - "t1": VolumeStorageToNetworkProximityTOne, - "t2": VolumeStorageToNetworkProximityTTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VolumeStorageToNetworkProximity(input) - return &out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumeproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumeproperties.go deleted file mode 100644 index 6ae23e00b8da..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumeproperties.go +++ /dev/null @@ -1,49 +0,0 @@ -package volumes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeProperties struct { - AvsDataStore *AvsDataStore `json:"avsDataStore,omitempty"` - BackupId *string `json:"backupId,omitempty"` - BaremetalTenantId *string `json:"baremetalTenantId,omitempty"` - CapacityPoolResourceId *string `json:"capacityPoolResourceId,omitempty"` - CloneProgress *int64 `json:"cloneProgress,omitempty"` - CoolAccess *bool `json:"coolAccess,omitempty"` - CoolnessPeriod *int64 `json:"coolnessPeriod,omitempty"` - CreationToken string `json:"creationToken"` - DataProtection *VolumePropertiesDataProtection `json:"dataProtection,omitempty"` - DefaultGroupQuotaInKiBs *int64 `json:"defaultGroupQuotaInKiBs,omitempty"` - DefaultUserQuotaInKiBs *int64 `json:"defaultUserQuotaInKiBs,omitempty"` - EnableSubvolumes *EnableSubvolumes `json:"enableSubvolumes,omitempty"` - EncryptionKeySource *string `json:"encryptionKeySource,omitempty"` - ExportPolicy *VolumePropertiesExportPolicy `json:"exportPolicy,omitempty"` - FileSystemId *string `json:"fileSystemId,omitempty"` - IsDefaultQuotaEnabled *bool `json:"isDefaultQuotaEnabled,omitempty"` - IsRestoring *bool `json:"isRestoring,omitempty"` - KerberosEnabled *bool `json:"kerberosEnabled,omitempty"` - LdapEnabled *bool `json:"ldapEnabled,omitempty"` - MaximumNumberOfFiles *int64 `json:"maximumNumberOfFiles,omitempty"` - MountTargets *[]MountTargetProperties `json:"mountTargets,omitempty"` - NetworkFeatures *NetworkFeatures `json:"networkFeatures,omitempty"` - NetworkSiblingSetId *string `json:"networkSiblingSetId,omitempty"` - PlacementRules *[]PlacementKeyValuePairs `json:"placementRules,omitempty"` - ProtocolTypes *[]string `json:"protocolTypes,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` - ProximityPlacementGroup *string `json:"proximityPlacementGroup,omitempty"` - SecurityStyle *SecurityStyle `json:"securityStyle,omitempty"` - ServiceLevel *ServiceLevel `json:"serviceLevel,omitempty"` - SmbContinuouslyAvailable *bool `json:"smbContinuouslyAvailable,omitempty"` - SmbEncryption *bool `json:"smbEncryption,omitempty"` - SnapshotDirectoryVisible *bool `json:"snapshotDirectoryVisible,omitempty"` - SnapshotId *string `json:"snapshotId,omitempty"` - StorageToNetworkProximity *VolumeStorageToNetworkProximity `json:"storageToNetworkProximity,omitempty"` - SubnetId string `json:"subnetId"` - T2Network *string `json:"t2Network,omitempty"` - ThroughputMibps *float64 `json:"throughputMibps,omitempty"` - UnixPermissions *string `json:"unixPermissions,omitempty"` - UsageThreshold int64 `json:"usageThreshold"` - VolumeGroupName *string `json:"volumeGroupName,omitempty"` - VolumeSpecName *string `json:"volumeSpecName,omitempty"` - VolumeType *string `json:"volumeType,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/version.go deleted file mode 100644 index 55ac8a54fde6..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package volumes - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-10-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/volumes/%s", defaultApiVersion) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/README.md deleted file mode 100644 index 037bd15af1bb..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/README.md +++ /dev/null @@ -1,106 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication` Documentation - -The `volumesreplication` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2021-10-01`). - -This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). - -### Import Path - -```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication" -``` - - -### Client Initialization - -```go -client := volumesreplication.NewVolumesReplicationClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VolumesReplicationClient.VolumesAuthorizeReplication` - -```go -ctx := context.TODO() -id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue") - -payload := volumesreplication.AuthorizeRequest{ - // ... -} - - -if err := client.VolumesAuthorizeReplicationThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VolumesReplicationClient.VolumesBreakReplication` - -```go -ctx := context.TODO() -id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue") - -payload := volumesreplication.BreakReplicationRequest{ - // ... -} - - -if err := client.VolumesBreakReplicationThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VolumesReplicationClient.VolumesDeleteReplication` - -```go -ctx := context.TODO() -id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue") - -if err := client.VolumesDeleteReplicationThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VolumesReplicationClient.VolumesReInitializeReplication` - -```go -ctx := context.TODO() -id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue") - -if err := client.VolumesReInitializeReplicationThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VolumesReplicationClient.VolumesReplicationStatus` - -```go -ctx := context.TODO() -id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue") - -read, err := client.VolumesReplicationStatus(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VolumesReplicationClient.VolumesResyncReplication` - -```go -ctx := context.TODO() -id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue") - -if err := client.VolumesResyncReplicationThenPoll(ctx, id); err != nil { - // handle the error -} -``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/constants.go deleted file mode 100644 index 6b67c17d5884..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/constants.go +++ /dev/null @@ -1,65 +0,0 @@ -package volumesreplication - -import "strings" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MirrorState string - -const ( - MirrorStateBroken MirrorState = "Broken" - MirrorStateMirrored MirrorState = "Mirrored" - MirrorStateUninitialized MirrorState = "Uninitialized" -) - -func PossibleValuesForMirrorState() []string { - return []string{ - string(MirrorStateBroken), - string(MirrorStateMirrored), - string(MirrorStateUninitialized), - } -} - -func parseMirrorState(input string) (*MirrorState, error) { - vals := map[string]MirrorState{ - "broken": MirrorStateBroken, - "mirrored": MirrorStateMirrored, - "uninitialized": MirrorStateUninitialized, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := MirrorState(input) - return &out, nil -} - -type RelationshipStatus string - -const ( - RelationshipStatusIdle RelationshipStatus = "Idle" - RelationshipStatusTransferring RelationshipStatus = "Transferring" -) - -func PossibleValuesForRelationshipStatus() []string { - return []string{ - string(RelationshipStatusIdle), - string(RelationshipStatusTransferring), - } -} - -func parseRelationshipStatus(input string) (*RelationshipStatus, error) { - vals := map[string]RelationshipStatus{ - "idle": RelationshipStatusIdle, - "transferring": RelationshipStatusTransferring, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RelationshipStatus(input) - return &out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/README.md deleted file mode 100644 index a96a742cad70..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/README.md +++ /dev/null @@ -1,99 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools` Documentation - -The `capacitypools` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2022-01-01`). - -This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). - -### Import Path - -```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools" -``` - - -### Client Initialization - -```go -client := capacitypools.NewCapacityPoolsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `CapacityPoolsClient.PoolsCreateOrUpdate` - -```go -ctx := context.TODO() -id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue") - -payload := capacitypools.CapacityPool{ - // ... -} - - -if err := client.PoolsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `CapacityPoolsClient.PoolsDelete` - -```go -ctx := context.TODO() -id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue") - -if err := client.PoolsDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `CapacityPoolsClient.PoolsGet` - -```go -ctx := context.TODO() -id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue") - -read, err := client.PoolsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `CapacityPoolsClient.PoolsList` - -```go -ctx := context.TODO() -id := capacitypools.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") - -// alternatively `client.PoolsList(ctx, id)` can be used to do batched pagination -items, err := client.PoolsListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `CapacityPoolsClient.PoolsUpdate` - -```go -ctx := context.TODO() -id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue") - -payload := capacitypools.CapacityPoolPatch{ - // ... -} - - -if err := client.PoolsUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/client.go deleted file mode 100644 index d31b6b301a25..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/client.go +++ /dev/null @@ -1,18 +0,0 @@ -package capacitypools - -import "github.com/Azure/go-autorest/autorest" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CapacityPoolsClient struct { - Client autorest.Client - baseUri string -} - -func NewCapacityPoolsClientWithBaseURI(endpoint string) CapacityPoolsClient { - return CapacityPoolsClient{ - Client: autorest.NewClientWithUserAgent(userAgent()), - baseUri: endpoint, - } -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/constants.go deleted file mode 100644 index 4856e8e79bc3..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/constants.go +++ /dev/null @@ -1,96 +0,0 @@ -package capacitypools - -import "strings" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EncryptionType string - -const ( - EncryptionTypeDouble EncryptionType = "Double" - EncryptionTypeSingle EncryptionType = "Single" -) - -func PossibleValuesForEncryptionType() []string { - return []string{ - string(EncryptionTypeDouble), - string(EncryptionTypeSingle), - } -} - -func parseEncryptionType(input string) (*EncryptionType, error) { - vals := map[string]EncryptionType{ - "double": EncryptionTypeDouble, - "single": EncryptionTypeSingle, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EncryptionType(input) - return &out, nil -} - -type QosType string - -const ( - QosTypeAuto QosType = "Auto" - QosTypeManual QosType = "Manual" -) - -func PossibleValuesForQosType() []string { - return []string{ - string(QosTypeAuto), - string(QosTypeManual), - } -} - -func parseQosType(input string) (*QosType, error) { - vals := map[string]QosType{ - "auto": QosTypeAuto, - "manual": QosTypeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := QosType(input) - return &out, nil -} - -type ServiceLevel string - -const ( - ServiceLevelPremium ServiceLevel = "Premium" - ServiceLevelStandard ServiceLevel = "Standard" - ServiceLevelStandardZRS ServiceLevel = "StandardZRS" - ServiceLevelUltra ServiceLevel = "Ultra" -) - -func PossibleValuesForServiceLevel() []string { - return []string{ - string(ServiceLevelPremium), - string(ServiceLevelStandard), - string(ServiceLevelStandardZRS), - string(ServiceLevelUltra), - } -} - -func parseServiceLevel(input string) (*ServiceLevel, error) { - vals := map[string]ServiceLevel{ - "premium": ServiceLevelPremium, - "standard": ServiceLevelStandard, - "standardzrs": ServiceLevelStandardZRS, - "ultra": ServiceLevelUltra, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ServiceLevel(input) - return &out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/id_capacitypool.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/id_capacitypool.go deleted file mode 100644 index a50e29408397..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/id_capacitypool.go +++ /dev/null @@ -1,137 +0,0 @@ -package capacitypools - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -var _ resourceids.ResourceId = CapacityPoolId{} - -// CapacityPoolId is a struct representing the Resource ID for a Capacity Pool -type CapacityPoolId struct { - SubscriptionId string - ResourceGroupName string - AccountName string - PoolName string -} - -// NewCapacityPoolID returns a new CapacityPoolId struct -func NewCapacityPoolID(subscriptionId string, resourceGroupName string, accountName string, poolName string) CapacityPoolId { - return CapacityPoolId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - AccountName: accountName, - PoolName: poolName, - } -} - -// ParseCapacityPoolID parses 'input' into a CapacityPoolId -func ParseCapacityPoolID(input string) (*CapacityPoolId, error) { - parser := resourceids.NewParserFromResourceIdType(CapacityPoolId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := CapacityPoolId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { - return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ParseCapacityPoolIDInsensitively parses 'input' case-insensitively into a CapacityPoolId -// note: this method should only be used for API response data and not user input -func ParseCapacityPoolIDInsensitively(input string) (*CapacityPoolId, error) { - parser := resourceids.NewParserFromResourceIdType(CapacityPoolId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := CapacityPoolId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { - return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ValidateCapacityPoolID checks that 'input' can be parsed as a Capacity Pool ID -func ValidateCapacityPoolID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := ParseCapacityPoolID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Capacity Pool ID -func (id CapacityPoolId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/capacityPools/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName, id.PoolName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Capacity Pool ID -func (id CapacityPoolId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), - resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("accountName", "accountValue"), - resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("poolName", "poolValue"), - } -} - -// String returns a human-readable description of this Capacity Pool ID -func (id CapacityPoolId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Account Name: %q", id.AccountName), - fmt.Sprintf("Pool Name: %q", id.PoolName), - } - return fmt.Sprintf("Capacity Pool (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/id_netappaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/id_netappaccount.go deleted file mode 100644 index 86bd7fcada46..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/id_netappaccount.go +++ /dev/null @@ -1,124 +0,0 @@ -package capacitypools - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -var _ resourceids.ResourceId = NetAppAccountId{} - -// NetAppAccountId is a struct representing the Resource ID for a Net App Account -type NetAppAccountId struct { - SubscriptionId string - ResourceGroupName string - AccountName string -} - -// NewNetAppAccountID returns a new NetAppAccountId struct -func NewNetAppAccountID(subscriptionId string, resourceGroupName string, accountName string) NetAppAccountId { - return NetAppAccountId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - AccountName: accountName, - } -} - -// ParseNetAppAccountID parses 'input' into a NetAppAccountId -func ParseNetAppAccountID(input string) (*NetAppAccountId, error) { - parser := resourceids.NewParserFromResourceIdType(NetAppAccountId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := NetAppAccountId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ParseNetAppAccountIDInsensitively parses 'input' case-insensitively into a NetAppAccountId -// note: this method should only be used for API response data and not user input -func ParseNetAppAccountIDInsensitively(input string) (*NetAppAccountId, error) { - parser := resourceids.NewParserFromResourceIdType(NetAppAccountId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := NetAppAccountId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ValidateNetAppAccountID checks that 'input' can be parsed as a Net App Account ID -func ValidateNetAppAccountID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := ParseNetAppAccountID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Net App Account ID -func (id NetAppAccountId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Net App Account ID -func (id NetAppAccountId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), - resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("accountName", "accountValue"), - } -} - -// String returns a human-readable description of this Net App Account ID -func (id NetAppAccountId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Account Name: %q", id.AccountName), - } - return fmt.Sprintf("Net App Account (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/method_poolscreateorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/method_poolscreateorupdate_autorest.go deleted file mode 100644 index 72891f7b9dfb..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/method_poolscreateorupdate_autorest.go +++ /dev/null @@ -1,79 +0,0 @@ -package capacitypools - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PoolsCreateOrUpdateOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// PoolsCreateOrUpdate ... -func (c CapacityPoolsClient) PoolsCreateOrUpdate(ctx context.Context, id CapacityPoolId, input CapacityPool) (result PoolsCreateOrUpdateOperationResponse, err error) { - req, err := c.preparerForPoolsCreateOrUpdate(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsCreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = c.senderForPoolsCreateOrUpdate(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsCreateOrUpdate", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// PoolsCreateOrUpdateThenPoll performs PoolsCreateOrUpdate then polls until it's completed -func (c CapacityPoolsClient) PoolsCreateOrUpdateThenPoll(ctx context.Context, id CapacityPoolId, input CapacityPool) error { - result, err := c.PoolsCreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing PoolsCreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after PoolsCreateOrUpdate: %+v", err) - } - - return nil -} - -// preparerForPoolsCreateOrUpdate prepares the PoolsCreateOrUpdate request. -func (c CapacityPoolsClient) preparerForPoolsCreateOrUpdate(ctx context.Context, id CapacityPoolId, input CapacityPool) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForPoolsCreateOrUpdate sends the PoolsCreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (c CapacityPoolsClient) senderForPoolsCreateOrUpdate(ctx context.Context, req *http.Request) (future PoolsCreateOrUpdateOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/method_poolsdelete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/method_poolsdelete_autorest.go deleted file mode 100644 index 61d0e6104b15..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/method_poolsdelete_autorest.go +++ /dev/null @@ -1,78 +0,0 @@ -package capacitypools - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PoolsDeleteOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// PoolsDelete ... -func (c CapacityPoolsClient) PoolsDelete(ctx context.Context, id CapacityPoolId) (result PoolsDeleteOperationResponse, err error) { - req, err := c.preparerForPoolsDelete(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsDelete", nil, "Failure preparing request") - return - } - - result, err = c.senderForPoolsDelete(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsDelete", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// PoolsDeleteThenPoll performs PoolsDelete then polls until it's completed -func (c CapacityPoolsClient) PoolsDeleteThenPoll(ctx context.Context, id CapacityPoolId) error { - result, err := c.PoolsDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing PoolsDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after PoolsDelete: %+v", err) - } - - return nil -} - -// preparerForPoolsDelete prepares the PoolsDelete request. -func (c CapacityPoolsClient) preparerForPoolsDelete(ctx context.Context, id CapacityPoolId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsDelete(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForPoolsDelete sends the PoolsDelete request. The method will close the -// http.Response Body if it receives an error. -func (c CapacityPoolsClient) senderForPoolsDelete(ctx context.Context, req *http.Request) (future PoolsDeleteOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/method_poolsget_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/method_poolsget_autorest.go deleted file mode 100644 index d2725693da9d..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/method_poolsget_autorest.go +++ /dev/null @@ -1,67 +0,0 @@ -package capacitypools - -import ( - "context" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PoolsGetOperationResponse struct { - HttpResponse *http.Response - Model *CapacityPool -} - -// PoolsGet ... -func (c CapacityPoolsClient) PoolsGet(ctx context.Context, id CapacityPoolId) (result PoolsGetOperationResponse, err error) { - req, err := c.preparerForPoolsGet(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsGet", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsGet", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForPoolsGet(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsGet", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForPoolsGet prepares the PoolsGet request. -func (c CapacityPoolsClient) preparerForPoolsGet(ctx context.Context, id CapacityPoolId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForPoolsGet handles the response to the PoolsGet request. The method always -// closes the http.Response Body. -func (c CapacityPoolsClient) responderForPoolsGet(resp *http.Response) (result PoolsGetOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/method_poolslist_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/method_poolslist_autorest.go deleted file mode 100644 index 25c06a45e9bd..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/method_poolslist_autorest.go +++ /dev/null @@ -1,186 +0,0 @@ -package capacitypools - -import ( - "context" - "fmt" - "net/http" - "net/url" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PoolsListOperationResponse struct { - HttpResponse *http.Response - Model *[]CapacityPool - - nextLink *string - nextPageFunc func(ctx context.Context, nextLink string) (PoolsListOperationResponse, error) -} - -type PoolsListCompleteResult struct { - Items []CapacityPool -} - -func (r PoolsListOperationResponse) HasMore() bool { - return r.nextLink != nil -} - -func (r PoolsListOperationResponse) LoadMore(ctx context.Context) (resp PoolsListOperationResponse, err error) { - if !r.HasMore() { - err = fmt.Errorf("no more pages returned") - return - } - return r.nextPageFunc(ctx, *r.nextLink) -} - -// PoolsList ... -func (c CapacityPoolsClient) PoolsList(ctx context.Context, id NetAppAccountId) (resp PoolsListOperationResponse, err error) { - req, err := c.preparerForPoolsList(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsList", nil, "Failure preparing request") - return - } - - resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsList", resp.HttpResponse, "Failure sending request") - return - } - - resp, err = c.responderForPoolsList(resp.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsList", resp.HttpResponse, "Failure responding to request") - return - } - return -} - -// PoolsListComplete retrieves all of the results into a single object -func (c CapacityPoolsClient) PoolsListComplete(ctx context.Context, id NetAppAccountId) (PoolsListCompleteResult, error) { - return c.PoolsListCompleteMatchingPredicate(ctx, id, CapacityPoolOperationPredicate{}) -} - -// PoolsListCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c CapacityPoolsClient) PoolsListCompleteMatchingPredicate(ctx context.Context, id NetAppAccountId, predicate CapacityPoolOperationPredicate) (resp PoolsListCompleteResult, err error) { - items := make([]CapacityPool, 0) - - page, err := c.PoolsList(ctx, id) - if err != nil { - err = fmt.Errorf("loading the initial page: %+v", err) - return - } - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - for page.HasMore() { - page, err = page.LoadMore(ctx) - if err != nil { - err = fmt.Errorf("loading the next page: %+v", err) - return - } - - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - } - - out := PoolsListCompleteResult{ - Items: items, - } - return out, nil -} - -// preparerForPoolsList prepares the PoolsList request. -func (c CapacityPoolsClient) preparerForPoolsList(ctx context.Context, id NetAppAccountId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/capacityPools", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// preparerForPoolsListWithNextLink prepares the PoolsList request with the given nextLink token. -func (c CapacityPoolsClient) preparerForPoolsListWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { - uri, err := url.Parse(nextLink) - if err != nil { - return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) - } - queryParameters := map[string]interface{}{} - for k, v := range uri.Query() { - if len(v) == 0 { - continue - } - val := v[0] - val = autorest.Encode("query", val) - queryParameters[k] = val - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(uri.Path), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForPoolsList handles the response to the PoolsList request. The method always -// closes the http.Response Body. -func (c CapacityPoolsClient) responderForPoolsList(resp *http.Response) (result PoolsListOperationResponse, err error) { - type page struct { - Values []CapacityPool `json:"value"` - NextLink *string `json:"nextLink"` - } - var respObj page - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&respObj), - autorest.ByClosing()) - result.HttpResponse = resp - result.Model = &respObj.Values - result.nextLink = respObj.NextLink - if respObj.NextLink != nil { - result.nextPageFunc = func(ctx context.Context, nextLink string) (result PoolsListOperationResponse, err error) { - req, err := c.preparerForPoolsListWithNextLink(ctx, nextLink) - if err != nil { - err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsList", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsList", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForPoolsList(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsList", result.HttpResponse, "Failure responding to request") - return - } - - return - } - } - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/method_poolsupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/method_poolsupdate_autorest.go deleted file mode 100644 index 680bc19748a1..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/method_poolsupdate_autorest.go +++ /dev/null @@ -1,79 +0,0 @@ -package capacitypools - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PoolsUpdateOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// PoolsUpdate ... -func (c CapacityPoolsClient) PoolsUpdate(ctx context.Context, id CapacityPoolId, input CapacityPoolPatch) (result PoolsUpdateOperationResponse, err error) { - req, err := c.preparerForPoolsUpdate(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsUpdate", nil, "Failure preparing request") - return - } - - result, err = c.senderForPoolsUpdate(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "capacitypools.CapacityPoolsClient", "PoolsUpdate", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// PoolsUpdateThenPoll performs PoolsUpdate then polls until it's completed -func (c CapacityPoolsClient) PoolsUpdateThenPoll(ctx context.Context, id CapacityPoolId, input CapacityPoolPatch) error { - result, err := c.PoolsUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing PoolsUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after PoolsUpdate: %+v", err) - } - - return nil -} - -// preparerForPoolsUpdate prepares the PoolsUpdate request. -func (c CapacityPoolsClient) preparerForPoolsUpdate(ctx context.Context, id CapacityPoolId, input CapacityPoolPatch) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForPoolsUpdate sends the PoolsUpdate request. The method will close the -// http.Response Body if it receives an error. -func (c CapacityPoolsClient) senderForPoolsUpdate(ctx context.Context, req *http.Request) (future PoolsUpdateOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/model_capacitypool.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/model_capacitypool.go deleted file mode 100644 index f5d6f1ea86df..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/model_capacitypool.go +++ /dev/null @@ -1,19 +0,0 @@ -package capacitypools - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CapacityPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Properties PoolProperties `json:"properties"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/model_capacitypoolpatch.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/model_capacitypoolpatch.go deleted file mode 100644 index 46abcde6b330..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/model_capacitypoolpatch.go +++ /dev/null @@ -1,13 +0,0 @@ -package capacitypools - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CapacityPoolPatch struct { - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PoolPatchProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/model_poolproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/model_poolproperties.go deleted file mode 100644 index a1fee733fb48..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/model_poolproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package capacitypools - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PoolProperties struct { - CoolAccess *bool `json:"coolAccess,omitempty"` - EncryptionType *EncryptionType `json:"encryptionType,omitempty"` - PoolId *string `json:"poolId,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` - QosType *QosType `json:"qosType,omitempty"` - ServiceLevel ServiceLevel `json:"serviceLevel"` - Size int64 `json:"size"` - TotalThroughputMibps *float64 `json:"totalThroughputMibps,omitempty"` - UtilizedThroughputMibps *float64 `json:"utilizedThroughputMibps,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/predicates.go deleted file mode 100644 index 67e2199aa2cd..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/predicates.go +++ /dev/null @@ -1,34 +0,0 @@ -package capacitypools - -type CapacityPoolOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p CapacityPoolOperationPredicate) Matches(input CapacityPool) bool { - - if p.Etag != nil && (input.Etag == nil && *p.Etag != *input.Etag) { - return false - } - - if p.Id != nil && (input.Id == nil && *p.Id != *input.Id) { - return false - } - - if p.Location != nil && *p.Location != input.Location { - return false - } - - if p.Name != nil && (input.Name == nil && *p.Name != *input.Name) { - return false - } - - if p.Type != nil && (input.Type == nil && *p.Type != *input.Type) { - return false - } - - return true -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/README.md deleted file mode 100644 index 737a4fa9b00b..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/README.md +++ /dev/null @@ -1,116 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts` Documentation - -The `netappaccounts` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2022-01-01`). - -This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). - -### Import Path - -```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts" -``` - - -### Client Initialization - -```go -client := netappaccounts.NewNetAppAccountsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `NetAppAccountsClient.AccountsCreateOrUpdate` - -```go -ctx := context.TODO() -id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") - -payload := netappaccounts.NetAppAccount{ - // ... -} - - -if err := client.AccountsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetAppAccountsClient.AccountsDelete` - -```go -ctx := context.TODO() -id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") - -if err := client.AccountsDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetAppAccountsClient.AccountsGet` - -```go -ctx := context.TODO() -id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") - -read, err := client.AccountsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetAppAccountsClient.AccountsList` - -```go -ctx := context.TODO() -id := netappaccounts.NewResourceGroupID() - -// alternatively `client.AccountsList(ctx, id)` can be used to do batched pagination -items, err := client.AccountsListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetAppAccountsClient.AccountsListBySubscription` - -```go -ctx := context.TODO() -id := netappaccounts.NewSubscriptionID() - -// alternatively `client.AccountsListBySubscription(ctx, id)` can be used to do batched pagination -items, err := client.AccountsListBySubscriptionComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetAppAccountsClient.AccountsUpdate` - -```go -ctx := context.TODO() -id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") - -payload := netappaccounts.NetAppAccountPatch{ - // ... -} - - -if err := client.AccountsUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/client.go deleted file mode 100644 index 1a10ce8e9b65..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/client.go +++ /dev/null @@ -1,18 +0,0 @@ -package netappaccounts - -import "github.com/Azure/go-autorest/autorest" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetAppAccountsClient struct { - Client autorest.Client - baseUri string -} - -func NewNetAppAccountsClientWithBaseURI(endpoint string) NetAppAccountsClient { - return NetAppAccountsClient{ - Client: autorest.NewClientWithUserAgent(userAgent()), - baseUri: endpoint, - } -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/constants.go deleted file mode 100644 index 6e41970873a4..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/constants.go +++ /dev/null @@ -1,43 +0,0 @@ -package netappaccounts - -import "strings" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ActiveDirectoryStatus string - -const ( - ActiveDirectoryStatusCreated ActiveDirectoryStatus = "Created" - ActiveDirectoryStatusDeleted ActiveDirectoryStatus = "Deleted" - ActiveDirectoryStatusError ActiveDirectoryStatus = "Error" - ActiveDirectoryStatusInUse ActiveDirectoryStatus = "InUse" - ActiveDirectoryStatusUpdating ActiveDirectoryStatus = "Updating" -) - -func PossibleValuesForActiveDirectoryStatus() []string { - return []string{ - string(ActiveDirectoryStatusCreated), - string(ActiveDirectoryStatusDeleted), - string(ActiveDirectoryStatusError), - string(ActiveDirectoryStatusInUse), - string(ActiveDirectoryStatusUpdating), - } -} - -func parseActiveDirectoryStatus(input string) (*ActiveDirectoryStatus, error) { - vals := map[string]ActiveDirectoryStatus{ - "created": ActiveDirectoryStatusCreated, - "deleted": ActiveDirectoryStatusDeleted, - "error": ActiveDirectoryStatusError, - "inuse": ActiveDirectoryStatusInUse, - "updating": ActiveDirectoryStatusUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ActiveDirectoryStatus(input) - return &out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/id_netappaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/id_netappaccount.go deleted file mode 100644 index 68e53f4815fc..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/id_netappaccount.go +++ /dev/null @@ -1,124 +0,0 @@ -package netappaccounts - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -var _ resourceids.ResourceId = NetAppAccountId{} - -// NetAppAccountId is a struct representing the Resource ID for a Net App Account -type NetAppAccountId struct { - SubscriptionId string - ResourceGroupName string - AccountName string -} - -// NewNetAppAccountID returns a new NetAppAccountId struct -func NewNetAppAccountID(subscriptionId string, resourceGroupName string, accountName string) NetAppAccountId { - return NetAppAccountId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - AccountName: accountName, - } -} - -// ParseNetAppAccountID parses 'input' into a NetAppAccountId -func ParseNetAppAccountID(input string) (*NetAppAccountId, error) { - parser := resourceids.NewParserFromResourceIdType(NetAppAccountId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := NetAppAccountId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ParseNetAppAccountIDInsensitively parses 'input' case-insensitively into a NetAppAccountId -// note: this method should only be used for API response data and not user input -func ParseNetAppAccountIDInsensitively(input string) (*NetAppAccountId, error) { - parser := resourceids.NewParserFromResourceIdType(NetAppAccountId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := NetAppAccountId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ValidateNetAppAccountID checks that 'input' can be parsed as a Net App Account ID -func ValidateNetAppAccountID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := ParseNetAppAccountID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Net App Account ID -func (id NetAppAccountId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Net App Account ID -func (id NetAppAccountId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), - resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("accountName", "accountValue"), - } -} - -// String returns a human-readable description of this Net App Account ID -func (id NetAppAccountId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Account Name: %q", id.AccountName), - } - return fmt.Sprintf("Net App Account (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountscreateorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountscreateorupdate_autorest.go deleted file mode 100644 index b192ede4f692..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountscreateorupdate_autorest.go +++ /dev/null @@ -1,79 +0,0 @@ -package netappaccounts - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AccountsCreateOrUpdateOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// AccountsCreateOrUpdate ... -func (c NetAppAccountsClient) AccountsCreateOrUpdate(ctx context.Context, id NetAppAccountId, input NetAppAccount) (result AccountsCreateOrUpdateOperationResponse, err error) { - req, err := c.preparerForAccountsCreateOrUpdate(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsCreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = c.senderForAccountsCreateOrUpdate(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsCreateOrUpdate", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// AccountsCreateOrUpdateThenPoll performs AccountsCreateOrUpdate then polls until it's completed -func (c NetAppAccountsClient) AccountsCreateOrUpdateThenPoll(ctx context.Context, id NetAppAccountId, input NetAppAccount) error { - result, err := c.AccountsCreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing AccountsCreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after AccountsCreateOrUpdate: %+v", err) - } - - return nil -} - -// preparerForAccountsCreateOrUpdate prepares the AccountsCreateOrUpdate request. -func (c NetAppAccountsClient) preparerForAccountsCreateOrUpdate(ctx context.Context, id NetAppAccountId, input NetAppAccount) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForAccountsCreateOrUpdate sends the AccountsCreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (c NetAppAccountsClient) senderForAccountsCreateOrUpdate(ctx context.Context, req *http.Request) (future AccountsCreateOrUpdateOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountsdelete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountsdelete_autorest.go deleted file mode 100644 index 4506db44c634..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountsdelete_autorest.go +++ /dev/null @@ -1,78 +0,0 @@ -package netappaccounts - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AccountsDeleteOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// AccountsDelete ... -func (c NetAppAccountsClient) AccountsDelete(ctx context.Context, id NetAppAccountId) (result AccountsDeleteOperationResponse, err error) { - req, err := c.preparerForAccountsDelete(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsDelete", nil, "Failure preparing request") - return - } - - result, err = c.senderForAccountsDelete(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsDelete", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// AccountsDeleteThenPoll performs AccountsDelete then polls until it's completed -func (c NetAppAccountsClient) AccountsDeleteThenPoll(ctx context.Context, id NetAppAccountId) error { - result, err := c.AccountsDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing AccountsDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after AccountsDelete: %+v", err) - } - - return nil -} - -// preparerForAccountsDelete prepares the AccountsDelete request. -func (c NetAppAccountsClient) preparerForAccountsDelete(ctx context.Context, id NetAppAccountId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsDelete(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForAccountsDelete sends the AccountsDelete request. The method will close the -// http.Response Body if it receives an error. -func (c NetAppAccountsClient) senderForAccountsDelete(ctx context.Context, req *http.Request) (future AccountsDeleteOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountsget_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountsget_autorest.go deleted file mode 100644 index 1c1edc04ccfb..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountsget_autorest.go +++ /dev/null @@ -1,67 +0,0 @@ -package netappaccounts - -import ( - "context" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AccountsGetOperationResponse struct { - HttpResponse *http.Response - Model *NetAppAccount -} - -// AccountsGet ... -func (c NetAppAccountsClient) AccountsGet(ctx context.Context, id NetAppAccountId) (result AccountsGetOperationResponse, err error) { - req, err := c.preparerForAccountsGet(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsGet", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsGet", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForAccountsGet(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsGet", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForAccountsGet prepares the AccountsGet request. -func (c NetAppAccountsClient) preparerForAccountsGet(ctx context.Context, id NetAppAccountId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForAccountsGet handles the response to the AccountsGet request. The method always -// closes the http.Response Body. -func (c NetAppAccountsClient) responderForAccountsGet(resp *http.Response) (result AccountsGetOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountslist_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountslist_autorest.go deleted file mode 100644 index dd93604fbcd5..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountslist_autorest.go +++ /dev/null @@ -1,187 +0,0 @@ -package netappaccounts - -import ( - "context" - "fmt" - "net/http" - "net/url" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AccountsListOperationResponse struct { - HttpResponse *http.Response - Model *[]NetAppAccount - - nextLink *string - nextPageFunc func(ctx context.Context, nextLink string) (AccountsListOperationResponse, error) -} - -type AccountsListCompleteResult struct { - Items []NetAppAccount -} - -func (r AccountsListOperationResponse) HasMore() bool { - return r.nextLink != nil -} - -func (r AccountsListOperationResponse) LoadMore(ctx context.Context) (resp AccountsListOperationResponse, err error) { - if !r.HasMore() { - err = fmt.Errorf("no more pages returned") - return - } - return r.nextPageFunc(ctx, *r.nextLink) -} - -// AccountsList ... -func (c NetAppAccountsClient) AccountsList(ctx context.Context, id commonids.ResourceGroupId) (resp AccountsListOperationResponse, err error) { - req, err := c.preparerForAccountsList(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsList", nil, "Failure preparing request") - return - } - - resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsList", resp.HttpResponse, "Failure sending request") - return - } - - resp, err = c.responderForAccountsList(resp.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsList", resp.HttpResponse, "Failure responding to request") - return - } - return -} - -// AccountsListComplete retrieves all of the results into a single object -func (c NetAppAccountsClient) AccountsListComplete(ctx context.Context, id commonids.ResourceGroupId) (AccountsListCompleteResult, error) { - return c.AccountsListCompleteMatchingPredicate(ctx, id, NetAppAccountOperationPredicate{}) -} - -// AccountsListCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c NetAppAccountsClient) AccountsListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate NetAppAccountOperationPredicate) (resp AccountsListCompleteResult, err error) { - items := make([]NetAppAccount, 0) - - page, err := c.AccountsList(ctx, id) - if err != nil { - err = fmt.Errorf("loading the initial page: %+v", err) - return - } - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - for page.HasMore() { - page, err = page.LoadMore(ctx) - if err != nil { - err = fmt.Errorf("loading the next page: %+v", err) - return - } - - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - } - - out := AccountsListCompleteResult{ - Items: items, - } - return out, nil -} - -// preparerForAccountsList prepares the AccountsList request. -func (c NetAppAccountsClient) preparerForAccountsList(ctx context.Context, id commonids.ResourceGroupId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/providers/Microsoft.NetApp/netAppAccounts", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// preparerForAccountsListWithNextLink prepares the AccountsList request with the given nextLink token. -func (c NetAppAccountsClient) preparerForAccountsListWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { - uri, err := url.Parse(nextLink) - if err != nil { - return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) - } - queryParameters := map[string]interface{}{} - for k, v := range uri.Query() { - if len(v) == 0 { - continue - } - val := v[0] - val = autorest.Encode("query", val) - queryParameters[k] = val - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(uri.Path), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForAccountsList handles the response to the AccountsList request. The method always -// closes the http.Response Body. -func (c NetAppAccountsClient) responderForAccountsList(resp *http.Response) (result AccountsListOperationResponse, err error) { - type page struct { - Values []NetAppAccount `json:"value"` - NextLink *string `json:"nextLink"` - } - var respObj page - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&respObj), - autorest.ByClosing()) - result.HttpResponse = resp - result.Model = &respObj.Values - result.nextLink = respObj.NextLink - if respObj.NextLink != nil { - result.nextPageFunc = func(ctx context.Context, nextLink string) (result AccountsListOperationResponse, err error) { - req, err := c.preparerForAccountsListWithNextLink(ctx, nextLink) - if err != nil { - err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsList", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsList", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForAccountsList(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsList", result.HttpResponse, "Failure responding to request") - return - } - - return - } - } - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountslistbysubscription_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountslistbysubscription_autorest.go deleted file mode 100644 index bd65578f1751..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountslistbysubscription_autorest.go +++ /dev/null @@ -1,187 +0,0 @@ -package netappaccounts - -import ( - "context" - "fmt" - "net/http" - "net/url" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AccountsListBySubscriptionOperationResponse struct { - HttpResponse *http.Response - Model *[]NetAppAccount - - nextLink *string - nextPageFunc func(ctx context.Context, nextLink string) (AccountsListBySubscriptionOperationResponse, error) -} - -type AccountsListBySubscriptionCompleteResult struct { - Items []NetAppAccount -} - -func (r AccountsListBySubscriptionOperationResponse) HasMore() bool { - return r.nextLink != nil -} - -func (r AccountsListBySubscriptionOperationResponse) LoadMore(ctx context.Context) (resp AccountsListBySubscriptionOperationResponse, err error) { - if !r.HasMore() { - err = fmt.Errorf("no more pages returned") - return - } - return r.nextPageFunc(ctx, *r.nextLink) -} - -// AccountsListBySubscription ... -func (c NetAppAccountsClient) AccountsListBySubscription(ctx context.Context, id commonids.SubscriptionId) (resp AccountsListBySubscriptionOperationResponse, err error) { - req, err := c.preparerForAccountsListBySubscription(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsListBySubscription", nil, "Failure preparing request") - return - } - - resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsListBySubscription", resp.HttpResponse, "Failure sending request") - return - } - - resp, err = c.responderForAccountsListBySubscription(resp.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsListBySubscription", resp.HttpResponse, "Failure responding to request") - return - } - return -} - -// AccountsListBySubscriptionComplete retrieves all of the results into a single object -func (c NetAppAccountsClient) AccountsListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId) (AccountsListBySubscriptionCompleteResult, error) { - return c.AccountsListBySubscriptionCompleteMatchingPredicate(ctx, id, NetAppAccountOperationPredicate{}) -} - -// AccountsListBySubscriptionCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c NetAppAccountsClient) AccountsListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate NetAppAccountOperationPredicate) (resp AccountsListBySubscriptionCompleteResult, err error) { - items := make([]NetAppAccount, 0) - - page, err := c.AccountsListBySubscription(ctx, id) - if err != nil { - err = fmt.Errorf("loading the initial page: %+v", err) - return - } - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - for page.HasMore() { - page, err = page.LoadMore(ctx) - if err != nil { - err = fmt.Errorf("loading the next page: %+v", err) - return - } - - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - } - - out := AccountsListBySubscriptionCompleteResult{ - Items: items, - } - return out, nil -} - -// preparerForAccountsListBySubscription prepares the AccountsListBySubscription request. -func (c NetAppAccountsClient) preparerForAccountsListBySubscription(ctx context.Context, id commonids.SubscriptionId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/providers/Microsoft.NetApp/netAppAccounts", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// preparerForAccountsListBySubscriptionWithNextLink prepares the AccountsListBySubscription request with the given nextLink token. -func (c NetAppAccountsClient) preparerForAccountsListBySubscriptionWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { - uri, err := url.Parse(nextLink) - if err != nil { - return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) - } - queryParameters := map[string]interface{}{} - for k, v := range uri.Query() { - if len(v) == 0 { - continue - } - val := v[0] - val = autorest.Encode("query", val) - queryParameters[k] = val - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(uri.Path), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForAccountsListBySubscription handles the response to the AccountsListBySubscription request. The method always -// closes the http.Response Body. -func (c NetAppAccountsClient) responderForAccountsListBySubscription(resp *http.Response) (result AccountsListBySubscriptionOperationResponse, err error) { - type page struct { - Values []NetAppAccount `json:"value"` - NextLink *string `json:"nextLink"` - } - var respObj page - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&respObj), - autorest.ByClosing()) - result.HttpResponse = resp - result.Model = &respObj.Values - result.nextLink = respObj.NextLink - if respObj.NextLink != nil { - result.nextPageFunc = func(ctx context.Context, nextLink string) (result AccountsListBySubscriptionOperationResponse, err error) { - req, err := c.preparerForAccountsListBySubscriptionWithNextLink(ctx, nextLink) - if err != nil { - err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsListBySubscription", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsListBySubscription", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForAccountsListBySubscription(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsListBySubscription", result.HttpResponse, "Failure responding to request") - return - } - - return - } - } - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountsupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountsupdate_autorest.go deleted file mode 100644 index 8ed5cd37c4ce..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/method_accountsupdate_autorest.go +++ /dev/null @@ -1,79 +0,0 @@ -package netappaccounts - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AccountsUpdateOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// AccountsUpdate ... -func (c NetAppAccountsClient) AccountsUpdate(ctx context.Context, id NetAppAccountId, input NetAppAccountPatch) (result AccountsUpdateOperationResponse, err error) { - req, err := c.preparerForAccountsUpdate(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsUpdate", nil, "Failure preparing request") - return - } - - result, err = c.senderForAccountsUpdate(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsUpdate", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// AccountsUpdateThenPoll performs AccountsUpdate then polls until it's completed -func (c NetAppAccountsClient) AccountsUpdateThenPoll(ctx context.Context, id NetAppAccountId, input NetAppAccountPatch) error { - result, err := c.AccountsUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing AccountsUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after AccountsUpdate: %+v", err) - } - - return nil -} - -// preparerForAccountsUpdate prepares the AccountsUpdate request. -func (c NetAppAccountsClient) preparerForAccountsUpdate(ctx context.Context, id NetAppAccountId, input NetAppAccountPatch) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForAccountsUpdate sends the AccountsUpdate request. The method will close the -// http.Response Body if it receives an error. -func (c NetAppAccountsClient) senderForAccountsUpdate(ctx context.Context, req *http.Request) (future AccountsUpdateOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/model_activedirectory.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/model_activedirectory.go deleted file mode 100644 index da90d13da0a4..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/model_activedirectory.go +++ /dev/null @@ -1,29 +0,0 @@ -package netappaccounts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ActiveDirectory struct { - ActiveDirectoryId *string `json:"activeDirectoryId,omitempty"` - AdName *string `json:"adName,omitempty"` - Administrators *[]string `json:"administrators,omitempty"` - AesEncryption *bool `json:"aesEncryption,omitempty"` - AllowLocalNfsUsersWithLdap *bool `json:"allowLocalNfsUsersWithLdap,omitempty"` - BackupOperators *[]string `json:"backupOperators,omitempty"` - Dns *string `json:"dns,omitempty"` - Domain *string `json:"domain,omitempty"` - EncryptDCConnections *bool `json:"encryptDCConnections,omitempty"` - KdcIP *string `json:"kdcIP,omitempty"` - LdapOverTLS *bool `json:"ldapOverTLS,omitempty"` - LdapSearchScope *LdapSearchScopeOpt `json:"ldapSearchScope,omitempty"` - LdapSigning *bool `json:"ldapSigning,omitempty"` - OrganizationalUnit *string `json:"organizationalUnit,omitempty"` - Password *string `json:"password,omitempty"` - SecurityOperators *[]string `json:"securityOperators,omitempty"` - ServerRootCACertificate *string `json:"serverRootCACertificate,omitempty"` - Site *string `json:"site,omitempty"` - SmbServerName *string `json:"smbServerName,omitempty"` - Status *ActiveDirectoryStatus `json:"status,omitempty"` - StatusDetails *string `json:"statusDetails,omitempty"` - Username *string `json:"username,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/model_ldapsearchscopeopt.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/model_ldapsearchscopeopt.go deleted file mode 100644 index c476b0f0875f..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/model_ldapsearchscopeopt.go +++ /dev/null @@ -1,10 +0,0 @@ -package netappaccounts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LdapSearchScopeOpt struct { - GroupDN *string `json:"groupDN,omitempty"` - GroupMembershipFilter *string `json:"groupMembershipFilter,omitempty"` - UserDN *string `json:"userDN,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/model_netappaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/model_netappaccount.go deleted file mode 100644 index ec2ed4aa10c5..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/model_netappaccount.go +++ /dev/null @@ -1,19 +0,0 @@ -package netappaccounts - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetAppAccount struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Properties *AccountProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/model_netappaccountpatch.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/model_netappaccountpatch.go deleted file mode 100644 index d3c6c1efcc20..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/model_netappaccountpatch.go +++ /dev/null @@ -1,13 +0,0 @@ -package netappaccounts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetAppAccountPatch struct { - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *AccountProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/predicates.go deleted file mode 100644 index cc139fd85c4a..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/predicates.go +++ /dev/null @@ -1,34 +0,0 @@ -package netappaccounts - -type NetAppAccountOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p NetAppAccountOperationPredicate) Matches(input NetAppAccount) bool { - - if p.Etag != nil && (input.Etag == nil && *p.Etag != *input.Etag) { - return false - } - - if p.Id != nil && (input.Id == nil && *p.Id != *input.Id) { - return false - } - - if p.Location != nil && *p.Location != input.Location { - return false - } - - if p.Name != nil && (input.Name == nil && *p.Name != *input.Name) { - return false - } - - if p.Type != nil && (input.Type == nil && *p.Type != *input.Type) { - return false - } - - return true -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/README.md deleted file mode 100644 index 6c1526c48129..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/README.md +++ /dev/null @@ -1,102 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy` Documentation - -The `snapshotpolicy` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2022-01-01`). - -This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). - -### Import Path - -```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy" -``` - - -### Client Initialization - -```go -client := snapshotpolicy.NewSnapshotPolicyClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `SnapshotPolicyClient.SnapshotPoliciesCreate` - -```go -ctx := context.TODO() -id := snapshotpolicy.NewSnapshotPoliciesID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "snapshotPolicyValue") - -payload := snapshotpolicy.SnapshotPolicy{ - // ... -} - - -read, err := client.SnapshotPoliciesCreate(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `SnapshotPolicyClient.SnapshotPoliciesDelete` - -```go -ctx := context.TODO() -id := snapshotpolicy.NewSnapshotPoliciesID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "snapshotPolicyValue") - -if err := client.SnapshotPoliciesDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `SnapshotPolicyClient.SnapshotPoliciesGet` - -```go -ctx := context.TODO() -id := snapshotpolicy.NewSnapshotPoliciesID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "snapshotPolicyValue") - -read, err := client.SnapshotPoliciesGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `SnapshotPolicyClient.SnapshotPoliciesList` - -```go -ctx := context.TODO() -id := snapshotpolicy.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") - -read, err := client.SnapshotPoliciesList(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `SnapshotPolicyClient.SnapshotPoliciesUpdate` - -```go -ctx := context.TODO() -id := snapshotpolicy.NewSnapshotPoliciesID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "snapshotPolicyValue") - -payload := snapshotpolicy.SnapshotPolicyPatch{ - // ... -} - - -if err := client.SnapshotPoliciesUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/client.go deleted file mode 100644 index 63c20fd6ea4d..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/client.go +++ /dev/null @@ -1,18 +0,0 @@ -package snapshotpolicy - -import "github.com/Azure/go-autorest/autorest" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SnapshotPolicyClient struct { - Client autorest.Client - baseUri string -} - -func NewSnapshotPolicyClientWithBaseURI(endpoint string) SnapshotPolicyClient { - return SnapshotPolicyClient{ - Client: autorest.NewClientWithUserAgent(userAgent()), - baseUri: endpoint, - } -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/id_netappaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/id_netappaccount.go deleted file mode 100644 index 726c28f92e9c..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/id_netappaccount.go +++ /dev/null @@ -1,124 +0,0 @@ -package snapshotpolicy - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -var _ resourceids.ResourceId = NetAppAccountId{} - -// NetAppAccountId is a struct representing the Resource ID for a Net App Account -type NetAppAccountId struct { - SubscriptionId string - ResourceGroupName string - AccountName string -} - -// NewNetAppAccountID returns a new NetAppAccountId struct -func NewNetAppAccountID(subscriptionId string, resourceGroupName string, accountName string) NetAppAccountId { - return NetAppAccountId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - AccountName: accountName, - } -} - -// ParseNetAppAccountID parses 'input' into a NetAppAccountId -func ParseNetAppAccountID(input string) (*NetAppAccountId, error) { - parser := resourceids.NewParserFromResourceIdType(NetAppAccountId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := NetAppAccountId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ParseNetAppAccountIDInsensitively parses 'input' case-insensitively into a NetAppAccountId -// note: this method should only be used for API response data and not user input -func ParseNetAppAccountIDInsensitively(input string) (*NetAppAccountId, error) { - parser := resourceids.NewParserFromResourceIdType(NetAppAccountId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := NetAppAccountId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ValidateNetAppAccountID checks that 'input' can be parsed as a Net App Account ID -func ValidateNetAppAccountID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := ParseNetAppAccountID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Net App Account ID -func (id NetAppAccountId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Net App Account ID -func (id NetAppAccountId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), - resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("accountName", "accountValue"), - } -} - -// String returns a human-readable description of this Net App Account ID -func (id NetAppAccountId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Account Name: %q", id.AccountName), - } - return fmt.Sprintf("Net App Account (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/id_snapshotpolicies.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/id_snapshotpolicies.go deleted file mode 100644 index f0662d3bf339..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/id_snapshotpolicies.go +++ /dev/null @@ -1,137 +0,0 @@ -package snapshotpolicy - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -var _ resourceids.ResourceId = SnapshotPoliciesId{} - -// SnapshotPoliciesId is a struct representing the Resource ID for a Snapshot Policies -type SnapshotPoliciesId struct { - SubscriptionId string - ResourceGroupName string - AccountName string - SnapshotPolicyName string -} - -// NewSnapshotPoliciesID returns a new SnapshotPoliciesId struct -func NewSnapshotPoliciesID(subscriptionId string, resourceGroupName string, accountName string, snapshotPolicyName string) SnapshotPoliciesId { - return SnapshotPoliciesId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - AccountName: accountName, - SnapshotPolicyName: snapshotPolicyName, - } -} - -// ParseSnapshotPoliciesID parses 'input' into a SnapshotPoliciesId -func ParseSnapshotPoliciesID(input string) (*SnapshotPoliciesId, error) { - parser := resourceids.NewParserFromResourceIdType(SnapshotPoliciesId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := SnapshotPoliciesId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - if id.SnapshotPolicyName, ok = parsed.Parsed["snapshotPolicyName"]; !ok { - return nil, fmt.Errorf("the segment 'snapshotPolicyName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ParseSnapshotPoliciesIDInsensitively parses 'input' case-insensitively into a SnapshotPoliciesId -// note: this method should only be used for API response data and not user input -func ParseSnapshotPoliciesIDInsensitively(input string) (*SnapshotPoliciesId, error) { - parser := resourceids.NewParserFromResourceIdType(SnapshotPoliciesId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := SnapshotPoliciesId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - if id.SnapshotPolicyName, ok = parsed.Parsed["snapshotPolicyName"]; !ok { - return nil, fmt.Errorf("the segment 'snapshotPolicyName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ValidateSnapshotPoliciesID checks that 'input' can be parsed as a Snapshot Policies ID -func ValidateSnapshotPoliciesID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := ParseSnapshotPoliciesID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Snapshot Policies ID -func (id SnapshotPoliciesId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/snapshotPolicies/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName, id.SnapshotPolicyName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Snapshot Policies ID -func (id SnapshotPoliciesId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), - resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("accountName", "accountValue"), - resourceids.StaticSegment("staticSnapshotPolicies", "snapshotPolicies", "snapshotPolicies"), - resourceids.UserSpecifiedSegment("snapshotPolicyName", "snapshotPolicyValue"), - } -} - -// String returns a human-readable description of this Snapshot Policies ID -func (id SnapshotPoliciesId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Account Name: %q", id.AccountName), - fmt.Sprintf("Snapshot Policy Name: %q", id.SnapshotPolicyName), - } - return fmt.Sprintf("Snapshot Policies (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/method_snapshotpoliciescreate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/method_snapshotpoliciescreate_autorest.go deleted file mode 100644 index 43d25be8b167..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/method_snapshotpoliciescreate_autorest.go +++ /dev/null @@ -1,68 +0,0 @@ -package snapshotpolicy - -import ( - "context" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SnapshotPoliciesCreateOperationResponse struct { - HttpResponse *http.Response - Model *SnapshotPolicy -} - -// SnapshotPoliciesCreate ... -func (c SnapshotPolicyClient) SnapshotPoliciesCreate(ctx context.Context, id SnapshotPoliciesId, input SnapshotPolicy) (result SnapshotPoliciesCreateOperationResponse, err error) { - req, err := c.preparerForSnapshotPoliciesCreate(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesCreate", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesCreate", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForSnapshotPoliciesCreate(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesCreate", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForSnapshotPoliciesCreate prepares the SnapshotPoliciesCreate request. -func (c SnapshotPolicyClient) preparerForSnapshotPoliciesCreate(ctx context.Context, id SnapshotPoliciesId, input SnapshotPolicy) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForSnapshotPoliciesCreate handles the response to the SnapshotPoliciesCreate request. The method always -// closes the http.Response Body. -func (c SnapshotPolicyClient) responderForSnapshotPoliciesCreate(resp *http.Response) (result SnapshotPoliciesCreateOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/method_snapshotpoliciesdelete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/method_snapshotpoliciesdelete_autorest.go deleted file mode 100644 index 0b2ba8905215..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/method_snapshotpoliciesdelete_autorest.go +++ /dev/null @@ -1,78 +0,0 @@ -package snapshotpolicy - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SnapshotPoliciesDeleteOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// SnapshotPoliciesDelete ... -func (c SnapshotPolicyClient) SnapshotPoliciesDelete(ctx context.Context, id SnapshotPoliciesId) (result SnapshotPoliciesDeleteOperationResponse, err error) { - req, err := c.preparerForSnapshotPoliciesDelete(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesDelete", nil, "Failure preparing request") - return - } - - result, err = c.senderForSnapshotPoliciesDelete(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesDelete", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// SnapshotPoliciesDeleteThenPoll performs SnapshotPoliciesDelete then polls until it's completed -func (c SnapshotPolicyClient) SnapshotPoliciesDeleteThenPoll(ctx context.Context, id SnapshotPoliciesId) error { - result, err := c.SnapshotPoliciesDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing SnapshotPoliciesDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after SnapshotPoliciesDelete: %+v", err) - } - - return nil -} - -// preparerForSnapshotPoliciesDelete prepares the SnapshotPoliciesDelete request. -func (c SnapshotPolicyClient) preparerForSnapshotPoliciesDelete(ctx context.Context, id SnapshotPoliciesId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsDelete(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForSnapshotPoliciesDelete sends the SnapshotPoliciesDelete request. The method will close the -// http.Response Body if it receives an error. -func (c SnapshotPolicyClient) senderForSnapshotPoliciesDelete(ctx context.Context, req *http.Request) (future SnapshotPoliciesDeleteOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/method_snapshotpoliciesget_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/method_snapshotpoliciesget_autorest.go deleted file mode 100644 index 26d3741d8b6c..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/method_snapshotpoliciesget_autorest.go +++ /dev/null @@ -1,67 +0,0 @@ -package snapshotpolicy - -import ( - "context" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SnapshotPoliciesGetOperationResponse struct { - HttpResponse *http.Response - Model *SnapshotPolicy -} - -// SnapshotPoliciesGet ... -func (c SnapshotPolicyClient) SnapshotPoliciesGet(ctx context.Context, id SnapshotPoliciesId) (result SnapshotPoliciesGetOperationResponse, err error) { - req, err := c.preparerForSnapshotPoliciesGet(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesGet", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesGet", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForSnapshotPoliciesGet(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesGet", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForSnapshotPoliciesGet prepares the SnapshotPoliciesGet request. -func (c SnapshotPolicyClient) preparerForSnapshotPoliciesGet(ctx context.Context, id SnapshotPoliciesId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForSnapshotPoliciesGet handles the response to the SnapshotPoliciesGet request. The method always -// closes the http.Response Body. -func (c SnapshotPolicyClient) responderForSnapshotPoliciesGet(resp *http.Response) (result SnapshotPoliciesGetOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/method_snapshotpolicieslist_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/method_snapshotpolicieslist_autorest.go deleted file mode 100644 index b9f36c35c96f..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/method_snapshotpolicieslist_autorest.go +++ /dev/null @@ -1,68 +0,0 @@ -package snapshotpolicy - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SnapshotPoliciesListOperationResponse struct { - HttpResponse *http.Response - Model *SnapshotPoliciesList -} - -// SnapshotPoliciesList ... -func (c SnapshotPolicyClient) SnapshotPoliciesList(ctx context.Context, id NetAppAccountId) (result SnapshotPoliciesListOperationResponse, err error) { - req, err := c.preparerForSnapshotPoliciesList(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesList", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesList", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForSnapshotPoliciesList(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesList", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForSnapshotPoliciesList prepares the SnapshotPoliciesList request. -func (c SnapshotPolicyClient) preparerForSnapshotPoliciesList(ctx context.Context, id NetAppAccountId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/snapshotPolicies", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForSnapshotPoliciesList handles the response to the SnapshotPoliciesList request. The method always -// closes the http.Response Body. -func (c SnapshotPolicyClient) responderForSnapshotPoliciesList(resp *http.Response) (result SnapshotPoliciesListOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/method_snapshotpoliciesupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/method_snapshotpoliciesupdate_autorest.go deleted file mode 100644 index eea75a1378c0..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/method_snapshotpoliciesupdate_autorest.go +++ /dev/null @@ -1,79 +0,0 @@ -package snapshotpolicy - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SnapshotPoliciesUpdateOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// SnapshotPoliciesUpdate ... -func (c SnapshotPolicyClient) SnapshotPoliciesUpdate(ctx context.Context, id SnapshotPoliciesId, input SnapshotPolicyPatch) (result SnapshotPoliciesUpdateOperationResponse, err error) { - req, err := c.preparerForSnapshotPoliciesUpdate(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesUpdate", nil, "Failure preparing request") - return - } - - result, err = c.senderForSnapshotPoliciesUpdate(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshotpolicy.SnapshotPolicyClient", "SnapshotPoliciesUpdate", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// SnapshotPoliciesUpdateThenPoll performs SnapshotPoliciesUpdate then polls until it's completed -func (c SnapshotPolicyClient) SnapshotPoliciesUpdateThenPoll(ctx context.Context, id SnapshotPoliciesId, input SnapshotPolicyPatch) error { - result, err := c.SnapshotPoliciesUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing SnapshotPoliciesUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after SnapshotPoliciesUpdate: %+v", err) - } - - return nil -} - -// preparerForSnapshotPoliciesUpdate prepares the SnapshotPoliciesUpdate request. -func (c SnapshotPolicyClient) preparerForSnapshotPoliciesUpdate(ctx context.Context, id SnapshotPoliciesId, input SnapshotPolicyPatch) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForSnapshotPoliciesUpdate sends the SnapshotPoliciesUpdate request. The method will close the -// http.Response Body if it receives an error. -func (c SnapshotPolicyClient) senderForSnapshotPoliciesUpdate(ctx context.Context, req *http.Request) (future SnapshotPoliciesUpdateOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_dailyschedule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_dailyschedule.go deleted file mode 100644 index bdafb72e6e09..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_dailyschedule.go +++ /dev/null @@ -1,11 +0,0 @@ -package snapshotpolicy - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DailySchedule struct { - Hour *int64 `json:"hour,omitempty"` - Minute *int64 `json:"minute,omitempty"` - SnapshotsToKeep *int64 `json:"snapshotsToKeep,omitempty"` - UsedBytes *int64 `json:"usedBytes,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_hourlyschedule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_hourlyschedule.go deleted file mode 100644 index a1e5d0fa0283..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_hourlyschedule.go +++ /dev/null @@ -1,10 +0,0 @@ -package snapshotpolicy - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HourlySchedule struct { - Minute *int64 `json:"minute,omitempty"` - SnapshotsToKeep *int64 `json:"snapshotsToKeep,omitempty"` - UsedBytes *int64 `json:"usedBytes,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_monthlyschedule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_monthlyschedule.go deleted file mode 100644 index 02cbcad6a592..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_monthlyschedule.go +++ /dev/null @@ -1,12 +0,0 @@ -package snapshotpolicy - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MonthlySchedule struct { - DaysOfMonth *string `json:"daysOfMonth,omitempty"` - Hour *int64 `json:"hour,omitempty"` - Minute *int64 `json:"minute,omitempty"` - SnapshotsToKeep *int64 `json:"snapshotsToKeep,omitempty"` - UsedBytes *int64 `json:"usedBytes,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_snapshotpolicieslist.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_snapshotpolicieslist.go deleted file mode 100644 index 910e2519adbe..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_snapshotpolicieslist.go +++ /dev/null @@ -1,8 +0,0 @@ -package snapshotpolicy - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SnapshotPoliciesList struct { - Value *[]SnapshotPolicy `json:"value,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_snapshotpolicy.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_snapshotpolicy.go deleted file mode 100644 index 310cfaaf1bb9..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_snapshotpolicy.go +++ /dev/null @@ -1,19 +0,0 @@ -package snapshotpolicy - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SnapshotPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Properties SnapshotPolicyProperties `json:"properties"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_snapshotpolicypatch.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_snapshotpolicypatch.go deleted file mode 100644 index 76df9be172b9..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_snapshotpolicypatch.go +++ /dev/null @@ -1,13 +0,0 @@ -package snapshotpolicy - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SnapshotPolicyPatch struct { - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SnapshotPolicyProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_snapshotpolicyproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_snapshotpolicyproperties.go deleted file mode 100644 index fb4fb0fcb05a..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_snapshotpolicyproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package snapshotpolicy - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SnapshotPolicyProperties struct { - DailySchedule *DailySchedule `json:"dailySchedule,omitempty"` - Enabled *bool `json:"enabled,omitempty"` - HourlySchedule *HourlySchedule `json:"hourlySchedule,omitempty"` - MonthlySchedule *MonthlySchedule `json:"monthlySchedule,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` - WeeklySchedule *WeeklySchedule `json:"weeklySchedule,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_weeklyschedule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_weeklyschedule.go deleted file mode 100644 index 128ece7ef5ef..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/model_weeklyschedule.go +++ /dev/null @@ -1,12 +0,0 @@ -package snapshotpolicy - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type WeeklySchedule struct { - Day *string `json:"day,omitempty"` - Hour *int64 `json:"hour,omitempty"` - Minute *int64 `json:"minute,omitempty"` - SnapshotsToKeep *int64 `json:"snapshotsToKeep,omitempty"` - UsedBytes *int64 `json:"usedBytes,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/version.go deleted file mode 100644 index 86df4353d7db..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshotpolicy/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package snapshotpolicy - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-01-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/snapshotpolicy/%s", defaultApiVersion) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/client.go deleted file mode 100644 index 62d2a1323835..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/client.go +++ /dev/null @@ -1,18 +0,0 @@ -package snapshots - -import "github.com/Azure/go-autorest/autorest" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SnapshotsClient struct { - Client autorest.Client - baseUri string -} - -func NewSnapshotsClientWithBaseURI(endpoint string) SnapshotsClient { - return SnapshotsClient{ - Client: autorest.NewClientWithUserAgent(userAgent()), - baseUri: endpoint, - } -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/id_snapshot.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/id_snapshot.go deleted file mode 100644 index d38fb8cb8f01..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/id_snapshot.go +++ /dev/null @@ -1,163 +0,0 @@ -package snapshots - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -var _ resourceids.ResourceId = SnapshotId{} - -// SnapshotId is a struct representing the Resource ID for a Snapshot -type SnapshotId struct { - SubscriptionId string - ResourceGroupName string - AccountName string - PoolName string - VolumeName string - SnapshotName string -} - -// NewSnapshotID returns a new SnapshotId struct -func NewSnapshotID(subscriptionId string, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) SnapshotId { - return SnapshotId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - AccountName: accountName, - PoolName: poolName, - VolumeName: volumeName, - SnapshotName: snapshotName, - } -} - -// ParseSnapshotID parses 'input' into a SnapshotId -func ParseSnapshotID(input string) (*SnapshotId, error) { - parser := resourceids.NewParserFromResourceIdType(SnapshotId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := SnapshotId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { - return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) - } - - if id.VolumeName, ok = parsed.Parsed["volumeName"]; !ok { - return nil, fmt.Errorf("the segment 'volumeName' was not found in the resource id %q", input) - } - - if id.SnapshotName, ok = parsed.Parsed["snapshotName"]; !ok { - return nil, fmt.Errorf("the segment 'snapshotName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ParseSnapshotIDInsensitively parses 'input' case-insensitively into a SnapshotId -// note: this method should only be used for API response data and not user input -func ParseSnapshotIDInsensitively(input string) (*SnapshotId, error) { - parser := resourceids.NewParserFromResourceIdType(SnapshotId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := SnapshotId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { - return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) - } - - if id.VolumeName, ok = parsed.Parsed["volumeName"]; !ok { - return nil, fmt.Errorf("the segment 'volumeName' was not found in the resource id %q", input) - } - - if id.SnapshotName, ok = parsed.Parsed["snapshotName"]; !ok { - return nil, fmt.Errorf("the segment 'snapshotName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ValidateSnapshotID checks that 'input' can be parsed as a Snapshot ID -func ValidateSnapshotID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := ParseSnapshotID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Snapshot ID -func (id SnapshotId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/capacityPools/%s/volumes/%s/snapshots/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName, id.PoolName, id.VolumeName, id.SnapshotName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Snapshot ID -func (id SnapshotId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), - resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("accountName", "accountValue"), - resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("poolName", "poolValue"), - resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), - resourceids.UserSpecifiedSegment("volumeName", "volumeValue"), - resourceids.StaticSegment("staticSnapshots", "snapshots", "snapshots"), - resourceids.UserSpecifiedSegment("snapshotName", "snapshotValue"), - } -} - -// String returns a human-readable description of this Snapshot ID -func (id SnapshotId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Account Name: %q", id.AccountName), - fmt.Sprintf("Pool Name: %q", id.PoolName), - fmt.Sprintf("Volume Name: %q", id.VolumeName), - fmt.Sprintf("Snapshot Name: %q", id.SnapshotName), - } - return fmt.Sprintf("Snapshot (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/id_volume.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/id_volume.go deleted file mode 100644 index c5cc73e141c7..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/id_volume.go +++ /dev/null @@ -1,150 +0,0 @@ -package snapshots - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -var _ resourceids.ResourceId = VolumeId{} - -// VolumeId is a struct representing the Resource ID for a Volume -type VolumeId struct { - SubscriptionId string - ResourceGroupName string - AccountName string - PoolName string - VolumeName string -} - -// NewVolumeID returns a new VolumeId struct -func NewVolumeID(subscriptionId string, resourceGroupName string, accountName string, poolName string, volumeName string) VolumeId { - return VolumeId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - AccountName: accountName, - PoolName: poolName, - VolumeName: volumeName, - } -} - -// ParseVolumeID parses 'input' into a VolumeId -func ParseVolumeID(input string) (*VolumeId, error) { - parser := resourceids.NewParserFromResourceIdType(VolumeId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := VolumeId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { - return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) - } - - if id.VolumeName, ok = parsed.Parsed["volumeName"]; !ok { - return nil, fmt.Errorf("the segment 'volumeName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ParseVolumeIDInsensitively parses 'input' case-insensitively into a VolumeId -// note: this method should only be used for API response data and not user input -func ParseVolumeIDInsensitively(input string) (*VolumeId, error) { - parser := resourceids.NewParserFromResourceIdType(VolumeId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := VolumeId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { - return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) - } - - if id.VolumeName, ok = parsed.Parsed["volumeName"]; !ok { - return nil, fmt.Errorf("the segment 'volumeName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ValidateVolumeID checks that 'input' can be parsed as a Volume ID -func ValidateVolumeID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := ParseVolumeID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Volume ID -func (id VolumeId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/capacityPools/%s/volumes/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName, id.PoolName, id.VolumeName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Volume ID -func (id VolumeId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), - resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("accountName", "accountValue"), - resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("poolName", "poolValue"), - resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), - resourceids.UserSpecifiedSegment("volumeName", "volumeValue"), - } -} - -// String returns a human-readable description of this Volume ID -func (id VolumeId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Account Name: %q", id.AccountName), - fmt.Sprintf("Pool Name: %q", id.PoolName), - fmt.Sprintf("Volume Name: %q", id.VolumeName), - } - return fmt.Sprintf("Volume (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_create_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_create_autorest.go deleted file mode 100644 index 90b33471adef..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_create_autorest.go +++ /dev/null @@ -1,79 +0,0 @@ -package snapshots - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CreateOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// Create ... -func (c SnapshotsClient) Create(ctx context.Context, id SnapshotId, input Snapshot) (result CreateOperationResponse, err error) { - req, err := c.preparerForCreate(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "Create", nil, "Failure preparing request") - return - } - - result, err = c.senderForCreate(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "Create", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// CreateThenPoll performs Create then polls until it's completed -func (c SnapshotsClient) CreateThenPoll(ctx context.Context, id SnapshotId, input Snapshot) error { - result, err := c.Create(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Create: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after Create: %+v", err) - } - - return nil -} - -// preparerForCreate prepares the Create request. -func (c SnapshotsClient) preparerForCreate(ctx context.Context, id SnapshotId, input Snapshot) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForCreate sends the Create request. The method will close the -// http.Response Body if it receives an error. -func (c SnapshotsClient) senderForCreate(ctx context.Context, req *http.Request) (future CreateOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_delete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_delete_autorest.go deleted file mode 100644 index 55f7d9d07967..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_delete_autorest.go +++ /dev/null @@ -1,78 +0,0 @@ -package snapshots - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DeleteOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// Delete ... -func (c SnapshotsClient) Delete(ctx context.Context, id SnapshotId) (result DeleteOperationResponse, err error) { - req, err := c.preparerForDelete(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = c.senderForDelete(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "Delete", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// DeleteThenPoll performs Delete then polls until it's completed -func (c SnapshotsClient) DeleteThenPoll(ctx context.Context, id SnapshotId) error { - result, err := c.Delete(ctx, id) - if err != nil { - return fmt.Errorf("performing Delete: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after Delete: %+v", err) - } - - return nil -} - -// preparerForDelete prepares the Delete request. -func (c SnapshotsClient) preparerForDelete(ctx context.Context, id SnapshotId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsDelete(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForDelete sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (c SnapshotsClient) senderForDelete(ctx context.Context, req *http.Request) (future DeleteOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_get_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_get_autorest.go deleted file mode 100644 index 4764bf6f0606..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_get_autorest.go +++ /dev/null @@ -1,67 +0,0 @@ -package snapshots - -import ( - "context" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GetOperationResponse struct { - HttpResponse *http.Response - Model *Snapshot -} - -// Get ... -func (c SnapshotsClient) Get(ctx context.Context, id SnapshotId) (result GetOperationResponse, err error) { - req, err := c.preparerForGet(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "Get", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "Get", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForGet(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "Get", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForGet prepares the Get request. -func (c SnapshotsClient) preparerForGet(ctx context.Context, id SnapshotId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForGet handles the response to the Get request. The method always -// closes the http.Response Body. -func (c SnapshotsClient) responderForGet(resp *http.Response) (result GetOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_list_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_list_autorest.go deleted file mode 100644 index 5d2f714bdc1f..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_list_autorest.go +++ /dev/null @@ -1,68 +0,0 @@ -package snapshots - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ListOperationResponse struct { - HttpResponse *http.Response - Model *SnapshotsList -} - -// List ... -func (c SnapshotsClient) List(ctx context.Context, id VolumeId) (result ListOperationResponse, err error) { - req, err := c.preparerForList(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "List", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "List", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForList(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "List", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForList prepares the List request. -func (c SnapshotsClient) preparerForList(ctx context.Context, id VolumeId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/snapshots", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForList handles the response to the List request. The method always -// closes the http.Response Body. -func (c SnapshotsClient) responderForList(resp *http.Response) (result ListOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_restorefiles_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_restorefiles_autorest.go deleted file mode 100644 index 18ef248aa733..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_restorefiles_autorest.go +++ /dev/null @@ -1,79 +0,0 @@ -package snapshots - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RestoreFilesOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// RestoreFiles ... -func (c SnapshotsClient) RestoreFiles(ctx context.Context, id SnapshotId, input SnapshotRestoreFiles) (result RestoreFilesOperationResponse, err error) { - req, err := c.preparerForRestoreFiles(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "RestoreFiles", nil, "Failure preparing request") - return - } - - result, err = c.senderForRestoreFiles(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "RestoreFiles", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// RestoreFilesThenPoll performs RestoreFiles then polls until it's completed -func (c SnapshotsClient) RestoreFilesThenPoll(ctx context.Context, id SnapshotId, input SnapshotRestoreFiles) error { - result, err := c.RestoreFiles(ctx, id, input) - if err != nil { - return fmt.Errorf("performing RestoreFiles: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after RestoreFiles: %+v", err) - } - - return nil -} - -// preparerForRestoreFiles prepares the RestoreFiles request. -func (c SnapshotsClient) preparerForRestoreFiles(ctx context.Context, id SnapshotId, input SnapshotRestoreFiles) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/restoreFiles", id.ID())), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForRestoreFiles sends the RestoreFiles request. The method will close the -// http.Response Body if it receives an error. -func (c SnapshotsClient) senderForRestoreFiles(ctx context.Context, req *http.Request) (future RestoreFilesOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_update_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_update_autorest.go deleted file mode 100644 index f96261c20b0b..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/method_update_autorest.go +++ /dev/null @@ -1,79 +0,0 @@ -package snapshots - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UpdateOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// Update ... -func (c SnapshotsClient) Update(ctx context.Context, id SnapshotId, input interface{}) (result UpdateOperationResponse, err error) { - req, err := c.preparerForUpdate(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = c.senderForUpdate(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "snapshots.SnapshotsClient", "Update", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// UpdateThenPoll performs Update then polls until it's completed -func (c SnapshotsClient) UpdateThenPoll(ctx context.Context, id SnapshotId, input interface{}) error { - result, err := c.Update(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Update: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after Update: %+v", err) - } - - return nil -} - -// preparerForUpdate prepares the Update request. -func (c SnapshotsClient) preparerForUpdate(ctx context.Context, id SnapshotId, input interface{}) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForUpdate sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (c SnapshotsClient) senderForUpdate(ctx context.Context, req *http.Request) (future UpdateOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/model_snapshot.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/model_snapshot.go deleted file mode 100644 index 996c7160dd19..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/model_snapshot.go +++ /dev/null @@ -1,12 +0,0 @@ -package snapshots - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Snapshot struct { - Id *string `json:"id,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Properties *SnapshotProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/model_snapshotproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/model_snapshotproperties.go deleted file mode 100644 index fe60537eaaa9..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/model_snapshotproperties.go +++ /dev/null @@ -1,28 +0,0 @@ -package snapshots - -import ( - "time" - - "github.com/hashicorp/go-azure-helpers/lang/dates" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SnapshotProperties struct { - Created *string `json:"created,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` - SnapshotId *string `json:"snapshotId,omitempty"` -} - -func (o *SnapshotProperties) GetCreatedAsTime() (*time.Time, error) { - if o.Created == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Created, "2006-01-02T15:04:05Z07:00") -} - -func (o *SnapshotProperties) SetCreatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Created = &formatted -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/model_snapshotrestorefiles.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/model_snapshotrestorefiles.go deleted file mode 100644 index de80d971dcf6..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/model_snapshotrestorefiles.go +++ /dev/null @@ -1,9 +0,0 @@ -package snapshots - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SnapshotRestoreFiles struct { - DestinationPath *string `json:"destinationPath,omitempty"` - FilePaths []string `json:"filePaths"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/model_snapshotslist.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/model_snapshotslist.go deleted file mode 100644 index bf283b0d2ac6..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/model_snapshotslist.go +++ /dev/null @@ -1,8 +0,0 @@ -package snapshots - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SnapshotsList struct { - Value *[]Snapshot `json:"value,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/version.go deleted file mode 100644 index 7835a752c20c..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package snapshots - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-01-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/snapshots/%s", defaultApiVersion) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/client.go deleted file mode 100644 index c7beab84b9a1..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/client.go +++ /dev/null @@ -1,18 +0,0 @@ -package volumegroups - -import "github.com/Azure/go-autorest/autorest" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeGroupsClient struct { - Client autorest.Client - baseUri string -} - -func NewVolumeGroupsClientWithBaseURI(endpoint string) VolumeGroupsClient { - return VolumeGroupsClient{ - Client: autorest.NewClientWithUserAgent(userAgent()), - baseUri: endpoint, - } -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/id_netappaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/id_netappaccount.go deleted file mode 100644 index 7b31002a4246..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/id_netappaccount.go +++ /dev/null @@ -1,124 +0,0 @@ -package volumegroups - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -var _ resourceids.ResourceId = NetAppAccountId{} - -// NetAppAccountId is a struct representing the Resource ID for a Net App Account -type NetAppAccountId struct { - SubscriptionId string - ResourceGroupName string - AccountName string -} - -// NewNetAppAccountID returns a new NetAppAccountId struct -func NewNetAppAccountID(subscriptionId string, resourceGroupName string, accountName string) NetAppAccountId { - return NetAppAccountId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - AccountName: accountName, - } -} - -// ParseNetAppAccountID parses 'input' into a NetAppAccountId -func ParseNetAppAccountID(input string) (*NetAppAccountId, error) { - parser := resourceids.NewParserFromResourceIdType(NetAppAccountId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := NetAppAccountId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ParseNetAppAccountIDInsensitively parses 'input' case-insensitively into a NetAppAccountId -// note: this method should only be used for API response data and not user input -func ParseNetAppAccountIDInsensitively(input string) (*NetAppAccountId, error) { - parser := resourceids.NewParserFromResourceIdType(NetAppAccountId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := NetAppAccountId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ValidateNetAppAccountID checks that 'input' can be parsed as a Net App Account ID -func ValidateNetAppAccountID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := ParseNetAppAccountID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Net App Account ID -func (id NetAppAccountId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Net App Account ID -func (id NetAppAccountId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), - resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("accountName", "accountValue"), - } -} - -// String returns a human-readable description of this Net App Account ID -func (id NetAppAccountId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Account Name: %q", id.AccountName), - } - return fmt.Sprintf("Net App Account (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/id_volumegroup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/id_volumegroup.go deleted file mode 100644 index a49d03263509..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/id_volumegroup.go +++ /dev/null @@ -1,137 +0,0 @@ -package volumegroups - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -var _ resourceids.ResourceId = VolumeGroupId{} - -// VolumeGroupId is a struct representing the Resource ID for a Volume Group -type VolumeGroupId struct { - SubscriptionId string - ResourceGroupName string - AccountName string - VolumeGroupName string -} - -// NewVolumeGroupID returns a new VolumeGroupId struct -func NewVolumeGroupID(subscriptionId string, resourceGroupName string, accountName string, volumeGroupName string) VolumeGroupId { - return VolumeGroupId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - AccountName: accountName, - VolumeGroupName: volumeGroupName, - } -} - -// ParseVolumeGroupID parses 'input' into a VolumeGroupId -func ParseVolumeGroupID(input string) (*VolumeGroupId, error) { - parser := resourceids.NewParserFromResourceIdType(VolumeGroupId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := VolumeGroupId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - if id.VolumeGroupName, ok = parsed.Parsed["volumeGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'volumeGroupName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ParseVolumeGroupIDInsensitively parses 'input' case-insensitively into a VolumeGroupId -// note: this method should only be used for API response data and not user input -func ParseVolumeGroupIDInsensitively(input string) (*VolumeGroupId, error) { - parser := resourceids.NewParserFromResourceIdType(VolumeGroupId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := VolumeGroupId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - if id.VolumeGroupName, ok = parsed.Parsed["volumeGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'volumeGroupName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ValidateVolumeGroupID checks that 'input' can be parsed as a Volume Group ID -func ValidateVolumeGroupID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := ParseVolumeGroupID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Volume Group ID -func (id VolumeGroupId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/volumeGroups/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName, id.VolumeGroupName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Volume Group ID -func (id VolumeGroupId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), - resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("accountName", "accountValue"), - resourceids.StaticSegment("staticVolumeGroups", "volumeGroups", "volumeGroups"), - resourceids.UserSpecifiedSegment("volumeGroupName", "volumeGroupValue"), - } -} - -// String returns a human-readable description of this Volume Group ID -func (id VolumeGroupId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Account Name: %q", id.AccountName), - fmt.Sprintf("Volume Group Name: %q", id.VolumeGroupName), - } - return fmt.Sprintf("Volume Group (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupscreate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupscreate_autorest.go deleted file mode 100644 index ee9616617b30..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupscreate_autorest.go +++ /dev/null @@ -1,79 +0,0 @@ -package volumegroups - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeGroupsCreateOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// VolumeGroupsCreate ... -func (c VolumeGroupsClient) VolumeGroupsCreate(ctx context.Context, id VolumeGroupId, input VolumeGroupDetails) (result VolumeGroupsCreateOperationResponse, err error) { - req, err := c.preparerForVolumeGroupsCreate(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsCreate", nil, "Failure preparing request") - return - } - - result, err = c.senderForVolumeGroupsCreate(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsCreate", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// VolumeGroupsCreateThenPoll performs VolumeGroupsCreate then polls until it's completed -func (c VolumeGroupsClient) VolumeGroupsCreateThenPoll(ctx context.Context, id VolumeGroupId, input VolumeGroupDetails) error { - result, err := c.VolumeGroupsCreate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing VolumeGroupsCreate: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after VolumeGroupsCreate: %+v", err) - } - - return nil -} - -// preparerForVolumeGroupsCreate prepares the VolumeGroupsCreate request. -func (c VolumeGroupsClient) preparerForVolumeGroupsCreate(ctx context.Context, id VolumeGroupId, input VolumeGroupDetails) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForVolumeGroupsCreate sends the VolumeGroupsCreate request. The method will close the -// http.Response Body if it receives an error. -func (c VolumeGroupsClient) senderForVolumeGroupsCreate(ctx context.Context, req *http.Request) (future VolumeGroupsCreateOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupsdelete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupsdelete_autorest.go deleted file mode 100644 index b3cba81e1756..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupsdelete_autorest.go +++ /dev/null @@ -1,78 +0,0 @@ -package volumegroups - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeGroupsDeleteOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// VolumeGroupsDelete ... -func (c VolumeGroupsClient) VolumeGroupsDelete(ctx context.Context, id VolumeGroupId) (result VolumeGroupsDeleteOperationResponse, err error) { - req, err := c.preparerForVolumeGroupsDelete(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsDelete", nil, "Failure preparing request") - return - } - - result, err = c.senderForVolumeGroupsDelete(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsDelete", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// VolumeGroupsDeleteThenPoll performs VolumeGroupsDelete then polls until it's completed -func (c VolumeGroupsClient) VolumeGroupsDeleteThenPoll(ctx context.Context, id VolumeGroupId) error { - result, err := c.VolumeGroupsDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing VolumeGroupsDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after VolumeGroupsDelete: %+v", err) - } - - return nil -} - -// preparerForVolumeGroupsDelete prepares the VolumeGroupsDelete request. -func (c VolumeGroupsClient) preparerForVolumeGroupsDelete(ctx context.Context, id VolumeGroupId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsDelete(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForVolumeGroupsDelete sends the VolumeGroupsDelete request. The method will close the -// http.Response Body if it receives an error. -func (c VolumeGroupsClient) senderForVolumeGroupsDelete(ctx context.Context, req *http.Request) (future VolumeGroupsDeleteOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupslistbynetappaccount_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupslistbynetappaccount_autorest.go deleted file mode 100644 index 92517aeaf6f2..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupslistbynetappaccount_autorest.go +++ /dev/null @@ -1,68 +0,0 @@ -package volumegroups - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeGroupsListByNetAppAccountOperationResponse struct { - HttpResponse *http.Response - Model *VolumeGroupList -} - -// VolumeGroupsListByNetAppAccount ... -func (c VolumeGroupsClient) VolumeGroupsListByNetAppAccount(ctx context.Context, id NetAppAccountId) (result VolumeGroupsListByNetAppAccountOperationResponse, err error) { - req, err := c.preparerForVolumeGroupsListByNetAppAccount(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsListByNetAppAccount", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsListByNetAppAccount", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForVolumeGroupsListByNetAppAccount(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "volumegroups.VolumeGroupsClient", "VolumeGroupsListByNetAppAccount", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForVolumeGroupsListByNetAppAccount prepares the VolumeGroupsListByNetAppAccount request. -func (c VolumeGroupsClient) preparerForVolumeGroupsListByNetAppAccount(ctx context.Context, id NetAppAccountId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/volumeGroups", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForVolumeGroupsListByNetAppAccount handles the response to the VolumeGroupsListByNetAppAccount request. The method always -// closes the http.Response Body. -func (c VolumeGroupsClient) responderForVolumeGroupsListByNetAppAccount(resp *http.Response) (result VolumeGroupsListByNetAppAccountOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_exportpolicyrule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_exportpolicyrule.go deleted file mode 100644 index e17395ba1a77..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_exportpolicyrule.go +++ /dev/null @@ -1,22 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExportPolicyRule struct { - AllowedClients *string `json:"allowedClients,omitempty"` - ChownMode *ChownMode `json:"chownMode,omitempty"` - Cifs *bool `json:"cifs,omitempty"` - HasRootAccess *bool `json:"hasRootAccess,omitempty"` - Kerberos5ReadOnly *bool `json:"kerberos5ReadOnly,omitempty"` - Kerberos5ReadWrite *bool `json:"kerberos5ReadWrite,omitempty"` - Kerberos5iReadOnly *bool `json:"kerberos5iReadOnly,omitempty"` - Kerberos5iReadWrite *bool `json:"kerberos5iReadWrite,omitempty"` - Kerberos5pReadOnly *bool `json:"kerberos5pReadOnly,omitempty"` - Kerberos5pReadWrite *bool `json:"kerberos5pReadWrite,omitempty"` - Nfsv3 *bool `json:"nfsv3,omitempty"` - Nfsv41 *bool `json:"nfsv41,omitempty"` - RuleIndex *int64 `json:"ruleIndex,omitempty"` - UnixReadOnly *bool `json:"unixReadOnly,omitempty"` - UnixReadWrite *bool `json:"unixReadWrite,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_mounttargetproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_mounttargetproperties.go deleted file mode 100644 index c59cc0dbf3e7..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_mounttargetproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MountTargetProperties struct { - FileSystemId string `json:"fileSystemId"` - IpAddress *string `json:"ipAddress,omitempty"` - MountTargetId *string `json:"mountTargetId,omitempty"` - SmbServerFqdn *string `json:"smbServerFqdn,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_placementkeyvaluepairs.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_placementkeyvaluepairs.go deleted file mode 100644 index 1714b1662a1d..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_placementkeyvaluepairs.go +++ /dev/null @@ -1,9 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PlacementKeyValuePairs struct { - Key string `json:"key"` - Value string `json:"value"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_replicationobject.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_replicationobject.go deleted file mode 100644 index 6d145aa00798..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_replicationobject.go +++ /dev/null @@ -1,12 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ReplicationObject struct { - EndpointType *EndpointType `json:"endpointType,omitempty"` - RemoteVolumeRegion *string `json:"remoteVolumeRegion,omitempty"` - RemoteVolumeResourceId string `json:"remoteVolumeResourceId"` - ReplicationId *string `json:"replicationId,omitempty"` - ReplicationSchedule *ReplicationSchedule `json:"replicationSchedule,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumebackupproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumebackupproperties.go deleted file mode 100644 index 1141229b560a..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumebackupproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeBackupProperties struct { - BackupEnabled *bool `json:"backupEnabled,omitempty"` - BackupPolicyId *string `json:"backupPolicyId,omitempty"` - PolicyEnforced *bool `json:"policyEnforced,omitempty"` - VaultId *string `json:"vaultId,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroup.go deleted file mode 100644 index 5e4df7bb9c04..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroup.go +++ /dev/null @@ -1,12 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeGroup struct { - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VolumeGroupListProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegrouplist.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegrouplist.go deleted file mode 100644 index 447c6e6e8588..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegrouplist.go +++ /dev/null @@ -1,8 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeGroupList struct { - Value *[]VolumeGroup `json:"value,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegrouplistproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegrouplistproperties.go deleted file mode 100644 index 5788ee516fc1..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegrouplistproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeGroupListProperties struct { - GroupMetaData *VolumeGroupMetaData `json:"groupMetaData,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupmetadata.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupmetadata.go deleted file mode 100644 index 30441c6826d5..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupmetadata.go +++ /dev/null @@ -1,13 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeGroupMetaData struct { - ApplicationIdentifier *string `json:"applicationIdentifier,omitempty"` - ApplicationType *ApplicationType `json:"applicationType,omitempty"` - DeploymentSpecId *string `json:"deploymentSpecId,omitempty"` - GlobalPlacementRules *[]PlacementKeyValuePairs `json:"globalPlacementRules,omitempty"` - GroupDescription *string `json:"groupDescription,omitempty"` - VolumesCount *int64 `json:"volumesCount,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupproperties.go deleted file mode 100644 index 0bab153b397e..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeGroupProperties struct { - GroupMetaData *VolumeGroupMetaData `json:"groupMetaData,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` - Volumes *[]VolumeGroupVolumeProperties `json:"volumes,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupvolumeproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupvolumeproperties.go deleted file mode 100644 index 61bbdab9ce3e..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupvolumeproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeGroupVolumeProperties struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties VolumeProperties `json:"properties"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumeproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumeproperties.go deleted file mode 100644 index 357c68e318fa..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumeproperties.go +++ /dev/null @@ -1,50 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeProperties struct { - AvsDataStore *AvsDataStore `json:"avsDataStore,omitempty"` - BackupId *string `json:"backupId,omitempty"` - BaremetalTenantId *string `json:"baremetalTenantId,omitempty"` - CapacityPoolResourceId *string `json:"capacityPoolResourceId,omitempty"` - CloneProgress *int64 `json:"cloneProgress,omitempty"` - CoolAccess *bool `json:"coolAccess,omitempty"` - CoolnessPeriod *int64 `json:"coolnessPeriod,omitempty"` - CreationToken string `json:"creationToken"` - DataProtection *VolumePropertiesDataProtection `json:"dataProtection,omitempty"` - DefaultGroupQuotaInKiBs *int64 `json:"defaultGroupQuotaInKiBs,omitempty"` - DefaultUserQuotaInKiBs *int64 `json:"defaultUserQuotaInKiBs,omitempty"` - EnableSubvolumes *EnableSubvolumes `json:"enableSubvolumes,omitempty"` - Encrypted *bool `json:"encrypted,omitempty"` - EncryptionKeySource *EncryptionKeySource `json:"encryptionKeySource,omitempty"` - ExportPolicy *VolumePropertiesExportPolicy `json:"exportPolicy,omitempty"` - FileSystemId *string `json:"fileSystemId,omitempty"` - IsDefaultQuotaEnabled *bool `json:"isDefaultQuotaEnabled,omitempty"` - IsRestoring *bool `json:"isRestoring,omitempty"` - KerberosEnabled *bool `json:"kerberosEnabled,omitempty"` - LdapEnabled *bool `json:"ldapEnabled,omitempty"` - MaximumNumberOfFiles *int64 `json:"maximumNumberOfFiles,omitempty"` - MountTargets *[]MountTargetProperties `json:"mountTargets,omitempty"` - NetworkFeatures *NetworkFeatures `json:"networkFeatures,omitempty"` - NetworkSiblingSetId *string `json:"networkSiblingSetId,omitempty"` - PlacementRules *[]PlacementKeyValuePairs `json:"placementRules,omitempty"` - ProtocolTypes *[]string `json:"protocolTypes,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` - ProximityPlacementGroup *string `json:"proximityPlacementGroup,omitempty"` - SecurityStyle *SecurityStyle `json:"securityStyle,omitempty"` - ServiceLevel *ServiceLevel `json:"serviceLevel,omitempty"` - SmbContinuouslyAvailable *bool `json:"smbContinuouslyAvailable,omitempty"` - SmbEncryption *bool `json:"smbEncryption,omitempty"` - SnapshotDirectoryVisible *bool `json:"snapshotDirectoryVisible,omitempty"` - SnapshotId *string `json:"snapshotId,omitempty"` - StorageToNetworkProximity *VolumeStorageToNetworkProximity `json:"storageToNetworkProximity,omitempty"` - SubnetId string `json:"subnetId"` - T2Network *string `json:"t2Network,omitempty"` - ThroughputMibps *float64 `json:"throughputMibps,omitempty"` - UnixPermissions *string `json:"unixPermissions,omitempty"` - UsageThreshold int64 `json:"usageThreshold"` - VolumeGroupName *string `json:"volumeGroupName,omitempty"` - VolumeSpecName *string `json:"volumeSpecName,omitempty"` - VolumeType *string `json:"volumeType,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumepropertiesdataprotection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumepropertiesdataprotection.go deleted file mode 100644 index 5cde3ecbaacc..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumepropertiesdataprotection.go +++ /dev/null @@ -1,10 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumePropertiesDataProtection struct { - Backup *VolumeBackupProperties `json:"backup,omitempty"` - Replication *ReplicationObject `json:"replication,omitempty"` - Snapshot *VolumeSnapshotProperties `json:"snapshot,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumepropertiesexportpolicy.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumepropertiesexportpolicy.go deleted file mode 100644 index 227c8586d6f2..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumepropertiesexportpolicy.go +++ /dev/null @@ -1,8 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumePropertiesExportPolicy struct { - Rules *[]ExportPolicyRule `json:"rules,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumesnapshotproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumesnapshotproperties.go deleted file mode 100644 index a3f5011da3b0..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumesnapshotproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package volumegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeSnapshotProperties struct { - SnapshotPolicyId *string `json:"snapshotPolicyId,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/version.go deleted file mode 100644 index a2c68d24f1a6..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package volumegroups - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-01-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/volumegroups/%s", defaultApiVersion) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/client.go deleted file mode 100644 index d0a40573bf00..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/client.go +++ /dev/null @@ -1,18 +0,0 @@ -package volumes - -import "github.com/Azure/go-autorest/autorest" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumesClient struct { - Client autorest.Client - baseUri string -} - -func NewVolumesClientWithBaseURI(endpoint string) VolumesClient { - return VolumesClient{ - Client: autorest.NewClientWithUserAgent(userAgent()), - baseUri: endpoint, - } -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/constants.go deleted file mode 100644 index 8455d065d5a2..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/constants.go +++ /dev/null @@ -1,295 +0,0 @@ -package volumes - -import "strings" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AvsDataStore string - -const ( - AvsDataStoreDisabled AvsDataStore = "Disabled" - AvsDataStoreEnabled AvsDataStore = "Enabled" -) - -func PossibleValuesForAvsDataStore() []string { - return []string{ - string(AvsDataStoreDisabled), - string(AvsDataStoreEnabled), - } -} - -func parseAvsDataStore(input string) (*AvsDataStore, error) { - vals := map[string]AvsDataStore{ - "disabled": AvsDataStoreDisabled, - "enabled": AvsDataStoreEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AvsDataStore(input) - return &out, nil -} - -type ChownMode string - -const ( - ChownModeRestricted ChownMode = "Restricted" - ChownModeUnrestricted ChownMode = "Unrestricted" -) - -func PossibleValuesForChownMode() []string { - return []string{ - string(ChownModeRestricted), - string(ChownModeUnrestricted), - } -} - -func parseChownMode(input string) (*ChownMode, error) { - vals := map[string]ChownMode{ - "restricted": ChownModeRestricted, - "unrestricted": ChownModeUnrestricted, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ChownMode(input) - return &out, nil -} - -type EnableSubvolumes string - -const ( - EnableSubvolumesDisabled EnableSubvolumes = "Disabled" - EnableSubvolumesEnabled EnableSubvolumes = "Enabled" -) - -func PossibleValuesForEnableSubvolumes() []string { - return []string{ - string(EnableSubvolumesDisabled), - string(EnableSubvolumesEnabled), - } -} - -func parseEnableSubvolumes(input string) (*EnableSubvolumes, error) { - vals := map[string]EnableSubvolumes{ - "disabled": EnableSubvolumesDisabled, - "enabled": EnableSubvolumesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EnableSubvolumes(input) - return &out, nil -} - -type EncryptionKeySource string - -const ( - EncryptionKeySourceMicrosoftPointNetApp EncryptionKeySource = "Microsoft.NetApp" -) - -func PossibleValuesForEncryptionKeySource() []string { - return []string{ - string(EncryptionKeySourceMicrosoftPointNetApp), - } -} - -func parseEncryptionKeySource(input string) (*EncryptionKeySource, error) { - vals := map[string]EncryptionKeySource{ - "microsoft.netapp": EncryptionKeySourceMicrosoftPointNetApp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EncryptionKeySource(input) - return &out, nil -} - -type EndpointType string - -const ( - EndpointTypeDst EndpointType = "dst" - EndpointTypeSrc EndpointType = "src" -) - -func PossibleValuesForEndpointType() []string { - return []string{ - string(EndpointTypeDst), - string(EndpointTypeSrc), - } -} - -func parseEndpointType(input string) (*EndpointType, error) { - vals := map[string]EndpointType{ - "dst": EndpointTypeDst, - "src": EndpointTypeSrc, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EndpointType(input) - return &out, nil -} - -type NetworkFeatures string - -const ( - NetworkFeaturesBasic NetworkFeatures = "Basic" - NetworkFeaturesStandard NetworkFeatures = "Standard" -) - -func PossibleValuesForNetworkFeatures() []string { - return []string{ - string(NetworkFeaturesBasic), - string(NetworkFeaturesStandard), - } -} - -func parseNetworkFeatures(input string) (*NetworkFeatures, error) { - vals := map[string]NetworkFeatures{ - "basic": NetworkFeaturesBasic, - "standard": NetworkFeaturesStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkFeatures(input) - return &out, nil -} - -type ReplicationSchedule string - -const ( - ReplicationScheduleDaily ReplicationSchedule = "daily" - ReplicationScheduleHourly ReplicationSchedule = "hourly" - ReplicationScheduleOneZerominutely ReplicationSchedule = "_10minutely" -) - -func PossibleValuesForReplicationSchedule() []string { - return []string{ - string(ReplicationScheduleDaily), - string(ReplicationScheduleHourly), - string(ReplicationScheduleOneZerominutely), - } -} - -func parseReplicationSchedule(input string) (*ReplicationSchedule, error) { - vals := map[string]ReplicationSchedule{ - "daily": ReplicationScheduleDaily, - "hourly": ReplicationScheduleHourly, - "_10minutely": ReplicationScheduleOneZerominutely, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ReplicationSchedule(input) - return &out, nil -} - -type SecurityStyle string - -const ( - SecurityStyleNtfs SecurityStyle = "ntfs" - SecurityStyleUnix SecurityStyle = "unix" -) - -func PossibleValuesForSecurityStyle() []string { - return []string{ - string(SecurityStyleNtfs), - string(SecurityStyleUnix), - } -} - -func parseSecurityStyle(input string) (*SecurityStyle, error) { - vals := map[string]SecurityStyle{ - "ntfs": SecurityStyleNtfs, - "unix": SecurityStyleUnix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityStyle(input) - return &out, nil -} - -type ServiceLevel string - -const ( - ServiceLevelPremium ServiceLevel = "Premium" - ServiceLevelStandard ServiceLevel = "Standard" - ServiceLevelStandardZRS ServiceLevel = "StandardZRS" - ServiceLevelUltra ServiceLevel = "Ultra" -) - -func PossibleValuesForServiceLevel() []string { - return []string{ - string(ServiceLevelPremium), - string(ServiceLevelStandard), - string(ServiceLevelStandardZRS), - string(ServiceLevelUltra), - } -} - -func parseServiceLevel(input string) (*ServiceLevel, error) { - vals := map[string]ServiceLevel{ - "premium": ServiceLevelPremium, - "standard": ServiceLevelStandard, - "standardzrs": ServiceLevelStandardZRS, - "ultra": ServiceLevelUltra, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ServiceLevel(input) - return &out, nil -} - -type VolumeStorageToNetworkProximity string - -const ( - VolumeStorageToNetworkProximityDefault VolumeStorageToNetworkProximity = "Default" - VolumeStorageToNetworkProximityTOne VolumeStorageToNetworkProximity = "T1" - VolumeStorageToNetworkProximityTTwo VolumeStorageToNetworkProximity = "T2" -) - -func PossibleValuesForVolumeStorageToNetworkProximity() []string { - return []string{ - string(VolumeStorageToNetworkProximityDefault), - string(VolumeStorageToNetworkProximityTOne), - string(VolumeStorageToNetworkProximityTTwo), - } -} - -func parseVolumeStorageToNetworkProximity(input string) (*VolumeStorageToNetworkProximity, error) { - vals := map[string]VolumeStorageToNetworkProximity{ - "default": VolumeStorageToNetworkProximityDefault, - "t1": VolumeStorageToNetworkProximityTOne, - "t2": VolumeStorageToNetworkProximityTTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VolumeStorageToNetworkProximity(input) - return &out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/id_capacitypool.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/id_capacitypool.go deleted file mode 100644 index 06f8b4531bd9..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/id_capacitypool.go +++ /dev/null @@ -1,137 +0,0 @@ -package volumes - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -var _ resourceids.ResourceId = CapacityPoolId{} - -// CapacityPoolId is a struct representing the Resource ID for a Capacity Pool -type CapacityPoolId struct { - SubscriptionId string - ResourceGroupName string - AccountName string - PoolName string -} - -// NewCapacityPoolID returns a new CapacityPoolId struct -func NewCapacityPoolID(subscriptionId string, resourceGroupName string, accountName string, poolName string) CapacityPoolId { - return CapacityPoolId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - AccountName: accountName, - PoolName: poolName, - } -} - -// ParseCapacityPoolID parses 'input' into a CapacityPoolId -func ParseCapacityPoolID(input string) (*CapacityPoolId, error) { - parser := resourceids.NewParserFromResourceIdType(CapacityPoolId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := CapacityPoolId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { - return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ParseCapacityPoolIDInsensitively parses 'input' case-insensitively into a CapacityPoolId -// note: this method should only be used for API response data and not user input -func ParseCapacityPoolIDInsensitively(input string) (*CapacityPoolId, error) { - parser := resourceids.NewParserFromResourceIdType(CapacityPoolId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := CapacityPoolId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { - return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ValidateCapacityPoolID checks that 'input' can be parsed as a Capacity Pool ID -func ValidateCapacityPoolID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := ParseCapacityPoolID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Capacity Pool ID -func (id CapacityPoolId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/capacityPools/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName, id.PoolName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Capacity Pool ID -func (id CapacityPoolId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), - resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("accountName", "accountValue"), - resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("poolName", "poolValue"), - } -} - -// String returns a human-readable description of this Capacity Pool ID -func (id CapacityPoolId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Account Name: %q", id.AccountName), - fmt.Sprintf("Pool Name: %q", id.PoolName), - } - return fmt.Sprintf("Capacity Pool (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/id_volume.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/id_volume.go deleted file mode 100644 index d4e93b387a44..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/id_volume.go +++ /dev/null @@ -1,150 +0,0 @@ -package volumes - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -var _ resourceids.ResourceId = VolumeId{} - -// VolumeId is a struct representing the Resource ID for a Volume -type VolumeId struct { - SubscriptionId string - ResourceGroupName string - AccountName string - PoolName string - VolumeName string -} - -// NewVolumeID returns a new VolumeId struct -func NewVolumeID(subscriptionId string, resourceGroupName string, accountName string, poolName string, volumeName string) VolumeId { - return VolumeId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - AccountName: accountName, - PoolName: poolName, - VolumeName: volumeName, - } -} - -// ParseVolumeID parses 'input' into a VolumeId -func ParseVolumeID(input string) (*VolumeId, error) { - parser := resourceids.NewParserFromResourceIdType(VolumeId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := VolumeId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { - return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) - } - - if id.VolumeName, ok = parsed.Parsed["volumeName"]; !ok { - return nil, fmt.Errorf("the segment 'volumeName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ParseVolumeIDInsensitively parses 'input' case-insensitively into a VolumeId -// note: this method should only be used for API response data and not user input -func ParseVolumeIDInsensitively(input string) (*VolumeId, error) { - parser := resourceids.NewParserFromResourceIdType(VolumeId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := VolumeId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { - return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) - } - - if id.VolumeName, ok = parsed.Parsed["volumeName"]; !ok { - return nil, fmt.Errorf("the segment 'volumeName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ValidateVolumeID checks that 'input' can be parsed as a Volume ID -func ValidateVolumeID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := ParseVolumeID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Volume ID -func (id VolumeId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/capacityPools/%s/volumes/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName, id.PoolName, id.VolumeName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Volume ID -func (id VolumeId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), - resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("accountName", "accountValue"), - resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("poolName", "poolValue"), - resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), - resourceids.UserSpecifiedSegment("volumeName", "volumeValue"), - } -} - -// String returns a human-readable description of this Volume ID -func (id VolumeId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Account Name: %q", id.AccountName), - fmt.Sprintf("Pool Name: %q", id.PoolName), - fmt.Sprintf("Volume Name: %q", id.VolumeName), - } - return fmt.Sprintf("Volume (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/method_createorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/method_createorupdate_autorest.go deleted file mode 100644 index ae61c0fe91ec..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/method_createorupdate_autorest.go +++ /dev/null @@ -1,79 +0,0 @@ -package volumes - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CreateOrUpdateOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// CreateOrUpdate ... -func (c VolumesClient) CreateOrUpdate(ctx context.Context, id VolumeId, input Volume) (result CreateOrUpdateOperationResponse, err error) { - req, err := c.preparerForCreateOrUpdate(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = c.senderForCreateOrUpdate(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "CreateOrUpdate", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c VolumesClient) CreateOrUpdateThenPoll(ctx context.Context, id VolumeId, input Volume) error { - result, err := c.CreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing CreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after CreateOrUpdate: %+v", err) - } - - return nil -} - -// preparerForCreateOrUpdate prepares the CreateOrUpdate request. -func (c VolumesClient) preparerForCreateOrUpdate(ctx context.Context, id VolumeId, input Volume) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForCreateOrUpdate sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (c VolumesClient) senderForCreateOrUpdate(ctx context.Context, req *http.Request) (future CreateOrUpdateOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/method_delete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/method_delete_autorest.go deleted file mode 100644 index 1b97fdf87abf..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/method_delete_autorest.go +++ /dev/null @@ -1,107 +0,0 @@ -package volumes - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DeleteOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -type DeleteOperationOptions struct { - ForceDelete *bool -} - -func DefaultDeleteOperationOptions() DeleteOperationOptions { - return DeleteOperationOptions{} -} - -func (o DeleteOperationOptions) toHeaders() map[string]interface{} { - out := make(map[string]interface{}) - - return out -} - -func (o DeleteOperationOptions) toQueryString() map[string]interface{} { - out := make(map[string]interface{}) - - if o.ForceDelete != nil { - out["forceDelete"] = *o.ForceDelete - } - - return out -} - -// Delete ... -func (c VolumesClient) Delete(ctx context.Context, id VolumeId, options DeleteOperationOptions) (result DeleteOperationResponse, err error) { - req, err := c.preparerForDelete(ctx, id, options) - if err != nil { - err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = c.senderForDelete(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "Delete", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// DeleteThenPoll performs Delete then polls until it's completed -func (c VolumesClient) DeleteThenPoll(ctx context.Context, id VolumeId, options DeleteOperationOptions) error { - result, err := c.Delete(ctx, id, options) - if err != nil { - return fmt.Errorf("performing Delete: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after Delete: %+v", err) - } - - return nil -} - -// preparerForDelete prepares the Delete request. -func (c VolumesClient) preparerForDelete(ctx context.Context, id VolumeId, options DeleteOperationOptions) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - for k, v := range options.toQueryString() { - queryParameters[k] = autorest.Encode("query", v) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsDelete(), - autorest.WithBaseURL(c.baseUri), - autorest.WithHeaders(options.toHeaders()), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForDelete sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (c VolumesClient) senderForDelete(ctx context.Context, req *http.Request) (future DeleteOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/method_get_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/method_get_autorest.go deleted file mode 100644 index f35ab8d36ba5..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/method_get_autorest.go +++ /dev/null @@ -1,67 +0,0 @@ -package volumes - -import ( - "context" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GetOperationResponse struct { - HttpResponse *http.Response - Model *Volume -} - -// Get ... -func (c VolumesClient) Get(ctx context.Context, id VolumeId) (result GetOperationResponse, err error) { - req, err := c.preparerForGet(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "Get", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "Get", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForGet(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "Get", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForGet prepares the Get request. -func (c VolumesClient) preparerForGet(ctx context.Context, id VolumeId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForGet handles the response to the Get request. The method always -// closes the http.Response Body. -func (c VolumesClient) responderForGet(resp *http.Response) (result GetOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/method_list_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/method_list_autorest.go deleted file mode 100644 index 40c311905e59..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/method_list_autorest.go +++ /dev/null @@ -1,186 +0,0 @@ -package volumes - -import ( - "context" - "fmt" - "net/http" - "net/url" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ListOperationResponse struct { - HttpResponse *http.Response - Model *[]Volume - - nextLink *string - nextPageFunc func(ctx context.Context, nextLink string) (ListOperationResponse, error) -} - -type ListCompleteResult struct { - Items []Volume -} - -func (r ListOperationResponse) HasMore() bool { - return r.nextLink != nil -} - -func (r ListOperationResponse) LoadMore(ctx context.Context) (resp ListOperationResponse, err error) { - if !r.HasMore() { - err = fmt.Errorf("no more pages returned") - return - } - return r.nextPageFunc(ctx, *r.nextLink) -} - -// List ... -func (c VolumesClient) List(ctx context.Context, id CapacityPoolId) (resp ListOperationResponse, err error) { - req, err := c.preparerForList(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "List", nil, "Failure preparing request") - return - } - - resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "List", resp.HttpResponse, "Failure sending request") - return - } - - resp, err = c.responderForList(resp.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "List", resp.HttpResponse, "Failure responding to request") - return - } - return -} - -// ListComplete retrieves all of the results into a single object -func (c VolumesClient) ListComplete(ctx context.Context, id CapacityPoolId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, VolumeOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c VolumesClient) ListCompleteMatchingPredicate(ctx context.Context, id CapacityPoolId, predicate VolumeOperationPredicate) (resp ListCompleteResult, err error) { - items := make([]Volume, 0) - - page, err := c.List(ctx, id) - if err != nil { - err = fmt.Errorf("loading the initial page: %+v", err) - return - } - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - for page.HasMore() { - page, err = page.LoadMore(ctx) - if err != nil { - err = fmt.Errorf("loading the next page: %+v", err) - return - } - - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - } - - out := ListCompleteResult{ - Items: items, - } - return out, nil -} - -// preparerForList prepares the List request. -func (c VolumesClient) preparerForList(ctx context.Context, id CapacityPoolId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/volumes", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// preparerForListWithNextLink prepares the List request with the given nextLink token. -func (c VolumesClient) preparerForListWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { - uri, err := url.Parse(nextLink) - if err != nil { - return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) - } - queryParameters := map[string]interface{}{} - for k, v := range uri.Query() { - if len(v) == 0 { - continue - } - val := v[0] - val = autorest.Encode("query", val) - queryParameters[k] = val - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(uri.Path), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForList handles the response to the List request. The method always -// closes the http.Response Body. -func (c VolumesClient) responderForList(resp *http.Response) (result ListOperationResponse, err error) { - type page struct { - Values []Volume `json:"value"` - NextLink *string `json:"nextLink"` - } - var respObj page - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&respObj), - autorest.ByClosing()) - result.HttpResponse = resp - result.Model = &respObj.Values - result.nextLink = respObj.NextLink - if respObj.NextLink != nil { - result.nextPageFunc = func(ctx context.Context, nextLink string) (result ListOperationResponse, err error) { - req, err := c.preparerForListWithNextLink(ctx, nextLink) - if err != nil { - err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "List", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "List", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForList(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "List", result.HttpResponse, "Failure responding to request") - return - } - - return - } - } - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/method_update_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/method_update_autorest.go deleted file mode 100644 index 7e6872e1513e..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/method_update_autorest.go +++ /dev/null @@ -1,79 +0,0 @@ -package volumes - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UpdateOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// Update ... -func (c VolumesClient) Update(ctx context.Context, id VolumeId, input VolumePatch) (result UpdateOperationResponse, err error) { - req, err := c.preparerForUpdate(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "Update", nil, "Failure preparing request") - return - } - - result, err = c.senderForUpdate(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "volumes.VolumesClient", "Update", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// UpdateThenPoll performs Update then polls until it's completed -func (c VolumesClient) UpdateThenPoll(ctx context.Context, id VolumeId, input VolumePatch) error { - result, err := c.Update(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Update: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after Update: %+v", err) - } - - return nil -} - -// preparerForUpdate prepares the Update request. -func (c VolumesClient) preparerForUpdate(ctx context.Context, id VolumeId, input VolumePatch) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForUpdate sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (c VolumesClient) senderForUpdate(ctx context.Context, req *http.Request) (future UpdateOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_exportpolicyrule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_exportpolicyrule.go deleted file mode 100644 index 9b059c747578..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_exportpolicyrule.go +++ /dev/null @@ -1,22 +0,0 @@ -package volumes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExportPolicyRule struct { - AllowedClients *string `json:"allowedClients,omitempty"` - ChownMode *ChownMode `json:"chownMode,omitempty"` - Cifs *bool `json:"cifs,omitempty"` - HasRootAccess *bool `json:"hasRootAccess,omitempty"` - Kerberos5ReadOnly *bool `json:"kerberos5ReadOnly,omitempty"` - Kerberos5ReadWrite *bool `json:"kerberos5ReadWrite,omitempty"` - Kerberos5iReadOnly *bool `json:"kerberos5iReadOnly,omitempty"` - Kerberos5iReadWrite *bool `json:"kerberos5iReadWrite,omitempty"` - Kerberos5pReadOnly *bool `json:"kerberos5pReadOnly,omitempty"` - Kerberos5pReadWrite *bool `json:"kerberos5pReadWrite,omitempty"` - Nfsv3 *bool `json:"nfsv3,omitempty"` - Nfsv41 *bool `json:"nfsv41,omitempty"` - RuleIndex *int64 `json:"ruleIndex,omitempty"` - UnixReadOnly *bool `json:"unixReadOnly,omitempty"` - UnixReadWrite *bool `json:"unixReadWrite,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_mounttargetproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_mounttargetproperties.go deleted file mode 100644 index b92b9edb4154..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_mounttargetproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package volumes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MountTargetProperties struct { - FileSystemId string `json:"fileSystemId"` - IpAddress *string `json:"ipAddress,omitempty"` - MountTargetId *string `json:"mountTargetId,omitempty"` - SmbServerFqdn *string `json:"smbServerFqdn,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_placementkeyvaluepairs.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_placementkeyvaluepairs.go deleted file mode 100644 index 588e9729c1e4..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_placementkeyvaluepairs.go +++ /dev/null @@ -1,9 +0,0 @@ -package volumes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PlacementKeyValuePairs struct { - Key string `json:"key"` - Value string `json:"value"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_replicationobject.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_replicationobject.go deleted file mode 100644 index b7d6873811e2..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_replicationobject.go +++ /dev/null @@ -1,12 +0,0 @@ -package volumes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ReplicationObject struct { - EndpointType *EndpointType `json:"endpointType,omitempty"` - RemoteVolumeRegion *string `json:"remoteVolumeRegion,omitempty"` - RemoteVolumeResourceId string `json:"remoteVolumeResourceId"` - ReplicationId *string `json:"replicationId,omitempty"` - ReplicationSchedule *ReplicationSchedule `json:"replicationSchedule,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volume.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volume.go deleted file mode 100644 index b9dc943c95bd..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volume.go +++ /dev/null @@ -1,20 +0,0 @@ -package volumes - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Volume struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Properties VolumeProperties `json:"properties"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *[]string `json:"zones,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumebackupproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumebackupproperties.go deleted file mode 100644 index 1de25f15e330..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumebackupproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package volumes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeBackupProperties struct { - BackupEnabled *bool `json:"backupEnabled,omitempty"` - BackupPolicyId *string `json:"backupPolicyId,omitempty"` - PolicyEnforced *bool `json:"policyEnforced,omitempty"` - VaultId *string `json:"vaultId,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepatch.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepatch.go deleted file mode 100644 index b39ea01aee89..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepatch.go +++ /dev/null @@ -1,13 +0,0 @@ -package volumes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumePatch struct { - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VolumePatchProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepatchproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepatchproperties.go deleted file mode 100644 index ed4479ca252b..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepatchproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package volumes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumePatchProperties struct { - DataProtection *VolumePatchPropertiesDataProtection `json:"dataProtection,omitempty"` - DefaultGroupQuotaInKiBs *int64 `json:"defaultGroupQuotaInKiBs,omitempty"` - DefaultUserQuotaInKiBs *int64 `json:"defaultUserQuotaInKiBs,omitempty"` - ExportPolicy *VolumePatchPropertiesExportPolicy `json:"exportPolicy,omitempty"` - IsDefaultQuotaEnabled *bool `json:"isDefaultQuotaEnabled,omitempty"` - ServiceLevel *ServiceLevel `json:"serviceLevel,omitempty"` - ThroughputMibps *float64 `json:"throughputMibps,omitempty"` - UnixPermissions *string `json:"unixPermissions,omitempty"` - UsageThreshold *int64 `json:"usageThreshold,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepatchpropertiesdataprotection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepatchpropertiesdataprotection.go deleted file mode 100644 index 8c9edc10ff72..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepatchpropertiesdataprotection.go +++ /dev/null @@ -1,9 +0,0 @@ -package volumes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumePatchPropertiesDataProtection struct { - Backup *VolumeBackupProperties `json:"backup,omitempty"` - Snapshot *VolumeSnapshotProperties `json:"snapshot,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepatchpropertiesexportpolicy.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepatchpropertiesexportpolicy.go deleted file mode 100644 index ae83a5fc1b4f..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepatchpropertiesexportpolicy.go +++ /dev/null @@ -1,8 +0,0 @@ -package volumes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumePatchPropertiesExportPolicy struct { - Rules *[]ExportPolicyRule `json:"rules,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumeproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumeproperties.go deleted file mode 100644 index 01cceff7a1dc..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumeproperties.go +++ /dev/null @@ -1,50 +0,0 @@ -package volumes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeProperties struct { - AvsDataStore *AvsDataStore `json:"avsDataStore,omitempty"` - BackupId *string `json:"backupId,omitempty"` - BaremetalTenantId *string `json:"baremetalTenantId,omitempty"` - CapacityPoolResourceId *string `json:"capacityPoolResourceId,omitempty"` - CloneProgress *int64 `json:"cloneProgress,omitempty"` - CoolAccess *bool `json:"coolAccess,omitempty"` - CoolnessPeriod *int64 `json:"coolnessPeriod,omitempty"` - CreationToken string `json:"creationToken"` - DataProtection *VolumePropertiesDataProtection `json:"dataProtection,omitempty"` - DefaultGroupQuotaInKiBs *int64 `json:"defaultGroupQuotaInKiBs,omitempty"` - DefaultUserQuotaInKiBs *int64 `json:"defaultUserQuotaInKiBs,omitempty"` - EnableSubvolumes *EnableSubvolumes `json:"enableSubvolumes,omitempty"` - Encrypted *bool `json:"encrypted,omitempty"` - EncryptionKeySource *EncryptionKeySource `json:"encryptionKeySource,omitempty"` - ExportPolicy *VolumePropertiesExportPolicy `json:"exportPolicy,omitempty"` - FileSystemId *string `json:"fileSystemId,omitempty"` - IsDefaultQuotaEnabled *bool `json:"isDefaultQuotaEnabled,omitempty"` - IsRestoring *bool `json:"isRestoring,omitempty"` - KerberosEnabled *bool `json:"kerberosEnabled,omitempty"` - LdapEnabled *bool `json:"ldapEnabled,omitempty"` - MaximumNumberOfFiles *int64 `json:"maximumNumberOfFiles,omitempty"` - MountTargets *[]MountTargetProperties `json:"mountTargets,omitempty"` - NetworkFeatures *NetworkFeatures `json:"networkFeatures,omitempty"` - NetworkSiblingSetId *string `json:"networkSiblingSetId,omitempty"` - PlacementRules *[]PlacementKeyValuePairs `json:"placementRules,omitempty"` - ProtocolTypes *[]string `json:"protocolTypes,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` - ProximityPlacementGroup *string `json:"proximityPlacementGroup,omitempty"` - SecurityStyle *SecurityStyle `json:"securityStyle,omitempty"` - ServiceLevel *ServiceLevel `json:"serviceLevel,omitempty"` - SmbContinuouslyAvailable *bool `json:"smbContinuouslyAvailable,omitempty"` - SmbEncryption *bool `json:"smbEncryption,omitempty"` - SnapshotDirectoryVisible *bool `json:"snapshotDirectoryVisible,omitempty"` - SnapshotId *string `json:"snapshotId,omitempty"` - StorageToNetworkProximity *VolumeStorageToNetworkProximity `json:"storageToNetworkProximity,omitempty"` - SubnetId string `json:"subnetId"` - T2Network *string `json:"t2Network,omitempty"` - ThroughputMibps *float64 `json:"throughputMibps,omitempty"` - UnixPermissions *string `json:"unixPermissions,omitempty"` - UsageThreshold int64 `json:"usageThreshold"` - VolumeGroupName *string `json:"volumeGroupName,omitempty"` - VolumeSpecName *string `json:"volumeSpecName,omitempty"` - VolumeType *string `json:"volumeType,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepropertiesdataprotection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepropertiesdataprotection.go deleted file mode 100644 index 28163c70a51c..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepropertiesdataprotection.go +++ /dev/null @@ -1,10 +0,0 @@ -package volumes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumePropertiesDataProtection struct { - Backup *VolumeBackupProperties `json:"backup,omitempty"` - Replication *ReplicationObject `json:"replication,omitempty"` - Snapshot *VolumeSnapshotProperties `json:"snapshot,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepropertiesexportpolicy.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepropertiesexportpolicy.go deleted file mode 100644 index fda5f4739dee..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumepropertiesexportpolicy.go +++ /dev/null @@ -1,8 +0,0 @@ -package volumes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumePropertiesExportPolicy struct { - Rules *[]ExportPolicyRule `json:"rules,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumesnapshotproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumesnapshotproperties.go deleted file mode 100644 index 48aba2acce0d..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/model_volumesnapshotproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package volumes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumeSnapshotProperties struct { - SnapshotPolicyId *string `json:"snapshotPolicyId,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/predicates.go deleted file mode 100644 index 536d6a70dc81..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/predicates.go +++ /dev/null @@ -1,34 +0,0 @@ -package volumes - -type VolumeOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p VolumeOperationPredicate) Matches(input Volume) bool { - - if p.Etag != nil && (input.Etag == nil && *p.Etag != *input.Etag) { - return false - } - - if p.Id != nil && (input.Id == nil && *p.Id != *input.Id) { - return false - } - - if p.Location != nil && *p.Location != input.Location { - return false - } - - if p.Name != nil && (input.Name == nil && *p.Name != *input.Name) { - return false - } - - if p.Type != nil && (input.Type == nil && *p.Type != *input.Type) { - return false - } - - return true -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/client.go deleted file mode 100644 index 64a4d559d37e..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/client.go +++ /dev/null @@ -1,18 +0,0 @@ -package volumesreplication - -import "github.com/Azure/go-autorest/autorest" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumesReplicationClient struct { - Client autorest.Client - baseUri string -} - -func NewVolumesReplicationClientWithBaseURI(endpoint string) VolumesReplicationClient { - return VolumesReplicationClient{ - Client: autorest.NewClientWithUserAgent(userAgent()), - baseUri: endpoint, - } -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/id_volume.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/id_volume.go deleted file mode 100644 index c88adaf98587..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/id_volume.go +++ /dev/null @@ -1,150 +0,0 @@ -package volumesreplication - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -var _ resourceids.ResourceId = VolumeId{} - -// VolumeId is a struct representing the Resource ID for a Volume -type VolumeId struct { - SubscriptionId string - ResourceGroupName string - AccountName string - PoolName string - VolumeName string -} - -// NewVolumeID returns a new VolumeId struct -func NewVolumeID(subscriptionId string, resourceGroupName string, accountName string, poolName string, volumeName string) VolumeId { - return VolumeId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - AccountName: accountName, - PoolName: poolName, - VolumeName: volumeName, - } -} - -// ParseVolumeID parses 'input' into a VolumeId -func ParseVolumeID(input string) (*VolumeId, error) { - parser := resourceids.NewParserFromResourceIdType(VolumeId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := VolumeId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { - return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) - } - - if id.VolumeName, ok = parsed.Parsed["volumeName"]; !ok { - return nil, fmt.Errorf("the segment 'volumeName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ParseVolumeIDInsensitively parses 'input' case-insensitively into a VolumeId -// note: this method should only be used for API response data and not user input -func ParseVolumeIDInsensitively(input string) (*VolumeId, error) { - parser := resourceids.NewParserFromResourceIdType(VolumeId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := VolumeId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) - } - - if id.PoolName, ok = parsed.Parsed["poolName"]; !ok { - return nil, fmt.Errorf("the segment 'poolName' was not found in the resource id %q", input) - } - - if id.VolumeName, ok = parsed.Parsed["volumeName"]; !ok { - return nil, fmt.Errorf("the segment 'volumeName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ValidateVolumeID checks that 'input' can be parsed as a Volume ID -func ValidateVolumeID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := ParseVolumeID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Volume ID -func (id VolumeId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/capacityPools/%s/volumes/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName, id.PoolName, id.VolumeName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Volume ID -func (id VolumeId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), - resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("accountName", "accountValue"), - resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("poolName", "poolValue"), - resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), - resourceids.UserSpecifiedSegment("volumeName", "volumeValue"), - } -} - -// String returns a human-readable description of this Volume ID -func (id VolumeId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Account Name: %q", id.AccountName), - fmt.Sprintf("Pool Name: %q", id.PoolName), - fmt.Sprintf("Volume Name: %q", id.VolumeName), - } - return fmt.Sprintf("Volume (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesauthorizereplication_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesauthorizereplication_autorest.go deleted file mode 100644 index 76b9f035e73f..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesauthorizereplication_autorest.go +++ /dev/null @@ -1,79 +0,0 @@ -package volumesreplication - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumesAuthorizeReplicationOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// VolumesAuthorizeReplication ... -func (c VolumesReplicationClient) VolumesAuthorizeReplication(ctx context.Context, id VolumeId, input AuthorizeRequest) (result VolumesAuthorizeReplicationOperationResponse, err error) { - req, err := c.preparerForVolumesAuthorizeReplication(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesAuthorizeReplication", nil, "Failure preparing request") - return - } - - result, err = c.senderForVolumesAuthorizeReplication(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesAuthorizeReplication", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// VolumesAuthorizeReplicationThenPoll performs VolumesAuthorizeReplication then polls until it's completed -func (c VolumesReplicationClient) VolumesAuthorizeReplicationThenPoll(ctx context.Context, id VolumeId, input AuthorizeRequest) error { - result, err := c.VolumesAuthorizeReplication(ctx, id, input) - if err != nil { - return fmt.Errorf("performing VolumesAuthorizeReplication: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after VolumesAuthorizeReplication: %+v", err) - } - - return nil -} - -// preparerForVolumesAuthorizeReplication prepares the VolumesAuthorizeReplication request. -func (c VolumesReplicationClient) preparerForVolumesAuthorizeReplication(ctx context.Context, id VolumeId, input AuthorizeRequest) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/authorizeReplication", id.ID())), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForVolumesAuthorizeReplication sends the VolumesAuthorizeReplication request. The method will close the -// http.Response Body if it receives an error. -func (c VolumesReplicationClient) senderForVolumesAuthorizeReplication(ctx context.Context, req *http.Request) (future VolumesAuthorizeReplicationOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesbreakreplication_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesbreakreplication_autorest.go deleted file mode 100644 index 2d1739198e38..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesbreakreplication_autorest.go +++ /dev/null @@ -1,79 +0,0 @@ -package volumesreplication - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumesBreakReplicationOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// VolumesBreakReplication ... -func (c VolumesReplicationClient) VolumesBreakReplication(ctx context.Context, id VolumeId, input BreakReplicationRequest) (result VolumesBreakReplicationOperationResponse, err error) { - req, err := c.preparerForVolumesBreakReplication(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesBreakReplication", nil, "Failure preparing request") - return - } - - result, err = c.senderForVolumesBreakReplication(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesBreakReplication", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// VolumesBreakReplicationThenPoll performs VolumesBreakReplication then polls until it's completed -func (c VolumesReplicationClient) VolumesBreakReplicationThenPoll(ctx context.Context, id VolumeId, input BreakReplicationRequest) error { - result, err := c.VolumesBreakReplication(ctx, id, input) - if err != nil { - return fmt.Errorf("performing VolumesBreakReplication: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after VolumesBreakReplication: %+v", err) - } - - return nil -} - -// preparerForVolumesBreakReplication prepares the VolumesBreakReplication request. -func (c VolumesReplicationClient) preparerForVolumesBreakReplication(ctx context.Context, id VolumeId, input BreakReplicationRequest) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/breakReplication", id.ID())), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForVolumesBreakReplication sends the VolumesBreakReplication request. The method will close the -// http.Response Body if it receives an error. -func (c VolumesReplicationClient) senderForVolumesBreakReplication(ctx context.Context, req *http.Request) (future VolumesBreakReplicationOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesdeletereplication_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesdeletereplication_autorest.go deleted file mode 100644 index 6dd32453b2de..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesdeletereplication_autorest.go +++ /dev/null @@ -1,78 +0,0 @@ -package volumesreplication - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumesDeleteReplicationOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// VolumesDeleteReplication ... -func (c VolumesReplicationClient) VolumesDeleteReplication(ctx context.Context, id VolumeId) (result VolumesDeleteReplicationOperationResponse, err error) { - req, err := c.preparerForVolumesDeleteReplication(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesDeleteReplication", nil, "Failure preparing request") - return - } - - result, err = c.senderForVolumesDeleteReplication(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesDeleteReplication", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// VolumesDeleteReplicationThenPoll performs VolumesDeleteReplication then polls until it's completed -func (c VolumesReplicationClient) VolumesDeleteReplicationThenPoll(ctx context.Context, id VolumeId) error { - result, err := c.VolumesDeleteReplication(ctx, id) - if err != nil { - return fmt.Errorf("performing VolumesDeleteReplication: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after VolumesDeleteReplication: %+v", err) - } - - return nil -} - -// preparerForVolumesDeleteReplication prepares the VolumesDeleteReplication request. -func (c VolumesReplicationClient) preparerForVolumesDeleteReplication(ctx context.Context, id VolumeId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/deleteReplication", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForVolumesDeleteReplication sends the VolumesDeleteReplication request. The method will close the -// http.Response Body if it receives an error. -func (c VolumesReplicationClient) senderForVolumesDeleteReplication(ctx context.Context, req *http.Request) (future VolumesDeleteReplicationOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesreinitializereplication_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesreinitializereplication_autorest.go deleted file mode 100644 index f894605753fa..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesreinitializereplication_autorest.go +++ /dev/null @@ -1,78 +0,0 @@ -package volumesreplication - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumesReInitializeReplicationOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// VolumesReInitializeReplication ... -func (c VolumesReplicationClient) VolumesReInitializeReplication(ctx context.Context, id VolumeId) (result VolumesReInitializeReplicationOperationResponse, err error) { - req, err := c.preparerForVolumesReInitializeReplication(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesReInitializeReplication", nil, "Failure preparing request") - return - } - - result, err = c.senderForVolumesReInitializeReplication(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesReInitializeReplication", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// VolumesReInitializeReplicationThenPoll performs VolumesReInitializeReplication then polls until it's completed -func (c VolumesReplicationClient) VolumesReInitializeReplicationThenPoll(ctx context.Context, id VolumeId) error { - result, err := c.VolumesReInitializeReplication(ctx, id) - if err != nil { - return fmt.Errorf("performing VolumesReInitializeReplication: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after VolumesReInitializeReplication: %+v", err) - } - - return nil -} - -// preparerForVolumesReInitializeReplication prepares the VolumesReInitializeReplication request. -func (c VolumesReplicationClient) preparerForVolumesReInitializeReplication(ctx context.Context, id VolumeId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/reinitializeReplication", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForVolumesReInitializeReplication sends the VolumesReInitializeReplication request. The method will close the -// http.Response Body if it receives an error. -func (c VolumesReplicationClient) senderForVolumesReInitializeReplication(ctx context.Context, req *http.Request) (future VolumesReInitializeReplicationOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesreplicationstatus_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesreplicationstatus_autorest.go deleted file mode 100644 index 12b0382b0cd4..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesreplicationstatus_autorest.go +++ /dev/null @@ -1,68 +0,0 @@ -package volumesreplication - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumesReplicationStatusOperationResponse struct { - HttpResponse *http.Response - Model *ReplicationStatus -} - -// VolumesReplicationStatus ... -func (c VolumesReplicationClient) VolumesReplicationStatus(ctx context.Context, id VolumeId) (result VolumesReplicationStatusOperationResponse, err error) { - req, err := c.preparerForVolumesReplicationStatus(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesReplicationStatus", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesReplicationStatus", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForVolumesReplicationStatus(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesReplicationStatus", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForVolumesReplicationStatus prepares the VolumesReplicationStatus request. -func (c VolumesReplicationClient) preparerForVolumesReplicationStatus(ctx context.Context, id VolumeId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/replicationStatus", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForVolumesReplicationStatus handles the response to the VolumesReplicationStatus request. The method always -// closes the http.Response Body. -func (c VolumesReplicationClient) responderForVolumesReplicationStatus(resp *http.Response) (result VolumesReplicationStatusOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesresyncreplication_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesresyncreplication_autorest.go deleted file mode 100644 index 05f303966fa5..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumesresyncreplication_autorest.go +++ /dev/null @@ -1,78 +0,0 @@ -package volumesreplication - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VolumesResyncReplicationOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// VolumesResyncReplication ... -func (c VolumesReplicationClient) VolumesResyncReplication(ctx context.Context, id VolumeId) (result VolumesResyncReplicationOperationResponse, err error) { - req, err := c.preparerForVolumesResyncReplication(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesResyncReplication", nil, "Failure preparing request") - return - } - - result, err = c.senderForVolumesResyncReplication(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesResyncReplication", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// VolumesResyncReplicationThenPoll performs VolumesResyncReplication then polls until it's completed -func (c VolumesReplicationClient) VolumesResyncReplicationThenPoll(ctx context.Context, id VolumeId) error { - result, err := c.VolumesResyncReplication(ctx, id) - if err != nil { - return fmt.Errorf("performing VolumesResyncReplication: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after VolumesResyncReplication: %+v", err) - } - - return nil -} - -// preparerForVolumesResyncReplication prepares the VolumesResyncReplication request. -func (c VolumesReplicationClient) preparerForVolumesResyncReplication(ctx context.Context, id VolumeId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/resyncReplication", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForVolumesResyncReplication sends the VolumesResyncReplication request. The method will close the -// http.Response Body if it receives an error. -func (c VolumesReplicationClient) senderForVolumesResyncReplication(ctx context.Context, req *http.Request) (future VolumesResyncReplicationOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/model_breakreplicationrequest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/model_breakreplicationrequest.go deleted file mode 100644 index b6a0a179a9c6..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/model_breakreplicationrequest.go +++ /dev/null @@ -1,8 +0,0 @@ -package volumesreplication - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BreakReplicationRequest struct { - ForceBreakReplication *bool `json:"forceBreakReplication,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/model_replicationstatus.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/model_replicationstatus.go deleted file mode 100644 index 2a79dddf7a40..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/model_replicationstatus.go +++ /dev/null @@ -1,12 +0,0 @@ -package volumesreplication - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ReplicationStatus struct { - ErrorMessage *string `json:"errorMessage,omitempty"` - Healthy *bool `json:"healthy,omitempty"` - MirrorState *MirrorState `json:"mirrorState,omitempty"` - RelationshipStatus *RelationshipStatus `json:"relationshipStatus,omitempty"` - TotalProgress *string `json:"totalProgress,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/version.go deleted file mode 100644 index 0090e82b73bc..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package volumesreplication - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-01-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/volumesreplication/%s", defaultApiVersion) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/capacitypools/README.md similarity index 95% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/README.md rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/capacitypools/README.md index a47f3c6bf12f..3d58c52acfff 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/README.md +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/capacitypools/README.md @@ -1,14 +1,14 @@ -## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools` Documentation +## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/capacitypools` Documentation -The `capacitypools` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2021-10-01`). +The `capacitypools` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2022-05-01`). This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). ### Import Path ```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools" +import "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/capacitypools" ``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/capacitypools/client.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/client.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/capacitypools/client.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/capacitypools/constants.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/constants.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/capacitypools/constants.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/id_capacitypool.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/capacitypools/id_capacitypool.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/id_capacitypool.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/capacitypools/id_capacitypool.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/id_netappaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/capacitypools/id_netappaccount.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/id_netappaccount.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/capacitypools/id_netappaccount.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolscreateorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/capacitypools/method_poolscreateorupdate_autorest.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolscreateorupdate_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/capacitypools/method_poolscreateorupdate_autorest.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolsdelete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/capacitypools/method_poolsdelete_autorest.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolsdelete_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/capacitypools/method_poolsdelete_autorest.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolsget_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/capacitypools/method_poolsget_autorest.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolsget_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/capacitypools/method_poolsget_autorest.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolslist_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/capacitypools/method_poolslist_autorest.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolslist_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/capacitypools/method_poolslist_autorest.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolsupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/capacitypools/method_poolsupdate_autorest.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/method_poolsupdate_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/capacitypools/method_poolsupdate_autorest.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/model_capacitypool.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/capacitypools/model_capacitypool.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/model_capacitypool.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/capacitypools/model_capacitypool.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/model_capacitypoolpatch.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/capacitypools/model_capacitypoolpatch.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/model_capacitypoolpatch.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/capacitypools/model_capacitypoolpatch.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/model_poolpatchproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/capacitypools/model_poolpatchproperties.go similarity index 60% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/model_poolpatchproperties.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/capacitypools/model_poolpatchproperties.go index 071dba445599..c971dd8637c2 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/model_poolpatchproperties.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/capacitypools/model_poolpatchproperties.go @@ -4,6 +4,7 @@ package capacitypools // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type PoolPatchProperties struct { - QosType *QosType `json:"qosType,omitempty"` - Size *int64 `json:"size,omitempty"` + CoolAccess *bool `json:"coolAccess,omitempty"` + QosType *QosType `json:"qosType,omitempty"` + Size *int64 `json:"size,omitempty"` } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/model_poolproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/capacitypools/model_poolproperties.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/model_poolproperties.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/capacitypools/model_poolproperties.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/capacitypools/predicates.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/capacitypools/predicates.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/capacitypools/predicates.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/capacitypools/version.go similarity index 88% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/version.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/capacitypools/version.go index f1cfc7ecf174..f29d61d60efd 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/capacitypools/version.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/capacitypools/version.go @@ -5,7 +5,7 @@ import "fmt" // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -const defaultApiVersion = "2022-01-01" +const defaultApiVersion = "2022-05-01" func userAgent() string { return fmt.Sprintf("hashicorp/go-azure-sdk/capacitypools/%s", defaultApiVersion) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/README.md similarity index 86% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/README.md rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/README.md index d011b7423309..0d3ea6ecc3e8 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/README.md +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/README.md @@ -1,14 +1,14 @@ -## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts` Documentation +## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts` Documentation -The `netappaccounts` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2021-10-01`). +The `netappaccounts` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2022-05-01`). This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). ### Import Path ```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts" +import "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts" ``` @@ -99,6 +99,18 @@ for _, item := range items { ``` +### Example Usage: `NetAppAccountsClient.AccountsRenewCredentials` + +```go +ctx := context.TODO() +id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") + +if err := client.AccountsRenewCredentialsThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + ### Example Usage: `NetAppAccountsClient.AccountsUpdate` ```go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/client.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/client.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/client.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/constants.go new file mode 100644 index 000000000000..2af15654e918 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/constants.go @@ -0,0 +1,108 @@ +package netappaccounts + +import "strings" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ActiveDirectoryStatus string + +const ( + ActiveDirectoryStatusCreated ActiveDirectoryStatus = "Created" + ActiveDirectoryStatusDeleted ActiveDirectoryStatus = "Deleted" + ActiveDirectoryStatusError ActiveDirectoryStatus = "Error" + ActiveDirectoryStatusInUse ActiveDirectoryStatus = "InUse" + ActiveDirectoryStatusUpdating ActiveDirectoryStatus = "Updating" +) + +func PossibleValuesForActiveDirectoryStatus() []string { + return []string{ + string(ActiveDirectoryStatusCreated), + string(ActiveDirectoryStatusDeleted), + string(ActiveDirectoryStatusError), + string(ActiveDirectoryStatusInUse), + string(ActiveDirectoryStatusUpdating), + } +} + +func parseActiveDirectoryStatus(input string) (*ActiveDirectoryStatus, error) { + vals := map[string]ActiveDirectoryStatus{ + "created": ActiveDirectoryStatusCreated, + "deleted": ActiveDirectoryStatusDeleted, + "error": ActiveDirectoryStatusError, + "inuse": ActiveDirectoryStatusInUse, + "updating": ActiveDirectoryStatusUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ActiveDirectoryStatus(input) + return &out, nil +} + +type KeySource string + +const ( + KeySourceMicrosoftPointKeyVault KeySource = "Microsoft.KeyVault" + KeySourceMicrosoftPointNetApp KeySource = "Microsoft.NetApp" +) + +func PossibleValuesForKeySource() []string { + return []string{ + string(KeySourceMicrosoftPointKeyVault), + string(KeySourceMicrosoftPointNetApp), + } +} + +func parseKeySource(input string) (*KeySource, error) { + vals := map[string]KeySource{ + "microsoft.keyvault": KeySourceMicrosoftPointKeyVault, + "microsoft.netapp": KeySourceMicrosoftPointNetApp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := KeySource(input) + return &out, nil +} + +type KeyVaultStatus string + +const ( + KeyVaultStatusCreated KeyVaultStatus = "Created" + KeyVaultStatusDeleted KeyVaultStatus = "Deleted" + KeyVaultStatusError KeyVaultStatus = "Error" + KeyVaultStatusInUse KeyVaultStatus = "InUse" + KeyVaultStatusUpdating KeyVaultStatus = "Updating" +) + +func PossibleValuesForKeyVaultStatus() []string { + return []string{ + string(KeyVaultStatusCreated), + string(KeyVaultStatusDeleted), + string(KeyVaultStatusError), + string(KeyVaultStatusInUse), + string(KeyVaultStatusUpdating), + } +} + +func parseKeyVaultStatus(input string) (*KeyVaultStatus, error) { + vals := map[string]KeyVaultStatus{ + "created": KeyVaultStatusCreated, + "deleted": KeyVaultStatusDeleted, + "error": KeyVaultStatusError, + "inuse": KeyVaultStatusInUse, + "updating": KeyVaultStatusUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := KeyVaultStatus(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/id_netappaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/id_netappaccount.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/id_netappaccount.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/id_netappaccount.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountscreateorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/method_accountscreateorupdate_autorest.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountscreateorupdate_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/method_accountscreateorupdate_autorest.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountsdelete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/method_accountsdelete_autorest.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountsdelete_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/method_accountsdelete_autorest.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountsget_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/method_accountsget_autorest.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountsget_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/method_accountsget_autorest.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountslist_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/method_accountslist_autorest.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountslist_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/method_accountslist_autorest.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountslistbysubscription_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/method_accountslistbysubscription_autorest.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountslistbysubscription_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/method_accountslistbysubscription_autorest.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/method_accountsrenewcredentials_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/method_accountsrenewcredentials_autorest.go new file mode 100644 index 000000000000..5b89b6f76a38 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/method_accountsrenewcredentials_autorest.go @@ -0,0 +1,78 @@ +package netappaccounts + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AccountsRenewCredentialsOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// AccountsRenewCredentials ... +func (c NetAppAccountsClient) AccountsRenewCredentials(ctx context.Context, id NetAppAccountId) (result AccountsRenewCredentialsOperationResponse, err error) { + req, err := c.preparerForAccountsRenewCredentials(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsRenewCredentials", nil, "Failure preparing request") + return + } + + result, err = c.senderForAccountsRenewCredentials(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "netappaccounts.NetAppAccountsClient", "AccountsRenewCredentials", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// AccountsRenewCredentialsThenPoll performs AccountsRenewCredentials then polls until it's completed +func (c NetAppAccountsClient) AccountsRenewCredentialsThenPoll(ctx context.Context, id NetAppAccountId) error { + result, err := c.AccountsRenewCredentials(ctx, id) + if err != nil { + return fmt.Errorf("performing AccountsRenewCredentials: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after AccountsRenewCredentials: %+v", err) + } + + return nil +} + +// preparerForAccountsRenewCredentials prepares the AccountsRenewCredentials request. +func (c NetAppAccountsClient) preparerForAccountsRenewCredentials(ctx context.Context, id NetAppAccountId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/renewCredentials", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForAccountsRenewCredentials sends the AccountsRenewCredentials request. The method will close the +// http.Response Body if it receives an error. +func (c NetAppAccountsClient) senderForAccountsRenewCredentials(ctx context.Context, req *http.Request) (future AccountsRenewCredentialsOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountsupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/method_accountsupdate_autorest.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/method_accountsupdate_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/method_accountsupdate_autorest.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/model_accountencryption.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/model_accountencryption.go similarity index 50% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/model_accountencryption.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/model_accountencryption.go index 39a9282ce500..93f1a662f776 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/model_accountencryption.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/model_accountencryption.go @@ -4,5 +4,7 @@ package netappaccounts // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type AccountEncryption struct { - KeySource *string `json:"keySource,omitempty"` + Identity *EncryptionIdentity `json:"identity,omitempty"` + KeySource *KeySource `json:"keySource,omitempty"` + KeyVaultProperties *KeyVaultProperties `json:"keyVaultProperties,omitempty"` } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/model_accountproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/model_accountproperties.go similarity index 85% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/model_accountproperties.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/model_accountproperties.go index b158b47fc946..18428908f562 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/model_accountproperties.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/model_accountproperties.go @@ -5,6 +5,7 @@ package netappaccounts type AccountProperties struct { ActiveDirectories *[]ActiveDirectory `json:"activeDirectories,omitempty"` + DisableShowmount *bool `json:"disableShowmount,omitempty"` Encryption *AccountEncryption `json:"encryption,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_activedirectory.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/model_activedirectory.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_activedirectory.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/model_activedirectory.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_accountencryption.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/model_encryptionidentity.go similarity index 52% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_accountencryption.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/model_encryptionidentity.go index 39a9282ce500..50cf4dbf6791 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_accountencryption.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/model_encryptionidentity.go @@ -3,6 +3,7 @@ package netappaccounts // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type AccountEncryption struct { - KeySource *string `json:"keySource,omitempty"` +type EncryptionIdentity struct { + PrincipalId *string `json:"principalId,omitempty"` + UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"` } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/model_keyvaultproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/model_keyvaultproperties.go new file mode 100644 index 000000000000..ac5d8c6afa48 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/model_keyvaultproperties.go @@ -0,0 +1,12 @@ +package netappaccounts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type KeyVaultProperties struct { + KeyName string `json:"keyName"` + KeyVaultId *string `json:"keyVaultId,omitempty"` + KeyVaultResourceId string `json:"keyVaultResourceId"` + KeyVaultUri string `json:"keyVaultUri"` + Status *KeyVaultStatus `json:"status,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_ldapsearchscopeopt.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/model_ldapsearchscopeopt.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_ldapsearchscopeopt.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/model_ldapsearchscopeopt.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/model_netappaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/model_netappaccount.go new file mode 100644 index 000000000000..ae38663e1261 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/model_netappaccount.go @@ -0,0 +1,21 @@ +package netappaccounts + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetAppAccount struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Identity *identity.LegacySystemAndUserAssignedMap `json:"identity,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties *AccountProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_netappaccountpatch.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/model_netappaccountpatch.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/model_netappaccountpatch.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/model_netappaccountpatch.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/predicates.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/netappaccounts/predicates.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/predicates.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/version.go similarity index 88% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/version.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/version.go index 01165f564b31..968fe11ac73f 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/netappaccounts/version.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/version.go @@ -5,7 +5,7 @@ import "fmt" // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -const defaultApiVersion = "2022-01-01" +const defaultApiVersion = "2022-05-01" func userAgent() string { return fmt.Sprintf("hashicorp/go-azure-sdk/netappaccounts/%s", defaultApiVersion) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshotpolicy/README.md similarity index 95% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/README.md rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshotpolicy/README.md index 3fcab33d905b..3bbe03bafd43 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/README.md +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshotpolicy/README.md @@ -1,14 +1,14 @@ -## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy` Documentation +## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshotpolicy` Documentation -The `snapshotpolicy` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2021-10-01`). +The `snapshotpolicy` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2022-05-01`). This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). ### Import Path ```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy" +import "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshotpolicy" ``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshotpolicy/client.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/client.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshotpolicy/client.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/id_netappaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshotpolicy/id_netappaccount.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/id_netappaccount.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshotpolicy/id_netappaccount.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/id_snapshotpolicy.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshotpolicy/id_snapshotpolicy.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/id_snapshotpolicy.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshotpolicy/id_snapshotpolicy.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpoliciescreate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshotpolicy/method_snapshotpoliciescreate_autorest.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpoliciescreate_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshotpolicy/method_snapshotpoliciescreate_autorest.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpoliciesdelete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshotpolicy/method_snapshotpoliciesdelete_autorest.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpoliciesdelete_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshotpolicy/method_snapshotpoliciesdelete_autorest.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpoliciesget_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshotpolicy/method_snapshotpoliciesget_autorest.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpoliciesget_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshotpolicy/method_snapshotpoliciesget_autorest.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpolicieslist_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshotpolicy/method_snapshotpolicieslist_autorest.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpolicieslist_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshotpolicy/method_snapshotpolicieslist_autorest.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpoliciesupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshotpolicy/method_snapshotpoliciesupdate_autorest.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/method_snapshotpoliciesupdate_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshotpolicy/method_snapshotpoliciesupdate_autorest.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_dailyschedule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshotpolicy/model_dailyschedule.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_dailyschedule.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshotpolicy/model_dailyschedule.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_hourlyschedule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshotpolicy/model_hourlyschedule.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_hourlyschedule.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshotpolicy/model_hourlyschedule.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_monthlyschedule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshotpolicy/model_monthlyschedule.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_monthlyschedule.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshotpolicy/model_monthlyschedule.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_snapshotpolicieslist.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshotpolicy/model_snapshotpolicieslist.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_snapshotpolicieslist.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshotpolicy/model_snapshotpolicieslist.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_snapshotpolicy.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshotpolicy/model_snapshotpolicy.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_snapshotpolicy.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshotpolicy/model_snapshotpolicy.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_snapshotpolicypatch.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshotpolicy/model_snapshotpolicypatch.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_snapshotpolicypatch.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshotpolicy/model_snapshotpolicypatch.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_snapshotpolicyproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshotpolicy/model_snapshotpolicyproperties.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_snapshotpolicyproperties.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshotpolicy/model_snapshotpolicyproperties.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_weeklyschedule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshotpolicy/model_weeklyschedule.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/model_weeklyschedule.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshotpolicy/model_weeklyschedule.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshotpolicy/version.go similarity index 88% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/version.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshotpolicy/version.go index 00061163a3a7..c2169f8dcf75 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshotpolicy/version.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshotpolicy/version.go @@ -5,7 +5,7 @@ import "fmt" // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -const defaultApiVersion = "2021-10-01" +const defaultApiVersion = "2022-05-01" func userAgent() string { return fmt.Sprintf("hashicorp/go-azure-sdk/snapshotpolicy/%s", defaultApiVersion) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshots/README.md similarity index 96% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/README.md rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshots/README.md index 9eb7671f8828..4a2a3aa6c0d4 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots/README.md +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshots/README.md @@ -1,14 +1,14 @@ -## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots` Documentation +## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshots` Documentation -The `snapshots` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2022-01-01`). +The `snapshots` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2022-05-01`). This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). ### Import Path ```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/snapshots" +import "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshots" ``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshots/client.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/client.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshots/client.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/id_snapshot.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshots/id_snapshot.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/id_snapshot.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshots/id_snapshot.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/id_volume.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshots/id_volume.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/id_volume.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshots/id_volume.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_create_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshots/method_create_autorest.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_create_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshots/method_create_autorest.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_delete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshots/method_delete_autorest.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_delete_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshots/method_delete_autorest.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_get_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshots/method_get_autorest.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_get_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshots/method_get_autorest.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_list_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshots/method_list_autorest.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_list_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshots/method_list_autorest.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_restorefiles_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshots/method_restorefiles_autorest.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_restorefiles_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshots/method_restorefiles_autorest.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_update_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshots/method_update_autorest.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/method_update_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshots/method_update_autorest.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/model_snapshot.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshots/model_snapshot.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/model_snapshot.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshots/model_snapshot.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/model_snapshotproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshots/model_snapshotproperties.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/model_snapshotproperties.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshots/model_snapshotproperties.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/model_snapshotrestorefiles.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshots/model_snapshotrestorefiles.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/model_snapshotrestorefiles.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshots/model_snapshotrestorefiles.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/model_snapshotslist.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshots/model_snapshotslist.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/model_snapshotslist.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshots/model_snapshotslist.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshots/version.go similarity index 88% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/version.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshots/version.go index 90179a6f56ae..5a40a00ed726 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/snapshots/version.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshots/version.go @@ -5,7 +5,7 @@ import "fmt" // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -const defaultApiVersion = "2021-10-01" +const defaultApiVersion = "2022-05-01" func userAgent() string { return fmt.Sprintf("hashicorp/go-azure-sdk/snapshots/%s", defaultApiVersion) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/README.md similarity index 94% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/README.md rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/README.md index f733a433557a..f6fc22ff39b1 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/README.md +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/README.md @@ -1,14 +1,14 @@ -## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups` Documentation +## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups` Documentation -The `volumegroups` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2022-01-01`). +The `volumegroups` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2022-05-01`). This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). ### Import Path ```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups" +import "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups" ``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/client.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/client.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/client.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/constants.go similarity index 76% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/constants.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/constants.go index 15a1d52b1822..60915c4b5581 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/constants.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/constants.go @@ -114,6 +114,34 @@ func parseEnableSubvolumes(input string) (*EnableSubvolumes, error) { return &out, nil } +type EncryptionKeySource string + +const ( + EncryptionKeySourceMicrosoftPointKeyVault EncryptionKeySource = "Microsoft.KeyVault" + EncryptionKeySourceMicrosoftPointNetApp EncryptionKeySource = "Microsoft.NetApp" +) + +func PossibleValuesForEncryptionKeySource() []string { + return []string{ + string(EncryptionKeySourceMicrosoftPointKeyVault), + string(EncryptionKeySourceMicrosoftPointNetApp), + } +} + +func parseEncryptionKeySource(input string) (*EncryptionKeySource, error) { + vals := map[string]EncryptionKeySource{ + "microsoft.keyvault": EncryptionKeySourceMicrosoftPointKeyVault, + "microsoft.netapp": EncryptionKeySourceMicrosoftPointNetApp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := EncryptionKeySource(input) + return &out, nil +} + type EndpointType string const ( @@ -263,6 +291,62 @@ func parseServiceLevel(input string) (*ServiceLevel, error) { return &out, nil } +type SmbAccessBasedEnumeration string + +const ( + SmbAccessBasedEnumerationDisabled SmbAccessBasedEnumeration = "Disabled" + SmbAccessBasedEnumerationEnabled SmbAccessBasedEnumeration = "Enabled" +) + +func PossibleValuesForSmbAccessBasedEnumeration() []string { + return []string{ + string(SmbAccessBasedEnumerationDisabled), + string(SmbAccessBasedEnumerationEnabled), + } +} + +func parseSmbAccessBasedEnumeration(input string) (*SmbAccessBasedEnumeration, error) { + vals := map[string]SmbAccessBasedEnumeration{ + "disabled": SmbAccessBasedEnumerationDisabled, + "enabled": SmbAccessBasedEnumerationEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SmbAccessBasedEnumeration(input) + return &out, nil +} + +type SmbNonBrowsable string + +const ( + SmbNonBrowsableDisabled SmbNonBrowsable = "Disabled" + SmbNonBrowsableEnabled SmbNonBrowsable = "Enabled" +) + +func PossibleValuesForSmbNonBrowsable() []string { + return []string{ + string(SmbNonBrowsableDisabled), + string(SmbNonBrowsableEnabled), + } +} + +func parseSmbNonBrowsable(input string) (*SmbNonBrowsable, error) { + vals := map[string]SmbNonBrowsable{ + "disabled": SmbNonBrowsableDisabled, + "enabled": SmbNonBrowsableEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SmbNonBrowsable(input) + return &out, nil +} + type VolumeStorageToNetworkProximity string const ( diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/id_netappaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/id_netappaccount.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/id_netappaccount.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/id_netappaccount.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/id_volumegroup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/id_volumegroup.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/id_volumegroup.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/id_volumegroup.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupscreate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/method_volumegroupscreate_autorest.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupscreate_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/method_volumegroupscreate_autorest.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupsdelete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/method_volumegroupsdelete_autorest.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupsdelete_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/method_volumegroupsdelete_autorest.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupsget_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/method_volumegroupsget_autorest.go similarity index 99% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupsget_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/method_volumegroupsget_autorest.go index d52a1f2e8c2e..c216597fce42 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/method_volumegroupsget_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/method_volumegroupsget_autorest.go @@ -63,5 +63,6 @@ func (c VolumeGroupsClient) responderForVolumeGroupsGet(resp *http.Response) (re autorest.ByUnmarshallingJSON(&result.Model), autorest.ByClosing()) result.HttpResponse = resp + return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupslistbynetappaccount_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/method_volumegroupslistbynetappaccount_autorest.go similarity index 99% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupslistbynetappaccount_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/method_volumegroupslistbynetappaccount_autorest.go index 92517aeaf6f2..f37aba669c51 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/method_volumegroupslistbynetappaccount_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/method_volumegroupslistbynetappaccount_autorest.go @@ -64,5 +64,6 @@ func (c VolumeGroupsClient) responderForVolumeGroupsListByNetAppAccount(resp *ht autorest.ByUnmarshallingJSON(&result.Model), autorest.ByClosing()) result.HttpResponse = resp + return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_exportpolicyrule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/model_exportpolicyrule.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_exportpolicyrule.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/model_exportpolicyrule.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_mounttargetproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/model_mounttargetproperties.go similarity index 87% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_mounttargetproperties.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/model_mounttargetproperties.go index c59cc0dbf3e7..5844b80ce9dd 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_mounttargetproperties.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/model_mounttargetproperties.go @@ -5,7 +5,7 @@ package volumegroups type MountTargetProperties struct { FileSystemId string `json:"fileSystemId"` - IpAddress *string `json:"ipAddress,omitempty"` + IPAddress *string `json:"ipAddress,omitempty"` MountTargetId *string `json:"mountTargetId,omitempty"` SmbServerFqdn *string `json:"smbServerFqdn,omitempty"` } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_placementkeyvaluepairs.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/model_placementkeyvaluepairs.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_placementkeyvaluepairs.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/model_placementkeyvaluepairs.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_replicationobject.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/model_replicationobject.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_replicationobject.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/model_replicationobject.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumebackupproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/model_volumebackupproperties.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumebackupproperties.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/model_volumebackupproperties.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/model_volumegroup.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroup.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/model_volumegroup.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupdetails.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/model_volumegroupdetails.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/model_volumegroupdetails.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/model_volumegroupdetails.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegrouplist.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/model_volumegrouplist.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegrouplist.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/model_volumegrouplist.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegrouplistproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/model_volumegrouplistproperties.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegrouplistproperties.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/model_volumegrouplistproperties.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupmetadata.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/model_volumegroupmetadata.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupmetadata.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/model_volumegroupmetadata.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/model_volumegroupproperties.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupproperties.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/model_volumegroupproperties.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupvolumeproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/model_volumegroupvolumeproperties.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumegroupvolumeproperties.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/model_volumegroupvolumeproperties.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/model_volumeproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/model_volumeproperties.go new file mode 100644 index 000000000000..bf37d27af942 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/model_volumeproperties.go @@ -0,0 +1,54 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeProperties struct { + AvsDataStore *AvsDataStore `json:"avsDataStore,omitempty"` + BackupId *string `json:"backupId,omitempty"` + BaremetalTenantId *string `json:"baremetalTenantId,omitempty"` + CapacityPoolResourceId *string `json:"capacityPoolResourceId,omitempty"` + CloneProgress *int64 `json:"cloneProgress,omitempty"` + CoolAccess *bool `json:"coolAccess,omitempty"` + CoolnessPeriod *int64 `json:"coolnessPeriod,omitempty"` + CreationToken string `json:"creationToken"` + DataProtection *VolumePropertiesDataProtection `json:"dataProtection,omitempty"` + DefaultGroupQuotaInKiBs *int64 `json:"defaultGroupQuotaInKiBs,omitempty"` + DefaultUserQuotaInKiBs *int64 `json:"defaultUserQuotaInKiBs,omitempty"` + DeleteBaseSnapshot *bool `json:"deleteBaseSnapshot,omitempty"` + EnableSubvolumes *EnableSubvolumes `json:"enableSubvolumes,omitempty"` + Encrypted *bool `json:"encrypted,omitempty"` + EncryptionKeySource *EncryptionKeySource `json:"encryptionKeySource,omitempty"` + ExportPolicy *VolumePropertiesExportPolicy `json:"exportPolicy,omitempty"` + FileSystemId *string `json:"fileSystemId,omitempty"` + IsDefaultQuotaEnabled *bool `json:"isDefaultQuotaEnabled,omitempty"` + IsRestoring *bool `json:"isRestoring,omitempty"` + KerberosEnabled *bool `json:"kerberosEnabled,omitempty"` + KeyVaultPrivateEndpointResourceId *string `json:"keyVaultPrivateEndpointResourceId,omitempty"` + LdapEnabled *bool `json:"ldapEnabled,omitempty"` + MaximumNumberOfFiles *int64 `json:"maximumNumberOfFiles,omitempty"` + MountTargets *[]MountTargetProperties `json:"mountTargets,omitempty"` + NetworkFeatures *NetworkFeatures `json:"networkFeatures,omitempty"` + NetworkSiblingSetId *string `json:"networkSiblingSetId,omitempty"` + PlacementRules *[]PlacementKeyValuePairs `json:"placementRules,omitempty"` + ProtocolTypes *[]string `json:"protocolTypes,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + ProximityPlacementGroup *string `json:"proximityPlacementGroup,omitempty"` + SecurityStyle *SecurityStyle `json:"securityStyle,omitempty"` + ServiceLevel *ServiceLevel `json:"serviceLevel,omitempty"` + SmbAccessBasedEnumeration *SmbAccessBasedEnumeration `json:"smbAccessBasedEnumeration,omitempty"` + SmbContinuouslyAvailable *bool `json:"smbContinuouslyAvailable,omitempty"` + SmbEncryption *bool `json:"smbEncryption,omitempty"` + SmbNonBrowsable *SmbNonBrowsable `json:"smbNonBrowsable,omitempty"` + SnapshotDirectoryVisible *bool `json:"snapshotDirectoryVisible,omitempty"` + SnapshotId *string `json:"snapshotId,omitempty"` + StorageToNetworkProximity *VolumeStorageToNetworkProximity `json:"storageToNetworkProximity,omitempty"` + SubnetId string `json:"subnetId"` + T2Network *string `json:"t2Network,omitempty"` + ThroughputMibps *float64 `json:"throughputMibps,omitempty"` + UnixPermissions *string `json:"unixPermissions,omitempty"` + UsageThreshold int64 `json:"usageThreshold"` + VolumeGroupName *string `json:"volumeGroupName,omitempty"` + VolumeSpecName *string `json:"volumeSpecName,omitempty"` + VolumeType *string `json:"volumeType,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumepropertiesdataprotection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/model_volumepropertiesdataprotection.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumepropertiesdataprotection.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/model_volumepropertiesdataprotection.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumepropertiesexportpolicy.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/model_volumepropertiesexportpolicy.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumepropertiesexportpolicy.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/model_volumepropertiesexportpolicy.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumesnapshotproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/model_volumesnapshotproperties.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/model_volumesnapshotproperties.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/model_volumesnapshotproperties.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/version.go similarity index 88% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/version.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/version.go index 93f3d1ecbb06..30dbbd9db030 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumegroups/version.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/version.go @@ -5,7 +5,7 @@ import "fmt" // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -const defaultApiVersion = "2021-10-01" +const defaultApiVersion = "2022-05-01" func userAgent() string { return fmt.Sprintf("hashicorp/go-azure-sdk/volumegroups/%s", defaultApiVersion) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/README.md similarity index 95% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/README.md rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/README.md index e5b1f822c355..95b153f55908 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/README.md +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/README.md @@ -1,14 +1,14 @@ -## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes` Documentation +## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes` Documentation -The `volumes` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2022-01-01`). +The `volumes` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2022-05-01`). This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). ### Import Path ```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes" +import "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes" ``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/client.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/client.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/client.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/constants.go similarity index 81% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/constants.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/constants.go index 6eb9b8afe4fb..fa6be5b8058a 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumegroups/constants.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/constants.go @@ -1,35 +1,10 @@ -package volumegroups +package volumes import "strings" // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ApplicationType string - -const ( - ApplicationTypeSAPNegativeHANA ApplicationType = "SAP-HANA" -) - -func PossibleValuesForApplicationType() []string { - return []string{ - string(ApplicationTypeSAPNegativeHANA), - } -} - -func parseApplicationType(input string) (*ApplicationType, error) { - vals := map[string]ApplicationType{ - "sap-hana": ApplicationTypeSAPNegativeHANA, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationType(input) - return &out, nil -} - type AvsDataStore string const ( @@ -117,18 +92,21 @@ func parseEnableSubvolumes(input string) (*EnableSubvolumes, error) { type EncryptionKeySource string const ( - EncryptionKeySourceMicrosoftPointNetApp EncryptionKeySource = "Microsoft.NetApp" + EncryptionKeySourceMicrosoftPointKeyVault EncryptionKeySource = "Microsoft.KeyVault" + EncryptionKeySourceMicrosoftPointNetApp EncryptionKeySource = "Microsoft.NetApp" ) func PossibleValuesForEncryptionKeySource() []string { return []string{ + string(EncryptionKeySourceMicrosoftPointKeyVault), string(EncryptionKeySourceMicrosoftPointNetApp), } } func parseEncryptionKeySource(input string) (*EncryptionKeySource, error) { vals := map[string]EncryptionKeySource{ - "microsoft.netapp": EncryptionKeySourceMicrosoftPointNetApp, + "microsoft.keyvault": EncryptionKeySourceMicrosoftPointKeyVault, + "microsoft.netapp": EncryptionKeySourceMicrosoftPointNetApp, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil @@ -288,6 +266,62 @@ func parseServiceLevel(input string) (*ServiceLevel, error) { return &out, nil } +type SmbAccessBasedEnumeration string + +const ( + SmbAccessBasedEnumerationDisabled SmbAccessBasedEnumeration = "Disabled" + SmbAccessBasedEnumerationEnabled SmbAccessBasedEnumeration = "Enabled" +) + +func PossibleValuesForSmbAccessBasedEnumeration() []string { + return []string{ + string(SmbAccessBasedEnumerationDisabled), + string(SmbAccessBasedEnumerationEnabled), + } +} + +func parseSmbAccessBasedEnumeration(input string) (*SmbAccessBasedEnumeration, error) { + vals := map[string]SmbAccessBasedEnumeration{ + "disabled": SmbAccessBasedEnumerationDisabled, + "enabled": SmbAccessBasedEnumerationEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SmbAccessBasedEnumeration(input) + return &out, nil +} + +type SmbNonBrowsable string + +const ( + SmbNonBrowsableDisabled SmbNonBrowsable = "Disabled" + SmbNonBrowsableEnabled SmbNonBrowsable = "Enabled" +) + +func PossibleValuesForSmbNonBrowsable() []string { + return []string{ + string(SmbNonBrowsableDisabled), + string(SmbNonBrowsableEnabled), + } +} + +func parseSmbNonBrowsable(input string) (*SmbNonBrowsable, error) { + vals := map[string]SmbNonBrowsable{ + "disabled": SmbNonBrowsableDisabled, + "enabled": SmbNonBrowsableEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SmbNonBrowsable(input) + return &out, nil +} + type VolumeStorageToNetworkProximity string const ( diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/id_capacitypool.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/id_capacitypool.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/id_capacitypool.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/id_capacitypool.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/id_volume.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/id_volume.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/id_volume.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/id_volume.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_createorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/method_createorupdate_autorest.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_createorupdate_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/method_createorupdate_autorest.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_delete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/method_delete_autorest.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_delete_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/method_delete_autorest.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_get_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/method_get_autorest.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_get_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/method_get_autorest.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_list_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/method_list_autorest.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_list_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/method_list_autorest.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_update_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/method_update_autorest.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/method_update_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/method_update_autorest.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_exportpolicyrule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/model_exportpolicyrule.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_exportpolicyrule.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/model_exportpolicyrule.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_mounttargetproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/model_mounttargetproperties.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_mounttargetproperties.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/model_mounttargetproperties.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_placementkeyvaluepairs.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/model_placementkeyvaluepairs.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_placementkeyvaluepairs.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/model_placementkeyvaluepairs.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_replicationobject.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/model_replicationobject.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_replicationobject.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/model_replicationobject.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volume.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/model_volume.go similarity index 85% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volume.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/model_volume.go index f92955c95e93..1679818444b4 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volume.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/model_volume.go @@ -2,6 +2,7 @@ package volumes import ( "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" + "github.com/hashicorp/go-azure-helpers/resourcemanager/zones" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -16,4 +17,5 @@ type Volume struct { SystemData *systemdata.SystemData `json:"systemData,omitempty"` Tags *map[string]string `json:"tags,omitempty"` Type *string `json:"type,omitempty"` + Zones *zones.Schema `json:"zones,omitempty"` } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumebackupproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/model_volumebackupproperties.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumebackupproperties.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/model_volumebackupproperties.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepatch.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/model_volumepatch.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepatch.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/model_volumepatch.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepatchproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/model_volumepatchproperties.go similarity index 85% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepatchproperties.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/model_volumepatchproperties.go index ed4479ca252b..5fab8a90ed1a 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepatchproperties.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/model_volumepatchproperties.go @@ -4,6 +4,8 @@ package volumes // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type VolumePatchProperties struct { + CoolAccess *bool `json:"coolAccess,omitempty"` + CoolnessPeriod *int64 `json:"coolnessPeriod,omitempty"` DataProtection *VolumePatchPropertiesDataProtection `json:"dataProtection,omitempty"` DefaultGroupQuotaInKiBs *int64 `json:"defaultGroupQuotaInKiBs,omitempty"` DefaultUserQuotaInKiBs *int64 `json:"defaultUserQuotaInKiBs,omitempty"` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepatchpropertiesdataprotection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/model_volumepatchpropertiesdataprotection.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepatchpropertiesdataprotection.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/model_volumepatchpropertiesdataprotection.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepatchpropertiesexportpolicy.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/model_volumepatchpropertiesexportpolicy.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepatchpropertiesexportpolicy.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/model_volumepatchpropertiesexportpolicy.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/model_volumeproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/model_volumeproperties.go new file mode 100644 index 000000000000..834a68fdb6ec --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/model_volumeproperties.go @@ -0,0 +1,54 @@ +package volumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeProperties struct { + AvsDataStore *AvsDataStore `json:"avsDataStore,omitempty"` + BackupId *string `json:"backupId,omitempty"` + BaremetalTenantId *string `json:"baremetalTenantId,omitempty"` + CapacityPoolResourceId *string `json:"capacityPoolResourceId,omitempty"` + CloneProgress *int64 `json:"cloneProgress,omitempty"` + CoolAccess *bool `json:"coolAccess,omitempty"` + CoolnessPeriod *int64 `json:"coolnessPeriod,omitempty"` + CreationToken string `json:"creationToken"` + DataProtection *VolumePropertiesDataProtection `json:"dataProtection,omitempty"` + DefaultGroupQuotaInKiBs *int64 `json:"defaultGroupQuotaInKiBs,omitempty"` + DefaultUserQuotaInKiBs *int64 `json:"defaultUserQuotaInKiBs,omitempty"` + DeleteBaseSnapshot *bool `json:"deleteBaseSnapshot,omitempty"` + EnableSubvolumes *EnableSubvolumes `json:"enableSubvolumes,omitempty"` + Encrypted *bool `json:"encrypted,omitempty"` + EncryptionKeySource *EncryptionKeySource `json:"encryptionKeySource,omitempty"` + ExportPolicy *VolumePropertiesExportPolicy `json:"exportPolicy,omitempty"` + FileSystemId *string `json:"fileSystemId,omitempty"` + IsDefaultQuotaEnabled *bool `json:"isDefaultQuotaEnabled,omitempty"` + IsRestoring *bool `json:"isRestoring,omitempty"` + KerberosEnabled *bool `json:"kerberosEnabled,omitempty"` + KeyVaultPrivateEndpointResourceId *string `json:"keyVaultPrivateEndpointResourceId,omitempty"` + LdapEnabled *bool `json:"ldapEnabled,omitempty"` + MaximumNumberOfFiles *int64 `json:"maximumNumberOfFiles,omitempty"` + MountTargets *[]MountTargetProperties `json:"mountTargets,omitempty"` + NetworkFeatures *NetworkFeatures `json:"networkFeatures,omitempty"` + NetworkSiblingSetId *string `json:"networkSiblingSetId,omitempty"` + PlacementRules *[]PlacementKeyValuePairs `json:"placementRules,omitempty"` + ProtocolTypes *[]string `json:"protocolTypes,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + ProximityPlacementGroup *string `json:"proximityPlacementGroup,omitempty"` + SecurityStyle *SecurityStyle `json:"securityStyle,omitempty"` + ServiceLevel *ServiceLevel `json:"serviceLevel,omitempty"` + SmbAccessBasedEnumeration *SmbAccessBasedEnumeration `json:"smbAccessBasedEnumeration,omitempty"` + SmbContinuouslyAvailable *bool `json:"smbContinuouslyAvailable,omitempty"` + SmbEncryption *bool `json:"smbEncryption,omitempty"` + SmbNonBrowsable *SmbNonBrowsable `json:"smbNonBrowsable,omitempty"` + SnapshotDirectoryVisible *bool `json:"snapshotDirectoryVisible,omitempty"` + SnapshotId *string `json:"snapshotId,omitempty"` + StorageToNetworkProximity *VolumeStorageToNetworkProximity `json:"storageToNetworkProximity,omitempty"` + SubnetId string `json:"subnetId"` + T2Network *string `json:"t2Network,omitempty"` + ThroughputMibps *float64 `json:"throughputMibps,omitempty"` + UnixPermissions *string `json:"unixPermissions,omitempty"` + UsageThreshold int64 `json:"usageThreshold"` + VolumeGroupName *string `json:"volumeGroupName,omitempty"` + VolumeSpecName *string `json:"volumeSpecName,omitempty"` + VolumeType *string `json:"volumeType,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepropertiesdataprotection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/model_volumepropertiesdataprotection.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepropertiesdataprotection.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/model_volumepropertiesdataprotection.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepropertiesexportpolicy.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/model_volumepropertiesexportpolicy.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumepropertiesexportpolicy.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/model_volumepropertiesexportpolicy.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumesnapshotproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/model_volumesnapshotproperties.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/model_volumesnapshotproperties.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/model_volumesnapshotproperties.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/predicates.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumes/predicates.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/predicates.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/version.go similarity index 88% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/version.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/version.go index 985665c9fcc2..9ccb3fd80933 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumes/version.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes/version.go @@ -5,7 +5,7 @@ import "fmt" // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -const defaultApiVersion = "2022-01-01" +const defaultApiVersion = "2022-05-01" func userAgent() string { return fmt.Sprintf("hashicorp/go-azure-sdk/volumes/%s", defaultApiVersion) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication/README.md similarity index 85% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/README.md rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication/README.md index d3b6a530cdd8..91e1f1bd4fb7 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/README.md +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication/README.md @@ -1,14 +1,14 @@ -## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication` Documentation +## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication` Documentation -The `volumesreplication` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2022-01-01`). +The `volumesreplication` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2022-05-01`). This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). ### Import Path ```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication" +import "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication" ``` @@ -94,6 +94,23 @@ if err := client.VolumesReInitializeReplicationThenPoll(ctx, id); err != nil { ``` +### Example Usage: `VolumesReplicationClient.VolumesReestablishReplication` + +```go +ctx := context.TODO() +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "poolValue", "volumeValue") + +payload := volumesreplication.ReestablishReplicationRequest{ + // ... +} + + +if err := client.VolumesReestablishReplicationThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + ### Example Usage: `VolumesReplicationClient.VolumesReplicationStatus` ```go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication/client.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/client.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication/client.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication/constants.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/constants.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication/constants.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/id_volume.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication/id_volume.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/id_volume.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication/id_volume.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesauthorizereplication_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication/method_volumesauthorizereplication_autorest.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesauthorizereplication_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication/method_volumesauthorizereplication_autorest.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesbreakreplication_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication/method_volumesbreakreplication_autorest.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesbreakreplication_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication/method_volumesbreakreplication_autorest.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesdeletereplication_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication/method_volumesdeletereplication_autorest.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesdeletereplication_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication/method_volumesdeletereplication_autorest.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumeslistreplications_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication/method_volumeslistreplications_autorest.go similarity index 99% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumeslistreplications_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication/method_volumeslistreplications_autorest.go index 7bfeef216c20..bd62eeedb160 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/method_volumeslistreplications_autorest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication/method_volumeslistreplications_autorest.go @@ -64,5 +64,6 @@ func (c VolumesReplicationClient) responderForVolumesListReplications(resp *http autorest.ByUnmarshallingJSON(&result.Model), autorest.ByClosing()) result.HttpResponse = resp + return } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication/method_volumesreestablishreplication_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication/method_volumesreestablishreplication_autorest.go new file mode 100644 index 000000000000..e8086e14aba5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication/method_volumesreestablishreplication_autorest.go @@ -0,0 +1,79 @@ +package volumesreplication + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumesReestablishReplicationOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// VolumesReestablishReplication ... +func (c VolumesReplicationClient) VolumesReestablishReplication(ctx context.Context, id VolumeId, input ReestablishReplicationRequest) (result VolumesReestablishReplicationOperationResponse, err error) { + req, err := c.preparerForVolumesReestablishReplication(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesReestablishReplication", nil, "Failure preparing request") + return + } + + result, err = c.senderForVolumesReestablishReplication(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "volumesreplication.VolumesReplicationClient", "VolumesReestablishReplication", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// VolumesReestablishReplicationThenPoll performs VolumesReestablishReplication then polls until it's completed +func (c VolumesReplicationClient) VolumesReestablishReplicationThenPoll(ctx context.Context, id VolumeId, input ReestablishReplicationRequest) error { + result, err := c.VolumesReestablishReplication(ctx, id, input) + if err != nil { + return fmt.Errorf("performing VolumesReestablishReplication: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after VolumesReestablishReplication: %+v", err) + } + + return nil +} + +// preparerForVolumesReestablishReplication prepares the VolumesReestablishReplication request. +func (c VolumesReplicationClient) preparerForVolumesReestablishReplication(ctx context.Context, id VolumeId, input ReestablishReplicationRequest) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/reestablishReplication", id.ID())), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForVolumesReestablishReplication sends the VolumesReestablishReplication request. The method will close the +// http.Response Body if it receives an error. +func (c VolumesReplicationClient) senderForVolumesReestablishReplication(ctx context.Context, req *http.Request) (future VolumesReestablishReplicationOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesreinitializereplication_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication/method_volumesreinitializereplication_autorest.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesreinitializereplication_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication/method_volumesreinitializereplication_autorest.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesreplicationstatus_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication/method_volumesreplicationstatus_autorest.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesreplicationstatus_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication/method_volumesreplicationstatus_autorest.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesresyncreplication_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication/method_volumesresyncreplication_autorest.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/method_volumesresyncreplication_autorest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication/method_volumesresyncreplication_autorest.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/model_authorizerequest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication/model_authorizerequest.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/model_authorizerequest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication/model_authorizerequest.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/model_breakreplicationrequest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication/model_breakreplicationrequest.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/model_breakreplicationrequest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication/model_breakreplicationrequest.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/model_listreplications.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication/model_listreplications.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/model_listreplications.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication/model_listreplications.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/model_authorizerequest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication/model_reestablishreplicationrequest.go similarity index 64% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/model_authorizerequest.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication/model_reestablishreplicationrequest.go index ff1cefa31efa..193b71f14903 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/model_authorizerequest.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication/model_reestablishreplicationrequest.go @@ -3,6 +3,6 @@ package volumesreplication // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type AuthorizeRequest struct { - RemoteVolumeResourceId *string `json:"remoteVolumeResourceId,omitempty"` +type ReestablishReplicationRequest struct { + SourceVolumeId *string `json:"sourceVolumeId,omitempty"` } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/model_replication.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication/model_replication.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-01-01/volumesreplication/model_replication.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication/model_replication.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/model_replicationstatus.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication/model_replicationstatus.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/model_replicationstatus.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication/model_replicationstatus.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication/version.go similarity index 88% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/version.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication/version.go index 5a6266022a22..5bed92cb09ff 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2021-10-01/volumesreplication/version.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication/version.go @@ -5,7 +5,7 @@ import "fmt" // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -const defaultApiVersion = "2021-10-01" +const defaultApiVersion = "2022-05-01" func userAgent() string { return fmt.Sprintf("hashicorp/go-azure-sdk/volumesreplication/%s", defaultApiVersion) diff --git a/vendor/golang.org/x/crypto/curve25519/curve25519.go b/vendor/golang.org/x/crypto/curve25519/curve25519.go index bc62161d6e42..cda3fdd3540d 100644 --- a/vendor/golang.org/x/crypto/curve25519/curve25519.go +++ b/vendor/golang.org/x/crypto/curve25519/curve25519.go @@ -9,8 +9,7 @@ package curve25519 // import "golang.org/x/crypto/curve25519" import ( "crypto/subtle" - "errors" - "strconv" + "fmt" "golang.org/x/crypto/curve25519/internal/field" ) @@ -125,10 +124,10 @@ func X25519(scalar, point []byte) ([]byte, error) { func x25519(dst *[32]byte, scalar, point []byte) ([]byte, error) { var in [32]byte if l := len(scalar); l != 32 { - return nil, errors.New("bad scalar length: " + strconv.Itoa(l) + ", expected 32") + return nil, fmt.Errorf("bad scalar length: %d, expected %d", l, 32) } if l := len(point); l != 32 { - return nil, errors.New("bad point length: " + strconv.Itoa(l) + ", expected 32") + return nil, fmt.Errorf("bad point length: %d, expected %d", l, 32) } copy(in[:], scalar) if &point[0] == &Basepoint[0] { @@ -139,7 +138,7 @@ func x25519(dst *[32]byte, scalar, point []byte) ([]byte, error) { copy(base[:], point) ScalarMult(dst, &in, &base) if subtle.ConstantTimeCompare(dst[:], zero[:]) == 1 { - return nil, errors.New("bad input point: low order point") + return nil, fmt.Errorf("bad input point: low order point") } } return dst[:], nil From a338165f4735d1ea936ea29e67e3a86a020bf307 Mon Sep 17 00:00:00 2001 From: Paulo Date: Tue, 21 Mar 2023 21:45:39 +0000 Subject: [PATCH 22/83] minor changes due to new api version --- .../netapp/netapp_volume_group_resource.go | 1 - .../netapp_volume_group_resource_test.go | 60 +++++++++---------- 2 files changed, 30 insertions(+), 31 deletions(-) diff --git a/internal/services/netapp/netapp_volume_group_resource.go b/internal/services/netapp/netapp_volume_group_resource.go index 87a233bb3ac0..1e29e7110519 100644 --- a/internal/services/netapp/netapp_volume_group_resource.go +++ b/internal/services/netapp/netapp_volume_group_resource.go @@ -178,7 +178,6 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { Elem: &pluginsdk.Schema{ Type: pluginsdk.TypeString, ValidateFunc: validation.StringInSlice([]string{ - "NFSv3", "NFSv4.1", }, false), }, diff --git a/internal/services/netapp/netapp_volume_group_resource_test.go b/internal/services/netapp/netapp_volume_group_resource_test.go index a421ffb9d0eb..340c281f9642 100644 --- a/internal/services/netapp/netapp_volume_group_resource_test.go +++ b/internal/services/netapp/netapp_volume_group_resource_test.go @@ -127,15 +127,15 @@ resource "azurerm_netapp_volume_group" "test" { volume_spec_name = "data" storage_quota_in_gb = 1024 throughput_in_mibps = 24 - protocols = ["NFSv3"] + protocols = ["NFSv4.1"] security_style = "Unix" snapshot_directory_visible = false export_policy_rule { rule_index = 1 allowed_clients = "0.0.0.0/0" - nfsv3_enabled = true - nfsv41_enabled = false + nfsv3_enabled = false + nfsv41_enabled = true unix_read_only = false unix_read_write = true root_access_enabled = false @@ -157,15 +157,15 @@ resource "azurerm_netapp_volume_group" "test" { volume_spec_name = "log" storage_quota_in_gb = 1024 throughput_in_mibps = 24 - protocols = ["NFSv3"] + protocols = ["NFSv4.1"] security_style = "Unix" snapshot_directory_visible = false export_policy_rule { rule_index = 1 allowed_clients = "0.0.0.0/0" - nfsv3_enabled = true - nfsv41_enabled = false + nfsv3_enabled = false + nfsv41_enabled = true unix_read_only = false unix_read_write = true root_access_enabled = false @@ -187,15 +187,15 @@ resource "azurerm_netapp_volume_group" "test" { volume_spec_name = "shared" storage_quota_in_gb = 1024 throughput_in_mibps = 24 - protocols = ["NFSv3"] + protocols = ["NFSv4.1"] security_style = "Unix" snapshot_directory_visible = false export_policy_rule { rule_index = 1 allowed_clients = "0.0.0.0/0" - nfsv3_enabled = true - nfsv41_enabled = false + nfsv3_enabled = false + nfsv41_enabled = true unix_read_only = false unix_read_write = true root_access_enabled = false @@ -217,15 +217,15 @@ resource "azurerm_netapp_volume_group" "test" { volume_spec_name = "data-backup" storage_quota_in_gb = 1024 throughput_in_mibps = 24 - protocols = ["NFSv3"] + protocols = ["NFSv4.1"] security_style = "Unix" snapshot_directory_visible = false export_policy_rule { rule_index = 1 allowed_clients = "0.0.0.0/0" - nfsv3_enabled = true - nfsv41_enabled = false + nfsv3_enabled = false + nfsv41_enabled = true unix_read_only = false unix_read_write = true root_access_enabled = false @@ -247,15 +247,15 @@ resource "azurerm_netapp_volume_group" "test" { volume_spec_name = "log-backup" storage_quota_in_gb = 1024 throughput_in_mibps = 24 - protocols = ["NFSv3"] + protocols = ["NFSv4.1"] security_style = "Unix" snapshot_directory_visible = false export_policy_rule { rule_index = 1 allowed_clients = "0.0.0.0/0" - nfsv3_enabled = true - nfsv41_enabled = false + nfsv3_enabled = false + nfsv41_enabled = true unix_read_only = false unix_read_write = true root_access_enabled = false @@ -320,15 +320,15 @@ resource "azurerm_netapp_volume_group" "test" { volume_spec_name = "data" storage_quota_in_gb = 1024 throughput_in_mibps = 24 - protocols = ["NFSv3"] + protocols = ["NFSv4.1"] security_style = "Unix" snapshot_directory_visible = false export_policy_rule { rule_index = 1 allowed_clients = "0.0.0.0/0" - nfsv3_enabled = true - nfsv41_enabled = false + nfsv3_enabled = false + nfsv41_enabled = true unix_read_only = false unix_read_write = true root_access_enabled = false @@ -354,15 +354,15 @@ resource "azurerm_netapp_volume_group" "test" { volume_spec_name = "log" storage_quota_in_gb = 1024 throughput_in_mibps = 24 - protocols = ["NFSv3"] + protocols = ["NFSv4.1"] security_style = "Unix" snapshot_directory_visible = false export_policy_rule { rule_index = 1 allowed_clients = "0.0.0.0/0" - nfsv3_enabled = true - nfsv41_enabled = false + nfsv3_enabled = false + nfsv41_enabled = true unix_read_only = false unix_read_write = true root_access_enabled = false @@ -388,15 +388,15 @@ resource "azurerm_netapp_volume_group" "test" { volume_spec_name = "shared" storage_quota_in_gb = 1024 throughput_in_mibps = 24 - protocols = ["NFSv3"] + protocols = ["NFSv4.1"] security_style = "Unix" snapshot_directory_visible = false export_policy_rule { rule_index = 1 allowed_clients = "0.0.0.0/0" - nfsv3_enabled = true - nfsv41_enabled = false + nfsv3_enabled = false + nfsv41_enabled = true unix_read_only = false unix_read_write = true root_access_enabled = false @@ -422,15 +422,15 @@ resource "azurerm_netapp_volume_group" "test" { volume_spec_name = "data-backup" storage_quota_in_gb = 1024 throughput_in_mibps = 24 - protocols = ["NFSv3"] + protocols = ["NFSv4.1"] security_style = "Unix" snapshot_directory_visible = false export_policy_rule { rule_index = 1 allowed_clients = "0.0.0.0/0" - nfsv3_enabled = true - nfsv41_enabled = false + nfsv3_enabled = false + nfsv41_enabled = true unix_read_only = false unix_read_write = true root_access_enabled = false @@ -456,15 +456,15 @@ resource "azurerm_netapp_volume_group" "test" { volume_spec_name = "log-backup" storage_quota_in_gb = 1024 throughput_in_mibps = 24 - protocols = ["NFSv3"] + protocols = ["NFSv4.1"] security_style = "Unix" snapshot_directory_visible = false export_policy_rule { rule_index = 1 allowed_clients = "0.0.0.0/0" - nfsv3_enabled = true - nfsv41_enabled = false + nfsv3_enabled = false + nfsv41_enabled = true unix_read_only = false unix_read_write = true root_access_enabled = false From 6cd1b2a055085908ea6f59fe0b73ae0ea43a8355 Mon Sep 17 00:00:00 2001 From: Paulo Date: Tue, 21 Mar 2023 23:51:06 +0000 Subject: [PATCH 23/83] updating volume id --- internal/services/netapp/netapp_volume_group_resource.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/services/netapp/netapp_volume_group_resource.go b/internal/services/netapp/netapp_volume_group_resource.go index 1e29e7110519..5f8b2e1f3853 100644 --- a/internal/services/netapp/netapp_volume_group_resource.go +++ b/internal/services/netapp/netapp_volume_group_resource.go @@ -474,6 +474,8 @@ func (r NetAppVolumeGroupResource) Update() sdk.ResourceFunc { if metadata.ResourceData.HasChange(volumeItem) { + volumeId := metadata.ResourceData.Get(fmt.Sprintf("%v.id", volumeItem)) + update := volumes.VolumePatch{ Properties: &volumes.VolumePatchProperties{}, } @@ -518,7 +520,7 @@ func (r NetAppVolumeGroupResource) Update() sdk.ResourceFunc { } // Wait for volume to complete update - if err := waitForVolumeCreateOrUpdate(ctx, volumeClient, *id); err != nil { + if err := waitForVolumeCreateOrUpdate(ctx, volumeClient, *volumeId); err != nil { return err } From e271a9f6f3345ef356eb7103d3e489ee437dcf2e Mon Sep 17 00:00:00 2001 From: Paulo Date: Wed, 22 Mar 2023 00:34:50 +0000 Subject: [PATCH 24/83] Fixing volume group id --- .../services/netapp/netapp_volume_group_resource.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/services/netapp/netapp_volume_group_resource.go b/internal/services/netapp/netapp_volume_group_resource.go index 5f8b2e1f3853..c2b36298b628 100644 --- a/internal/services/netapp/netapp_volume_group_resource.go +++ b/internal/services/netapp/netapp_volume_group_resource.go @@ -451,7 +451,7 @@ func (r NetAppVolumeGroupResource) Update() sdk.ResourceFunc { Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { volumeClient := metadata.Client.NetApp.VolumeClient - id, err := volumes.ParseVolumeID(metadata.ResourceData.Id()) + id, err := volumegroups.ParseVolumeID(metadata.ResourceData.Id()) if err != nil { return err } @@ -474,7 +474,7 @@ func (r NetAppVolumeGroupResource) Update() sdk.ResourceFunc { if metadata.ResourceData.HasChange(volumeItem) { - volumeId := metadata.ResourceData.Get(fmt.Sprintf("%v.id", volumeItem)) + volumeId := volumes.NewVolumeID(id.SubscriptionId, id.ResourceGroupName, id.AccountName, id.PoolName, metadata.ResourceData.Get(fmt.Sprintf("%v.name", volumeItem)).(string)) update := volumes.VolumePatch{ Properties: &volumes.VolumePatchProperties{}, @@ -497,7 +497,7 @@ func (r NetAppVolumeGroupResource) Update() sdk.ResourceFunc { dataProtectionReplication := expandNetAppVolumeDataProtectionReplication(dataProtectionReplicationRaw) if dataProtectionReplication != nil && dataProtectionReplication.Replication != nil && dataProtectionReplication.Replication.EndpointType != nil && strings.ToLower(string(*dataProtectionReplication.Replication.EndpointType)) == "dst" { - return fmt.Errorf("snapshot policy cannot be enabled on a data protection volume, %s", id) + return fmt.Errorf("snapshot policy cannot be enabled on a data protection volume, %s", volumeId) } dataProtectionSnapshotPolicyRaw := metadata.ResourceData.Get(fmt.Sprintf("%v.data_protection_snapshot_policy", volumeItem)).([]interface{}) @@ -515,12 +515,12 @@ func (r NetAppVolumeGroupResource) Update() sdk.ResourceFunc { update.Tags = tags.Expand(tagsRaw) } - if err = volumeClient.UpdateThenPoll(ctx, *id, update); err != nil { - return fmt.Errorf("updating %s: %+v", id, err) + if err = volumeClient.UpdateThenPoll(ctx, volumeId, update); err != nil { + return fmt.Errorf("updating %s: %+v", volumeId, err) } // Wait for volume to complete update - if err := waitForVolumeCreateOrUpdate(ctx, volumeClient, *volumeId); err != nil { + if err := waitForVolumeCreateOrUpdate(ctx, volumeClient, volumeId); err != nil { return err } From dc892377095a5d66dd939d0e2ce0377743b60a52 Mon Sep 17 00:00:00 2001 From: Paulo Date: Wed, 22 Mar 2023 22:14:21 +0000 Subject: [PATCH 25/83] Changing expandNetAppVolumeGroupVolumeExportPolicyRulePatch for the new way --- .../services/netapp/netapp_volume_helper.go | 31 +++++-------------- 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/internal/services/netapp/netapp_volume_helper.go b/internal/services/netapp/netapp_volume_helper.go index c4edf7d0e438..418eeffcba25 100644 --- a/internal/services/netapp/netapp_volume_helper.go +++ b/internal/services/netapp/netapp_volume_helper.go @@ -343,11 +343,14 @@ func expandNetAppVolumeGroupVolumeExportPolicyRulePatch(input []interface{}) *vo for _, item := range input { if item != nil { v := item.(map[string]interface{}) - ruleIndex := int64(v["rule_index"].(int)) - allowedClients := strings.Join(*utils.ExpandStringSlice(v["allowed_clients"].(*pluginsdk.Set).List()), ",") - nfsv3Enabled := false - nfsv41Enabled := false + ruleIndex := int64(v["rule_index"].(int)) + allowedClients := v["allowed_clients"].(string) + nfsv3Enabled := v["nfsv3_enabled"].(bool) + nfsv41Enabled := v["nfsv41_enabled"].(bool) + unixReadOnly := v["unix_read_only"].(bool) + unixReadWrite := v["unix_read_write"].(bool) + rootAccessEnabled := v["root_access_enabled"].(bool) // Hard-Coded values, for AVG these cannot be set diffrently // they are not exposed as TF configuration @@ -360,26 +363,6 @@ func expandNetAppVolumeGroupVolumeExportPolicyRulePatch(input []interface{}) *vo kerberos5pReadOnly := false kerberos5pReadWrite := false - if vpe := v["protocols_enabled"]; vpe != nil { - protocolsEnabled := vpe.([]interface{}) - if len(protocolsEnabled) != 0 { - for _, protocol := range protocolsEnabled { - if protocol != nil { - switch strings.ToLower(protocol.(string)) { - case "nfsv3": - nfsv3Enabled = true - case "nfsv4.1": - nfsv41Enabled = true - } - } - } - } - } - - unixReadOnly := v["unix_read_only"].(bool) - unixReadWrite := v["unix_read_write"].(bool) - rootAccessEnabled := v["root_access_enabled"].(bool) - result := volumes.ExportPolicyRule{ AllowedClients: utils.String(allowedClients), Cifs: utils.Bool(cifsEnabled), From 4e2f11aa45bda93688406bf7fe107eaf48cd9974 Mon Sep 17 00:00:00 2001 From: Paulo Date: Thu, 23 Mar 2023 00:30:25 +0000 Subject: [PATCH 26/83] WIP: Changes needed due to ANF SDK 2022.05 --- .../netapp/netapp_volume_group_resource.go | 14 ++- .../netapp_volume_group_resource_test.go | 96 ++++++++++--------- 2 files changed, 61 insertions(+), 49 deletions(-) diff --git a/internal/services/netapp/netapp_volume_group_resource.go b/internal/services/netapp/netapp_volume_group_resource.go index c2b36298b628..75bc3bf030b0 100644 --- a/internal/services/netapp/netapp_volume_group_resource.go +++ b/internal/services/netapp/netapp_volume_group_resource.go @@ -171,7 +171,7 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { }, "protocols": { - Type: pluginsdk.TypeSet, + Type: pluginsdk.TypeList, ForceNew: true, Required: true, MaxItems: 1, @@ -205,7 +205,7 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { }, "export_policy_rule": { - Type: pluginsdk.TypeSet, + Type: pluginsdk.TypeList, Required: true, MaxItems: 5, Elem: &pluginsdk.Resource{ @@ -451,7 +451,7 @@ func (r NetAppVolumeGroupResource) Update() sdk.ResourceFunc { Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { volumeClient := metadata.Client.NetApp.VolumeClient - id, err := volumegroups.ParseVolumeID(metadata.ResourceData.Id()) + id, err := volumegroups.ParseVolumeGroupID(metadata.ResourceData.Id()) if err != nil { return err } @@ -471,10 +471,16 @@ func (r NetAppVolumeGroupResource) Update() sdk.ResourceFunc { // Checking if individual volume has a change volumeItem := fmt.Sprintf("volume.%v", i) + capacityPoolId := metadata.ResourceData.Get(fmt.Sprintf("%v.capacity_pool_id", volumeItem)).(string) + capacityPoolName := getResourceNameString(&capacityPoolId) if metadata.ResourceData.HasChange(volumeItem) { - volumeId := volumes.NewVolumeID(id.SubscriptionId, id.ResourceGroupName, id.AccountName, id.PoolName, metadata.ResourceData.Get(fmt.Sprintf("%v.name", volumeItem)).(string)) + volumeId := volumes.NewVolumeID(id.SubscriptionId, + id.ResourceGroupName, + id.AccountName, + capacityPoolName, + metadata.ResourceData.Get(fmt.Sprintf("%v.name", volumeItem)).(string)) update := volumes.VolumePatch{ Properties: &volumes.VolumePatchProperties{}, diff --git a/internal/services/netapp/netapp_volume_group_resource_test.go b/internal/services/netapp/netapp_volume_group_resource_test.go index 340c281f9642..48d65cd563ff 100644 --- a/internal/services/netapp/netapp_volume_group_resource_test.go +++ b/internal/services/netapp/netapp_volume_group_resource_test.go @@ -62,6 +62,12 @@ func TestAccNetAppVolumeGroup_volumeUpdates(t *testing.T) { Config: r.updateVolumes(data), Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("volume.0.storage_quota_in_gb").HasValue("1200"), + check.That(data.ResourceName).Key("volume.1.export_policy_rule.0.allowed_clients").HasValue("10.0.0.0/8"), + check.That(data.ResourceName).Key("volume.2.tags.CreatedOnDate").HasValue("2022-07-27T12:00:00Z"), + check.That(data.ResourceName).Key("volume.4.storage_quota_in_gb").HasValue("1200"), + check.That(data.ResourceName).Key("volume.4.export_policy_rule.0.allowed_clients").HasValue("192.168.0.0/24"), + check.That(data.ResourceName).Key("volume.4.tags.CreatedOnDate").HasValue("2022-07-28T11:00:00Z"), ), }, data.ImportStep(), @@ -513,15 +519,15 @@ resource "azurerm_netapp_volume_group" "test" { volume_spec_name = "data" storage_quota_in_gb = 1200 throughput_in_mibps = 24 - protocols = ["NFSv3"] + protocols = ["NFSv4.1"] security_style = "Unix" snapshot_directory_visible = false export_policy_rule { rule_index = 1 allowed_clients = "0.0.0.0/0" - nfsv3_enabled = true - nfsv41_enabled = false + nfsv3_enabled = false + nfsv41_enabled = true unix_read_only = false unix_read_write = true root_access_enabled = false @@ -543,15 +549,15 @@ resource "azurerm_netapp_volume_group" "test" { volume_spec_name = "log" storage_quota_in_gb = 1024 throughput_in_mibps = 24 - protocols = ["NFSv3"] + protocols = ["NFSv4.1"] security_style = "Unix" snapshot_directory_visible = false export_policy_rule { rule_index = 1 allowed_clients = "10.0.0.0/8" - nfsv3_enabled = true - nfsv41_enabled = false + nfsv3_enabled = false + nfsv41_enabled = true unix_read_only = false unix_read_write = true root_access_enabled = false @@ -573,15 +579,15 @@ resource "azurerm_netapp_volume_group" "test" { volume_spec_name = "shared" storage_quota_in_gb = 1024 throughput_in_mibps = 24 - protocols = ["NFSv3"] + protocols = ["NFSv4.1"] security_style = "Unix" snapshot_directory_visible = false export_policy_rule { rule_index = 1 allowed_clients = "0.0.0.0/0" - nfsv3_enabled = true - nfsv41_enabled = false + nfsv3_enabled = false + nfsv41_enabled = true unix_read_only = false unix_read_write = true root_access_enabled = false @@ -603,15 +609,15 @@ resource "azurerm_netapp_volume_group" "test" { volume_spec_name = "data-backup" storage_quota_in_gb = 1024 throughput_in_mibps = 24 - protocols = ["NFSv3"] + protocols = ["NFSv4.1"] security_style = "Unix" snapshot_directory_visible = false export_policy_rule { rule_index = 1 allowed_clients = "0.0.0.0/0" - nfsv3_enabled = true - nfsv41_enabled = false + nfsv3_enabled = false + nfsv41_enabled = true unix_read_only = false unix_read_write = true root_access_enabled = false @@ -633,15 +639,15 @@ resource "azurerm_netapp_volume_group" "test" { volume_spec_name = "log-backup" storage_quota_in_gb = 1200 throughput_in_mibps = 24 - protocols = ["NFSv3"] + protocols = ["NFSv4.1"] security_style = "Unix" snapshot_directory_visible = false export_policy_rule { rule_index = 1 allowed_clients = "192.168.0.0/24" - nfsv3_enabled = true - nfsv41_enabled = false + nfsv3_enabled = false + nfsv41_enabled = true unix_read_only = false unix_read_write = true root_access_enabled = false @@ -686,15 +692,15 @@ resource "azurerm_netapp_volume_group" "test_primary" { volume_spec_name = "data" storage_quota_in_gb = 1024 throughput_in_mibps = 24 - protocols = ["NFSv3"] + protocols = ["NFSv4.1"] security_style = "Unix" snapshot_directory_visible = false export_policy_rule { rule_index = 1 allowed_clients = "0.0.0.0/0" - nfsv3_enabled = true - nfsv41_enabled = false + nfsv3_enabled = false + nfsv41_enabled = true unix_read_only = false unix_read_write = true root_access_enabled = false @@ -716,15 +722,15 @@ resource "azurerm_netapp_volume_group" "test_primary" { volume_spec_name = "log" storage_quota_in_gb = 1024 throughput_in_mibps = 24 - protocols = ["NFSv3"] + protocols = ["NFSv4.1"] security_style = "Unix" snapshot_directory_visible = false export_policy_rule { rule_index = 1 allowed_clients = "0.0.0.0/0" - nfsv3_enabled = true - nfsv41_enabled = false + nfsv3_enabled = false + nfsv41_enabled = true unix_read_only = false unix_read_write = true root_access_enabled = false @@ -746,15 +752,15 @@ resource "azurerm_netapp_volume_group" "test_primary" { volume_spec_name = "shared" storage_quota_in_gb = 1024 throughput_in_mibps = 24 - protocols = ["NFSv3"] + protocols = ["NFSv4.1"] security_style = "Unix" snapshot_directory_visible = false export_policy_rule { rule_index = 1 allowed_clients = "0.0.0.0/0" - nfsv3_enabled = true - nfsv41_enabled = false + nfsv3_enabled = false + nfsv41_enabled = true unix_read_only = false unix_read_write = true root_access_enabled = false @@ -776,15 +782,15 @@ resource "azurerm_netapp_volume_group" "test_primary" { volume_spec_name = "data-backup" storage_quota_in_gb = 1024 throughput_in_mibps = 24 - protocols = ["NFSv3"] + protocols = ["NFSv4.1"] security_style = "Unix" snapshot_directory_visible = false export_policy_rule { rule_index = 1 allowed_clients = "0.0.0.0/0" - nfsv3_enabled = true - nfsv41_enabled = false + nfsv3_enabled = false + nfsv41_enabled = true unix_read_only = false unix_read_write = true root_access_enabled = false @@ -806,15 +812,15 @@ resource "azurerm_netapp_volume_group" "test_primary" { volume_spec_name = "log-backup" storage_quota_in_gb = 1024 throughput_in_mibps = 24 - protocols = ["NFSv3"] + protocols = ["NFSv4.1"] security_style = "Unix" snapshot_directory_visible = false export_policy_rule { rule_index = 1 allowed_clients = "0.0.0.0/0" - nfsv3_enabled = true - nfsv41_enabled = false + nfsv3_enabled = false + nfsv41_enabled = true unix_read_only = false unix_read_write = true root_access_enabled = false @@ -852,15 +858,15 @@ resource "azurerm_netapp_volume_group" "test_secondary" { volume_spec_name = "data" storage_quota_in_gb = 1024 throughput_in_mibps = 24 - protocols = ["NFSv3"] + protocols = ["NFSv4.1"] security_style = "Unix" snapshot_directory_visible = false export_policy_rule { rule_index = 1 allowed_clients = "0.0.0.0/0" - nfsv3_enabled = true - nfsv41_enabled = false + nfsv3_enabled = false + nfsv41_enabled = true unix_read_only = false unix_read_write = true root_access_enabled = false @@ -889,15 +895,15 @@ resource "azurerm_netapp_volume_group" "test_secondary" { volume_spec_name = "log" storage_quota_in_gb = 1024 throughput_in_mibps = 24 - protocols = ["NFSv3"] + protocols = ["NFSv4.1"] security_style = "Unix" snapshot_directory_visible = false export_policy_rule { rule_index = 1 allowed_clients = "0.0.0.0/0" - nfsv3_enabled = true - nfsv41_enabled = false + nfsv3_enabled = false + nfsv41_enabled = true unix_read_only = false unix_read_write = true root_access_enabled = false @@ -926,15 +932,15 @@ resource "azurerm_netapp_volume_group" "test_secondary" { volume_spec_name = "shared" storage_quota_in_gb = 1024 throughput_in_mibps = 24 - protocols = ["NFSv3"] + protocols = ["NFSv4.1"] security_style = "Unix" snapshot_directory_visible = false export_policy_rule { rule_index = 1 allowed_clients = "0.0.0.0/0" - nfsv3_enabled = true - nfsv41_enabled = false + nfsv3_enabled = false + nfsv41_enabled = true unix_read_only = false unix_read_write = true root_access_enabled = false @@ -963,15 +969,15 @@ resource "azurerm_netapp_volume_group" "test_secondary" { volume_spec_name = "data-backup" storage_quota_in_gb = 1024 throughput_in_mibps = 24 - protocols = ["NFSv3"] + protocols = ["NFSv4.1"] security_style = "Unix" snapshot_directory_visible = false export_policy_rule { rule_index = 1 allowed_clients = "0.0.0.0/0" - nfsv3_enabled = true - nfsv41_enabled = false + nfsv3_enabled = false + nfsv41_enabled = true unix_read_only = false unix_read_write = true root_access_enabled = false @@ -1000,15 +1006,15 @@ resource "azurerm_netapp_volume_group" "test_secondary" { volume_spec_name = "log-backup" storage_quota_in_gb = 1024 throughput_in_mibps = 24 - protocols = ["NFSv3"] + protocols = ["NFSv4.1"] security_style = "Unix" snapshot_directory_visible = false export_policy_rule { rule_index = 1 allowed_clients = "0.0.0.0/0" - nfsv3_enabled = true - nfsv41_enabled = false + nfsv3_enabled = false + nfsv41_enabled = true unix_read_only = false unix_read_write = true root_access_enabled = false From a2c02f74eb81d74abcddbd621440627f9eb52db5 Mon Sep 17 00:00:00 2001 From: Paulo Date: Fri, 24 Mar 2023 17:21:21 +0000 Subject: [PATCH 27/83] WIP: AVG changes for new SDK --- .../netapp/netapp_volume_group_resource.go | 12 +- .../netapp_volume_group_resource_test.go | 282 +----------------- .../services/netapp/netapp_volume_helper.go | 25 +- .../services/netapp/netapp_volume_resource.go | 16 - 4 files changed, 31 insertions(+), 304 deletions(-) diff --git a/internal/services/netapp/netapp_volume_group_resource.go b/internal/services/netapp/netapp_volume_group_resource.go index 75bc3bf030b0..8413b645befb 100644 --- a/internal/services/netapp/netapp_volume_group_resource.go +++ b/internal/services/netapp/netapp_volume_group_resource.go @@ -103,7 +103,7 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { "volume": { Type: pluginsdk.TypeList, Required: true, - MinItems: 5, + MinItems: 3, MaxItems: 5, Elem: &pluginsdk.Resource{ Schema: map[string]*pluginsdk.Schema{ @@ -370,7 +370,7 @@ func (r NetAppVolumeGroupResource) Create() sdk.ResourceFunc { for i, volumeCrr := range *volumeList { if volumeCrr.Properties.DataProtection != nil && volumeCrr.Properties.DataProtection.Replication != nil && - *volumeCrr.Properties.DataProtection.Replication.EndpointType == volumegroups.EndpointTypeDst { + strings.ToLower(string(*volumeCrr.Properties.DataProtection.Replication.EndpointType)) == string(volumegroups.EndpointTypeDst) { // Modify volumeType as data protection type on main volumeList // so it gets created correctly as data protection volume @@ -396,17 +396,11 @@ func (r NetAppVolumeGroupResource) Create() sdk.ResourceFunc { return fmt.Errorf("creating %s: %+v", id, err) } - // TODO: Check if this is necessary for volume groups - // // Waiting for volume be completely provisioned - // if err := waitForVolumeCreateOrUpdate(ctx, client, id); err != nil { - // return err - // } - // CRR - Authorizing secondaries from primary volumes for _, volumeCrr := range *volumeList { if volumeCrr.Properties.DataProtection != nil && volumeCrr.Properties.DataProtection.Replication != nil && - *volumeCrr.Properties.DataProtection.Replication.EndpointType == volumegroups.EndpointTypeDst { + strings.ToLower(string(*volumeCrr.Properties.DataProtection.Replication.EndpointType)) == string(volumegroups.EndpointTypeDst) { // Getting secondary volume resource id secondaryId := volumes.NewVolumeID(subscriptionId, diff --git a/internal/services/netapp/netapp_volume_group_resource_test.go b/internal/services/netapp/netapp_volume_group_resource_test.go index 48d65cd563ff..b70c7913b86d 100644 --- a/internal/services/netapp/netapp_volume_group_resource_test.go +++ b/internal/services/netapp/netapp_volume_group_resource_test.go @@ -65,9 +65,6 @@ func TestAccNetAppVolumeGroup_volumeUpdates(t *testing.T) { check.That(data.ResourceName).Key("volume.0.storage_quota_in_gb").HasValue("1200"), check.That(data.ResourceName).Key("volume.1.export_policy_rule.0.allowed_clients").HasValue("10.0.0.0/8"), check.That(data.ResourceName).Key("volume.2.tags.CreatedOnDate").HasValue("2022-07-27T12:00:00Z"), - check.That(data.ResourceName).Key("volume.4.storage_quota_in_gb").HasValue("1200"), - check.That(data.ResourceName).Key("volume.4.export_policy_rule.0.allowed_clients").HasValue("192.168.0.0/24"), - check.That(data.ResourceName).Key("volume.4.tags.CreatedOnDate").HasValue("2022-07-28T11:00:00Z"), ), }, data.ImportStep(), @@ -213,66 +210,6 @@ resource "azurerm_netapp_volume_group" "test" { } } - volume { - name = "acctest-NetAppVolume-4-%[2]d" - volume_path = "my-unique-file-path-4-%[2]d" - service_level = "Standard" - capacity_pool_id = azurerm_netapp_pool.test.id - subnet_id = azurerm_subnet.test.id - proximity_placement_group_id = azurerm_proximity_placement_group.test.id - volume_spec_name = "data-backup" - storage_quota_in_gb = 1024 - throughput_in_mibps = 24 - protocols = ["NFSv4.1"] - security_style = "Unix" - snapshot_directory_visible = false - - export_policy_rule { - rule_index = 1 - allowed_clients = "0.0.0.0/0" - nfsv3_enabled = false - nfsv41_enabled = true - unix_read_only = false - unix_read_write = true - root_access_enabled = false - } - - tags = { - "CreatedOnDate" = "2022-07-08T23:50:21Z", - "SkipASMAzSecPack" = "true" - } - } - - volume { - name = "acctest-NetAppVolume-5-%[2]d" - volume_path = "my-unique-file-path-5-%[2]d" - service_level = "Standard" - capacity_pool_id = azurerm_netapp_pool.test.id - subnet_id = azurerm_subnet.test.id - proximity_placement_group_id = azurerm_proximity_placement_group.test.id - volume_spec_name = "log-backup" - storage_quota_in_gb = 1024 - throughput_in_mibps = 24 - protocols = ["NFSv4.1"] - security_style = "Unix" - snapshot_directory_visible = false - - export_policy_rule { - rule_index = 1 - allowed_clients = "0.0.0.0/0" - nfsv3_enabled = false - nfsv41_enabled = true - unix_read_only = false - unix_read_write = true - root_access_enabled = false - } - - tags = { - "CreatedOnDate" = "2022-07-08T23:50:21Z", - "SkipASMAzSecPack" = "true" - } - } - depends_on = [ azurerm_linux_virtual_machine.test, azurerm_proximity_placement_group.test @@ -418,74 +355,6 @@ resource "azurerm_netapp_volume_group" "test" { } } - volume { - name = "acctest-NetAppVolume-4-%[2]d" - volume_path = "my-unique-file-path-4-%[2]d" - service_level = "Standard" - capacity_pool_id = azurerm_netapp_pool.test.id - subnet_id = azurerm_subnet.test.id - proximity_placement_group_id = azurerm_proximity_placement_group.test.id - volume_spec_name = "data-backup" - storage_quota_in_gb = 1024 - throughput_in_mibps = 24 - protocols = ["NFSv4.1"] - security_style = "Unix" - snapshot_directory_visible = false - - export_policy_rule { - rule_index = 1 - allowed_clients = "0.0.0.0/0" - nfsv3_enabled = false - nfsv41_enabled = true - unix_read_only = false - unix_read_write = true - root_access_enabled = false - } - - data_protection_snapshot_policy { - snapshot_policy_id = azurerm_netapp_snapshot_policy.test.id - } - - tags = { - "CreatedOnDate" = "2022-07-08T23:50:21Z", - "SkipASMAzSecPack" = "true" - } - } - - volume { - name = "acctest-NetAppVolume-5-%[2]d" - volume_path = "my-unique-file-path-5-%[2]d" - service_level = "Standard" - capacity_pool_id = azurerm_netapp_pool.test.id - subnet_id = azurerm_subnet.test.id - proximity_placement_group_id = azurerm_proximity_placement_group.test.id - volume_spec_name = "log-backup" - storage_quota_in_gb = 1024 - throughput_in_mibps = 24 - protocols = ["NFSv4.1"] - security_style = "Unix" - snapshot_directory_visible = false - - export_policy_rule { - rule_index = 1 - allowed_clients = "0.0.0.0/0" - nfsv3_enabled = false - nfsv41_enabled = true - unix_read_only = false - unix_read_write = true - root_access_enabled = false - } - - data_protection_snapshot_policy { - snapshot_policy_id = azurerm_netapp_snapshot_policy.test.id - } - - tags = { - "CreatedOnDate" = "2022-07-08T23:50:21Z", - "SkipASMAzSecPack" = "true" - } - } - depends_on = [ azurerm_linux_virtual_machine.test, azurerm_proximity_placement_group.test @@ -772,66 +641,6 @@ resource "azurerm_netapp_volume_group" "test_primary" { } } - volume { - name = "acctest-NetAppVolume-4-Primary-%[2]d" - volume_path = "my-unique-file-path-4-Primary-%[2]d" - service_level = "Standard" - capacity_pool_id = azurerm_netapp_pool.test.id - subnet_id = azurerm_subnet.test.id - proximity_placement_group_id = azurerm_proximity_placement_group.test.id - volume_spec_name = "data-backup" - storage_quota_in_gb = 1024 - throughput_in_mibps = 24 - protocols = ["NFSv4.1"] - security_style = "Unix" - snapshot_directory_visible = false - - export_policy_rule { - rule_index = 1 - allowed_clients = "0.0.0.0/0" - nfsv3_enabled = false - nfsv41_enabled = true - unix_read_only = false - unix_read_write = true - root_access_enabled = false - } - - tags = { - "CreatedOnDate" = "2022-07-08T23:50:21Z", - "SkipASMAzSecPack" = "true" - } - } - - volume { - name = "acctest-NetAppVolume-5-Primary-%[2]d" - volume_path = "my-unique-file-path-5-Primary-%[2]d" - service_level = "Standard" - capacity_pool_id = azurerm_netapp_pool.test.id - subnet_id = azurerm_subnet.test.id - proximity_placement_group_id = azurerm_proximity_placement_group.test.id - volume_spec_name = "log-backup" - storage_quota_in_gb = 1024 - throughput_in_mibps = 24 - protocols = ["NFSv4.1"] - security_style = "Unix" - snapshot_directory_visible = false - - export_policy_rule { - rule_index = 1 - allowed_clients = "0.0.0.0/0" - nfsv3_enabled = false - nfsv41_enabled = true - unix_read_only = false - unix_read_write = true - root_access_enabled = false - } - - tags = { - "CreatedOnDate" = "2022-07-08T23:50:21Z", - "SkipASMAzSecPack" = "true" - } - } - depends_on = [ azurerm_linux_virtual_machine.test, azurerm_proximity_placement_group.test @@ -840,7 +649,7 @@ resource "azurerm_netapp_volume_group" "test_primary" { resource "azurerm_netapp_volume_group" "test_secondary" { name = "acctest-NetAppVolumeGroup-Secondary-%[2]d" - location = %[3]s + location = "%[3]s" resource_group_name = azurerm_resource_group.test.name account_name = azurerm_netapp_account.test_secondary.name group_description = "Test volume group" @@ -908,13 +717,6 @@ resource "azurerm_netapp_volume_group" "test_secondary" { unix_read_write = true root_access_enabled = false } - - data_protection_replication { - endpoint_type = "dst" - remote_volume_location = azurerm_resource_group.test.location - remote_volume_resource_id = azurerm_netapp_volume_group.test_primary.volume[1].id - replication_frequency = "10minutes" - } tags = { "CreatedOnDate" = "2022-07-08T23:50:21Z", @@ -959,80 +761,6 @@ resource "azurerm_netapp_volume_group" "test_secondary" { } } - volume { - name = "acctest-NetAppVolume-4-Secondary-%[2]d" - volume_path = "my-unique-file-path-4-Secondary-%[2]d" - service_level = "Standard" - capacity_pool_id = azurerm_netapp_pool.test_secondary.id - subnet_id = azurerm_subnet.test_secondary.id - proximity_placement_group_id = azurerm_proximity_placement_group.test_secondary.id - volume_spec_name = "data-backup" - storage_quota_in_gb = 1024 - throughput_in_mibps = 24 - protocols = ["NFSv4.1"] - security_style = "Unix" - snapshot_directory_visible = false - - export_policy_rule { - rule_index = 1 - allowed_clients = "0.0.0.0/0" - nfsv3_enabled = false - nfsv41_enabled = true - unix_read_only = false - unix_read_write = true - root_access_enabled = false - } - - data_protection_replication { - endpoint_type = "dst" - remote_volume_location = azurerm_resource_group.test.location - remote_volume_resource_id = azurerm_netapp_volume_group.test_primary.volume[3].id - replication_frequency = "10minutes" - } - - tags = { - "CreatedOnDate" = "2022-07-08T23:50:21Z", - "SkipASMAzSecPack" = "true" - } - } - - volume { - name = "acctest-NetAppVolume-5-Secondary-%[2]d" - volume_path = "my-unique-file-path-5-Secondary-%[2]d" - service_level = "Standard" - capacity_pool_id = azurerm_netapp_pool.test_secondary.id - subnet_id = azurerm_subnet.test_secondary.id - proximity_placement_group_id = azurerm_proximity_placement_group.test_secondary.id - volume_spec_name = "log-backup" - storage_quota_in_gb = 1024 - throughput_in_mibps = 24 - protocols = ["NFSv4.1"] - security_style = "Unix" - snapshot_directory_visible = false - - export_policy_rule { - rule_index = 1 - allowed_clients = "0.0.0.0/0" - nfsv3_enabled = false - nfsv41_enabled = true - unix_read_only = false - unix_read_write = true - root_access_enabled = false - } - - data_protection_replication { - endpoint_type = "dst" - remote_volume_location = azurerm_resource_group.test.location - remote_volume_resource_id = azurerm_netapp_volume_group.test_primary.volume[4].id - replication_frequency = "10minutes" - } - - tags = { - "CreatedOnDate" = "2022-07-08T23:50:21Z", - "SkipASMAzSecPack" = "true" - } - } - depends_on = [ azurerm_linux_virtual_machine.test_secondary, azurerm_proximity_placement_group.test_secondary, @@ -1040,7 +768,7 @@ resource "azurerm_netapp_volume_group" "test_secondary" { ] } -`, template, data.RandomInteger, "eastus2") +`, template, data.RandomInteger, "eastus") } func (r NetAppVolumeGroupResource) templateForAvgCrossRegionReplication(data acceptance.TestData) string { @@ -1096,7 +824,7 @@ resource "azurerm_subnet" "test1_secondary" { resource "azurerm_subnet_network_security_group_association" "test_secondary" { subnet_id = azurerm_subnet.test1_secondary.id - network_security_group_id = azurerm_network_security_group.test.id + network_security_group_id = azurerm_network_security_group.test_secondary.id } resource "azurerm_proximity_placement_group" "test_secondary" { @@ -1204,7 +932,7 @@ resource "azurerm_netapp_pool" "test_secondary" { "SkipASMAzSecPack" = "true" } } -`, template, data.RandomInteger, "eastus2") +`, template, data.RandomInteger, "eastus") } func (NetAppVolumeGroupResource) templatePPG(data acceptance.TestData) string { @@ -1390,5 +1118,5 @@ resource "azurerm_netapp_pool" "test" { "SkipASMAzSecPack" = "true" } } -`, data.RandomInteger, "westus2") +`, data.RandomInteger, "westus") } diff --git a/internal/services/netapp/netapp_volume_helper.go b/internal/services/netapp/netapp_volume_helper.go index 418eeffcba25..03bfd9340a22 100644 --- a/internal/services/netapp/netapp_volume_helper.go +++ b/internal/services/netapp/netapp_volume_helper.go @@ -316,12 +316,17 @@ func flattenNetAppVolumeGroupVolumesDPReplication(input *volumes.ReplicationObje return []DataProtectionReplication{} } + replicationFrequency := "" + if input.ReplicationSchedule != nil { + replicationFrequency = translateSDKSchedule(strings.ToLower(string(*input.ReplicationSchedule))) + } + return []DataProtectionReplication{ { - EndpointType: string(*input.EndpointType), + EndpointType: strings.ToLower(string(*input.EndpointType)), RemoteVolumeLocation: *input.RemoteVolumeRegion, RemoteVolumeResourceId: input.RemoteVolumeResourceId, - ReplicationFrequency: string(*input.ReplicationSchedule), + ReplicationFrequency: replicationFrequency, }, } } @@ -715,3 +720,19 @@ func waitForReplAuthorization(ctx context.Context, client *volumesreplication.Vo return nil } + +func translateTFSchedule(scheduleName string) string { + if strings.EqualFold(scheduleName, "10minutes") { + return "_10minutely" + } + + return scheduleName +} + +func translateSDKSchedule(scheduleName string) string { + if strings.EqualFold(scheduleName, "_10minutely") { + return "10minutes" + } + + return scheduleName +} diff --git a/internal/services/netapp/netapp_volume_resource.go b/internal/services/netapp/netapp_volume_resource.go index 519be4f978e1..fe877d39e82d 100644 --- a/internal/services/netapp/netapp_volume_resource.go +++ b/internal/services/netapp/netapp_volume_resource.go @@ -911,19 +911,3 @@ func flattenNetAppVolumeDataProtectionSnapshotPolicy(input *volumes.VolumeProper }, } } - -func translateTFSchedule(scheduleName string) string { - if strings.EqualFold(scheduleName, "10minutes") { - return "_10minutely" - } - - return scheduleName -} - -func translateSDKSchedule(scheduleName string) string { - if strings.EqualFold(scheduleName, "_10minutely") { - return "10minutes" - } - - return scheduleName -} From 956e139b1b5e2f74c9dea239aa578164a3186537 Mon Sep 17 00:00:00 2001 From: Paulo Date: Fri, 24 Mar 2023 22:05:59 +0000 Subject: [PATCH 28/83] Removing deploymentSpecId from schema --- .../netapp/netapp_volume_group_resource.go | 19 ++++++------------- .../netapp_volume_group_resource_test.go | 5 ----- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/internal/services/netapp/netapp_volume_group_resource.go b/internal/services/netapp/netapp_volume_group_resource.go index 8413b645befb..6824d882d5c2 100644 --- a/internal/services/netapp/netapp_volume_group_resource.go +++ b/internal/services/netapp/netapp_volume_group_resource.go @@ -32,7 +32,6 @@ type NetAppVolumeGroupModel struct { GroupDescription string `tfschema:"group_description"` ApplicationType string `tfschema:"application_type"` ApplicationIdentifier string `tfschema:"application_identifier"` - DeploymentSpecId string `tfschema:"deployment_spec_id"` Volumes []NetAppVolumeGroupVolume `tfschema:"volume"` } @@ -91,19 +90,10 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { ValidateFunc: validation.StringLenBetween(1, 3), }, - "deployment_spec_id": { - Type: pluginsdk.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validation.StringInSlice([]string{ - "20542149-bfca-5618-1879-9863dc6767f1", // SAP HANA Deployment Spec ID - }, false), - }, - "volume": { Type: pluginsdk.TypeList, Required: true, - MinItems: 3, + MinItems: 3, // TODO: make this value 2 in a upcoming major release of AVG MaxItems: 5, Elem: &pluginsdk.Resource{ Schema: map[string]*pluginsdk.Schema{ @@ -378,6 +368,10 @@ func (r NetAppVolumeGroupResource) Create() sdk.ResourceFunc { } } + // TODO: This is a temporary workaround until the API is fixed and DeploymentSpecId is not required anymore, + // it will be handled internally by the RP + deploymentSpecId := "20542149-bfca-5618-1879-9863dc6767f1" + parameters := volumegroups.VolumeGroupDetails{ Location: utils.String(location.Normalize(model.Location)), Properties: &volumegroups.VolumeGroupProperties{ @@ -385,7 +379,7 @@ func (r NetAppVolumeGroupResource) Create() sdk.ResourceFunc { GroupDescription: utils.String(model.GroupDescription), ApplicationType: &applicationType, ApplicationIdentifier: utils.String(model.ApplicationIdentifier), - DeploymentSpecId: utils.String(model.DeploymentSpecId), + DeploymentSpecId: utils.String(deploymentSpecId), }, Volumes: volumeList, }, @@ -570,7 +564,6 @@ func (r NetAppVolumeGroupResource) Read() sdk.ResourceFunc { model.GroupDescription = utils.NormalizeNilableString(props.GroupMetaData.GroupDescription) model.ApplicationIdentifier = utils.NormalizeNilableString(props.GroupMetaData.ApplicationIdentifier) model.ApplicationType = string(*props.GroupMetaData.ApplicationType) - model.DeploymentSpecId = utils.NormalizeNilableString(props.GroupMetaData.DeploymentSpecId) volumes, err := flattenNetAppVolumeGroupVolumes(ctx, props.Volumes, metadata) if err != nil { diff --git a/internal/services/netapp/netapp_volume_group_resource_test.go b/internal/services/netapp/netapp_volume_group_resource_test.go index b70c7913b86d..fe505ea0d3fd 100644 --- a/internal/services/netapp/netapp_volume_group_resource_test.go +++ b/internal/services/netapp/netapp_volume_group_resource_test.go @@ -118,7 +118,6 @@ resource "azurerm_netapp_volume_group" "test" { group_description = "Test volume group" application_type = "SAP-HANA" application_identifier = "TST" - deployment_spec_id = "20542149-bfca-5618-1879-9863dc6767f1" volume { name = "acctest-NetAppVolume-1-%[2]d" @@ -251,7 +250,6 @@ resource "azurerm_netapp_volume_group" "test" { group_description = "Test volume group" application_type = "SAP-HANA" application_identifier = "TST" - deployment_spec_id = "20542149-bfca-5618-1879-9863dc6767f1" volume { name = "acctest-NetAppVolume-1-%[2]d" @@ -376,7 +374,6 @@ resource "azurerm_netapp_volume_group" "test" { group_description = "Test volume group" application_type = "SAP-HANA" application_identifier = "TST" - deployment_spec_id = "20542149-bfca-5618-1879-9863dc6767f1" volume { name = "acctest-NetAppVolume-1-%[2]d" @@ -549,7 +546,6 @@ resource "azurerm_netapp_volume_group" "test_primary" { group_description = "Test volume group" application_type = "SAP-HANA" application_identifier = "TST" - deployment_spec_id = "20542149-bfca-5618-1879-9863dc6767f1" volume { name = "acctest-NetAppVolume-1-Primary-%[2]d" @@ -655,7 +651,6 @@ resource "azurerm_netapp_volume_group" "test_secondary" { group_description = "Test volume group" application_type = "SAP-HANA" application_identifier = "TST" - deployment_spec_id = "20542149-bfca-5618-1879-9863dc6767f1" volume { name = "acctest-NetAppVolume-1-Secondary-%[2]d" From c19bcb758cc79b80fdcaa1a19ac70826c2625781 Mon Sep 17 00:00:00 2001 From: Paulo Date: Fri, 24 Mar 2023 22:34:34 +0000 Subject: [PATCH 29/83] Modifying minimal size --- internal/services/netapp/netapp_volume_group_resource.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/services/netapp/netapp_volume_group_resource.go b/internal/services/netapp/netapp_volume_group_resource.go index 6824d882d5c2..e535ecafb042 100644 --- a/internal/services/netapp/netapp_volume_group_resource.go +++ b/internal/services/netapp/netapp_volume_group_resource.go @@ -93,8 +93,8 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { "volume": { Type: pluginsdk.TypeList, Required: true, - MinItems: 3, // TODO: make this value 2 in a upcoming major release of AVG - MaxItems: 5, + MinItems: 2, + MaxItems: 5, // TODO: make this value 12 in a upcoming major release of AVG Elem: &pluginsdk.Resource{ Schema: map[string]*pluginsdk.Schema{ "id": { From e33d78d39a615ddd91952f4e8f7f766bb9a957ae Mon Sep 17 00:00:00 2001 From: Paulo Date: Tue, 28 Mar 2023 15:21:14 +0000 Subject: [PATCH 30/83] making similar purpose function closer --- .../services/netapp/netapp_volume_helper.go | 234 +++++++++--------- 1 file changed, 118 insertions(+), 116 deletions(-) diff --git a/internal/services/netapp/netapp_volume_helper.go b/internal/services/netapp/netapp_volume_helper.go index 03bfd9340a22..8e7760ee716c 100644 --- a/internal/services/netapp/netapp_volume_helper.go +++ b/internal/services/netapp/netapp_volume_helper.go @@ -200,6 +200,124 @@ func expandNetAppVolumeGroupVolumes(input []NetAppVolumeGroupVolume, id volumegr return &results, nil } + +func expandNetAppVolumeGroupVolumeExportPolicyRulePatch(input []interface{}) *volumes.VolumePatchPropertiesExportPolicy { + results := make([]volumes.ExportPolicyRule, 0) + for _, item := range input { + if item != nil { + v := item.(map[string]interface{}) + + ruleIndex := int64(v["rule_index"].(int)) + allowedClients := v["allowed_clients"].(string) + nfsv3Enabled := v["nfsv3_enabled"].(bool) + nfsv41Enabled := v["nfsv41_enabled"].(bool) + unixReadOnly := v["unix_read_only"].(bool) + unixReadWrite := v["unix_read_write"].(bool) + rootAccessEnabled := v["root_access_enabled"].(bool) + + // Hard-Coded values, for AVG these cannot be set diffrently + // they are not exposed as TF configuration + // but PUT request requires those fields to succeed + cifsEnabled := false + kerberos5ReadOnly := false + kerberos5ReadWrite := false + kerberos5iReadOnly := false + kerberos5iReadWrite := false + kerberos5pReadOnly := false + kerberos5pReadWrite := false + + result := volumes.ExportPolicyRule{ + AllowedClients: utils.String(allowedClients), + Cifs: utils.Bool(cifsEnabled), + Nfsv3: utils.Bool(nfsv3Enabled), + Nfsv41: utils.Bool(nfsv41Enabled), + RuleIndex: utils.Int64(ruleIndex), + UnixReadOnly: utils.Bool(unixReadOnly), + UnixReadWrite: utils.Bool(unixReadWrite), + HasRootAccess: utils.Bool(rootAccessEnabled), + Kerberos5ReadOnly: utils.Bool(kerberos5ReadOnly), + Kerberos5ReadWrite: utils.Bool(kerberos5ReadWrite), + Kerberos5iReadOnly: utils.Bool(kerberos5iReadOnly), + Kerberos5iReadWrite: utils.Bool(kerberos5iReadWrite), + Kerberos5pReadOnly: utils.Bool(kerberos5pReadOnly), + Kerberos5pReadWrite: utils.Bool(kerberos5pReadWrite), + } + + results = append(results, result) + } + } + + return &volumes.VolumePatchPropertiesExportPolicy{ + Rules: &results, + } +} + +func expandNetAppVolumeDataProtectionReplication(input []interface{}) *volumes.VolumePropertiesDataProtection { + if len(input) == 0 || input[0] == nil { + return &volumes.VolumePropertiesDataProtection{} + } + + replicationObject := volumes.ReplicationObject{} + + replicationRaw := input[0].(map[string]interface{}) + + if v, ok := replicationRaw["endpoint_type"]; ok { + endpointType := volumes.EndpointType(v.(string)) + replicationObject.EndpointType = &endpointType + } + if v, ok := replicationRaw["remote_volume_location"]; ok { + replicationObject.RemoteVolumeRegion = utils.String(v.(string)) + } + if v, ok := replicationRaw["remote_volume_resource_id"]; ok { + replicationObject.RemoteVolumeResourceId = v.(string) + } + if v, ok := replicationRaw["replication_frequency"]; ok { + replicationSchedule := volumes.ReplicationSchedule(translateTFSchedule(v.(string))) + replicationObject.ReplicationSchedule = &replicationSchedule + } + + return &volumes.VolumePropertiesDataProtection{ + Replication: &replicationObject, + } +} + +func expandNetAppVolumeDataProtectionSnapshotPolicy(input []interface{}) *volumes.VolumePropertiesDataProtection { + if len(input) == 0 || input[0] == nil { + return &volumes.VolumePropertiesDataProtection{} + } + + snapshotObject := volumes.VolumeSnapshotProperties{} + + snapshotRaw := input[0].(map[string]interface{}) + + if v, ok := snapshotRaw["snapshot_policy_id"]; ok { + snapshotObject.SnapshotPolicyId = utils.String(v.(string)) + } + + return &volumes.VolumePropertiesDataProtection{ + Snapshot: &snapshotObject, + } +} + +func expandNetAppVolumeDataProtectionSnapshotPolicyPatch(input []interface{}) *volumes.VolumePatchPropertiesDataProtection { + if len(input) == 0 || input[0] == nil { + return &volumes.VolumePatchPropertiesDataProtection{} + } + + snapshotObject := volumes.VolumeSnapshotProperties{} + + snapshotRaw := input[0].(map[string]interface{}) + + if v, ok := snapshotRaw["snapshot_policy_id"]; ok { + snapshotObject.SnapshotPolicyId = utils.String(v.(string)) + } + + return &volumes.VolumePatchPropertiesDataProtection{ + Snapshot: &snapshotObject, + } +} + + func flattenNetAppVolumeGroupVolumes(ctx context.Context, input *[]volumegroups.VolumeGroupVolumeProperties, metadata sdk.ResourceMetaData) ([]NetAppVolumeGroupVolume, error) { results := make([]NetAppVolumeGroupVolume, 0) @@ -343,122 +461,6 @@ func flattenNetAppVolumeGroupVolumesDPSnapshotPolicy(input *volumes.VolumeSnapsh } } -func expandNetAppVolumeGroupVolumeExportPolicyRulePatch(input []interface{}) *volumes.VolumePatchPropertiesExportPolicy { - results := make([]volumes.ExportPolicyRule, 0) - for _, item := range input { - if item != nil { - v := item.(map[string]interface{}) - - ruleIndex := int64(v["rule_index"].(int)) - allowedClients := v["allowed_clients"].(string) - nfsv3Enabled := v["nfsv3_enabled"].(bool) - nfsv41Enabled := v["nfsv41_enabled"].(bool) - unixReadOnly := v["unix_read_only"].(bool) - unixReadWrite := v["unix_read_write"].(bool) - rootAccessEnabled := v["root_access_enabled"].(bool) - - // Hard-Coded values, for AVG these cannot be set diffrently - // they are not exposed as TF configuration - // but PUT request requires those fields to succeed - cifsEnabled := false - kerberos5ReadOnly := false - kerberos5ReadWrite := false - kerberos5iReadOnly := false - kerberos5iReadWrite := false - kerberos5pReadOnly := false - kerberos5pReadWrite := false - - result := volumes.ExportPolicyRule{ - AllowedClients: utils.String(allowedClients), - Cifs: utils.Bool(cifsEnabled), - Nfsv3: utils.Bool(nfsv3Enabled), - Nfsv41: utils.Bool(nfsv41Enabled), - RuleIndex: utils.Int64(ruleIndex), - UnixReadOnly: utils.Bool(unixReadOnly), - UnixReadWrite: utils.Bool(unixReadWrite), - HasRootAccess: utils.Bool(rootAccessEnabled), - Kerberos5ReadOnly: utils.Bool(kerberos5ReadOnly), - Kerberos5ReadWrite: utils.Bool(kerberos5ReadWrite), - Kerberos5iReadOnly: utils.Bool(kerberos5iReadOnly), - Kerberos5iReadWrite: utils.Bool(kerberos5iReadWrite), - Kerberos5pReadOnly: utils.Bool(kerberos5pReadOnly), - Kerberos5pReadWrite: utils.Bool(kerberos5pReadWrite), - } - - results = append(results, result) - } - } - - return &volumes.VolumePatchPropertiesExportPolicy{ - Rules: &results, - } -} - -func expandNetAppVolumeDataProtectionReplication(input []interface{}) *volumes.VolumePropertiesDataProtection { - if len(input) == 0 || input[0] == nil { - return &volumes.VolumePropertiesDataProtection{} - } - - replicationObject := volumes.ReplicationObject{} - - replicationRaw := input[0].(map[string]interface{}) - - if v, ok := replicationRaw["endpoint_type"]; ok { - endpointType := volumes.EndpointType(v.(string)) - replicationObject.EndpointType = &endpointType - } - if v, ok := replicationRaw["remote_volume_location"]; ok { - replicationObject.RemoteVolumeRegion = utils.String(v.(string)) - } - if v, ok := replicationRaw["remote_volume_resource_id"]; ok { - replicationObject.RemoteVolumeResourceId = v.(string) - } - if v, ok := replicationRaw["replication_frequency"]; ok { - replicationSchedule := volumes.ReplicationSchedule(translateTFSchedule(v.(string))) - replicationObject.ReplicationSchedule = &replicationSchedule - } - - return &volumes.VolumePropertiesDataProtection{ - Replication: &replicationObject, - } -} - -func expandNetAppVolumeDataProtectionSnapshotPolicy(input []interface{}) *volumes.VolumePropertiesDataProtection { - if len(input) == 0 || input[0] == nil { - return &volumes.VolumePropertiesDataProtection{} - } - - snapshotObject := volumes.VolumeSnapshotProperties{} - - snapshotRaw := input[0].(map[string]interface{}) - - if v, ok := snapshotRaw["snapshot_policy_id"]; ok { - snapshotObject.SnapshotPolicyId = utils.String(v.(string)) - } - - return &volumes.VolumePropertiesDataProtection{ - Snapshot: &snapshotObject, - } -} - -func expandNetAppVolumeDataProtectionSnapshotPolicyPatch(input []interface{}) *volumes.VolumePatchPropertiesDataProtection { - if len(input) == 0 || input[0] == nil { - return &volumes.VolumePatchPropertiesDataProtection{} - } - - snapshotObject := volumes.VolumeSnapshotProperties{} - - snapshotRaw := input[0].(map[string]interface{}) - - if v, ok := snapshotRaw["snapshot_policy_id"]; ok { - snapshotObject.SnapshotPolicyId = utils.String(v.(string)) - } - - return &volumes.VolumePatchPropertiesDataProtection{ - Snapshot: &snapshotObject, - } -} - func getResourceNameString(input *string) string { segments := len(strings.Split(*input, "/")) if segments == 0 { From 9597304db788e2e396953d3da360717163c37ed6 Mon Sep 17 00:00:00 2001 From: Paulo Date: Wed, 29 Mar 2023 23:11:53 +0000 Subject: [PATCH 31/83] Removing hardcoded strings --- .../netapp/netapp_volume_group_resource.go | 49 ++--- .../services/netapp/netapp_volume_helper.go | 190 ++++++++++++++++-- 2 files changed, 199 insertions(+), 40 deletions(-) diff --git a/internal/services/netapp/netapp_volume_group_resource.go b/internal/services/netapp/netapp_volume_group_resource.go index e535ecafb042..4e91337ef6e4 100644 --- a/internal/services/netapp/netapp_volume_group_resource.go +++ b/internal/services/netapp/netapp_volume_group_resource.go @@ -94,7 +94,7 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { Type: pluginsdk.TypeList, Required: true, MinItems: 2, - MaxItems: 5, // TODO: make this value 12 in a upcoming major release of AVG + MaxItems: 5, Elem: &pluginsdk.Resource{ Schema: map[string]*pluginsdk.Schema{ "id": { @@ -126,13 +126,7 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { "volume_spec_name": { Type: pluginsdk.TypeString, Required: true, - ValidateFunc: validation.StringInSlice([]string{ - "data", - "data-backup", - "log", - "log-backup", - "shared", - }, false), + ValidateFunc: validation.StringInSlice(PossibleValuesForVolumeSpecName(), false), }, "volume_path": { @@ -167,9 +161,7 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { MaxItems: 1, Elem: &pluginsdk.Schema{ Type: pluginsdk.TypeString, - ValidateFunc: validation.StringInSlice([]string{ - "NFSv4.1", - }, false), + ValidateFunc: validation.StringInSlice(PossibleValuesForProtocolTypeAvg(), false), }, }, @@ -177,10 +169,7 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { Type: pluginsdk.TypeString, Required: true, ForceNew: true, - ValidateFunc: validation.StringInSlice([]string{ - "Unix", // Using hardcoded values instead of SDK enum since no matter what case is passed, - "Ntfs", // ANF changes casing to Pascal case in the backend. Please refer to https://github.com/Azure/azure-sdk-for-go/issues/14684 - }, false), + ValidateFunc: validation.StringInSlice(PossibleValuesForSecurityStyle(), false), }, "storage_quota_in_gb": { @@ -197,6 +186,7 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { "export_policy_rule": { Type: pluginsdk.TypeList, Required: true, + MinItems: 1, MaxItems: 5, Elem: &pluginsdk.Resource{ Schema: map[string]*pluginsdk.Schema{ @@ -265,10 +255,8 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { "endpoint_type": { Type: pluginsdk.TypeString, Optional: true, - Default: "dst", - ValidateFunc: validation.StringInSlice([]string{ - "dst", - }, false), + Default: string(volumegroups.EndpointTypeDst), + ValidateFunc: validation.StringInSlice(volumegroups.PossibleValuesForEndpointType(), false), }, "remote_volume_location": azure.SchemaLocation(), @@ -282,11 +270,7 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { "replication_frequency": { Type: pluginsdk.TypeString, Required: true, - ValidateFunc: validation.StringInSlice([]string{ - "10minutes", - "daily", - "hourly", - }, false), + ValidateFunc: validation.StringInSlice(PossibleValuesForReplicationSchedule(), false), }, }, }, @@ -356,11 +340,16 @@ func (r NetAppVolumeGroupResource) Create() sdk.ResourceFunc { return err } + // Performing some basic validations that are not possible in the schema + if errorList := validateNetAppVolumeGroupVolumes(volumeList, applicationType); len(errorList) > 0 { + return fmt.Errorf("one or more issues found while performing deeper validations for %s:\n%+v", id, errorList) + } + // Parse volume list to set secondary volumes for CRR for i, volumeCrr := range *volumeList { if volumeCrr.Properties.DataProtection != nil && volumeCrr.Properties.DataProtection.Replication != nil && - strings.ToLower(string(*volumeCrr.Properties.DataProtection.Replication.EndpointType)) == string(volumegroups.EndpointTypeDst) { + strings.EqualFold(string(*volumeCrr.Properties.DataProtection.Replication.EndpointType), string(volumegroups.EndpointTypeDst)) { // Modify volumeType as data protection type on main volumeList // so it gets created correctly as data protection volume @@ -368,7 +357,7 @@ func (r NetAppVolumeGroupResource) Create() sdk.ResourceFunc { } } - // TODO: This is a temporary workaround until the API is fixed and DeploymentSpecId is not required anymore, + // TODO: This is a temporary workaround until the backend is updated and DeploymentSpecId is not required anymore, // it will be handled internally by the RP deploymentSpecId := "20542149-bfca-5618-1879-9863dc6767f1" @@ -394,7 +383,7 @@ func (r NetAppVolumeGroupResource) Create() sdk.ResourceFunc { for _, volumeCrr := range *volumeList { if volumeCrr.Properties.DataProtection != nil && volumeCrr.Properties.DataProtection.Replication != nil && - strings.ToLower(string(*volumeCrr.Properties.DataProtection.Replication.EndpointType)) == string(volumegroups.EndpointTypeDst) { + strings.EqualFold(string(*volumeCrr.Properties.DataProtection.Replication.EndpointType), string(volumegroups.EndpointTypeDst)) { // Getting secondary volume resource id secondaryId := volumes.NewVolumeID(subscriptionId, @@ -490,7 +479,11 @@ func (r NetAppVolumeGroupResource) Update() sdk.ResourceFunc { dataProtectionReplicationRaw := metadata.ResourceData.Get(fmt.Sprintf("%v.data_protection_replication", volumeItem)).([]interface{}) dataProtectionReplication := expandNetAppVolumeDataProtectionReplication(dataProtectionReplicationRaw) - if dataProtectionReplication != nil && dataProtectionReplication.Replication != nil && dataProtectionReplication.Replication.EndpointType != nil && strings.ToLower(string(*dataProtectionReplication.Replication.EndpointType)) == "dst" { + if dataProtectionReplication != nil && + dataProtectionReplication.Replication != nil && + dataProtectionReplication.Replication.EndpointType != nil && + strings.EqualFold(string(*dataProtectionReplication.Replication.EndpointType), string(volumegroups.EndpointTypeDst)) { + return fmt.Errorf("snapshot policy cannot be enabled on a data protection volume, %s", volumeId) } diff --git a/internal/services/netapp/netapp_volume_helper.go b/internal/services/netapp/netapp_volume_helper.go index 8e7760ee716c..4984b434e7e8 100644 --- a/internal/services/netapp/netapp_volume_helper.go +++ b/internal/services/netapp/netapp_volume_helper.go @@ -59,6 +59,86 @@ type DataProtectionSnapshotPolicy struct { DataProtectionSnapshotPolicy string `tfschema:"snapshot_policy_id"` } +type VolumeSpecName string + +const ( + VolumeSpecNameData VolumeSpecName = "data" + VolumeSpecNameLog VolumeSpecName = "log" + VolumeSpecNameShared VolumeSpecName = "shared" + VolumeSpecNameDataBackup VolumeSpecName = "data-Backup" + VolumeSpecNameLogBackup VolumeSpecName = "log-Backup" +) + +func PossibleValuesForVolumeSpecName() []string { + return []string{ + string(VolumeSpecNameData), + string(VolumeSpecNameLog), + string(VolumeSpecNameShared), + } +} + +func RequiredVolumesForSAPHANA() []string { + return []string{ + string(VolumeSpecNameData), + string(VolumeSpecNameLog), + } +} + +type ProtocolType string + +const ( + ProtocolTypeNfsV41 ProtocolType = "NFSv4.1" + ProtocolTypeNfsV3 ProtocolType = "NFSv3" + ProtocolTypeCifs ProtocolType = "CIFS" +) + +func PossibleValuesForProtocolType() []string { + return []string{ + string(ProtocolTypeNfsV41), + string(ProtocolTypeNfsV3), + string(ProtocolTypeCifs), + } +} + +func PossibleValuesForProtocolTypeAvg() []string { + return []string{ + string(ProtocolTypeNfsV41), + string(ProtocolTypeNfsV3), + } +} + +type ReplicationSchedule string + +const ( + ReplicationSchedule10Minutes ReplicationSchedule = "10minutes" + ReplicationScheduleDaily ReplicationSchedule = "daily" + ReplicationScheduleHourly ReplicationSchedule = "hourly" +) + +func PossibleValuesForReplicationSchedule() []string { + return []string{ + string(ReplicationSchedule10Minutes), + string(ReplicationScheduleDaily), + string(ReplicationScheduleHourly), + } +} + +// Diverging from the SDK volumegroups.SecurityStyle since it is defined as lower case +// but the backend changes it to Pascal case on GET. Please refer to https://github.com/Azure/azure-sdk-for-go/issues/14684 +type SecurityStyle string + +const ( + SecurityStyleUnix SecurityStyle = "Unix" + SecurityStyleNtfs SecurityStyle = "Ntfs" +) + +func PossibleValuesForSecurityStyle() []string { + return []string{ + string(SecurityStyleUnix), + string(SecurityStyleNtfs), + } +} + func expandNetAppVolumeGroupVolumeExportPolicyRule(input []ExportPolicyRule) *volumegroups.VolumePropertiesExportPolicy { if len(input) == 0 || input == nil { @@ -158,11 +238,16 @@ func expandNetAppVolumeGroupVolumes(input []NetAppVolumeGroupVolume, id volumegr // Handling security style property securityStyle := volumegroups.SecurityStyle(item.SecurityStyle) - if strings.EqualFold(string(securityStyle), "unix") && len(protocols) == 1 && strings.EqualFold(protocols[0], "cifs") { - return &[]volumegroups.VolumeGroupVolumeProperties{}, fmt.Errorf("unix security style cannot be used in a CIFS enabled volume for %s", id) + if strings.EqualFold(string(securityStyle), string(SecurityStyleUnix)) && + len(protocols) == 1 && + strings.EqualFold(protocols[0], string(ProtocolTypeCifs)) { + return &[]volumegroups.VolumeGroupVolumeProperties{}, fmt.Errorf("unix security style cannot be used in a CIFS enabled volume for %s", id) } - if strings.EqualFold(string(securityStyle), "ntfs") && len(protocols) == 1 && (strings.EqualFold(protocols[0], "nfsv3") || strings.EqualFold(protocols[0], "nfsv4.1")) { + if strings.EqualFold(string(securityStyle), string(SecurityStyleNtfs)) && + len(protocols) == 1 && + (strings.EqualFold(protocols[0], string(ProtocolTypeNfsV3)) || strings.EqualFold(protocols[0], string(ProtocolTypeNfsV41))) { + return &[]volumegroups.VolumeGroupVolumeProperties{}, fmt.Errorf("ntfs security style cannot be used in a NFSv3/NFSv4.1 enabled volume for %s", id) } @@ -200,7 +285,6 @@ func expandNetAppVolumeGroupVolumes(input []NetAppVolumeGroupVolume, id volumegr return &results, nil } - func expandNetAppVolumeGroupVolumeExportPolicyRulePatch(input []interface{}) *volumes.VolumePatchPropertiesExportPolicy { results := make([]volumes.ExportPolicyRule, 0) for _, item := range input { @@ -317,7 +401,6 @@ func expandNetAppVolumeDataProtectionSnapshotPolicyPatch(input []interface{}) *v } } - func flattenNetAppVolumeGroupVolumes(ctx context.Context, input *[]volumegroups.VolumeGroupVolumeProperties, metadata sdk.ResourceMetaData) ([]NetAppVolumeGroupVolume, error) { results := make([]NetAppVolumeGroupVolume, 0) @@ -429,8 +512,7 @@ func flattenNetAppVolumeGroupVolumesDPReplication(input *volumes.ReplicationObje if input == nil { return []DataProtectionReplication{} } - - if strings.ToLower(string(*input.EndpointType)) == "" || strings.ToLower(string(*input.EndpointType)) != "dst" { + if string(*input.EndpointType) == "" || strings.EqualFold(string(*input.EndpointType), string(volumes.EndpointTypeDst)) { return []DataProtectionReplication{} } @@ -494,7 +576,7 @@ func deleteVolume(ctx context.Context, metadata sdk.ResourceMetaData, volumeId s if err != nil { return err } - if dataProtectionReplication.Replication.EndpointType != nil && strings.ToLower(string(*dataProtectionReplication.Replication.EndpointType)) != "dst" { + if dataProtectionReplication.Replication.EndpointType != nil && strings.EqualFold(string(*dataProtectionReplication.Replication.EndpointType), string(volumes.EndpointTypeDst)) { // This is the case where primary volume started the deletion, in this case, to be consistent we will remove replication from secondary replicaVolumeId, err = volumesreplication.ParseVolumeID(dataProtectionReplication.Replication.RemoteVolumeResourceId) if err != nil { @@ -724,17 +806,101 @@ func waitForReplAuthorization(ctx context.Context, client *volumesreplication.Vo } func translateTFSchedule(scheduleName string) string { - if strings.EqualFold(scheduleName, "10minutes") { - return "_10minutely" + if strings.EqualFold(scheduleName, string(ReplicationSchedule10Minutes)) { + return string(volumegroups.ReplicationScheduleOneZerominutely) } return scheduleName } func translateSDKSchedule(scheduleName string) string { - if strings.EqualFold(scheduleName, "_10minutely") { - return "10minutes" + if strings.EqualFold(scheduleName, string(volumegroups.ReplicationScheduleOneZerominutely)) { + return string(ReplicationSchedule10Minutes) } return scheduleName } + +func validateNetAppVolumeGroupVolumes(volumeList *[]volumegroups.VolumeGroupVolumeProperties, applicationType volumegroups.ApplicationType) []error { + errors := make([]error, 0) + requiredVolumes := make([]string, 0) + if applicationType == volumegroups.ApplicationTypeSAPNegativeHANA { + + // Validating maximum number of volumes + if len(*volumeList) > 5 { + errors = append(errors, fmt.Errorf("'`volume` list cannot be greater than 5 for %v'", applicationType)) + } + + // Validating each volume + for _, volume := range *volumeList { + // Validating maximum number of protocols + if len(*volume.Properties.ProtocolTypes) > 1 { + errors = append(errors, fmt.Errorf("'`protocols` list cannot be greater than 1 for %v on volume %v'", applicationType, *volume.Name)) + } + + // Validating protocols + for _, protocol := range *volume.Properties.ProtocolTypes { + + // Can't be CIFS at all times + if strings.EqualFold(protocol, string(ProtocolTypeCifs)) { + errors = append(errors, fmt.Errorf("'cifs is not supported for %v on volume %v'", applicationType, *volume.Name)) + } + + // Can't be nfsv3 on data, log and share volumes + if strings.EqualFold(protocol, string(ProtocolTypeNfsV3)) && + (strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameData)) || + strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameShared)) || + strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameLog))) { + + errors = append(errors, fmt.Errorf("'nfsv3 on data, log and shared volumes for %v is not supported on volume %v'", applicationType, *volume.Name)) + } + } + + // Adding volume to required volumes list for checking if all required volumes are present, total of 2 for SAP HANA + if strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameData)) || strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameLog)) { + requiredVolumes = append(requiredVolumes, *volume.Properties.VolumeSpecName) + } + + // Checking CRR rule that log cannot be DataProtection type + if strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameLog)) && + volume.Properties.DataProtection != nil && + volume.Properties.DataProtection.Replication != nil && + strings.EqualFold(string(*volume.Properties.DataProtection.Replication.EndpointType), string(volumegroups.EndpointTypeDst)) { + + errors = append(errors, fmt.Errorf("'log volume spec type cannot be DataProtection type for %v on volume %v'", applicationType, *volume.Name)) + } + + // Validating that snapshot policies are not being created in a data protection volume + if volume.Properties.DataProtection.Snapshot != nil && + strings.EqualFold(string(*volume.Properties.DataProtection.Replication.EndpointType), string(volumegroups.EndpointTypeDst)) { + + errors = append(errors, fmt.Errorf("'snapshot policy cannot be enabled on a data protection volume for %v on volume %v'", applicationType, *volume.Name)) + } + } + + if len(requiredVolumes) != 2 { + errors = append(errors, fmt.Errorf("'required volume spec types are not present for %v, missing ones: %v'", applicationType, diffSliceString(requiredVolumes, RequiredVolumesForSAPHANA()))) + } + } + + return errors +} + +func diffSliceString(slice1, slice2 []string) []string { + var diff []string + for _, v := range slice2 { + if !FindStringInSlice(slice1, v) { + diff = append(diff, v) + } + } + return diff +} + +func FindStringInSlice(slice []string, val string) bool { + for _, item := range slice { + if strings.EqualFold(item, val) { + return true + } + } + return false +} \ No newline at end of file From 838891dfd386967119cd3169811a0ad975b97b57 Mon Sep 17 00:00:00 2001 From: Paulo Date: Thu, 30 Mar 2023 00:43:49 +0000 Subject: [PATCH 32/83] updating reference to terraform-plugin-testing --- internal/services/netapp/netapp_volume_group_resource_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/services/netapp/netapp_volume_group_resource_test.go b/internal/services/netapp/netapp_volume_group_resource_test.go index fe505ea0d3fd..f40da43b33e9 100644 --- a/internal/services/netapp/netapp_volume_group_resource_test.go +++ b/internal/services/netapp/netapp_volume_group_resource_test.go @@ -7,7 +7,7 @@ import ( "testing" "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/hashicorp/terraform-plugin-testing/terraform" "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" From 50b899959d9158bec37db3c6ff683fa7c7f726da Mon Sep 17 00:00:00 2001 From: Paulo Date: Thu, 30 Mar 2023 01:06:03 +0000 Subject: [PATCH 33/83] fixing case and some typos --- internal/services/netapp/netapp_volume_helper.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/services/netapp/netapp_volume_helper.go b/internal/services/netapp/netapp_volume_helper.go index aef0823e0371..066c87ade995 100644 --- a/internal/services/netapp/netapp_volume_helper.go +++ b/internal/services/netapp/netapp_volume_helper.go @@ -65,8 +65,8 @@ const ( VolumeSpecNameData VolumeSpecName = "data" VolumeSpecNameLog VolumeSpecName = "log" VolumeSpecNameShared VolumeSpecName = "shared" - VolumeSpecNameDataBackup VolumeSpecName = "data-Backup" - VolumeSpecNameLogBackup VolumeSpecName = "log-Backup" + VolumeSpecNameDataBackup VolumeSpecName = "data-backup" + VolumeSpecNameLogBackup VolumeSpecName = "log-backup" ) func PossibleValuesForVolumeSpecName() []string { @@ -149,7 +149,7 @@ func expandNetAppVolumeGroupVolumeExportPolicyRule(input []ExportPolicyRule) *vo for _, item := range input { - // Hard-Coded values, for AVG these cannot be set diffrently + // Hard-Coded values, for AVG these cannot be set differently // they are not exposed as TF configuration // but PUT request requires those fields to succeed cifsEnabled := false @@ -299,7 +299,7 @@ func expandNetAppVolumeGroupVolumeExportPolicyRulePatch(input []interface{}) *vo unixReadWrite := v["unix_read_write"].(bool) rootAccessEnabled := v["root_access_enabled"].(bool) - // Hard-Coded values, for AVG these cannot be set diffrently + // Hard-Coded values, for AVG these cannot be set differently // they are not exposed as TF configuration // but PUT request requires those fields to succeed cifsEnabled := false @@ -439,7 +439,7 @@ func flattenNetAppVolumeGroupVolumes(ctx context.Context, input *[]volumegroups. volumeGroupVolume.MountIpAddresses = flattenNetAppVolumeGroupVolumesMountIpAddresses(props.MountTargets) } - // Getting volume resource directly from standalone volime + // Getting volume resource directly from standalone volume // since VolumeGroup Volumes don't return DataProtection information volumeClient := metadata.Client.NetApp.VolumeClient id, err := volumes.ParseVolumeID(*item.Id) From 620663c6a8617a9c780e04b18bde9d0670703c1c Mon Sep 17 00:00:00 2001 From: Paulo Date: Thu, 30 Mar 2023 01:07:10 +0000 Subject: [PATCH 34/83] making error message start with lower case --- internal/services/netapp/netapp_volume_helper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/services/netapp/netapp_volume_helper.go b/internal/services/netapp/netapp_volume_helper.go index 066c87ade995..9e115c21f055 100644 --- a/internal/services/netapp/netapp_volume_helper.go +++ b/internal/services/netapp/netapp_volume_helper.go @@ -769,7 +769,7 @@ func netappVolumeReplicationMirrorStateRefreshFunc(ctx context.Context, client * // Possible Mirror States to be used as desiredStates: // mirrored, broken or uninitialized if !utils.SliceContainsValue(validStates, strings.ToLower(desiredState)) { - return nil, "", fmt.Errorf("Invalid desired mirror state was passed to check mirror replication state (%s), possible values: (%+v)", desiredState, volumesreplication.PossibleValuesForMirrorState()) + return nil, "", fmt.Errorf("invalid desired mirror state was passed to check mirror replication state (%s), possible values: (%+v)", desiredState, volumesreplication.PossibleValuesForMirrorState()) } res, err := client.VolumesReplicationStatus(ctx, id) From f91166ff516e6d5ee5391a99d3730650881763f6 Mon Sep 17 00:00:00 2001 From: Paulo Date: Thu, 30 Mar 2023 18:06:52 +0000 Subject: [PATCH 35/83] WIP: fixing issues after merging main --- .../netapp/netapp_volume_group_resource.go | 5 + .../netapp_volume_group_resource_test.go | 266 +++++++++++++++++- .../services/netapp/netapp_volume_helper.go | 51 +++- 3 files changed, 316 insertions(+), 6 deletions(-) diff --git a/internal/services/netapp/netapp_volume_group_resource.go b/internal/services/netapp/netapp_volume_group_resource.go index 7ce17fe0dd88..f16c9d633070 100644 --- a/internal/services/netapp/netapp_volume_group_resource.go +++ b/internal/services/netapp/netapp_volume_group_resource.go @@ -379,6 +379,11 @@ func (r NetAppVolumeGroupResource) Create() sdk.ResourceFunc { return fmt.Errorf("creating %s: %+v", id, err) } + // Waiting for volume group be completely provisioned + if err := waitForVolumeGroupCreateOrUpdate(ctx, client, id); err != nil { + return err + } + // CRR - Authorizing secondaries from primary volumes for _, volumeCrr := range *volumeList { if volumeCrr.Properties.DataProtection != nil && diff --git a/internal/services/netapp/netapp_volume_group_resource_test.go b/internal/services/netapp/netapp_volume_group_resource_test.go index f40da43b33e9..27be2fef02a6 100644 --- a/internal/services/netapp/netapp_volume_group_resource_test.go +++ b/internal/services/netapp/netapp_volume_group_resource_test.go @@ -65,6 +65,9 @@ func TestAccNetAppVolumeGroup_volumeUpdates(t *testing.T) { check.That(data.ResourceName).Key("volume.0.storage_quota_in_gb").HasValue("1200"), check.That(data.ResourceName).Key("volume.1.export_policy_rule.0.allowed_clients").HasValue("10.0.0.0/8"), check.That(data.ResourceName).Key("volume.2.tags.CreatedOnDate").HasValue("2022-07-27T12:00:00Z"), + check.That(data.ResourceName).Key("volume.4.storage_quota_in_gb").HasValue("1200"), + check.That(data.ResourceName).Key("volume.4.export_policy_rule.0.allowed_clients").HasValue("192.168.0.0/24"), + check.That(data.ResourceName).Key("volume.4.tags.CreatedOnDate").HasValue("2022-07-28T11:00:00Z"), ), }, data.ImportStep(), @@ -80,7 +83,6 @@ func TestAccNetAppVolumeGroup_crossRegionReplication(t *testing.T) { Config: r.crossRegionReplication(data), Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), - check.That(data.ResourceName).Key("volume.0.data_protection_replication.0.endpoint_type").HasValue("dst"), ), }, data.ImportStep(), @@ -209,6 +211,66 @@ resource "azurerm_netapp_volume_group" "test" { } } + volume { + name = "acctest-NetAppVolume-4-%[2]d" + volume_path = "my-unique-file-path-4-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + proximity_placement_group_id = azurerm_proximity_placement_group.test.id + volume_spec_name = "data-backup" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv4.1"] + security_style = "Unix" + snapshot_directory_visible = false + + export_policy_rule { + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false + } + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } + } + + volume { + name = "acctest-NetAppVolume-5-%[2]d" + volume_path = "my-unique-file-path-5-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + proximity_placement_group_id = azurerm_proximity_placement_group.test.id + volume_spec_name = "log-backup" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv4.1"] + security_style = "Unix" + snapshot_directory_visible = false + + export_policy_rule { + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false + } + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } + } + depends_on = [ azurerm_linux_virtual_machine.test, azurerm_proximity_placement_group.test @@ -353,6 +415,74 @@ resource "azurerm_netapp_volume_group" "test" { } } + volume { + name = "acctest-NetAppVolume-4-%[2]d" + volume_path = "my-unique-file-path-4-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + proximity_placement_group_id = azurerm_proximity_placement_group.test.id + volume_spec_name = "data-backup" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv4.1"] + security_style = "Unix" + snapshot_directory_visible = false + + export_policy_rule { + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false + } + + data_protection_snapshot_policy { + snapshot_policy_id = azurerm_netapp_snapshot_policy.test.id + } + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } + } + + volume { + name = "acctest-NetAppVolume-5-%[2]d" + volume_path = "my-unique-file-path-5-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + proximity_placement_group_id = azurerm_proximity_placement_group.test.id + volume_spec_name = "log-backup" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv4.1"] + security_style = "Unix" + snapshot_directory_visible = false + + export_policy_rule { + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false + } + + data_protection_snapshot_policy { + snapshot_policy_id = azurerm_netapp_snapshot_policy.test.id + } + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } + } + depends_on = [ azurerm_linux_virtual_machine.test, azurerm_proximity_placement_group.test @@ -637,6 +767,66 @@ resource "azurerm_netapp_volume_group" "test_primary" { } } + volume { + name = "acctest-NetAppVolume-4-Primary-%[2]d" + volume_path = "my-unique-file-path-4-Primary-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + proximity_placement_group_id = azurerm_proximity_placement_group.test.id + volume_spec_name = "data-backup" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv4.1"] + security_style = "Unix" + snapshot_directory_visible = false + + export_policy_rule { + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false + } + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } + } + + volume { + name = "acctest-NetAppVolume-5-Primary-%[2]d" + volume_path = "my-unique-file-path-5-Primary-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + proximity_placement_group_id = azurerm_proximity_placement_group.test.id + volume_spec_name = "log-backup" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv4.1"] + security_style = "Unix" + snapshot_directory_visible = false + + export_policy_rule { + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false + } + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } + } + depends_on = [ azurerm_linux_virtual_machine.test, azurerm_proximity_placement_group.test @@ -756,6 +946,80 @@ resource "azurerm_netapp_volume_group" "test_secondary" { } } + volume { + name = "acctest-NetAppVolume-4-Secondary-%[2]d" + volume_path = "my-unique-file-path-4-Secondary-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test_secondary.id + subnet_id = azurerm_subnet.test_secondary.id + proximity_placement_group_id = azurerm_proximity_placement_group.test_secondary.id + volume_spec_name = "data-backup" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv4.1"] + security_style = "Unix" + snapshot_directory_visible = false + + export_policy_rule { + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false + } + + data_protection_replication { + endpoint_type = "dst" + remote_volume_location = azurerm_resource_group.test.location + remote_volume_resource_id = azurerm_netapp_volume_group.test_primary.volume[3].id + replication_frequency = "10minutes" + } + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } + } + + volume { + name = "acctest-NetAppVolume-5-Secondary-%[2]d" + volume_path = "my-unique-file-path-5-Secondary-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test_secondary.id + subnet_id = azurerm_subnet.test_secondary.id + proximity_placement_group_id = azurerm_proximity_placement_group.test_secondary.id + volume_spec_name = "log-backup" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv4.1"] + security_style = "Unix" + snapshot_directory_visible = false + + export_policy_rule { + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false + } + + data_protection_replication { + endpoint_type = "dst" + remote_volume_location = azurerm_resource_group.test.location + remote_volume_resource_id = azurerm_netapp_volume_group.test_primary.volume[4].id + replication_frequency = "10minutes" + } + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } + } + depends_on = [ azurerm_linux_virtual_machine.test_secondary, azurerm_proximity_placement_group.test_secondary, diff --git a/internal/services/netapp/netapp_volume_helper.go b/internal/services/netapp/netapp_volume_helper.go index 9e115c21f055..aa52718c5b41 100644 --- a/internal/services/netapp/netapp_volume_helper.go +++ b/internal/services/netapp/netapp_volume_helper.go @@ -74,6 +74,8 @@ func PossibleValuesForVolumeSpecName() []string { string(VolumeSpecNameData), string(VolumeSpecNameLog), string(VolumeSpecNameShared), + string(VolumeSpecNameDataBackup), + string(VolumeSpecNameLogBackup), } } @@ -569,9 +571,8 @@ func deleteVolume(ctx context.Context, metadata sdk.ResourceMetaData, volumeId s } // Removing replication if present - dataProtectionReplication := existing.Model.Properties.DataProtection - - if dataProtectionReplication != nil && dataProtectionReplication.Replication != nil { + if existing.Model.Properties.DataProtection != nil && existing.Model.Properties.DataProtection.Replication != nil { + dataProtectionReplication := existing.Model.Properties.DataProtection replicaVolumeId, err := volumesreplication.ParseVolumeID(id.ID()) if err != nil { return err @@ -656,6 +657,28 @@ func waitForVolumeCreateOrUpdate(ctx context.Context, client *volumes.VolumesCli return nil } +func waitForVolumeGroupCreateOrUpdate(ctx context.Context, client *volumegroups.VolumeGroupsClient, id volumegroups.VolumeGroupId) error { + deadline, ok := ctx.Deadline() + if !ok { + return fmt.Errorf("context had no deadline") + } + stateConf := &pluginsdk.StateChangeConf{ + ContinuousTargetOccurence: 5, + Delay: 10 * time.Second, + MinTimeout: 10 * time.Second, + Pending: []string{"204", "404"}, + Target: []string{"200", "202"}, + Refresh: netappVolumeGroupStateRefreshFunc(ctx, client, id), + Timeout: time.Until(deadline), + } + + if _, err := stateConf.WaitForStateContext(ctx); err != nil { + return fmt.Errorf("waiting for %s to finish creating: %+v", id, err) + } + + return nil +} + func waitForReplAuthorization(ctx context.Context, client *volumesreplication.VolumesReplicationClient, id volumesreplication.VolumeId) error { deadline, ok := ctx.Deadline() if !ok { @@ -762,6 +785,23 @@ func netappVolumeStateRefreshFunc(ctx context.Context, client *volumes.VolumesCl } } +func netappVolumeGroupStateRefreshFunc(ctx context.Context, client *volumegroups.VolumeGroupsClient, id volumegroups.VolumeGroupId) pluginsdk.StateRefreshFunc { + return func() (interface{}, string, error) { + res, err := client.VolumeGroupsGet(ctx, id) + if err != nil { + if !response.WasNotFound(res.HttpResponse) { + return nil, "", fmt.Errorf("retrieving %s: %s", id, err) + } + } + + statusCode := "dropped connection" + if res.HttpResponse != nil { + statusCode = strconv.Itoa(res.HttpResponse.StatusCode) + } + return res, statusCode, nil + } +} + func netappVolumeReplicationMirrorStateRefreshFunc(ctx context.Context, client *volumesreplication.VolumesReplicationClient, id volumesreplication.VolumeId, desiredState string) pluginsdk.StateRefreshFunc { validStates := []string{"mirrored", "broken", "uninitialized"} @@ -876,8 +916,9 @@ func validateNetAppVolumeGroupVolumes(volumeList *[]volumegroups.VolumeGroupVolu } // Validating that snapshot policies are not being created in a data protection volume - if volume.Properties.DataProtection.Snapshot != nil && - strings.EqualFold(string(*volume.Properties.DataProtection.Replication.EndpointType), string(volumegroups.EndpointTypeDst)) { + if volume.Properties.DataProtection != nil && + volume.Properties.DataProtection.Snapshot != nil && + (volume.Properties.DataProtection.Replication != nil && strings.EqualFold(string(*volume.Properties.DataProtection.Replication.EndpointType), string(volumegroups.EndpointTypeDst))) { errors = append(errors, fmt.Errorf("'snapshot policy cannot be enabled on a data protection volume for %v on volume %v'", applicationType, *volume.Name)) } From 46663c22b049a5835f63f55cca5e3d4c930fca40 Mon Sep 17 00:00:00 2001 From: Paulo Date: Thu, 30 Mar 2023 18:29:51 +0000 Subject: [PATCH 36/83] Fixing primary volume logic check --- internal/services/netapp/netapp_volume_helper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/services/netapp/netapp_volume_helper.go b/internal/services/netapp/netapp_volume_helper.go index aa52718c5b41..d7aba16a5a16 100644 --- a/internal/services/netapp/netapp_volume_helper.go +++ b/internal/services/netapp/netapp_volume_helper.go @@ -577,7 +577,7 @@ func deleteVolume(ctx context.Context, metadata sdk.ResourceMetaData, volumeId s if err != nil { return err } - if dataProtectionReplication.Replication.EndpointType != nil && strings.EqualFold(string(*dataProtectionReplication.Replication.EndpointType), string(volumes.EndpointTypeDst)) { + if dataProtectionReplication.Replication.EndpointType != nil && !strings.EqualFold(string(*dataProtectionReplication.Replication.EndpointType), string(volumes.EndpointTypeDst)) { // This is the case where primary volume started the deletion, in this case, to be consistent we will remove replication from secondary replicaVolumeId, err = volumesreplication.ParseVolumeID(dataProtectionReplication.Replication.RemoteVolumeResourceId) if err != nil { From 0c7b0f8a928847851acbacff2bca6b2d73bb913b Mon Sep 17 00:00:00 2001 From: Paulo Date: Thu, 30 Mar 2023 23:01:00 +0000 Subject: [PATCH 37/83] adjusting location to be same as the related primary volume group --- .../services/netapp/netapp_volume_group_resource_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/services/netapp/netapp_volume_group_resource_test.go b/internal/services/netapp/netapp_volume_group_resource_test.go index 27be2fef02a6..01fee0d7a613 100644 --- a/internal/services/netapp/netapp_volume_group_resource_test.go +++ b/internal/services/netapp/netapp_volume_group_resource_test.go @@ -868,7 +868,7 @@ resource "azurerm_netapp_volume_group" "test_secondary" { data_protection_replication { endpoint_type = "dst" - remote_volume_location = azurerm_resource_group.test.location + remote_volume_location = azurerm_netapp_volume_group.test_primary.location remote_volume_resource_id = azurerm_netapp_volume_group.test_primary.volume[0].id replication_frequency = "10minutes" } @@ -935,7 +935,7 @@ resource "azurerm_netapp_volume_group" "test_secondary" { data_protection_replication { endpoint_type = "dst" - remote_volume_location = azurerm_resource_group.test.location + remote_volume_location = azurerm_netapp_volume_group.test_primary.location remote_volume_resource_id = azurerm_netapp_volume_group.test_primary.volume[2].id replication_frequency = "10minutes" } @@ -972,7 +972,7 @@ resource "azurerm_netapp_volume_group" "test_secondary" { data_protection_replication { endpoint_type = "dst" - remote_volume_location = azurerm_resource_group.test.location + remote_volume_location = azurerm_netapp_volume_group.test_primary.location remote_volume_resource_id = azurerm_netapp_volume_group.test_primary.volume[3].id replication_frequency = "10minutes" } @@ -1009,7 +1009,7 @@ resource "azurerm_netapp_volume_group" "test_secondary" { data_protection_replication { endpoint_type = "dst" - remote_volume_location = azurerm_resource_group.test.location + remote_volume_location = azurerm_netapp_volume_group.test_primary.location remote_volume_resource_id = azurerm_netapp_volume_group.test_primary.volume[4].id replication_frequency = "10minutes" } From 0fccf9524ad90fb9b39f280146002c197eb2d34a Mon Sep 17 00:00:00 2001 From: Paulo Date: Fri, 31 Mar 2023 13:19:42 +0000 Subject: [PATCH 38/83] Using LocationComputed --- internal/services/netapp/netapp_volume_group_resource.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/services/netapp/netapp_volume_group_resource.go b/internal/services/netapp/netapp_volume_group_resource.go index f16c9d633070..cd63f5b33c58 100644 --- a/internal/services/netapp/netapp_volume_group_resource.go +++ b/internal/services/netapp/netapp_volume_group_resource.go @@ -259,7 +259,7 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { ValidateFunc: validation.StringInSlice(volumegroups.PossibleValuesForEndpointType(), false), }, - "remote_volume_location": commonschema.Location(), + "remote_volume_location": commonschema.LocationComputed(), "remote_volume_resource_id": { Type: pluginsdk.TypeString, From 77ea88958f2768cb2046421eeacd1039a818ba85 Mon Sep 17 00:00:00 2001 From: Paulo Date: Fri, 31 Mar 2023 13:20:54 +0000 Subject: [PATCH 39/83] Updating comment --- internal/services/netapp/netapp_volume_group_resource.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/services/netapp/netapp_volume_group_resource.go b/internal/services/netapp/netapp_volume_group_resource.go index cd63f5b33c58..eba03dcfc025 100644 --- a/internal/services/netapp/netapp_volume_group_resource.go +++ b/internal/services/netapp/netapp_volume_group_resource.go @@ -357,8 +357,8 @@ func (r NetAppVolumeGroupResource) Create() sdk.ResourceFunc { } } - // TODO: This is a temporary workaround until the backend is updated and DeploymentSpecId is not required anymore, - // it will be handled internally by the RP + // TODO: deploymentSpecId is temporary until the backend is updated and deploymentSpecId is not required anymore, + // it will be handled internally by the RP deploymentSpecId := "20542149-bfca-5618-1879-9863dc6767f1" parameters := volumegroups.VolumeGroupDetails{ From 6c12b1e3ec28d743dfe21c59619968347052ec2f Mon Sep 17 00:00:00 2001 From: Paulo Date: Fri, 31 Mar 2023 13:36:35 +0000 Subject: [PATCH 40/83] replacing LocationComputed with LocationWithoutForceNew --- internal/services/netapp/netapp_volume_group_resource.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/services/netapp/netapp_volume_group_resource.go b/internal/services/netapp/netapp_volume_group_resource.go index eba03dcfc025..c16170da870c 100644 --- a/internal/services/netapp/netapp_volume_group_resource.go +++ b/internal/services/netapp/netapp_volume_group_resource.go @@ -259,7 +259,7 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { ValidateFunc: validation.StringInSlice(volumegroups.PossibleValuesForEndpointType(), false), }, - "remote_volume_location": commonschema.LocationComputed(), + "remote_volume_location": commonschema.LocationWithoutForceNew(), "remote_volume_resource_id": { Type: pluginsdk.TypeString, @@ -515,7 +515,6 @@ func (r NetAppVolumeGroupResource) Update() sdk.ResourceFunc { if err := waitForVolumeCreateOrUpdate(ctx, volumeClient, volumeId); err != nil { return err } - } } } From 8d8ce4bf09d989e9e18c8db6235cf32e11037732 Mon Sep 17 00:00:00 2001 From: Paulo Date: Tue, 4 Apr 2023 22:31:39 +0000 Subject: [PATCH 41/83] Finishing up application volume group implementation --- .../netapp/netapp_volume_group_data_source.go | 291 ++++++++++++++ .../netapp_volume_group_data_source_test.go | 40 ++ .../netapp/netapp_volume_group_resource.go | 2 + .../services/netapp/netapp_volume_helper.go | 46 ++- .../netapp/netapp_volume_resource_test.go | 6 + internal/services/netapp/registration.go | 4 +- .../docs/d/netapp_volume_group.html.markdown | 137 +++++++ .../docs/r/netapp_volume_group.html.markdown | 361 ++++++++++++++++++ 8 files changed, 872 insertions(+), 15 deletions(-) create mode 100644 internal/services/netapp/netapp_volume_group_data_source.go create mode 100644 internal/services/netapp/netapp_volume_group_data_source_test.go create mode 100644 website/docs/d/netapp_volume_group.html.markdown create mode 100644 website/docs/r/netapp_volume_group.html.markdown diff --git a/internal/services/netapp/netapp_volume_group_data_source.go b/internal/services/netapp/netapp_volume_group_data_source.go new file mode 100644 index 000000000000..51ae5531d8d5 --- /dev/null +++ b/internal/services/netapp/netapp_volume_group_data_source.go @@ -0,0 +1,291 @@ +package netapp + +import ( + "context" + "fmt" + "net/http" + "time" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" + "github.com/hashicorp/go-azure-helpers/resourcemanager/location" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups" + "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" +) + +type NetAppVolumeGroupDataSourceModel struct { + Name string `tfschema:"name"` + ResourceGroupName string `tfschema:"resource_group_name"` + Location string `tfschema:"location"` + AccountName string `tfschema:"account_name"` + GroupDescription string `tfschema:"group_description"` + ApplicationType string `tfschema:"application_type"` + ApplicationIdentifier string `tfschema:"application_identifier"` + Volumes []NetAppVolumeGroupVolume `tfschema:"volume"` +} + +var _ sdk.DataSource = NetAppVolumeGroupDataSource{} + +type NetAppVolumeGroupDataSource struct{} + +func (r NetAppVolumeGroupDataSource) ResourceType() string { + return "azurerm_netapp_volume_group" +} + +func (r NetAppVolumeGroupDataSource) ModelObject() interface{} { + return &NetAppVolumeGroupDataSourceModel{} +} + +func (r NetAppVolumeGroupDataSource) IDValidationFunc() pluginsdk.SchemaValidateFunc { + return volumegroups.ValidateVolumeGroupID +} + +func (r NetAppVolumeGroupDataSource) Arguments() map[string]*pluginsdk.Schema { + return map[string]*pluginsdk.Schema{ + "name": { + Type: pluginsdk.TypeString, + Required: true, + }, + + "resource_group_name": commonschema.ResourceGroupName(), + + "account_name": { + Type: pluginsdk.TypeString, + Required: true, + }, + } +} + +func (r NetAppVolumeGroupDataSource) Attributes() map[string]*pluginsdk.Schema { + return map[string]*pluginsdk.Schema{ + "location": commonschema.LocationComputed(), + + "group_description": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "application_type": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "application_identifier": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "volume": { + Type: pluginsdk.TypeList, + Computed: true, + Elem: &pluginsdk.Resource{ + Schema: map[string]*pluginsdk.Schema{ + "id": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "name": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "capacity_pool_id": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "proximity_placement_group_id": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "volume_spec_name": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "volume_path": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "service_level": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "subnet_id": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "protocols": { + Type: pluginsdk.TypeList, + Computed: true, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeString, + }, + }, + + "security_style": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "storage_quota_in_gb": { + Type: pluginsdk.TypeInt, + Computed: true, + }, + + "throughput_in_mibps": { + Type: pluginsdk.TypeFloat, + Required: true, + }, + + "export_policy_rule": { + Type: pluginsdk.TypeList, + Computed: true, + Elem: &pluginsdk.Resource{ + Schema: map[string]*pluginsdk.Schema{ + "rule_index": { + Type: pluginsdk.TypeInt, + Computed: true, + }, + + "allowed_clients": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "nfsv3_enabled": { + Type: pluginsdk.TypeBool, + Computed: true, + }, + + "nfsv41_enabled": { + Type: pluginsdk.TypeBool, + Computed: true, + }, + + "unix_read_only": { + Type: pluginsdk.TypeBool, + Computed: true, + }, + + "unix_read_write": { + Type: pluginsdk.TypeBool, + Computed: true, + }, + + "root_access_enabled": { + Type: pluginsdk.TypeBool, + Computed: true, + }, + }, + }, + }, + + "tags": commonschema.Tags(), + + "snapshot_directory_visible": { + Type: pluginsdk.TypeBool, + Computed: true, + }, + + "mount_ip_addresses": { + Type: pluginsdk.TypeList, + Computed: true, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeString, + }, + }, + + "data_protection_replication": { + Type: pluginsdk.TypeList, + Computed: true, + Elem: &pluginsdk.Resource{ + Schema: map[string]*pluginsdk.Schema{ + "endpoint_type": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "remote_volume_location": commonschema.LocationComputed(), + + "remote_volume_resource_id": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "replication_frequency": { + Type: pluginsdk.TypeString, + Computed: true, + }, + }, + }, + }, + + "data_protection_snapshot_policy": { + Type: pluginsdk.TypeList, + Computed: true, + Elem: &pluginsdk.Resource{ + Schema: map[string]*pluginsdk.Schema{ + "snapshot_policy_id": { + Type: pluginsdk.TypeString, + Computed: true, + }, + }, + }, + }, + }, + }, + }, + } +} + +func (r NetAppVolumeGroupDataSource) Read() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 5 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + + client := metadata.Client.NetApp.VolumeGroupClient + + var state NetAppVolumeGroupDataSourceModel + if err := metadata.Decode(&state); err != nil { + return fmt.Errorf("decoding: %+v", err) + } + + id := volumegroups.NewVolumeGroupID(metadata.Client.Account.SubscriptionId, state.ResourceGroupName, state.AccountName, state.Name) + + resp, err := client.VolumeGroupsGet(ctx, id) + if err != nil { + if resp.HttpResponse.StatusCode == http.StatusNotFound { + return metadata.MarkAsGone(id) + } + return fmt.Errorf("retrieving %s: %v", id, err) + } + + model := resp.Model + if model == nil { + return fmt.Errorf("retrieving %s: model was nil", id) + } + + state.Location = location.Normalize(*model.Location) + state.ApplicationIdentifier = *model.Properties.GroupMetaData.ApplicationIdentifier + state.ApplicationType = string(*model.Properties.GroupMetaData.ApplicationType) + state.GroupDescription = *model.Properties.GroupMetaData.GroupDescription + + volumes, err := flattenNetAppVolumeGroupVolumes(ctx, model.Properties.Volumes, metadata) + if err != nil { + return fmt.Errorf("setting `volume`: %+v", err) + } + + state.Volumes = volumes + + metadata.SetID(id) + + return metadata.Encode(&state) + }, + } +} diff --git a/internal/services/netapp/netapp_volume_group_data_source_test.go b/internal/services/netapp/netapp_volume_group_data_source_test.go new file mode 100644 index 000000000000..7a9f0a949680 --- /dev/null +++ b/internal/services/netapp/netapp_volume_group_data_source_test.go @@ -0,0 +1,40 @@ +package netapp_test + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" +) + +type NetAppVolumeGroupDataSource struct{} + +func TestAccNetAppVolumeGroupDataSource_basic(t *testing.T) { + data := acceptance.BuildTestData(t, "data.azurerm_netapp_volume_group", "test") + d := NetAppVolumeGroupDataSource{} + + data.DataSourceTest(t, []acceptance.TestStep{ + { + Config: d.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).Key("name").Exists(), + check.That(data.ResourceName).Key("resource_group_name").Exists(), + check.That(data.ResourceName).Key("application_type").HasValue("SAP-HANA"), + check.That(data.ResourceName).Key("volume.1.volume_spec_name").HasValue("log"), + ), + }, + }) +} + +func (d NetAppVolumeGroupDataSource) basic(data acceptance.TestData) string { + return fmt.Sprintf(` +%s + +data "azurerm_netapp_volume_group" "test" { + name = azurerm_netapp_volume_group.test.name + resource_group_name = azurerm_netapp_volume_group.test.resource_group_name + account_name = azurerm_netapp_volume_group.test.account_name +} +`, NetAppVolumeGroupResource{}.basic(data)) +} diff --git a/internal/services/netapp/netapp_volume_group_resource.go b/internal/services/netapp/netapp_volume_group_resource.go index c16170da870c..11e77cff3f11 100644 --- a/internal/services/netapp/netapp_volume_group_resource.go +++ b/internal/services/netapp/netapp_volume_group_resource.go @@ -550,6 +550,8 @@ func (r NetAppVolumeGroupResource) Read() sdk.ResourceFunc { return fmt.Errorf("retrieving %s: %v", id, err) } + metadata.SetID(id) + model := NetAppVolumeGroupModel{ Name: id.VolumeGroupName, AccountName: id.AccountName, diff --git a/internal/services/netapp/netapp_volume_helper.go b/internal/services/netapp/netapp_volume_helper.go index d7aba16a5a16..7dbe20bb99e8 100644 --- a/internal/services/netapp/netapp_volume_helper.go +++ b/internal/services/netapp/netapp_volume_helper.go @@ -137,7 +137,6 @@ const ( func PossibleValuesForSecurityStyle() []string { return []string{ string(SecurityStyleUnix), - string(SecurityStyleNtfs), } } @@ -514,7 +513,7 @@ func flattenNetAppVolumeGroupVolumesDPReplication(input *volumes.ReplicationObje if input == nil { return []DataProtectionReplication{} } - if string(*input.EndpointType) == "" || strings.EqualFold(string(*input.EndpointType), string(volumes.EndpointTypeDst)) { + if string(*input.EndpointType) == "" || !strings.EqualFold(string(*input.EndpointType), string(volumes.EndpointTypeDst)) { return []DataProtectionReplication{} } @@ -883,21 +882,40 @@ func validateNetAppVolumeGroupVolumes(volumeList *[]volumegroups.VolumeGroupVolu errors = append(errors, fmt.Errorf("'`protocols` list cannot be greater than 1 for %v on volume %v'", applicationType, *volume.Name)) } - // Validating protocols - for _, protocol := range *volume.Properties.ProtocolTypes { + // Validating protocol, it supports only one and that is enforced by the schema - // Can't be CIFS at all times - if strings.EqualFold(protocol, string(ProtocolTypeCifs)) { - errors = append(errors, fmt.Errorf("'cifs is not supported for %v on volume %v'", applicationType, *volume.Name)) - } + // Can't be CIFS at all times + if strings.EqualFold(string((*volume.Properties.ProtocolTypes)[0]), string(ProtocolTypeCifs)) { + errors = append(errors, fmt.Errorf("'cifs is not supported for %v on volume %v'", applicationType, *volume.Name)) + } + + // Can't be nfsv3 on data, log and share volumes + if strings.EqualFold(string((*volume.Properties.ProtocolTypes)[0]), string(ProtocolTypeNfsV3)) && + (strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameData)) || + strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameShared)) || + strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameLog))) { + + errors = append(errors, fmt.Errorf("'nfsv3 on data, log and shared volumes for %v is not supported on volume %v'", applicationType, *volume.Name)) + } - // Can't be nfsv3 on data, log and share volumes - if strings.EqualFold(protocol, string(ProtocolTypeNfsV3)) && - (strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameData)) || - strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameShared)) || - strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameLog))) { + // Validating export policies + if volume.Properties.ExportPolicy != nil { + for _, rule := range *volume.Properties.ExportPolicy.Rules { - errors = append(errors, fmt.Errorf("'nfsv3 on data, log and shared volumes for %v is not supported on volume %v'", applicationType, *volume.Name)) + // Validating that nfsv3 and nfsv4.1 are not enabled in the same rule + if *rule.Nfsv3 && *rule.Nfsv41 { + errors = append(errors, fmt.Errorf("'nfsv3 and nfsv4.1 cannot be enabled at the same time for %v on volume %v'", applicationType, *volume.Name)) + } + + // Validating that nfsv4.1 export policy is not set on nfsv3 volume + if *rule.Nfsv41 && strings.EqualFold(string((*volume.Properties.ProtocolTypes)[0]), string(ProtocolTypeNfsV3)) { + errors = append(errors, fmt.Errorf("'nfsv4.1 export policy cannot be enabled on nfsv3 volume %v'", *volume.Name)) + } + + // Validating that nfsv3 export policy is not set on nfsv4.1 volume + if *rule.Nfsv3 && strings.EqualFold(string((*volume.Properties.ProtocolTypes)[0]), string(ProtocolTypeNfsV41)) { + errors = append(errors, fmt.Errorf("'nfsv3 export policy cannot be enabled on nfsv4.1 volume %v'", *volume.Name)) + } } } diff --git a/internal/services/netapp/netapp_volume_resource_test.go b/internal/services/netapp/netapp_volume_resource_test.go index da1ce49dd80b..6651544eb4da 100644 --- a/internal/services/netapp/netapp_volume_resource_test.go +++ b/internal/services/netapp/netapp_volume_resource_test.go @@ -942,6 +942,12 @@ provider "azurerm" { resource "azurerm_resource_group" "test" { name = "acctestRG-netapp-%d" location = "%s" + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true", + "SkipNRMSNSG" = "true" + } } resource "azurerm_virtual_network" "test" { diff --git a/internal/services/netapp/registration.go b/internal/services/netapp/registration.go index 866af01c08ff..e47b9aceb8e1 100644 --- a/internal/services/netapp/registration.go +++ b/internal/services/netapp/registration.go @@ -48,7 +48,9 @@ func (r Registration) SupportedResources() map[string]*pluginsdk.Resource { // DataSources returns the typed DataSources supported by this service func (r Registration) DataSources() []sdk.DataSource { - return []sdk.DataSource{} + return []sdk.DataSource{ + NetAppVolumeGroupDataSource{}, + } } // Resources returns the typed Resources supported by this service diff --git a/website/docs/d/netapp_volume_group.html.markdown b/website/docs/d/netapp_volume_group.html.markdown new file mode 100644 index 000000000000..af4e71258956 --- /dev/null +++ b/website/docs/d/netapp_volume_group.html.markdown @@ -0,0 +1,137 @@ +--- +subcategory: "netapp" +layout: "azurerm" +page_title: "Azure Resource Manager: Data Source: azurerm_netapp_volume_group" +description: |- + Gets information about an existing Application Volume Group. +--- + +# Data Source: azurerm_netapp_volume_group + +Use this data source to access information about an existing Application Volume Group. + +## Example Usage + +```hcl +data "azurerm_netapp_volume_group" "example" { + name = "existing application volume group name" + resource_group_name = "resource group name where the account and volume group belong to" + account_name = "existing account where the application volume group belong to" +} + +output "id" { + value = data.azurerm_netapp_volume_group.example.id +} +``` + +## Arguments Reference + +The following arguments are supported: + +* `account_name` - (Required) Name of the account where the application volume group belong to. + +* `name` - (Required) The name of this Application Volume Group. + +* `resource_group_name` - (Required) The name of the Resource Group where the Application Volume Group exists. + +## Attributes Reference + +In addition to the Arguments listed above - the following Attributes are exported: + +* `id` - The ID of the Application Volume Group. + +* `application_identifier` - The application identifier. + +* `application_type` - The application type. + +* `group_description` - Volume group description. + +* `location` - The Azure Region where the Application Volume Group exists. + +* `volume` - A `volume` block as defined below. + +--- + +A `volume` block exports the following: + +* `capacity_pool_id` - The ID of the Capacity Pool. + +* `id` - Volume ID. + +* `name` - The name of this volume. + +* `proximity_placement_group_id` - The ID of the proximity placement group. + +* `security_style` - Volume security style. + +* `service_level` - The target performance of the file system. + +* `snapshot_directory_visible` - Is the .snapshot (NFS clients) path of a volume visible? + +* `storage_quota_in_gb` - The maximum Storage Quota allowed for a file system in Gigabytes. + +* `subnet_id` - The ID of the Subnet the NetApp Volume resides in. + +* `tags` - A mapping of tags assigned to the Application Volume Group. + +* `throughput_in_mibps` - Throughput of this volume in Mibps. + +* `volume_path` - A unique file path for the volume. + +* `volume_spec_name` - Volume spec name. + +* `data_protection_replication` - A `data_protection_replication` block as defined below. + +* `data_protection_snapshot_policy` - A `data_protection_snapshot_policy` block as defined below. + +* `export_policy_rule` - A `export_policy_rule` block as defined below. + +* `mount_ip_addresses` - A `mount_ip_addresses` block as defined below. + +* `protocols` - A `protocols` block as defined below. + +--- + +A `data_protection_replication` block exports the following: + +* `endpoint_type` - The endpoint type. + +* `remote_volume_location` - Location of the primary volume. + +* `remote_volume_resource_id` - Resource ID of the primary volume. + +* `replication_frequency` - Replication frequency. + +--- + +A `data_protection_snapshot_policy` block exports the following: + +* `snapshot_policy_id` - Resource ID of the snapshot policy to apply to the volume. + +--- + +A `export_policy_rule` block exports the following: + +* `allowed_clients` - A list of allowed clients IPv4 addresses. + +* `nfsv3_enabled` - Is the NFSv3 protocol enabled? + +* `nfsv41_enabled` - Is the NFSv4.1 enabled? + +* `root_access_enabled` - Is root access permitted to this volume? + +* `rule_index` - The index number of the rule. + +* `unix_read_only` - Is the file system on unix read only?. + +* `unix_read_write` - Is the file system on unix read and write?. + +--- + + + +## Timeouts + +The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions: + +* `read` - (Defaults to 5 minutes) Used when retrieving the Application Volume Group. \ No newline at end of file diff --git a/website/docs/r/netapp_volume_group.html.markdown b/website/docs/r/netapp_volume_group.html.markdown new file mode 100644 index 000000000000..2f03c925c6e1 --- /dev/null +++ b/website/docs/r/netapp_volume_group.html.markdown @@ -0,0 +1,361 @@ +--- +subcategory: "netapp" +layout: "azurerm" +page_title: "Azure Resource Manager: azurerm_netapp_volume_group" +description: |- + Manages a Application Volume Group. +--- + +# azurerm_netapp_volume_group + +Manages a Application Volume Group. + +>Note: This feature is intended to be used for SAP-HANA workloads only, with several requirements, please refer to [Understand Azure NetApp Files application volume group for SAP HANA](https://learn.microsoft.com/en-us/azure/azure-netapp-files/application-volume-group-introduction) document as the starting point to understand this feature before using it with Terraform. + +## Example Usage + +```hcl +provider "azurerm" { + features { + resource_group { + prevent_deletion_if_contains_resources = false + } + } +} + +resource "random_string" "test" { + length = 12 + special = true +} + +locals { + admin_username = "testadmin" + admin_password = random_string.test.result +} + +resource "azurerm_resource_group" "test" { + name = "${var.prefix}-resources" + location = var.location +} + +resource "azurerm_virtual_network" "test" { + name = "${var.prefix}-vnet" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + address_space = ["10.6.0.0/16"] +} + +resource "azurerm_subnet" "test" { + name = "${var.prefix}-delegated-subnet" + resource_group_name = azurerm_resource_group.test.name + virtual_network_name = azurerm_virtual_network.test.name + address_prefixes = ["10.6.2.0/24"] + + delegation { + name = "testdelegation" + + service_delegation { + name = "Microsoft.Netapp/volumes" + actions = ["Microsoft.Network/networkinterfaces/*", "Microsoft.Network/virtualNetworks/subnets/join/action"] + } + } +} + +resource "azurerm_subnet" "test1" { + name = "${var.prefix}-hosts-subnet" + resource_group_name = azurerm_resource_group.test.name + virtual_network_name = azurerm_virtual_network.test.name + address_prefixes = ["10.6.1.0/24"] +} + +resource "azurerm_proximity_placement_group" "test" { + name = "${var.prefix}-ppg" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name +} + +resource "azurerm_availability_set" "test" { + name = "${var.prefix}-avset" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + + proximity_placement_group_id = azurerm_proximity_placement_group.test.id +} + +resource "azurerm_network_interface" "test" { + name = "${var.prefix}-nic" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + + ip_configuration { + name = "internal" + subnet_id = azurerm_subnet.test1.id + private_ip_address_allocation = "Dynamic" + } +} + +resource "azurerm_linux_virtual_machine" "test" { + name = "${var.prefix}-vm" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + size = "Standard_M8ms" + admin_username = local.admin_username + admin_password = local.admin_password + disable_password_authentication = false + proximity_placement_group_id = azurerm_proximity_placement_group.test.id + availability_set_id = azurerm_availability_set.test.id + network_interface_ids = [ + azurerm_network_interface.test.id + ] + + source_image_reference { + publisher = "Canonical" + offer = "UbuntuServer" + sku = "18.04-LTS" + version = "latest" + } + + os_disk { + storage_account_type = "Standard_LRS" + caching = "ReadWrite" + } +} + +resource "azurerm_netapp_account" "test" { + name = "${var.prefix}-netapp-account" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + + depends_on = [ + azurerm_subnet.test, + azurerm_subnet.test1 + ] +} + +resource "azurerm_netapp_pool" "test" { + name = "${var.prefix}-netapp-pool" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + account_name = azurerm_netapp_account.test.name + service_level = "Standard" + size_in_tb = 8 + qos_type = "Manual" +} + +resource "azurerm_netapp_volume_group" "test" { + name = "${var.prefix}-netapp-volumegroup" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + account_name = azurerm_netapp_account.test.name + group_description = "Test volume group" + application_type = "SAP-HANA" + application_identifier = "TST" + + volume { + name = "${var.prefix}-netapp-volume-1" + volume_path = "my-unique-file-path-1" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + proximity_placement_group_id = azurerm_proximity_placement_group.test.id + volume_spec_name = "data" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv4.1"] + security_style = "Unix" + snapshot_directory_visible = false + + export_policy_rule { + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false + } + + tags = { + "foo" = "bar" + } + } + + volume { + name = "${var.prefix}-netapp-volume-2" + volume_path = "my-unique-file-path-2" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + proximity_placement_group_id = azurerm_proximity_placement_group.test.id + volume_spec_name = "log" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv4.1"] + security_style = "Unix" + snapshot_directory_visible = false + + export_policy_rule { + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false + } + + tags = { + "foo" = "bar" + } + } + + volume { + name = "${var.prefix}-netapp-volume-3" + volume_path = "my-unique-file-path-3" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + proximity_placement_group_id = azurerm_proximity_placement_group.test.id + volume_spec_name = "shared" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv4.1"] + security_style = "Unix" + snapshot_directory_visible = false + + export_policy_rule { + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false + } + } + + depends_on = [ + azurerm_linux_virtual_machine.test, + azurerm_proximity_placement_group.test + ] +} +``` + +## Arguments Reference + +The following arguments are supported: + +* `account_name` - (Required) Name of the account where the application volume group belong to. Changing this forces a new Application Volume Group to be created. + +* `application_identifier` - (Required) The SAP System ID, maximum 3 characters, e.g. `SH9`. Changing this forces a new Application Volume Group to be created. + +* `application_type` - (Required) The application type. The only possible value is `SAP-HANA`. Changing this forces a new Application Volume Group to be created. + +* `group_description` - (Required) Volume group description. Changing this forces a new Application Volume Group to be created. + +* `location` - (Required) The Azure Region where the Application Volume Group should exist. Changing this forces a new Application Volume Group to be created. + +* `name` - (Required) The name which should be used for this Application Volume Group. Changing this forces a new Application Volume Group to be created. + +* `resource_group_name` - (Required) The name of the Resource Group where the Application Volume Group should exist. Changing this forces a new Application Volume Group to be created. + +* `volume` - (Required) One or more `volume` blocks as defined below. + +--- + +A `volume` block supports the following: + +* `capacity_pool_id` - (Required) The ID of the Capacity Pool. Changing this forces a new Application Volume Group to be created. + +* `name` - (Required) The name which should be used for this volume. Changing this forces a new Application Volume Group to be created. + +* `protocols` - (Required) The target volume protocol expressed as a list. Changing this forces a new Application Volume Group to be created. Supported values for Application Volume Group include `NFSv3` or `NFSv4.1`, multi-protocol is not supported and there are certain rules on which protocol is supporteed per volume spec, please check [Configure application volume groups for the SAP HANA REST API](https://learn.microsoft.com/en-us/azure/azure-netapp-files/configure-application-volume-group-sap-hana-api) document for details. + +* `proximity_placement_group_id` - (Required) The ID of the proximity placement group. Changing this forces a new Application Volume Group to be created. For SAP-HANA application, it is required to have PPG enabled so Azure NetApp Files can pin the volumes next to your compute resources, please check [Requirements and considerations for application volume group for SAP HANA](https://learn.microsoft.com/en-us/azure/azure-netapp-files/application-volume-group-considerations) for details and other requirements. + +* `security_style` - (Required) Volume security style. Possible value is `Unix`. Changing this forces a new Application Volume Group to be created. + +* `service_level` - (Required) Volume security style. Possible values are `Premium`, `Standard` and `Ultra`. Changing this forces a new Application Volume Group to be created. + +* `snapshot_directory_visible` - (Required) Specifies whether the .snapshot (NFS clients) path of a volume is visible. Changing this forces a new Application Volume Group to be created. + +* `storage_quota_in_gb` - (Required) The maximum Storage Quota allowed for a file system in Gigabytes. + +* `subnet_id` - (Required) The ID of the Subnet the NetApp Volume resides in, which must have the `Microsoft.NetApp/volumes` delegation. Changing this forces a new Application Volume Group to be created. + +* `throughput_in_mibps` - (Required) Throughput of this volume in Mibps. + +* `volume_path` - (Required) A unique file path for the volume. Changing this forces a new Application Volume Group to be created. + +* `volume_spec_name` - (Required) Volume specification name. Possible values are `data`, `log`, `shared`, `data-backup` and `log-backup`. + +* `tags` - (Optional) A mapping of tags which should be assigned to the Application Volume Group. + +* `export_policy_rule` - (Required) One or more `export_policy_rule` blocks as defined below. + +* `data_protection_replication` - (Optional) A `data_protection_replication` block as defined below. Changing this forces a new Application Volume Group to be created. + +* `data_protection_snapshot_policy` - (Optional) A `data_protection_snapshot_policy` block as defined below. + +--- + +A `data_protection_replication` block is used when enabling the Cross-Region Replication (CRR) data protection option by deploying two Azure NetApp Files Volumes, one to be a primary volume and the other one will be the secondary, the secondary will have this block and will reference the primary volume, not all volume spec types are supported, please refer to [Configure application volume groups for the SAP HANA REST API](https://learn.microsoft.com/en-us/azure/azure-netapp-files/configure-application-volume-group-sap-hana-api) for detauls. Each volume must be in a supported [region pair](https://docs.microsoft.com/azure/azure-netapp-files/cross-region-replication-introduction#supported-region-pairs). + +This block supports the following: + +* `remote_volume_location` - (Required) Location of the primary volume. Changing this forces a new resource to be created. + +* `remote_volume_resource_id` - (Required) Resource ID of the primary volume. + +* `replication_frequency` - (Required) eplication frequency. Possible values are `10minutes`, `daily` and `hourly`. + +* `endpoint_type` - (Optional) The endpoint type. Possible values are `dst` and `src`. Defaults to `dst`. + +--- + +A `data_protection_snapshot_policy` block supports the following: + +* `snapshot_policy_id` - (Required) Resource ID of the snapshot policy to apply to the volume. + +--- + +A `export_policy_rule` block supports the following: + +* `allowed_clients` - (Required) A comma-sperated list of allowed client IPv4 addresses. + +* `nfsv3_enabled` - (Required) Enables NFSv3. Please note that this cannot be enabled if volume has NFSv4.1 as its protocol. + +* `nfsv41_enabled` - (Required) Enables NFSv4.1. Please note that this cannot be enabled if volume has NFSv3 as its protocol. + +* `root_access_enabled` - (Required) Is root access permitted to this volume? + +* `rule_index` - (Required) The index number of the rule, must start at 1 and maximum 5. + +* `unix_read_only` - (Required) Is the file system on unix read only? + +* `unix_read_write` - (Required) Is the file system on unix read and write? + +--- + +## Attributes Reference + +In addition to the Arguments listed above - the following Attributes are exported: + +* `id` - The ID of the Application Volume Group. + +## Timeouts + +The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions: + +* `create` - (Defaults to 1 hour and 30 minutes) Used when creating the Application Volume Group. +* `read` - (Defaults to 5 minutes) Used when retrieving the Application Volume Group. +* `update` - (Defaults to 2 hours) Used when updating the Application Volume Group. +* `delete` - (Defaults to 2 hours) Used when deleting the Application Volume Group. + +## Import + +Application Volume Groups can be imported using the `resource id`, e.g. + +```shell +terraform import azurerm_netapp_volume_group.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mytest-rg/providers/Microsoft.NetApp/netAppAccounts/netapp-account-test/volumeGroups/netapp-volumegroup-test +``` \ No newline at end of file From fb2d7d513576999aa0dab1d859be5f44f5e6912a Mon Sep 17 00:00:00 2001 From: Paulo Date: Tue, 4 Apr 2023 22:48:20 +0000 Subject: [PATCH 42/83] Fixing linting issues --- go.sum | 9 +++++++++ website/docs/d/netapp_volume_group.html.markdown | 2 +- website/docs/r/netapp_volume_group.html.markdown | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/go.sum b/go.sum index f469b2951d09..e7e996e427d7 100644 --- a/go.sum +++ b/go.sum @@ -196,6 +196,7 @@ github.com/hashicorp/yamux v0.0.0-20210316155119-a95892c5f864/go.mod h1:CtWFDAQg github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= @@ -205,11 +206,14 @@ github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 h1:DowS9hvgy github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/magodo/terraform-provider-azurerm-example-gen v0.0.0-20220407025246-3a3ee0ab24a8 h1:HHSqLmPZaa8U66U7N2Gtx3gYptSHrUB/rB5t+6fZTkQ= github.com/magodo/terraform-provider-azurerm-example-gen v0.0.0-20220407025246-3a3ee0ab24a8/go.mod h1:iMzpAzVr2v/NUVie/apAYtZlFZYFndPcp6/E0VLxgAM= github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= @@ -241,6 +245,7 @@ github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rickb777/date v1.12.5-0.20200422084442-6300e543c4d9 h1:czJCcoUR3FMpHnRQow2E84H/0CPrX1fMAGn9HugzyI4= @@ -263,6 +268,7 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.2 h1:4jaiDzPyXQvSd7D0EjG45355tLlV3VOECpq10pLC+8s= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/tombuildsstuff/giovanni v0.20.0 h1:IM/I/iNWMXnPYwcSq8uxV7TKDlv7Nejq0bRK9i6O/C0= github.com/tombuildsstuff/giovanni v0.20.0/go.mod h1:66KVLYma2whJhEdxPSPL3GQHkulhK+C5CluKfHGfPF4= @@ -275,6 +281,7 @@ github.com/vmihailenco/msgpack/v4 v4.3.12 h1:07s4sz9IReOgdikxLTKNbBdqDMLsjPKXwvC github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= github.com/vmihailenco/tagparser v0.1.1 h1:quXMXlA39OCbd2wAdTsGDlK9RkOk6Wuw+x37wVyIuWY= github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= +github.com/xanzy/ssh-agent v0.3.0 h1:wUMzuKtKilRgBAD1sUb8gOwwRr2FGoBVumcjoOACClI= github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= @@ -424,9 +431,11 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/website/docs/d/netapp_volume_group.html.markdown b/website/docs/d/netapp_volume_group.html.markdown index af4e71258956..a331193f267b 100644 --- a/website/docs/d/netapp_volume_group.html.markdown +++ b/website/docs/d/netapp_volume_group.html.markdown @@ -1,5 +1,5 @@ --- -subcategory: "netapp" +subcategory: "NetApp" layout: "azurerm" page_title: "Azure Resource Manager: Data Source: azurerm_netapp_volume_group" description: |- diff --git a/website/docs/r/netapp_volume_group.html.markdown b/website/docs/r/netapp_volume_group.html.markdown index 2f03c925c6e1..7c1af59181e7 100644 --- a/website/docs/r/netapp_volume_group.html.markdown +++ b/website/docs/r/netapp_volume_group.html.markdown @@ -1,5 +1,5 @@ --- -subcategory: "netapp" +subcategory: "NetApp" layout: "azurerm" page_title: "Azure Resource Manager: azurerm_netapp_volume_group" description: |- From 4c14ed68e2e3fa5a3180961a133ae0902f8d831d Mon Sep 17 00:00:00 2001 From: Paulo Date: Tue, 4 Apr 2023 23:39:43 +0000 Subject: [PATCH 43/83] Fixing Gencheck issues --- .teamcity/components/generated/services.kt | 4 ++-- website/allowed-subcategories | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.teamcity/components/generated/services.kt b/.teamcity/components/generated/services.kt index e4e483ec68c9..d570ecc90a92 100644 --- a/.teamcity/components/generated/services.kt +++ b/.teamcity/components/generated/services.kt @@ -78,7 +78,6 @@ var services = mapOf( "mobilenetwork" to "Mobile Network", "monitor" to "Monitor", "mysql" to "MySQL", - "netapp" to "NetApp", "network" to "Network", "nginx" to "Nginx", "notificationhub" to "Notification Hub", @@ -115,5 +114,6 @@ var services = mapOf( "vmware" to "VMware", "videoanalyzer" to "Video Analyzer", "voiceservices" to "Voice Services", - "web" to "Web" + "web" to "Web", + "netapp" to "netapp" ) \ No newline at end of file diff --git a/website/allowed-subcategories b/website/allowed-subcategories index a9d4b7e28962..823be366631f 100644 --- a/website/allowed-subcategories +++ b/website/allowed-subcategories @@ -69,7 +69,6 @@ Messaging Mixed Reality Mobile Network Monitor -NetApp Network Nginx Orbital @@ -97,4 +96,5 @@ Time Series Insights VMware (AVS) Video Analyzer Voice Services -Web PubSub \ No newline at end of file +Web PubSub +netapp \ No newline at end of file From 9fb63dfcad8f681b83e765c45ed96eb83e54aa5e Mon Sep 17 00:00:00 2001 From: Paulo Date: Tue, 4 Apr 2023 23:49:04 +0000 Subject: [PATCH 44/83] Fixing golint issues --- .../services/netapp/netapp_volume_helper.go | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/internal/services/netapp/netapp_volume_helper.go b/internal/services/netapp/netapp_volume_helper.go index 7dbe20bb99e8..49510941f909 100644 --- a/internal/services/netapp/netapp_volume_helper.go +++ b/internal/services/netapp/netapp_volume_helper.go @@ -252,7 +252,7 @@ func expandNetAppVolumeGroupVolumes(input []NetAppVolumeGroupVolume, id volumegr return &[]volumegroups.VolumeGroupVolumeProperties{}, fmt.Errorf("ntfs security style cannot be used in a NFSv3/NFSv4.1 enabled volume for %s", id) } - storageQuotaInGB := int64(item.StorageQuotaInGB * 1073741824) + storageQuotaInGB := item.StorageQuotaInGB * 1073741824 exportPolicyRule := expandNetAppVolumeGroupVolumeExportPolicyRule(item.ExportPolicy) dataProtectionReplication := expandNetAppVolumeGroupDataProtectionReplication(item.DataProtectionReplication) dataProtectionSnapshotPolicy := expandNetAppVolumeGroupDataProtectionSnapshotPolicy(item.DataProtectionSnapshotPolicy) @@ -269,7 +269,7 @@ func expandNetAppVolumeGroupVolumes(input []NetAppVolumeGroupVolume, id volumegr UsageThreshold: storageQuotaInGB, ExportPolicy: exportPolicyRule, SnapshotDirectoryVisible: utils.Bool(snapshotDirectoryVisible), - ThroughputMibps: utils.Float(float64(item.ThroughputInMibps)), + ThroughputMibps: utils.Float(item.ThroughputInMibps), ProximityPlacementGroup: utils.String(item.ProximityPlacementGroupId), VolumeSpecName: utils.String(item.VolumeSpecName), DataProtection: &volumegroups.VolumePropertiesDataProtection{ @@ -422,13 +422,13 @@ func flattenNetAppVolumeGroupVolumes(ctx context.Context, input *[]volumegroups. volumeGroupVolume.Protocols = *props.ProtocolTypes volumeGroupVolume.SecurityStyle = string(*props.SecurityStyle) volumeGroupVolume.SnapshotDirectoryVisible = *props.SnapshotDirectoryVisible - volumeGroupVolume.ThroughputInMibps = float64(*props.ThroughputMibps) + volumeGroupVolume.ThroughputInMibps = *props.ThroughputMibps volumeGroupVolume.Tags = *item.Tags volumeGroupVolume.ProximityPlacementGroupId = utils.NormalizeNilableString(props.ProximityPlacementGroup) - volumeGroupVolume.VolumeSpecName = string(*props.VolumeSpecName) + volumeGroupVolume.VolumeSpecName = *props.VolumeSpecName - if int64(props.UsageThreshold) > 0 { - usageThreshold := int64(props.UsageThreshold) / 1073741824 + if props.UsageThreshold > 0 { + usageThreshold := props.UsageThreshold / 1073741824 volumeGroupVolume.StorageQuotaInGB = usageThreshold } @@ -461,7 +461,7 @@ func flattenNetAppVolumeGroupVolumes(ctx context.Context, input *[]volumegroups. volumeGroupVolume.DataProtectionSnapshotPolicy = flattenNetAppVolumeGroupVolumesDPSnapshotPolicy(standaloneVol.Model.Properties.DataProtection.Snapshot) } - volumeGroupVolume.Id = string(*standaloneVol.Model.Id) + volumeGroupVolume.Id = *standaloneVol.Model.Id results = append(results, volumeGroupVolume) } @@ -539,7 +539,7 @@ func flattenNetAppVolumeGroupVolumesDPSnapshotPolicy(input *volumes.VolumeSnapsh return []DataProtectionSnapshotPolicy{ { - DataProtectionSnapshotPolicy: string(*input.SnapshotPolicyId), + DataProtectionSnapshotPolicy: *input.SnapshotPolicyId, }, } } @@ -885,12 +885,12 @@ func validateNetAppVolumeGroupVolumes(volumeList *[]volumegroups.VolumeGroupVolu // Validating protocol, it supports only one and that is enforced by the schema // Can't be CIFS at all times - if strings.EqualFold(string((*volume.Properties.ProtocolTypes)[0]), string(ProtocolTypeCifs)) { + if strings.EqualFold((*volume.Properties.ProtocolTypes)[0], string(ProtocolTypeCifs)) { errors = append(errors, fmt.Errorf("'cifs is not supported for %v on volume %v'", applicationType, *volume.Name)) } // Can't be nfsv3 on data, log and share volumes - if strings.EqualFold(string((*volume.Properties.ProtocolTypes)[0]), string(ProtocolTypeNfsV3)) && + if strings.EqualFold((*volume.Properties.ProtocolTypes)[0], string(ProtocolTypeNfsV3)) && (strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameData)) || strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameShared)) || strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameLog))) { @@ -908,12 +908,12 @@ func validateNetAppVolumeGroupVolumes(volumeList *[]volumegroups.VolumeGroupVolu } // Validating that nfsv4.1 export policy is not set on nfsv3 volume - if *rule.Nfsv41 && strings.EqualFold(string((*volume.Properties.ProtocolTypes)[0]), string(ProtocolTypeNfsV3)) { + if *rule.Nfsv41 && strings.EqualFold((*volume.Properties.ProtocolTypes)[0], string(ProtocolTypeNfsV3)) { errors = append(errors, fmt.Errorf("'nfsv4.1 export policy cannot be enabled on nfsv3 volume %v'", *volume.Name)) } // Validating that nfsv3 export policy is not set on nfsv4.1 volume - if *rule.Nfsv3 && strings.EqualFold(string((*volume.Properties.ProtocolTypes)[0]), string(ProtocolTypeNfsV41)) { + if *rule.Nfsv3 && strings.EqualFold((*volume.Properties.ProtocolTypes)[0], string(ProtocolTypeNfsV41)) { errors = append(errors, fmt.Errorf("'nfsv3 export policy cannot be enabled on nfsv4.1 volume %v'", *volume.Name)) } } From b53b5314d0ec99f7fede461795933e06e115182f Mon Sep 17 00:00:00 2001 From: Paulo Date: Tue, 4 Apr 2023 23:56:31 +0000 Subject: [PATCH 45/83] Fixing Vendor Dependencies Check / depscheck --- .../2022-05-01/netappaccounts/README.md | 2 +- .../netapp/2022-05-01/volumegroups/README.md | 8 +++---- .../volumegroups/id_netappaccount.go | 23 +++++++++++-------- .../2022-05-01/volumegroups/id_volumegroup.go | 23 +++++++++++-------- vendor/modules.txt | 2 +- 5 files changed, 32 insertions(+), 26 deletions(-) diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/README.md index 3a7047d24895..1849c21a15e9 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/README.md +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts/README.md @@ -103,7 +103,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") +id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue") if err := client.AccountsRenewCredentialsThenPoll(ctx, id); err != nil { // handle the error diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/README.md index f6fc22ff39b1..bd321b7befaf 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/README.md +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "volumeGroupValue") +id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "volumeGroupValue") payload := volumegroups.VolumeGroupDetails{ // ... @@ -41,7 +41,7 @@ if err := client.VolumeGroupsCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "volumeGroupValue") +id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "volumeGroupValue") if err := client.VolumeGroupsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.VolumeGroupsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "volumeGroupValue") +id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "volumeGroupValue") read, err := client.VolumeGroupsGet(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := volumegroups.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue") +id := volumegroups.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue") read, err := client.VolumeGroupsListByNetAppAccount(ctx, id) if err != nil { diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/id_netappaccount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/id_netappaccount.go index 7b31002a4246..f96e16183c88 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/id_netappaccount.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/id_netappaccount.go @@ -7,21 +7,24 @@ import ( "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" ) +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + var _ resourceids.ResourceId = NetAppAccountId{} // NetAppAccountId is a struct representing the Resource ID for a Net App Account type NetAppAccountId struct { SubscriptionId string ResourceGroupName string - AccountName string + NetAppAccountName string } // NewNetAppAccountID returns a new NetAppAccountId struct -func NewNetAppAccountID(subscriptionId string, resourceGroupName string, accountName string) NetAppAccountId { +func NewNetAppAccountID(subscriptionId string, resourceGroupName string, netAppAccountName string) NetAppAccountId { return NetAppAccountId{ SubscriptionId: subscriptionId, ResourceGroupName: resourceGroupName, - AccountName: accountName, + NetAppAccountName: netAppAccountName, } } @@ -44,8 +47,8 @@ func ParseNetAppAccountID(input string) (*NetAppAccountId, error) { return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) } - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + if id.NetAppAccountName, ok = parsed.Parsed["netAppAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'netAppAccountName' was not found in the resource id %q", input) } return &id, nil @@ -71,8 +74,8 @@ func ParseNetAppAccountIDInsensitively(input string) (*NetAppAccountId, error) { return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) } - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + if id.NetAppAccountName, ok = parsed.Parsed["netAppAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'netAppAccountName' was not found in the resource id %q", input) } return &id, nil @@ -96,7 +99,7 @@ func ValidateNetAppAccountID(input interface{}, key string) (warnings []string, // ID returns the formatted Net App Account ID func (id NetAppAccountId) ID() string { fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName) + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetAppAccountName) } // Segments returns a slice of Resource ID Segments which comprise this Net App Account ID @@ -109,7 +112,7 @@ func (id NetAppAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("accountName", "accountValue"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountValue"), } } @@ -118,7 +121,7 @@ func (id NetAppAccountId) String() string { components := []string{ fmt.Sprintf("Subscription: %q", id.SubscriptionId), fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Account Name: %q", id.AccountName), + fmt.Sprintf("Net App Account Name: %q", id.NetAppAccountName), } return fmt.Sprintf("Net App Account (%s)", strings.Join(components, "\n")) } diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/id_volumegroup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/id_volumegroup.go index a49d03263509..d76205f10070 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/id_volumegroup.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups/id_volumegroup.go @@ -7,22 +7,25 @@ import ( "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" ) +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + var _ resourceids.ResourceId = VolumeGroupId{} // VolumeGroupId is a struct representing the Resource ID for a Volume Group type VolumeGroupId struct { SubscriptionId string ResourceGroupName string - AccountName string + NetAppAccountName string VolumeGroupName string } // NewVolumeGroupID returns a new VolumeGroupId struct -func NewVolumeGroupID(subscriptionId string, resourceGroupName string, accountName string, volumeGroupName string) VolumeGroupId { +func NewVolumeGroupID(subscriptionId string, resourceGroupName string, netAppAccountName string, volumeGroupName string) VolumeGroupId { return VolumeGroupId{ SubscriptionId: subscriptionId, ResourceGroupName: resourceGroupName, - AccountName: accountName, + NetAppAccountName: netAppAccountName, VolumeGroupName: volumeGroupName, } } @@ -46,8 +49,8 @@ func ParseVolumeGroupID(input string) (*VolumeGroupId, error) { return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) } - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + if id.NetAppAccountName, ok = parsed.Parsed["netAppAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'netAppAccountName' was not found in the resource id %q", input) } if id.VolumeGroupName, ok = parsed.Parsed["volumeGroupName"]; !ok { @@ -77,8 +80,8 @@ func ParseVolumeGroupIDInsensitively(input string) (*VolumeGroupId, error) { return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) } - if id.AccountName, ok = parsed.Parsed["accountName"]; !ok { - return nil, fmt.Errorf("the segment 'accountName' was not found in the resource id %q", input) + if id.NetAppAccountName, ok = parsed.Parsed["netAppAccountName"]; !ok { + return nil, fmt.Errorf("the segment 'netAppAccountName' was not found in the resource id %q", input) } if id.VolumeGroupName, ok = parsed.Parsed["volumeGroupName"]; !ok { @@ -106,7 +109,7 @@ func ValidateVolumeGroupID(input interface{}, key string) (warnings []string, er // ID returns the formatted Volume Group ID func (id VolumeGroupId) ID() string { fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/volumeGroups/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AccountName, id.VolumeGroupName) + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetAppAccountName, id.VolumeGroupName) } // Segments returns a slice of Resource ID Segments which comprise this Volume Group ID @@ -119,7 +122,7 @@ func (id VolumeGroupId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("accountName", "accountValue"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountValue"), resourceids.StaticSegment("staticVolumeGroups", "volumeGroups", "volumeGroups"), resourceids.UserSpecifiedSegment("volumeGroupName", "volumeGroupValue"), } @@ -130,7 +133,7 @@ func (id VolumeGroupId) String() string { components := []string{ fmt.Sprintf("Subscription: %q", id.SubscriptionId), fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Account Name: %q", id.AccountName), + fmt.Sprintf("Net App Account Name: %q", id.NetAppAccountName), fmt.Sprintf("Volume Group Name: %q", id.VolumeGroupName), } return fmt.Sprintf("Volume Group (%s)", strings.Join(components, "\n")) diff --git a/vendor/modules.txt b/vendor/modules.txt index b0829dd810bd..0476d2d6538f 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -419,8 +419,8 @@ github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/capacitypoo github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/netappaccounts github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshotpolicy github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshots -github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups +github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication github.com/hashicorp/go-azure-sdk/resource-manager/nginx/2022-08-01 github.com/hashicorp/go-azure-sdk/resource-manager/nginx/2022-08-01/nginxcertificate From 8c2c012ff7c92db72d7ca6a28a161937e2258ea1 Mon Sep 17 00:00:00 2001 From: Paulo Date: Tue, 4 Apr 2023 23:59:29 +0000 Subject: [PATCH 46/83] Fixing website-lint issues --- .../docs/d/netapp_volume_group.html.markdown | 6 +- .../docs/r/netapp_volume_group.html.markdown | 70 +++++++++---------- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/website/docs/d/netapp_volume_group.html.markdown b/website/docs/d/netapp_volume_group.html.markdown index a331193f267b..56db2d0ea9ae 100644 --- a/website/docs/d/netapp_volume_group.html.markdown +++ b/website/docs/d/netapp_volume_group.html.markdown @@ -14,9 +14,9 @@ Use this data source to access information about an existing Application Volume ```hcl data "azurerm_netapp_volume_group" "example" { - name = "existing application volume group name" + name = "existing application volume group name" resource_group_name = "resource group name where the account and volume group belong to" - account_name = "existing account where the application volume group belong to" + account_name = "existing account where the application volume group belong to" } output "id" { @@ -134,4 +134,4 @@ A `export_policy_rule` block exports the following: The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions: -* `read` - (Defaults to 5 minutes) Used when retrieving the Application Volume Group. \ No newline at end of file +* `read` - (Defaults to 5 minutes) Used when retrieving the Application Volume Group. diff --git a/website/docs/r/netapp_volume_group.html.markdown b/website/docs/r/netapp_volume_group.html.markdown index 7c1af59181e7..42475e68a79c 100644 --- a/website/docs/r/netapp_volume_group.html.markdown +++ b/website/docs/r/netapp_volume_group.html.markdown @@ -24,13 +24,13 @@ provider "azurerm" { } resource "random_string" "test" { - length = 12 + length = 12 special = true } locals { - admin_username = "testadmin" - admin_password = random_string.test.result + admin_username = "testadmin" + admin_password = random_string.test.result } resource "azurerm_resource_group" "test" { @@ -62,10 +62,10 @@ resource "azurerm_subnet" "test" { } resource "azurerm_subnet" "test1" { - name = "${var.prefix}-hosts-subnet" - resource_group_name = azurerm_resource_group.test.name - virtual_network_name = azurerm_virtual_network.test.name - address_prefixes = ["10.6.1.0/24"] + name = "${var.prefix}-hosts-subnet" + resource_group_name = azurerm_resource_group.test.name + virtual_network_name = azurerm_virtual_network.test.name + address_prefixes = ["10.6.1.0/24"] } resource "azurerm_proximity_placement_group" "test" { @@ -150,7 +150,7 @@ resource "azurerm_netapp_volume_group" "test" { group_description = "Test volume group" application_type = "SAP-HANA" application_identifier = "TST" - + volume { name = "${var.prefix}-netapp-volume-1" volume_path = "my-unique-file-path-1" @@ -164,17 +164,17 @@ resource "azurerm_netapp_volume_group" "test" { protocols = ["NFSv4.1"] security_style = "Unix" snapshot_directory_visible = false - + export_policy_rule { - rule_index = 1 - allowed_clients = "0.0.0.0/0" - nfsv3_enabled = false - nfsv41_enabled = true - unix_read_only = false - unix_read_write = true - root_access_enabled = false + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false } - + tags = { "foo" = "bar" } @@ -193,17 +193,17 @@ resource "azurerm_netapp_volume_group" "test" { protocols = ["NFSv4.1"] security_style = "Unix" snapshot_directory_visible = false - + export_policy_rule { - rule_index = 1 - allowed_clients = "0.0.0.0/0" - nfsv3_enabled = false - nfsv41_enabled = true - unix_read_only = false - unix_read_write = true - root_access_enabled = false + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false } - + tags = { "foo" = "bar" } @@ -222,15 +222,15 @@ resource "azurerm_netapp_volume_group" "test" { protocols = ["NFSv4.1"] security_style = "Unix" snapshot_directory_visible = false - + export_policy_rule { - rule_index = 1 - allowed_clients = "0.0.0.0/0" - nfsv3_enabled = false - nfsv41_enabled = true - unix_read_only = false - unix_read_write = true - root_access_enabled = false + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false } } @@ -358,4 +358,4 @@ Application Volume Groups can be imported using the `resource id`, e.g. ```shell terraform import azurerm_netapp_volume_group.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mytest-rg/providers/Microsoft.NetApp/netAppAccounts/netapp-account-test/volumeGroups/netapp-volumegroup-test -``` \ No newline at end of file +``` From b16455d0f338721ad4bc3f4adf7266dc72959561 Mon Sep 17 00:00:00 2001 From: Paulo Date: Wed, 5 Apr 2023 00:02:17 +0000 Subject: [PATCH 47/83] Updating NetApp subcategory back to NetApp --- website/allowed-subcategories | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/allowed-subcategories b/website/allowed-subcategories index 823be366631f..7cca57d470e3 100644 --- a/website/allowed-subcategories +++ b/website/allowed-subcategories @@ -97,4 +97,4 @@ VMware (AVS) Video Analyzer Voice Services Web PubSub -netapp \ No newline at end of file +NetApp \ No newline at end of file From 11e6dc147f986df96c5c74de6c5c5a356e0fec4d Mon Sep 17 00:00:00 2001 From: Paulo Date: Wed, 5 Apr 2023 00:07:24 +0000 Subject: [PATCH 48/83] Fixing SDK property change after merging latest from main --- internal/services/netapp/netapp_volume_group_resource.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/services/netapp/netapp_volume_group_resource.go b/internal/services/netapp/netapp_volume_group_resource.go index 11e77cff3f11..332ce0d98e86 100644 --- a/internal/services/netapp/netapp_volume_group_resource.go +++ b/internal/services/netapp/netapp_volume_group_resource.go @@ -460,7 +460,7 @@ func (r NetAppVolumeGroupResource) Update() sdk.ResourceFunc { volumeId := volumes.NewVolumeID(id.SubscriptionId, id.ResourceGroupName, - id.AccountName, + id.NetAppAccountName, capacityPoolName, metadata.ResourceData.Get(fmt.Sprintf("%v.name", volumeItem)).(string)) @@ -554,7 +554,7 @@ func (r NetAppVolumeGroupResource) Read() sdk.ResourceFunc { model := NetAppVolumeGroupModel{ Name: id.VolumeGroupName, - AccountName: id.AccountName, + AccountName: id.NetAppAccountName, Location: location.NormalizeNilable(existing.Model.Location), ResourceGroupName: id.ResourceGroupName, } From 093a56a64ea7a174e69259aaf6921e55ea422d88 Mon Sep 17 00:00:00 2001 From: Paulo Date: Wed, 5 Apr 2023 17:41:31 +0000 Subject: [PATCH 49/83] Adding forcenew to volume_spec_name and adding validation to update process --- .../netapp/netapp_volume_group_resource.go | 23 ++++++++++++ .../services/netapp/netapp_volume_helper.go | 37 +++++++++++-------- 2 files changed, 45 insertions(+), 15 deletions(-) diff --git a/internal/services/netapp/netapp_volume_group_resource.go b/internal/services/netapp/netapp_volume_group_resource.go index 332ce0d98e86..f3871711f137 100644 --- a/internal/services/netapp/netapp_volume_group_resource.go +++ b/internal/services/netapp/netapp_volume_group_resource.go @@ -126,6 +126,7 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { "volume_spec_name": { Type: pluginsdk.TypeString, Required: true, + ForceNew: true, ValidateFunc: validation.StringInSlice(PossibleValuesForVolumeSpecName(), false), }, @@ -475,6 +476,28 @@ func (r NetAppVolumeGroupResource) Update() sdk.ResourceFunc { if metadata.ResourceData.HasChange(fmt.Sprintf("%v.export_policy_rule", volumeItem)) { exportPolicyRuleRaw := metadata.ResourceData.Get(fmt.Sprintf("%v.export_policy_rule", volumeItem)).([]interface{}) + + // Validating export policy rules + volumeProtocolRaw := (metadata.ResourceData.Get(fmt.Sprintf("%v.protocols", volumeItem)).([]interface{}))[0] + volumeProtocol := volumeProtocolRaw.(string) + + errors := make([]error, 0) + for _, ruleRaw := range exportPolicyRuleRaw { + if ruleRaw != nil { + rule := volumegroups.ExportPolicyRule{} + + v := ruleRaw.(map[string]interface{}) + rule.Nfsv3 = utils.Bool(v["nfsv3_enabled"].(bool)) + rule.Nfsv41 = utils.Bool(v["nfsv41_enabled"].(bool)) + + errors = append(errors, validateNetAppVolumeGroupExportPolicyRule(rule, volumeProtocol)...) + } + } + + if len(errors) > 0 { + return fmt.Errorf("one or more issues found while performing export policies validations for %s:\n%+v", id, errors) + } + exportPolicyRule := expandNetAppVolumeGroupVolumeExportPolicyRulePatch(exportPolicyRuleRaw) update.Properties.ExportPolicy = exportPolicyRule } diff --git a/internal/services/netapp/netapp_volume_helper.go b/internal/services/netapp/netapp_volume_helper.go index 49510941f909..757a111e20bf 100644 --- a/internal/services/netapp/netapp_volume_helper.go +++ b/internal/services/netapp/netapp_volume_helper.go @@ -901,21 +901,7 @@ func validateNetAppVolumeGroupVolumes(volumeList *[]volumegroups.VolumeGroupVolu // Validating export policies if volume.Properties.ExportPolicy != nil { for _, rule := range *volume.Properties.ExportPolicy.Rules { - - // Validating that nfsv3 and nfsv4.1 are not enabled in the same rule - if *rule.Nfsv3 && *rule.Nfsv41 { - errors = append(errors, fmt.Errorf("'nfsv3 and nfsv4.1 cannot be enabled at the same time for %v on volume %v'", applicationType, *volume.Name)) - } - - // Validating that nfsv4.1 export policy is not set on nfsv3 volume - if *rule.Nfsv41 && strings.EqualFold((*volume.Properties.ProtocolTypes)[0], string(ProtocolTypeNfsV3)) { - errors = append(errors, fmt.Errorf("'nfsv4.1 export policy cannot be enabled on nfsv3 volume %v'", *volume.Name)) - } - - // Validating that nfsv3 export policy is not set on nfsv4.1 volume - if *rule.Nfsv3 && strings.EqualFold((*volume.Properties.ProtocolTypes)[0], string(ProtocolTypeNfsV41)) { - errors = append(errors, fmt.Errorf("'nfsv3 export policy cannot be enabled on nfsv4.1 volume %v'", *volume.Name)) - } + errors = append(errors, validateNetAppVolumeGroupExportPolicyRule(rule, (*volume.Properties.ProtocolTypes)[0])...) } } @@ -950,6 +936,27 @@ func validateNetAppVolumeGroupVolumes(volumeList *[]volumegroups.VolumeGroupVolu return errors } +func validateNetAppVolumeGroupExportPolicyRule(rule volumegroups.ExportPolicyRule, protocolType string) []error { + errors := make([]error, 0) + + // Validating that nfsv3 and nfsv4.1 are not enabled in the same rule + if *rule.Nfsv3 && *rule.Nfsv41 { + errors = append(errors, fmt.Errorf("'nfsv3 and nfsv4.1 cannot be enabled at the same time'")) + } + + // Validating that nfsv4.1 export policy is not set on nfsv3 volume + if *rule.Nfsv41 && strings.EqualFold(protocolType, string(ProtocolTypeNfsV3)) { + errors = append(errors, fmt.Errorf("'nfsv4.1 export policy cannot be enabled on nfsv3 volume'")) + } + + // Validating that nfsv3 export policy is not set on nfsv4.1 volume + if *rule.Nfsv3 && strings.EqualFold(protocolType, string(ProtocolTypeNfsV41)) { + errors = append(errors, fmt.Errorf("'nfsv3 export policy cannot be enabled on nfsv4.1 volume'")) + } + + return errors +} + func diffSliceString(slice1, slice2 []string) []string { var diff []string for _, v := range slice2 { From a1e6b0added36b9d46f1070a8edde0662af08d2b Mon Sep 17 00:00:00 2001 From: Paulo Date: Wed, 5 Apr 2023 17:41:57 +0000 Subject: [PATCH 50/83] Adding warning of data loss as we do on regular volumes --- .../docs/r/netapp_volume_group.html.markdown | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/website/docs/r/netapp_volume_group.html.markdown b/website/docs/r/netapp_volume_group.html.markdown index 42475e68a79c..2ce2cbc81325 100644 --- a/website/docs/r/netapp_volume_group.html.markdown +++ b/website/docs/r/netapp_volume_group.html.markdown @@ -245,19 +245,19 @@ resource "azurerm_netapp_volume_group" "test" { The following arguments are supported: -* `account_name` - (Required) Name of the account where the application volume group belong to. Changing this forces a new Application Volume Group to be created. +* `account_name` - (Required) Name of the account where the application volume group belong to. Changing this forces a new Application Volume Group to be created and data will be lost. -* `application_identifier` - (Required) The SAP System ID, maximum 3 characters, e.g. `SH9`. Changing this forces a new Application Volume Group to be created. +* `application_identifier` - (Required) The SAP System ID, maximum 3 characters, e.g. `SH9`. Changing this forces a new Application Volume Group to be created and data will be lost. -* `application_type` - (Required) The application type. The only possible value is `SAP-HANA`. Changing this forces a new Application Volume Group to be created. +* `application_type` - (Required) The application type. The only possible value is `SAP-HANA`. Changing this forces a new Application Volume Group to be created and data will be lost. -* `group_description` - (Required) Volume group description. Changing this forces a new Application Volume Group to be created. +* `group_description` - (Required) Volume group description. Changing this forces a new Application Volume Group to be created and data will be lost. -* `location` - (Required) The Azure Region where the Application Volume Group should exist. Changing this forces a new Application Volume Group to be created. +* `location` - (Required) The Azure Region where the Application Volume Group should exist. Changing this forces a new Application Volume Group to be created and data will be lost. -* `name` - (Required) The name which should be used for this Application Volume Group. Changing this forces a new Application Volume Group to be created. +* `name` - (Required) The name which should be used for this Application Volume Group. Changing this forces a new Application Volume Group to be created and data will be lost. -* `resource_group_name` - (Required) The name of the Resource Group where the Application Volume Group should exist. Changing this forces a new Application Volume Group to be created. +* `resource_group_name` - (Required) The name of the Resource Group where the Application Volume Group should exist. Changing this forces a new Application Volume Group to be created and data will be lost. * `volume` - (Required) One or more `volume` blocks as defined below. @@ -265,35 +265,35 @@ The following arguments are supported: A `volume` block supports the following: -* `capacity_pool_id` - (Required) The ID of the Capacity Pool. Changing this forces a new Application Volume Group to be created. +* `capacity_pool_id` - (Required) The ID of the Capacity Pool. Changing this forces a new Application Volume Group to be created and data will be lost. -* `name` - (Required) The name which should be used for this volume. Changing this forces a new Application Volume Group to be created. +* `name` - (Required) The name which should be used for this volume. Changing this forces a new Application Volume Group to be created and data will be lost. -* `protocols` - (Required) The target volume protocol expressed as a list. Changing this forces a new Application Volume Group to be created. Supported values for Application Volume Group include `NFSv3` or `NFSv4.1`, multi-protocol is not supported and there are certain rules on which protocol is supporteed per volume spec, please check [Configure application volume groups for the SAP HANA REST API](https://learn.microsoft.com/en-us/azure/azure-netapp-files/configure-application-volume-group-sap-hana-api) document for details. +* `protocols` - (Required) The target volume protocol expressed as a list. Changing this forces a new Application Volume Group to be created and data will be lost. Supported values for Application Volume Group include `NFSv3` or `NFSv4.1`, multi-protocol is not supported and there are certain rules on which protocol is supporteed per volume spec, please check [Configure application volume groups for the SAP HANA REST API](https://learn.microsoft.com/en-us/azure/azure-netapp-files/configure-application-volume-group-sap-hana-api) document for details. -* `proximity_placement_group_id` - (Required) The ID of the proximity placement group. Changing this forces a new Application Volume Group to be created. For SAP-HANA application, it is required to have PPG enabled so Azure NetApp Files can pin the volumes next to your compute resources, please check [Requirements and considerations for application volume group for SAP HANA](https://learn.microsoft.com/en-us/azure/azure-netapp-files/application-volume-group-considerations) for details and other requirements. +* `proximity_placement_group_id` - (Required) The ID of the proximity placement group. Changing this forces a new Application Volume Group to be created and data will be lost. For SAP-HANA application, it is required to have PPG enabled so Azure NetApp Files can pin the volumes next to your compute resources, please check [Requirements and considerations for application volume group for SAP HANA](https://learn.microsoft.com/en-us/azure/azure-netapp-files/application-volume-group-considerations) for details and other requirements. -* `security_style` - (Required) Volume security style. Possible value is `Unix`. Changing this forces a new Application Volume Group to be created. +* `security_style` - (Required) Volume security style. Possible value is `Unix`. Changing this forces a new Application Volume Group to be created and data will be lost. -* `service_level` - (Required) Volume security style. Possible values are `Premium`, `Standard` and `Ultra`. Changing this forces a new Application Volume Group to be created. +* `service_level` - (Required) Volume security style. Possible values are `Premium`, `Standard` and `Ultra`. Changing this forces a new Application Volume Group to be created and data will be lost. -* `snapshot_directory_visible` - (Required) Specifies whether the .snapshot (NFS clients) path of a volume is visible. Changing this forces a new Application Volume Group to be created. +* `snapshot_directory_visible` - (Required) Specifies whether the .snapshot (NFS clients) path of a volume is visible. Changing this forces a new Application Volume Group to be created and data will be lost. * `storage_quota_in_gb` - (Required) The maximum Storage Quota allowed for a file system in Gigabytes. -* `subnet_id` - (Required) The ID of the Subnet the NetApp Volume resides in, which must have the `Microsoft.NetApp/volumes` delegation. Changing this forces a new Application Volume Group to be created. +* `subnet_id` - (Required) The ID of the Subnet the NetApp Volume resides in, which must have the `Microsoft.NetApp/volumes` delegation. Changing this forces a new Application Volume Group to be created and data will be lost. * `throughput_in_mibps` - (Required) Throughput of this volume in Mibps. -* `volume_path` - (Required) A unique file path for the volume. Changing this forces a new Application Volume Group to be created. +* `volume_path` - (Required) A unique file path for the volume. Changing this forces a new Application Volume Group to be created and data will be lost. -* `volume_spec_name` - (Required) Volume specification name. Possible values are `data`, `log`, `shared`, `data-backup` and `log-backup`. +* `volume_spec_name` - (Required) Volume specification name. Possible values are `data`, `log`, `shared`, `data-backup` and `log-backup`. Changing this forces a new Application Volume Group to be created and data will be lost. * `tags` - (Optional) A mapping of tags which should be assigned to the Application Volume Group. * `export_policy_rule` - (Required) One or more `export_policy_rule` blocks as defined below. -* `data_protection_replication` - (Optional) A `data_protection_replication` block as defined below. Changing this forces a new Application Volume Group to be created. +* `data_protection_replication` - (Optional) A `data_protection_replication` block as defined below. Changing this forces a new Application Volume Group to be created and data will be lost. * `data_protection_snapshot_policy` - (Optional) A `data_protection_snapshot_policy` block as defined below. @@ -303,7 +303,7 @@ A `data_protection_replication` block is used when enabling the Cross-Region Rep This block supports the following: -* `remote_volume_location` - (Required) Location of the primary volume. Changing this forces a new resource to be created. +* `remote_volume_location` - (Required) Location of the primary volume. Changing this forces a new Application Volume Group to be created and data will be lost. * `remote_volume_resource_id` - (Required) Resource ID of the primary volume. From efb31ce23a14eaf1aaca101e36f337770b788b7a Mon Sep 17 00:00:00 2001 From: Paulo Date: Wed, 5 Apr 2023 20:15:28 +0000 Subject: [PATCH 51/83] Fixing NetApp service --- .teamcity/components/generated/services.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.teamcity/components/generated/services.kt b/.teamcity/components/generated/services.kt index d570ecc90a92..a281af47696f 100644 --- a/.teamcity/components/generated/services.kt +++ b/.teamcity/components/generated/services.kt @@ -115,5 +115,5 @@ var services = mapOf( "videoanalyzer" to "Video Analyzer", "voiceservices" to "Voice Services", "web" to "Web", - "netapp" to "netapp" + "netapp" to "NetApp" ) \ No newline at end of file From 7a3b24f7f4e094f6f72d4daf973704090ec87696 Mon Sep 17 00:00:00 2001 From: Paulo Date: Fri, 7 Apr 2023 14:06:29 +0000 Subject: [PATCH 52/83] Pushing new execution of `make generate` plus merge from last nights PR merges to main --- .teamcity/components/generated/services.kt | 2 +- website/allowed-subcategories | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.teamcity/components/generated/services.kt b/.teamcity/components/generated/services.kt index 86dccd840584..2756ad8836f9 100644 --- a/.teamcity/components/generated/services.kt +++ b/.teamcity/components/generated/services.kt @@ -116,5 +116,5 @@ var services = mapOf( "videoanalyzer" to "Video Analyzer", "voiceservices" to "Voice Services", "web" to "Web", - "netapp" to "NetApp" + "netapp" to "netapp" ) \ No newline at end of file diff --git a/website/allowed-subcategories b/website/allowed-subcategories index 2db5b276ee1d..3fe6c3deb958 100644 --- a/website/allowed-subcategories +++ b/website/allowed-subcategories @@ -97,4 +97,4 @@ VMware (AVS) Video Analyzer Voice Services Web PubSub -NetApp \ No newline at end of file +netapp \ No newline at end of file From c72786e63c8e73beaced600cd58921e08c988539 Mon Sep 17 00:00:00 2001 From: Paulo Date: Fri, 7 Apr 2023 14:12:37 +0000 Subject: [PATCH 53/83] Making all NetApp subcategory to lower case --- website/docs/d/netapp_account.html.markdown | 2 +- website/docs/d/netapp_pool.html.markdown | 2 +- website/docs/d/netapp_snapshot.html.markdown | 2 +- website/docs/d/netapp_snapshot_policy.html.markdown | 2 +- website/docs/d/netapp_volume.html.markdown | 2 +- website/docs/d/netapp_volume_group.html.markdown | 2 +- website/docs/r/netapp_account.html.markdown | 2 +- website/docs/r/netapp_pool.html.markdown | 2 +- website/docs/r/netapp_snapshot.html.markdown | 2 +- website/docs/r/netapp_snapshot_policy.html.markdown | 2 +- website/docs/r/netapp_volume.html.markdown | 2 +- website/docs/r/netapp_volume_group.html.markdown | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/website/docs/d/netapp_account.html.markdown b/website/docs/d/netapp_account.html.markdown index 22e97e5151b7..a4d688539dd4 100644 --- a/website/docs/d/netapp_account.html.markdown +++ b/website/docs/d/netapp_account.html.markdown @@ -1,5 +1,5 @@ --- -subcategory: "NetApp" +subcategory: "netapp" layout: "azurerm" page_title: "Azure Resource Manager: azurerm_netapp_account" description: |- diff --git a/website/docs/d/netapp_pool.html.markdown b/website/docs/d/netapp_pool.html.markdown index c0edd7b1fc25..1760210d9dff 100644 --- a/website/docs/d/netapp_pool.html.markdown +++ b/website/docs/d/netapp_pool.html.markdown @@ -1,5 +1,5 @@ --- -subcategory: "NetApp" +subcategory: "netapp" layout: "azurerm" page_title: "Azure Resource Manager: azurerm_netapp_pool" description: |- diff --git a/website/docs/d/netapp_snapshot.html.markdown b/website/docs/d/netapp_snapshot.html.markdown index ec87b779d59f..aa579f5630da 100644 --- a/website/docs/d/netapp_snapshot.html.markdown +++ b/website/docs/d/netapp_snapshot.html.markdown @@ -1,5 +1,5 @@ --- -subcategory: "NetApp" +subcategory: "netapp" layout: "azurerm" page_title: "Azure Resource Manager: azurerm_netapp_snapshot" description: |- diff --git a/website/docs/d/netapp_snapshot_policy.html.markdown b/website/docs/d/netapp_snapshot_policy.html.markdown index 6d73e9407150..345015d23b12 100644 --- a/website/docs/d/netapp_snapshot_policy.html.markdown +++ b/website/docs/d/netapp_snapshot_policy.html.markdown @@ -1,5 +1,5 @@ --- -subcategory: "NetApp" +subcategory: "netapp" layout: "azurerm" page_title: "Azure Resource Manager: azurerm_netapp_snapshot_policy" description: |- diff --git a/website/docs/d/netapp_volume.html.markdown b/website/docs/d/netapp_volume.html.markdown index b19af556d80f..caba37ac3131 100644 --- a/website/docs/d/netapp_volume.html.markdown +++ b/website/docs/d/netapp_volume.html.markdown @@ -1,5 +1,5 @@ --- -subcategory: "NetApp" +subcategory: "netapp" layout: "azurerm" page_title: "Azure Resource Manager: azurerm_netapp_volume" description: |- diff --git a/website/docs/d/netapp_volume_group.html.markdown b/website/docs/d/netapp_volume_group.html.markdown index 56db2d0ea9ae..f421cd2d08a1 100644 --- a/website/docs/d/netapp_volume_group.html.markdown +++ b/website/docs/d/netapp_volume_group.html.markdown @@ -1,5 +1,5 @@ --- -subcategory: "NetApp" +subcategory: "netapp" layout: "azurerm" page_title: "Azure Resource Manager: Data Source: azurerm_netapp_volume_group" description: |- diff --git a/website/docs/r/netapp_account.html.markdown b/website/docs/r/netapp_account.html.markdown index 99f2e16f25bd..d18f4bb5e61a 100644 --- a/website/docs/r/netapp_account.html.markdown +++ b/website/docs/r/netapp_account.html.markdown @@ -1,5 +1,5 @@ --- -subcategory: "NetApp" +subcategory: "netapp" layout: "azurerm" page_title: "Azure Resource Manager: azurerm_netapp_account" description: |- diff --git a/website/docs/r/netapp_pool.html.markdown b/website/docs/r/netapp_pool.html.markdown index cb9180d6ec95..a0cbdf695867 100644 --- a/website/docs/r/netapp_pool.html.markdown +++ b/website/docs/r/netapp_pool.html.markdown @@ -1,5 +1,5 @@ --- -subcategory: "NetApp" +subcategory: "netapp" layout: "azurerm" page_title: "Azure Resource Manager: azurerm_netapp_pool" description: |- diff --git a/website/docs/r/netapp_snapshot.html.markdown b/website/docs/r/netapp_snapshot.html.markdown index e8b1c56cddb6..49508b7ec128 100644 --- a/website/docs/r/netapp_snapshot.html.markdown +++ b/website/docs/r/netapp_snapshot.html.markdown @@ -1,5 +1,5 @@ --- -subcategory: "NetApp" +subcategory: "netapp" layout: "azurerm" page_title: "Azure Resource Manager: azurerm_netapp_snapshot" description: |- diff --git a/website/docs/r/netapp_snapshot_policy.html.markdown b/website/docs/r/netapp_snapshot_policy.html.markdown index ed54b12d17a6..257637029be4 100644 --- a/website/docs/r/netapp_snapshot_policy.html.markdown +++ b/website/docs/r/netapp_snapshot_policy.html.markdown @@ -1,5 +1,5 @@ --- -subcategory: "NetApp" +subcategory: "netapp" layout: "azurerm" page_title: "Azure Resource Manager: azurerm_netapp_snapshot_policy" description: |- diff --git a/website/docs/r/netapp_volume.html.markdown b/website/docs/r/netapp_volume.html.markdown index 65220ce5141d..d36305376378 100644 --- a/website/docs/r/netapp_volume.html.markdown +++ b/website/docs/r/netapp_volume.html.markdown @@ -1,5 +1,5 @@ --- -subcategory: "NetApp" +subcategory: "netapp" layout: "azurerm" page_title: "Azure Resource Manager: azurerm_netapp_volume" description: |- diff --git a/website/docs/r/netapp_volume_group.html.markdown b/website/docs/r/netapp_volume_group.html.markdown index 2ce2cbc81325..66aebe4940a6 100644 --- a/website/docs/r/netapp_volume_group.html.markdown +++ b/website/docs/r/netapp_volume_group.html.markdown @@ -1,5 +1,5 @@ --- -subcategory: "NetApp" +subcategory: "netapp" layout: "azurerm" page_title: "Azure Resource Manager: azurerm_netapp_volume_group" description: |- From 864baf7885b194feca7dca9d564a879090946f37 Mon Sep 17 00:00:00 2001 From: Paulo Marques Date: Tue, 11 Apr 2023 13:29:16 -0700 Subject: [PATCH 54/83] Update internal/services/netapp/netapp_volume_helper.go Co-authored-by: Matthew Frahry --- internal/services/netapp/netapp_volume_helper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/services/netapp/netapp_volume_helper.go b/internal/services/netapp/netapp_volume_helper.go index 757a111e20bf..6d7c3e04c10d 100644 --- a/internal/services/netapp/netapp_volume_helper.go +++ b/internal/services/netapp/netapp_volume_helper.go @@ -187,7 +187,7 @@ func expandNetAppVolumeGroupVolumeExportPolicyRule(input []ExportPolicyRule) *vo } func expandNetAppVolumeGroupDataProtectionReplication(input []DataProtectionReplication) *volumegroups.VolumePropertiesDataProtection { - if len(input) == 0 || input == nil { + if len(input) == 0 { return &volumegroups.VolumePropertiesDataProtection{} } From ef66b38f789bef56d524c3726d2617cf8238d059 Mon Sep 17 00:00:00 2001 From: Paulo Marques Date: Tue, 11 Apr 2023 13:29:54 -0700 Subject: [PATCH 55/83] Update internal/services/netapp/netapp_volume_helper.go Co-authored-by: Matthew Frahry --- internal/services/netapp/netapp_volume_helper.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/services/netapp/netapp_volume_helper.go b/internal/services/netapp/netapp_volume_helper.go index 6d7c3e04c10d..fb3d44e50297 100644 --- a/internal/services/netapp/netapp_volume_helper.go +++ b/internal/services/netapp/netapp_volume_helper.go @@ -221,7 +221,6 @@ func expandNetAppVolumeGroupDataProtectionSnapshotPolicy(input []DataProtectionS } func expandNetAppVolumeGroupVolumes(input []NetAppVolumeGroupVolume, id volumegroups.VolumeGroupId) (*[]volumegroups.VolumeGroupVolumeProperties, error) { - if len(input) == 0 || input == nil { return &[]volumegroups.VolumeGroupVolumeProperties{}, fmt.Errorf("received empty NetAppVolumeGroupVolume slice") } From 5b211aab23a218e55dcdd50d0b551d9caf55721c Mon Sep 17 00:00:00 2001 From: Paulo Marques Date: Tue, 11 Apr 2023 13:31:15 -0700 Subject: [PATCH 56/83] Update internal/services/netapp/netapp_volume_helper.go Co-authored-by: Matthew Frahry --- internal/services/netapp/netapp_volume_helper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/services/netapp/netapp_volume_helper.go b/internal/services/netapp/netapp_volume_helper.go index fb3d44e50297..427849dfea13 100644 --- a/internal/services/netapp/netapp_volume_helper.go +++ b/internal/services/netapp/netapp_volume_helper.go @@ -221,7 +221,7 @@ func expandNetAppVolumeGroupDataProtectionSnapshotPolicy(input []DataProtectionS } func expandNetAppVolumeGroupVolumes(input []NetAppVolumeGroupVolume, id volumegroups.VolumeGroupId) (*[]volumegroups.VolumeGroupVolumeProperties, error) { - if len(input) == 0 || input == nil { + if len(input) == 0 { return &[]volumegroups.VolumeGroupVolumeProperties{}, fmt.Errorf("received empty NetAppVolumeGroupVolume slice") } From 6301ec698efdddb6961639929bb384b63520a8d8 Mon Sep 17 00:00:00 2001 From: Paulo Marques Date: Tue, 11 Apr 2023 13:31:24 -0700 Subject: [PATCH 57/83] Update internal/services/netapp/netapp_snapshot_resource_test.go Co-authored-by: Matthew Frahry --- internal/services/netapp/netapp_snapshot_resource_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/services/netapp/netapp_snapshot_resource_test.go b/internal/services/netapp/netapp_snapshot_resource_test.go index f0e3e2bd9bb4..feb60bfb348a 100644 --- a/internal/services/netapp/netapp_snapshot_resource_test.go +++ b/internal/services/netapp/netapp_snapshot_resource_test.go @@ -6,7 +6,6 @@ import ( "testing" "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/snapshots" - "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" From 9bc6248824c2a774b9e972b48e4f1c23e66582a0 Mon Sep 17 00:00:00 2001 From: Paulo Marques Date: Tue, 11 Apr 2023 13:33:40 -0700 Subject: [PATCH 58/83] Update internal/services/netapp/netapp_volume_group_data_source.go Co-authored-by: Matthew Frahry --- internal/services/netapp/netapp_volume_group_data_source.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/services/netapp/netapp_volume_group_data_source.go b/internal/services/netapp/netapp_volume_group_data_source.go index 51ae5531d8d5..ca8eb24383a9 100644 --- a/internal/services/netapp/netapp_volume_group_data_source.go +++ b/internal/services/netapp/netapp_volume_group_data_source.go @@ -186,7 +186,7 @@ func (r NetAppVolumeGroupDataSource) Attributes() map[string]*pluginsdk.Schema { }, }, - "tags": commonschema.Tags(), + "tags": commonschema.TagsDataSource(), "snapshot_directory_visible": { Type: pluginsdk.TypeBool, From 80c6598e184954aaa939cdb12955c6493f18c3f5 Mon Sep 17 00:00:00 2001 From: Paulo Date: Tue, 11 Apr 2023 23:43:30 +0000 Subject: [PATCH 59/83] Resolving PR comments --- .../netapp/netapp_volume_group_resource.go | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/internal/services/netapp/netapp_volume_group_resource.go b/internal/services/netapp/netapp_volume_group_resource.go index f3871711f137..11097071c6ae 100644 --- a/internal/services/netapp/netapp_volume_group_resource.go +++ b/internal/services/netapp/netapp_volume_group_resource.go @@ -180,8 +180,9 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { }, "throughput_in_mibps": { - Type: pluginsdk.TypeFloat, - Required: true, + Type: pluginsdk.TypeFloat, + Required: true, + ValidateFunc: validation.IntAtLeast(1), }, "export_policy_rule": { @@ -298,14 +299,7 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { } func (r NetAppVolumeGroupResource) Attributes() map[string]*pluginsdk.Schema { - return map[string]*pluginsdk.Schema{ - /* - TODO - This section is for `Computed: true` only items, i.e. useful values that are returned by the - datasource that can be used as outputs or passed programmatically to other resources or data sources. - - NOTE: Not applicable for this resource type - */ - } + return map[string]*pluginsdk.Schema{} } func (r NetAppVolumeGroupResource) Create() sdk.ResourceFunc { From d70ddc3aacbacad796e1c1848c6f59e558062226 Mon Sep 17 00:00:00 2001 From: Paulo Date: Wed, 12 Apr 2023 00:06:27 +0000 Subject: [PATCH 60/83] Adding missing validations --- .../netapp/netapp_volume_group_resource.go | 19 ++--- .../netapp/validate/volume_group_name_test.go | 71 +++++++++++++++++++ .../netapp/validate/volume_grupo_name.go | 16 +++++ 3 files changed, 98 insertions(+), 8 deletions(-) create mode 100644 internal/services/netapp/validate/volume_group_name_test.go create mode 100644 internal/services/netapp/validate/volume_grupo_name.go diff --git a/internal/services/netapp/netapp_volume_group_resource.go b/internal/services/netapp/netapp_volume_group_resource.go index 11097071c6ae..e57d26dec322 100644 --- a/internal/services/netapp/netapp_volume_group_resource.go +++ b/internal/services/netapp/netapp_volume_group_resource.go @@ -52,9 +52,10 @@ func (r NetAppVolumeGroupResource) IDValidationFunc() pluginsdk.SchemaValidateFu func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { return map[string]*pluginsdk.Schema{ "name": { - Type: pluginsdk.TypeString, - Required: true, - ForceNew: true, + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: netAppValidate.VolumeGroupName, }, "resource_group_name": commonschema.ResourceGroupName(), @@ -69,9 +70,10 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { }, "group_description": { - Type: pluginsdk.TypeString, - Required: true, - ForceNew: true, + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.StringIsNotEmpty, }, "application_type": { @@ -199,8 +201,9 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { }, "allowed_clients": { - Type: pluginsdk.TypeString, - Required: true, + Type: pluginsdk.TypeString, + Required: true, + ValidateFunc: validation.StringIsNotEmpty, }, "nfsv3_enabled": { diff --git a/internal/services/netapp/validate/volume_group_name_test.go b/internal/services/netapp/validate/volume_group_name_test.go new file mode 100644 index 000000000000..1148a5e916a8 --- /dev/null +++ b/internal/services/netapp/validate/volume_group_name_test.go @@ -0,0 +1,71 @@ +package validate + +import "testing" + +func TestNetAppVolumeGroupName(t *testing.T) { + testData := []struct { + input string + expected bool + }{ + { + // empty + input: "", + expected: false, + }, + { + // basic example + input: "hello", + expected: true, + }, + { + // can't start with an underscore + input: "_hello", + expected: false, + }, + { + // can't end with a dash + input: "hello-", + expected: true, + }, + { + // can't contain an exclamation mark + input: "hello!", + expected: false, + }, + { + // dash in the middle + input: "malcolm-in-the-middle", + expected: true, + }, + { + // can't end with a period + input: "hello.", + expected: false, + }, + { + // 63 chars + input: "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk", + expected: true, + }, + { + // 64 chars + input: "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkj", + expected: true, + }, + { + // 65 chars + input: "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkja", + expected: false, + }, + } + + for _, v := range testData { + t.Logf("[DEBUG] Testing %q..", v.input) + + _, errors := VolumeGroupName(v.input, "name") + actual := len(errors) == 0 + if v.expected != actual { + t.Fatalf("Expected %t but got %t", v.expected, actual) + } + } +} diff --git a/internal/services/netapp/validate/volume_grupo_name.go b/internal/services/netapp/validate/volume_grupo_name.go new file mode 100644 index 000000000000..b0e4cea86ec0 --- /dev/null +++ b/internal/services/netapp/validate/volume_grupo_name.go @@ -0,0 +1,16 @@ +package validate + +import ( + "fmt" + "regexp" +) + +func VolumeGroupName(v interface{}, k string) (warnings []string, errors []error) { + value := v.(string) + + if !regexp.MustCompile(`^[a-zA-Z][-_\da-zA-Z]{0,63}$`).MatchString(value) { + errors = append(errors, fmt.Errorf("%q must be between 1 and 64 characters in length and start with letters and contains only letters, numbers, underscore or hyphens.", k)) + } + + return warnings, errors +} From facb4ba51d836ec183d11743cb4e5f462de4adc8 Mon Sep 17 00:00:00 2001 From: Paulo Date: Wed, 12 Apr 2023 21:57:26 +0000 Subject: [PATCH 61/83] Making volume_group resource become volume_group_sap_hana for better separation on future application types --- ...tapp_volume_group_sap_hana_data_source.go} | 31 +++---- ...volume_group_sap_hana_data_source_test.go} | 21 +++-- ... netapp_volume_group_sap_hana_resource.go} | 55 +++++-------- ...pp_volume_group_sap_hana_resource_test.go} | 81 +++++++++---------- .../services/netapp/netapp_volume_helper.go | 55 +++++-------- internal/services/netapp/registration.go | 4 +- ...etapp_volume_group_sap_hana.html.markdown} | 16 ++-- ...etapp_volume_group_sap_hana.html.markdown} | 15 ++-- 8 files changed, 117 insertions(+), 161 deletions(-) rename internal/services/netapp/{netapp_volume_group_data_source.go => netapp_volume_group_sap_hana_data_source.go} (86%) rename internal/services/netapp/{netapp_volume_group_data_source_test.go => netapp_volume_group_sap_hana_data_source_test.go} (50%) rename internal/services/netapp/{netapp_volume_group_resource.go => netapp_volume_group_sap_hana_resource.go} (92%) rename internal/services/netapp/{netapp_volume_group_resource_test.go => netapp_volume_group_sap_hana_resource_test.go} (94%) rename website/docs/d/{netapp_volume_group.html.markdown => netapp_volume_group_sap_hana.html.markdown} (89%) rename website/docs/r/{netapp_volume_group.html.markdown => netapp_volume_group_sap_hana.html.markdown} (96%) diff --git a/internal/services/netapp/netapp_volume_group_data_source.go b/internal/services/netapp/netapp_volume_group_sap_hana_data_source.go similarity index 86% rename from internal/services/netapp/netapp_volume_group_data_source.go rename to internal/services/netapp/netapp_volume_group_sap_hana_data_source.go index ca8eb24383a9..f79dfc15d75c 100644 --- a/internal/services/netapp/netapp_volume_group_data_source.go +++ b/internal/services/netapp/netapp_volume_group_sap_hana_data_source.go @@ -13,34 +13,33 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" ) -type NetAppVolumeGroupDataSourceModel struct { +type NetAppVolumeGroupSapHanaDataSourceModel struct { Name string `tfschema:"name"` ResourceGroupName string `tfschema:"resource_group_name"` Location string `tfschema:"location"` AccountName string `tfschema:"account_name"` GroupDescription string `tfschema:"group_description"` - ApplicationType string `tfschema:"application_type"` ApplicationIdentifier string `tfschema:"application_identifier"` Volumes []NetAppVolumeGroupVolume `tfschema:"volume"` } -var _ sdk.DataSource = NetAppVolumeGroupDataSource{} +var _ sdk.DataSource = NetAppVolumeGroupSapHanaDataSource{} -type NetAppVolumeGroupDataSource struct{} +type NetAppVolumeGroupSapHanaDataSource struct{} -func (r NetAppVolumeGroupDataSource) ResourceType() string { - return "azurerm_netapp_volume_group" +func (r NetAppVolumeGroupSapHanaDataSource) ResourceType() string { + return "azurerm_netapp_volume_group_sap_hana" } -func (r NetAppVolumeGroupDataSource) ModelObject() interface{} { - return &NetAppVolumeGroupDataSourceModel{} +func (r NetAppVolumeGroupSapHanaDataSource) ModelObject() interface{} { + return &NetAppVolumeGroupSapHanaDataSourceModel{} } -func (r NetAppVolumeGroupDataSource) IDValidationFunc() pluginsdk.SchemaValidateFunc { +func (r NetAppVolumeGroupSapHanaDataSource) IDValidationFunc() pluginsdk.SchemaValidateFunc { return volumegroups.ValidateVolumeGroupID } -func (r NetAppVolumeGroupDataSource) Arguments() map[string]*pluginsdk.Schema { +func (r NetAppVolumeGroupSapHanaDataSource) Arguments() map[string]*pluginsdk.Schema { return map[string]*pluginsdk.Schema{ "name": { Type: pluginsdk.TypeString, @@ -56,7 +55,7 @@ func (r NetAppVolumeGroupDataSource) Arguments() map[string]*pluginsdk.Schema { } } -func (r NetAppVolumeGroupDataSource) Attributes() map[string]*pluginsdk.Schema { +func (r NetAppVolumeGroupSapHanaDataSource) Attributes() map[string]*pluginsdk.Schema { return map[string]*pluginsdk.Schema{ "location": commonschema.LocationComputed(), @@ -65,11 +64,6 @@ func (r NetAppVolumeGroupDataSource) Attributes() map[string]*pluginsdk.Schema { Computed: true, }, - "application_type": { - Type: pluginsdk.TypeString, - Computed: true, - }, - "application_identifier": { Type: pluginsdk.TypeString, Computed: true, @@ -244,14 +238,14 @@ func (r NetAppVolumeGroupDataSource) Attributes() map[string]*pluginsdk.Schema { } } -func (r NetAppVolumeGroupDataSource) Read() sdk.ResourceFunc { +func (r NetAppVolumeGroupSapHanaDataSource) Read() sdk.ResourceFunc { return sdk.ResourceFunc{ Timeout: 5 * time.Minute, Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { client := metadata.Client.NetApp.VolumeGroupClient - var state NetAppVolumeGroupDataSourceModel + var state NetAppVolumeGroupSapHanaDataSourceModel if err := metadata.Decode(&state); err != nil { return fmt.Errorf("decoding: %+v", err) } @@ -273,7 +267,6 @@ func (r NetAppVolumeGroupDataSource) Read() sdk.ResourceFunc { state.Location = location.Normalize(*model.Location) state.ApplicationIdentifier = *model.Properties.GroupMetaData.ApplicationIdentifier - state.ApplicationType = string(*model.Properties.GroupMetaData.ApplicationType) state.GroupDescription = *model.Properties.GroupMetaData.GroupDescription volumes, err := flattenNetAppVolumeGroupVolumes(ctx, model.Properties.Volumes, metadata) diff --git a/internal/services/netapp/netapp_volume_group_data_source_test.go b/internal/services/netapp/netapp_volume_group_sap_hana_data_source_test.go similarity index 50% rename from internal/services/netapp/netapp_volume_group_data_source_test.go rename to internal/services/netapp/netapp_volume_group_sap_hana_data_source_test.go index 7a9f0a949680..f64aebdb9d99 100644 --- a/internal/services/netapp/netapp_volume_group_data_source_test.go +++ b/internal/services/netapp/netapp_volume_group_sap_hana_data_source_test.go @@ -8,11 +8,11 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" ) -type NetAppVolumeGroupDataSource struct{} +type NetAppVolumeGroupSapHanaDataSource struct{} -func TestAccNetAppVolumeGroupDataSource_basic(t *testing.T) { - data := acceptance.BuildTestData(t, "data.azurerm_netapp_volume_group", "test") - d := NetAppVolumeGroupDataSource{} +func TestAccNetAppVolumeGroupSapHanaDataSource_basic(t *testing.T) { + data := acceptance.BuildTestData(t, "data.azurerm_netapp_volume_group_sap_hana", "test") + d := NetAppVolumeGroupSapHanaDataSource{} data.DataSourceTest(t, []acceptance.TestStep{ { @@ -20,21 +20,20 @@ func TestAccNetAppVolumeGroupDataSource_basic(t *testing.T) { Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).Key("name").Exists(), check.That(data.ResourceName).Key("resource_group_name").Exists(), - check.That(data.ResourceName).Key("application_type").HasValue("SAP-HANA"), check.That(data.ResourceName).Key("volume.1.volume_spec_name").HasValue("log"), ), }, }) } -func (d NetAppVolumeGroupDataSource) basic(data acceptance.TestData) string { +func (d NetAppVolumeGroupSapHanaDataSource) basic(data acceptance.TestData) string { return fmt.Sprintf(` %s -data "azurerm_netapp_volume_group" "test" { - name = azurerm_netapp_volume_group.test.name - resource_group_name = azurerm_netapp_volume_group.test.resource_group_name - account_name = azurerm_netapp_volume_group.test.account_name +data "azurerm_netapp_volume_group_sap_hana" "test" { + name = azurerm_netapp_volume_group_sap_hana.test.name + resource_group_name = azurerm_netapp_volume_group_sap_hana.test.resource_group_name + account_name = azurerm_netapp_volume_group_sap_hana.test.account_name } -`, NetAppVolumeGroupResource{}.basic(data)) +`, NetAppVolumeGroupSapHanaResource{}.basic(data)) } diff --git a/internal/services/netapp/netapp_volume_group_resource.go b/internal/services/netapp/netapp_volume_group_sap_hana_resource.go similarity index 92% rename from internal/services/netapp/netapp_volume_group_resource.go rename to internal/services/netapp/netapp_volume_group_sap_hana_resource.go index e57d26dec322..515932d5b2a1 100644 --- a/internal/services/netapp/netapp_volume_group_resource.go +++ b/internal/services/netapp/netapp_volume_group_sap_hana_resource.go @@ -22,34 +22,33 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/utils" ) -type NetAppVolumeGroupResource struct{} +type NetAppVolumeGroupSapHanaResource struct{} -type NetAppVolumeGroupModel struct { +type NetAppVolumeGroupSapHanaModel struct { Name string `tfschema:"name"` ResourceGroupName string `tfschema:"resource_group_name"` Location string `tfschema:"location"` AccountName string `tfschema:"account_name"` GroupDescription string `tfschema:"group_description"` - ApplicationType string `tfschema:"application_type"` ApplicationIdentifier string `tfschema:"application_identifier"` Volumes []NetAppVolumeGroupVolume `tfschema:"volume"` } -var _ sdk.Resource = NetAppVolumeGroupResource{} +var _ sdk.Resource = NetAppVolumeGroupSapHanaResource{} -func (r NetAppVolumeGroupResource) ModelObject() interface{} { - return &NetAppVolumeGroupModel{} +func (r NetAppVolumeGroupSapHanaResource) ModelObject() interface{} { + return &NetAppVolumeGroupSapHanaModel{} } -func (r NetAppVolumeGroupResource) ResourceType() string { - return "azurerm_netapp_volume_group" +func (r NetAppVolumeGroupSapHanaResource) ResourceType() string { + return "azurerm_netapp_volume_group_sap_hana" } -func (r NetAppVolumeGroupResource) IDValidationFunc() pluginsdk.SchemaValidateFunc { +func (r NetAppVolumeGroupSapHanaResource) IDValidationFunc() pluginsdk.SchemaValidateFunc { return volumegroups.ValidateVolumeGroupID } -func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { +func (r NetAppVolumeGroupSapHanaResource) Arguments() map[string]*pluginsdk.Schema { return map[string]*pluginsdk.Schema{ "name": { Type: pluginsdk.TypeString, @@ -76,15 +75,6 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { ValidateFunc: validation.StringIsNotEmpty, }, - "application_type": { - Type: pluginsdk.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validation.StringInSlice([]string{ - string(volumegroups.ApplicationTypeSAPNegativeHANA), - }, false), - }, - "application_identifier": { Type: pluginsdk.TypeString, Required: true, @@ -129,7 +119,7 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { Type: pluginsdk.TypeString, Required: true, ForceNew: true, - ValidateFunc: validation.StringInSlice(PossibleValuesForVolumeSpecName(), false), + ValidateFunc: validation.StringInSlice(PossibleValuesForVolumeSpecNameSapHana(), false), }, "volume_path": { @@ -164,7 +154,7 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { MaxItems: 1, Elem: &pluginsdk.Schema{ Type: pluginsdk.TypeString, - ValidateFunc: validation.StringInSlice(PossibleValuesForProtocolTypeAvg(), false), + ValidateFunc: validation.StringInSlice(PossibleValuesForProtocolTypeVolumeGroupSapHana(), false), }, }, @@ -184,7 +174,7 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { "throughput_in_mibps": { Type: pluginsdk.TypeFloat, Required: true, - ValidateFunc: validation.IntAtLeast(1), + ValidateFunc: validation.FloatAtLeast(0.1), }, "export_policy_rule": { @@ -301,11 +291,11 @@ func (r NetAppVolumeGroupResource) Arguments() map[string]*pluginsdk.Schema { } } -func (r NetAppVolumeGroupResource) Attributes() map[string]*pluginsdk.Schema { +func (r NetAppVolumeGroupSapHanaResource) Attributes() map[string]*pluginsdk.Schema { return map[string]*pluginsdk.Schema{} } -func (r NetAppVolumeGroupResource) Create() sdk.ResourceFunc { +func (r NetAppVolumeGroupSapHanaResource) Create() sdk.ResourceFunc { return sdk.ResourceFunc{ Timeout: 90 * time.Minute, Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { @@ -314,7 +304,7 @@ func (r NetAppVolumeGroupResource) Create() sdk.ResourceFunc { subscriptionId := metadata.Client.Account.SubscriptionId - var model NetAppVolumeGroupModel + var model NetAppVolumeGroupSapHanaModel if err := metadata.Decode(&model); err != nil { return fmt.Errorf("decoding: %+v", err) } @@ -331,7 +321,7 @@ func (r NetAppVolumeGroupResource) Create() sdk.ResourceFunc { return metadata.ResourceRequiresImport(r.ResourceType(), id) } - applicationType := volumegroups.ApplicationType(model.ApplicationType) + applicationType := volumegroups.ApplicationTypeSAPNegativeHANA volumeList, err := expandNetAppVolumeGroupVolumes(model.Volumes, id) if err != nil { @@ -425,7 +415,7 @@ func (r NetAppVolumeGroupResource) Create() sdk.ResourceFunc { } } -func (r NetAppVolumeGroupResource) Update() sdk.ResourceFunc { +func (r NetAppVolumeGroupSapHanaResource) Update() sdk.ResourceFunc { return sdk.ResourceFunc{ Timeout: 120 * time.Minute, Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { @@ -437,7 +427,7 @@ func (r NetAppVolumeGroupResource) Update() sdk.ResourceFunc { } metadata.Logger.Infof("Decoding state for %s", id) - var state NetAppVolumeGroupModel + var state NetAppVolumeGroupSapHanaModel if err := metadata.Decode(&state); err != nil { return err } @@ -544,7 +534,7 @@ func (r NetAppVolumeGroupResource) Update() sdk.ResourceFunc { } } -func (r NetAppVolumeGroupResource) Read() sdk.ResourceFunc { +func (r NetAppVolumeGroupSapHanaResource) Read() sdk.ResourceFunc { return sdk.ResourceFunc{ Timeout: 5 * time.Minute, Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { @@ -557,7 +547,7 @@ func (r NetAppVolumeGroupResource) Read() sdk.ResourceFunc { } metadata.Logger.Infof("Decoding state for %s", id) - var state NetAppVolumeGroupModel + var state NetAppVolumeGroupSapHanaModel if err := metadata.Decode(&state); err != nil { return err } @@ -572,7 +562,7 @@ func (r NetAppVolumeGroupResource) Read() sdk.ResourceFunc { metadata.SetID(id) - model := NetAppVolumeGroupModel{ + model := NetAppVolumeGroupSapHanaModel{ Name: id.VolumeGroupName, AccountName: id.NetAppAccountName, Location: location.NormalizeNilable(existing.Model.Location), @@ -582,7 +572,6 @@ func (r NetAppVolumeGroupResource) Read() sdk.ResourceFunc { if props := existing.Model.Properties; props != nil { model.GroupDescription = utils.NormalizeNilableString(props.GroupMetaData.GroupDescription) model.ApplicationIdentifier = utils.NormalizeNilableString(props.GroupMetaData.ApplicationIdentifier) - model.ApplicationType = string(*props.GroupMetaData.ApplicationType) volumes, err := flattenNetAppVolumeGroupVolumes(ctx, props.Volumes, metadata) if err != nil { @@ -597,7 +586,7 @@ func (r NetAppVolumeGroupResource) Read() sdk.ResourceFunc { } } -func (r NetAppVolumeGroupResource) Delete() sdk.ResourceFunc { +func (r NetAppVolumeGroupSapHanaResource) Delete() sdk.ResourceFunc { return sdk.ResourceFunc{ Timeout: 120 * time.Minute, Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { diff --git a/internal/services/netapp/netapp_volume_group_resource_test.go b/internal/services/netapp/netapp_volume_group_sap_hana_resource_test.go similarity index 94% rename from internal/services/netapp/netapp_volume_group_resource_test.go rename to internal/services/netapp/netapp_volume_group_sap_hana_resource_test.go index 01fee0d7a613..7bacd67e5969 100644 --- a/internal/services/netapp/netapp_volume_group_resource_test.go +++ b/internal/services/netapp/netapp_volume_group_sap_hana_resource_test.go @@ -14,11 +14,11 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/utils" ) -type NetAppVolumeGroupResource struct{} +type NetAppVolumeGroupSapHanaResource struct{} -func TestAccNetAppVolumeGroup_basic(t *testing.T) { - data := acceptance.BuildTestData(t, "azurerm_netapp_volume_group", "test") - r := NetAppVolumeGroupResource{} +func TestAccNetAppVolumeGroupSapHana_basic(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_netapp_volume_group_sap_hana", "test") + r := NetAppVolumeGroupSapHanaResource{} data.ResourceTest(t, r, []acceptance.TestStep{ { @@ -31,9 +31,9 @@ func TestAccNetAppVolumeGroup_basic(t *testing.T) { }) } -func TestAccNetAppVolumeGroup_snapshotPolicy(t *testing.T) { - data := acceptance.BuildTestData(t, "azurerm_netapp_volume_group", "test") - r := NetAppVolumeGroupResource{} +func TestAccNetAppVolumeGroupSapHana_snapshotPolicy(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_netapp_volume_group_sap_hana", "test") + r := NetAppVolumeGroupSapHanaResource{} data.ResourceTest(t, r, []acceptance.TestStep{ { @@ -46,9 +46,9 @@ func TestAccNetAppVolumeGroup_snapshotPolicy(t *testing.T) { }) } -func TestAccNetAppVolumeGroup_volumeUpdates(t *testing.T) { - data := acceptance.BuildTestData(t, "azurerm_netapp_volume_group", "test") - r := NetAppVolumeGroupResource{} +func TestAccNetAppVolumeGroupSapHana_volumeUpdates(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_netapp_volume_group_sap_hana", "test") + r := NetAppVolumeGroupSapHanaResource{} data.ResourceTest(t, r, []acceptance.TestStep{ { @@ -74,9 +74,9 @@ func TestAccNetAppVolumeGroup_volumeUpdates(t *testing.T) { }) } -func TestAccNetAppVolumeGroup_crossRegionReplication(t *testing.T) { - data := acceptance.BuildTestData(t, "azurerm_netapp_volume_group", "test_secondary") - r := NetAppVolumeGroupResource{} +func TestAccNetAppVolumeGroupSapHana_crossRegionReplication(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_netapp_volume_group_sap_hana", "test_secondary") + r := NetAppVolumeGroupSapHanaResource{} data.ResourceTest(t, r, []acceptance.TestStep{ { @@ -89,7 +89,7 @@ func TestAccNetAppVolumeGroup_crossRegionReplication(t *testing.T) { }) } -func (t NetAppVolumeGroupResource) Exists(ctx context.Context, clients *clients.Client, state *terraform.InstanceState) (*bool, error) { +func (t NetAppVolumeGroupSapHanaResource) Exists(ctx context.Context, clients *clients.Client, state *terraform.InstanceState) (*bool, error) { id, err := volumegroups.ParseVolumeGroupID(state.ID) if err != nil { return nil, err @@ -107,18 +107,17 @@ func (t NetAppVolumeGroupResource) Exists(ctx context.Context, clients *clients. return utils.Bool(true), nil } -func (NetAppVolumeGroupResource) basic(data acceptance.TestData) string { - template := NetAppVolumeGroupResource{}.templatePPG(data) +func (NetAppVolumeGroupSapHanaResource) basic(data acceptance.TestData) string { + template := NetAppVolumeGroupSapHanaResource{}.templatePPG(data) return fmt.Sprintf(` %[1]s -resource "azurerm_netapp_volume_group" "test" { +resource "azurerm_netapp_volume_group_sap_hana" "test" { name = "acctest-NetAppVolumeGroup-%[2]d" location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name account_name = azurerm_netapp_account.test.name group_description = "Test volume group" - application_type = "SAP-HANA" application_identifier = "TST" volume { @@ -279,8 +278,8 @@ resource "azurerm_netapp_volume_group" "test" { `, template, data.RandomInteger) } -func (NetAppVolumeGroupResource) avgSnapshotPolicy(data acceptance.TestData) string { - template := NetAppVolumeGroupResource{}.templatePPG(data) +func (NetAppVolumeGroupSapHanaResource) avgSnapshotPolicy(data acceptance.TestData) string { + template := NetAppVolumeGroupSapHanaResource{}.templatePPG(data) return fmt.Sprintf(` %[1]s @@ -304,13 +303,12 @@ resource "azurerm_netapp_snapshot_policy" "test" { } } -resource "azurerm_netapp_volume_group" "test" { +resource "azurerm_netapp_volume_group_sap_hana" "test" { name = "acctest-NetAppVolumeGroup-%[2]d" location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name account_name = azurerm_netapp_account.test.name group_description = "Test volume group" - application_type = "SAP-HANA" application_identifier = "TST" volume { @@ -491,18 +489,17 @@ resource "azurerm_netapp_volume_group" "test" { `, template, data.RandomInteger) } -func (NetAppVolumeGroupResource) updateVolumes(data acceptance.TestData) string { - template := NetAppVolumeGroupResource{}.templatePPG(data) +func (NetAppVolumeGroupSapHanaResource) updateVolumes(data acceptance.TestData) string { + template := NetAppVolumeGroupSapHanaResource{}.templatePPG(data) return fmt.Sprintf(` %[1]s -resource "azurerm_netapp_volume_group" "test" { +resource "azurerm_netapp_volume_group_sap_hana" "test" { name = "acctest-NetAppVolumeGroup-%[2]d" location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name account_name = azurerm_netapp_account.test.name group_description = "Test volume group" - application_type = "SAP-HANA" application_identifier = "TST" volume { @@ -663,18 +660,17 @@ resource "azurerm_netapp_volume_group" "test" { `, template, data.RandomInteger) } -func (NetAppVolumeGroupResource) crossRegionReplication(data acceptance.TestData) string { - template := NetAppVolumeGroupResource{}.templateForAvgCrossRegionReplication(data) +func (NetAppVolumeGroupSapHanaResource) crossRegionReplication(data acceptance.TestData) string { + template := NetAppVolumeGroupSapHanaResource{}.templateForAvgCrossRegionReplication(data) return fmt.Sprintf(` %[1]s -resource "azurerm_netapp_volume_group" "test_primary" { +resource "azurerm_netapp_volume_group_sap_hana" "test_primary" { name = "acctest-NetAppVolumeGroup-Primary-%[2]d" location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name account_name = azurerm_netapp_account.test.name group_description = "Test volume group" - application_type = "SAP-HANA" application_identifier = "TST" volume { @@ -833,13 +829,12 @@ resource "azurerm_netapp_volume_group" "test_primary" { ] } -resource "azurerm_netapp_volume_group" "test_secondary" { +resource "azurerm_netapp_volume_group_sap_hana" "test_secondary" { name = "acctest-NetAppVolumeGroup-Secondary-%[2]d" location = "%[3]s" resource_group_name = azurerm_resource_group.test.name account_name = azurerm_netapp_account.test_secondary.name group_description = "Test volume group" - application_type = "SAP-HANA" application_identifier = "TST" volume { @@ -868,8 +863,8 @@ resource "azurerm_netapp_volume_group" "test_secondary" { data_protection_replication { endpoint_type = "dst" - remote_volume_location = azurerm_netapp_volume_group.test_primary.location - remote_volume_resource_id = azurerm_netapp_volume_group.test_primary.volume[0].id + remote_volume_location = azurerm_netapp_volume_group_sap_hana.test_primary.location + remote_volume_resource_id = azurerm_netapp_volume_group_sap_hana.test_primary.volume[0].id replication_frequency = "10minutes" } @@ -935,8 +930,8 @@ resource "azurerm_netapp_volume_group" "test_secondary" { data_protection_replication { endpoint_type = "dst" - remote_volume_location = azurerm_netapp_volume_group.test_primary.location - remote_volume_resource_id = azurerm_netapp_volume_group.test_primary.volume[2].id + remote_volume_location = azurerm_netapp_volume_group_sap_hana.test_primary.location + remote_volume_resource_id = azurerm_netapp_volume_group_sap_hana.test_primary.volume[2].id replication_frequency = "10minutes" } @@ -972,8 +967,8 @@ resource "azurerm_netapp_volume_group" "test_secondary" { data_protection_replication { endpoint_type = "dst" - remote_volume_location = azurerm_netapp_volume_group.test_primary.location - remote_volume_resource_id = azurerm_netapp_volume_group.test_primary.volume[3].id + remote_volume_location = azurerm_netapp_volume_group_sap_hana.test_primary.location + remote_volume_resource_id = azurerm_netapp_volume_group_sap_hana.test_primary.volume[3].id replication_frequency = "10minutes" } @@ -1009,8 +1004,8 @@ resource "azurerm_netapp_volume_group" "test_secondary" { data_protection_replication { endpoint_type = "dst" - remote_volume_location = azurerm_netapp_volume_group.test_primary.location - remote_volume_resource_id = azurerm_netapp_volume_group.test_primary.volume[4].id + remote_volume_location = azurerm_netapp_volume_group_sap_hana.test_primary.location + remote_volume_resource_id = azurerm_netapp_volume_group_sap_hana.test_primary.volume[4].id replication_frequency = "10minutes" } @@ -1030,8 +1025,8 @@ resource "azurerm_netapp_volume_group" "test_secondary" { `, template, data.RandomInteger, "eastus") } -func (r NetAppVolumeGroupResource) templateForAvgCrossRegionReplication(data acceptance.TestData) string { - template := NetAppVolumeGroupResource{}.templatePPG(data) +func (r NetAppVolumeGroupSapHanaResource) templateForAvgCrossRegionReplication(data acceptance.TestData) string { + template := NetAppVolumeGroupSapHanaResource{}.templatePPG(data) return fmt.Sprintf(` %[1]s @@ -1194,7 +1189,7 @@ resource "azurerm_netapp_pool" "test_secondary" { `, template, data.RandomInteger, "eastus") } -func (NetAppVolumeGroupResource) templatePPG(data acceptance.TestData) string { +func (NetAppVolumeGroupSapHanaResource) templatePPG(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { alias = "all2" diff --git a/internal/services/netapp/netapp_volume_helper.go b/internal/services/netapp/netapp_volume_helper.go index 427849dfea13..a71ccf163cd6 100644 --- a/internal/services/netapp/netapp_volume_helper.go +++ b/internal/services/netapp/netapp_volume_helper.go @@ -59,30 +59,30 @@ type DataProtectionSnapshotPolicy struct { DataProtectionSnapshotPolicy string `tfschema:"snapshot_policy_id"` } -type VolumeSpecName string +type VolumeSpecNameSapHana string const ( - VolumeSpecNameData VolumeSpecName = "data" - VolumeSpecNameLog VolumeSpecName = "log" - VolumeSpecNameShared VolumeSpecName = "shared" - VolumeSpecNameDataBackup VolumeSpecName = "data-backup" - VolumeSpecNameLogBackup VolumeSpecName = "log-backup" + VolumeSpecNameSapHanaData VolumeSpecNameSapHana = "data" + VolumeSpecNameSapHanaLog VolumeSpecNameSapHana = "log" + VolumeSpecNameSapHanaShared VolumeSpecNameSapHana = "shared" + VolumeSpecNameSapHanaDataBackup VolumeSpecNameSapHana = "data-backup" + VolumeSpecNameSapHanaLogBackup VolumeSpecNameSapHana = "log-backup" ) -func PossibleValuesForVolumeSpecName() []string { +func PossibleValuesForVolumeSpecNameSapHana() []string { return []string{ - string(VolumeSpecNameData), - string(VolumeSpecNameLog), - string(VolumeSpecNameShared), - string(VolumeSpecNameDataBackup), - string(VolumeSpecNameLogBackup), + string(VolumeSpecNameSapHanaData), + string(VolumeSpecNameSapHanaLog), + string(VolumeSpecNameSapHanaShared), + string(VolumeSpecNameSapHanaDataBackup), + string(VolumeSpecNameSapHanaLogBackup), } } func RequiredVolumesForSAPHANA() []string { return []string{ - string(VolumeSpecNameData), - string(VolumeSpecNameLog), + string(VolumeSpecNameSapHanaData), + string(VolumeSpecNameSapHanaLog), } } @@ -102,7 +102,7 @@ func PossibleValuesForProtocolType() []string { } } -func PossibleValuesForProtocolTypeAvg() []string { +func PossibleValuesForProtocolTypeVolumeGroupSapHana() []string { return []string{ string(ProtocolTypeNfsV41), string(ProtocolTypeNfsV3), @@ -235,22 +235,7 @@ func expandNetAppVolumeGroupVolumes(input []NetAppVolumeGroupVolume, id volumegr capacityPoolID := item.CapacityPoolId protocols := item.Protocols snapshotDirectoryVisible := item.SnapshotDirectoryVisible - - // Handling security style property securityStyle := volumegroups.SecurityStyle(item.SecurityStyle) - if strings.EqualFold(string(securityStyle), string(SecurityStyleUnix)) && - len(protocols) == 1 && - strings.EqualFold(protocols[0], string(ProtocolTypeCifs)) { - - return &[]volumegroups.VolumeGroupVolumeProperties{}, fmt.Errorf("unix security style cannot be used in a CIFS enabled volume for %s", id) - } - if strings.EqualFold(string(securityStyle), string(SecurityStyleNtfs)) && - len(protocols) == 1 && - (strings.EqualFold(protocols[0], string(ProtocolTypeNfsV3)) || strings.EqualFold(protocols[0], string(ProtocolTypeNfsV41))) { - - return &[]volumegroups.VolumeGroupVolumeProperties{}, fmt.Errorf("ntfs security style cannot be used in a NFSv3/NFSv4.1 enabled volume for %s", id) - } - storageQuotaInGB := item.StorageQuotaInGB * 1073741824 exportPolicyRule := expandNetAppVolumeGroupVolumeExportPolicyRule(item.ExportPolicy) dataProtectionReplication := expandNetAppVolumeGroupDataProtectionReplication(item.DataProtectionReplication) @@ -890,9 +875,9 @@ func validateNetAppVolumeGroupVolumes(volumeList *[]volumegroups.VolumeGroupVolu // Can't be nfsv3 on data, log and share volumes if strings.EqualFold((*volume.Properties.ProtocolTypes)[0], string(ProtocolTypeNfsV3)) && - (strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameData)) || - strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameShared)) || - strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameLog))) { + (strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameSapHanaData)) || + strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameSapHanaShared)) || + strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameSapHanaLog))) { errors = append(errors, fmt.Errorf("'nfsv3 on data, log and shared volumes for %v is not supported on volume %v'", applicationType, *volume.Name)) } @@ -905,12 +890,12 @@ func validateNetAppVolumeGroupVolumes(volumeList *[]volumegroups.VolumeGroupVolu } // Adding volume to required volumes list for checking if all required volumes are present, total of 2 for SAP HANA - if strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameData)) || strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameLog)) { + if strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameSapHanaData)) || strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameSapHanaLog)) { requiredVolumes = append(requiredVolumes, *volume.Properties.VolumeSpecName) } // Checking CRR rule that log cannot be DataProtection type - if strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameLog)) && + if strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameSapHanaLog)) && volume.Properties.DataProtection != nil && volume.Properties.DataProtection.Replication != nil && strings.EqualFold(string(*volume.Properties.DataProtection.Replication.EndpointType), string(volumegroups.EndpointTypeDst)) { diff --git a/internal/services/netapp/registration.go b/internal/services/netapp/registration.go index e47b9aceb8e1..95855d592b0f 100644 --- a/internal/services/netapp/registration.go +++ b/internal/services/netapp/registration.go @@ -49,13 +49,13 @@ func (r Registration) SupportedResources() map[string]*pluginsdk.Resource { // DataSources returns the typed DataSources supported by this service func (r Registration) DataSources() []sdk.DataSource { return []sdk.DataSource{ - NetAppVolumeGroupDataSource{}, + NetAppVolumeGroupSapHanaDataSource{}, } } // Resources returns the typed Resources supported by this service func (r Registration) Resources() []sdk.Resource { return []sdk.Resource{ - NetAppVolumeGroupResource{}, + NetAppVolumeGroupSapHanaResource{}, } } diff --git a/website/docs/d/netapp_volume_group.html.markdown b/website/docs/d/netapp_volume_group_sap_hana.html.markdown similarity index 89% rename from website/docs/d/netapp_volume_group.html.markdown rename to website/docs/d/netapp_volume_group_sap_hana.html.markdown index f421cd2d08a1..799d419e5685 100644 --- a/website/docs/d/netapp_volume_group.html.markdown +++ b/website/docs/d/netapp_volume_group_sap_hana.html.markdown @@ -1,26 +1,26 @@ --- subcategory: "netapp" layout: "azurerm" -page_title: "Azure Resource Manager: Data Source: azurerm_netapp_volume_group" +page_title: "Azure Resource Manager: Data Source: azurerm_netapp_volume_group_sap_hana" description: |- - Gets information about an existing Application Volume Group. + Gets information about an existing Application Volume Group for SAP HANA application. --- -# Data Source: azurerm_netapp_volume_group +# Data Source: azurerm_netapp_volume_group_sap_hana -Use this data source to access information about an existing Application Volume Group. +Use this data source to access information about an existing Application Volume Group for SAP HANA application. ## Example Usage ```hcl -data "azurerm_netapp_volume_group" "example" { +data "azurerm_netapp_volume_group_sap_hana" "example" { name = "existing application volume group name" resource_group_name = "resource group name where the account and volume group belong to" account_name = "existing account where the application volume group belong to" } output "id" { - value = data.azurerm_netapp_volume_group.example.id + value = data.azurerm_netapp_volume_group_sap_hana.example.id } ``` @@ -30,7 +30,7 @@ The following arguments are supported: * `account_name` - (Required) Name of the account where the application volume group belong to. -* `name` - (Required) The name of this Application Volume Group. +* `name` - (Required) The name of this Application Volume Group for SAP HANA application. * `resource_group_name` - (Required) The name of the Resource Group where the Application Volume Group exists. @@ -42,8 +42,6 @@ In addition to the Arguments listed above - the following Attributes are exporte * `application_identifier` - The application identifier. -* `application_type` - The application type. - * `group_description` - Volume group description. * `location` - The Azure Region where the Application Volume Group exists. diff --git a/website/docs/r/netapp_volume_group.html.markdown b/website/docs/r/netapp_volume_group_sap_hana.html.markdown similarity index 96% rename from website/docs/r/netapp_volume_group.html.markdown rename to website/docs/r/netapp_volume_group_sap_hana.html.markdown index 66aebe4940a6..751903a42c85 100644 --- a/website/docs/r/netapp_volume_group.html.markdown +++ b/website/docs/r/netapp_volume_group_sap_hana.html.markdown @@ -1,14 +1,14 @@ --- subcategory: "netapp" layout: "azurerm" -page_title: "Azure Resource Manager: azurerm_netapp_volume_group" +page_title: "Azure Resource Manager: azurerm_netapp_volume_group_sap_hana" description: |- - Manages a Application Volume Group. + Manages a Application Volume Group for SAP HANA application. --- -# azurerm_netapp_volume_group +# azurerm_netapp_volume_group_sap_hana -Manages a Application Volume Group. +Manages a Application Volume Group for SAP HANA application. >Note: This feature is intended to be used for SAP-HANA workloads only, with several requirements, please refer to [Understand Azure NetApp Files application volume group for SAP HANA](https://learn.microsoft.com/en-us/azure/azure-netapp-files/application-volume-group-introduction) document as the starting point to understand this feature before using it with Terraform. @@ -142,13 +142,12 @@ resource "azurerm_netapp_pool" "test" { qos_type = "Manual" } -resource "azurerm_netapp_volume_group" "test" { +resource "azurerm_netapp_volume_group_sap_hana" "test" { name = "${var.prefix}-netapp-volumegroup" location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name account_name = azurerm_netapp_account.test.name group_description = "Test volume group" - application_type = "SAP-HANA" application_identifier = "TST" volume { @@ -249,8 +248,6 @@ The following arguments are supported: * `application_identifier` - (Required) The SAP System ID, maximum 3 characters, e.g. `SH9`. Changing this forces a new Application Volume Group to be created and data will be lost. -* `application_type` - (Required) The application type. The only possible value is `SAP-HANA`. Changing this forces a new Application Volume Group to be created and data will be lost. - * `group_description` - (Required) Volume group description. Changing this forces a new Application Volume Group to be created and data will be lost. * `location` - (Required) The Azure Region where the Application Volume Group should exist. Changing this forces a new Application Volume Group to be created and data will be lost. @@ -357,5 +354,5 @@ The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/l Application Volume Groups can be imported using the `resource id`, e.g. ```shell -terraform import azurerm_netapp_volume_group.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mytest-rg/providers/Microsoft.NetApp/netAppAccounts/netapp-account-test/volumeGroups/netapp-volumegroup-test +terraform import azurerm_netapp_volume_group_sap_hana.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mytest-rg/providers/Microsoft.NetApp/netAppAccounts/netapp-account-test/volumeGroups/netapp-volumegroup-test ``` From 10df6dafa36865ddeb92eeecdd79c2db52750c09 Mon Sep 17 00:00:00 2001 From: Paulo Date: Thu, 13 Apr 2023 00:43:18 +0000 Subject: [PATCH 62/83] Extra validations --- .../netapp_volume_group_sap_hana_resource.go | 2 +- ...app_volume_group_sap_hana_resource_test.go | 8 ---- .../services/netapp/netapp_volume_helper.go | 46 +++++++++++++++---- 3 files changed, 39 insertions(+), 17 deletions(-) diff --git a/internal/services/netapp/netapp_volume_group_sap_hana_resource.go b/internal/services/netapp/netapp_volume_group_sap_hana_resource.go index 515932d5b2a1..d5ea75737e24 100644 --- a/internal/services/netapp/netapp_volume_group_sap_hana_resource.go +++ b/internal/services/netapp/netapp_volume_group_sap_hana_resource.go @@ -110,7 +110,7 @@ func (r NetAppVolumeGroupSapHanaResource) Arguments() map[string]*pluginsdk.Sche "proximity_placement_group_id": { Type: pluginsdk.TypeString, - Required: true, + Optional: true, ForceNew: true, ValidateFunc: azure.ValidateResourceID, }, diff --git a/internal/services/netapp/netapp_volume_group_sap_hana_resource_test.go b/internal/services/netapp/netapp_volume_group_sap_hana_resource_test.go index 7bacd67e5969..e0d8d8236754 100644 --- a/internal/services/netapp/netapp_volume_group_sap_hana_resource_test.go +++ b/internal/services/netapp/netapp_volume_group_sap_hana_resource_test.go @@ -216,7 +216,6 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" { service_level = "Standard" capacity_pool_id = azurerm_netapp_pool.test.id subnet_id = azurerm_subnet.test.id - proximity_placement_group_id = azurerm_proximity_placement_group.test.id volume_spec_name = "data-backup" storage_quota_in_gb = 1024 throughput_in_mibps = 24 @@ -246,7 +245,6 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" { service_level = "Standard" capacity_pool_id = azurerm_netapp_pool.test.id subnet_id = azurerm_subnet.test.id - proximity_placement_group_id = azurerm_proximity_placement_group.test.id volume_spec_name = "log-backup" storage_quota_in_gb = 1024 throughput_in_mibps = 24 @@ -419,7 +417,6 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" { service_level = "Standard" capacity_pool_id = azurerm_netapp_pool.test.id subnet_id = azurerm_subnet.test.id - proximity_placement_group_id = azurerm_proximity_placement_group.test.id volume_spec_name = "data-backup" storage_quota_in_gb = 1024 throughput_in_mibps = 24 @@ -453,7 +450,6 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" { service_level = "Standard" capacity_pool_id = azurerm_netapp_pool.test.id subnet_id = azurerm_subnet.test.id - proximity_placement_group_id = azurerm_proximity_placement_group.test.id volume_spec_name = "log-backup" storage_quota_in_gb = 1024 throughput_in_mibps = 24 @@ -598,7 +594,6 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" { service_level = "Standard" capacity_pool_id = azurerm_netapp_pool.test.id subnet_id = azurerm_subnet.test.id - proximity_placement_group_id = azurerm_proximity_placement_group.test.id volume_spec_name = "data-backup" storage_quota_in_gb = 1024 throughput_in_mibps = 24 @@ -628,7 +623,6 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" { service_level = "Standard" capacity_pool_id = azurerm_netapp_pool.test.id subnet_id = azurerm_subnet.test.id - proximity_placement_group_id = azurerm_proximity_placement_group.test.id volume_spec_name = "log-backup" storage_quota_in_gb = 1200 throughput_in_mibps = 24 @@ -947,7 +941,6 @@ resource "azurerm_netapp_volume_group_sap_hana" "test_secondary" { service_level = "Standard" capacity_pool_id = azurerm_netapp_pool.test_secondary.id subnet_id = azurerm_subnet.test_secondary.id - proximity_placement_group_id = azurerm_proximity_placement_group.test_secondary.id volume_spec_name = "data-backup" storage_quota_in_gb = 1024 throughput_in_mibps = 24 @@ -984,7 +977,6 @@ resource "azurerm_netapp_volume_group_sap_hana" "test_secondary" { service_level = "Standard" capacity_pool_id = azurerm_netapp_pool.test_secondary.id subnet_id = azurerm_subnet.test_secondary.id - proximity_placement_group_id = azurerm_proximity_placement_group.test_secondary.id volume_spec_name = "log-backup" storage_quota_in_gb = 1024 throughput_in_mibps = 24 diff --git a/internal/services/netapp/netapp_volume_helper.go b/internal/services/netapp/netapp_volume_helper.go index a71ccf163cd6..5bcae6753649 100644 --- a/internal/services/netapp/netapp_volume_helper.go +++ b/internal/services/netapp/netapp_volume_helper.go @@ -187,7 +187,7 @@ func expandNetAppVolumeGroupVolumeExportPolicyRule(input []ExportPolicyRule) *vo } func expandNetAppVolumeGroupDataProtectionReplication(input []DataProtectionReplication) *volumegroups.VolumePropertiesDataProtection { - if len(input) == 0 { + if len(input) == 0 || input == nil { return &volumegroups.VolumePropertiesDataProtection{} } @@ -221,7 +221,7 @@ func expandNetAppVolumeGroupDataProtectionSnapshotPolicy(input []DataProtectionS } func expandNetAppVolumeGroupVolumes(input []NetAppVolumeGroupVolume, id volumegroups.VolumeGroupId) (*[]volumegroups.VolumeGroupVolumeProperties, error) { - if len(input) == 0 { + if len(input) == 0 || input == nil { return &[]volumegroups.VolumeGroupVolumeProperties{}, fmt.Errorf("received empty NetAppVolumeGroupVolume slice") } @@ -237,6 +237,7 @@ func expandNetAppVolumeGroupVolumes(input []NetAppVolumeGroupVolume, id volumegr snapshotDirectoryVisible := item.SnapshotDirectoryVisible securityStyle := volumegroups.SecurityStyle(item.SecurityStyle) storageQuotaInGB := item.StorageQuotaInGB * 1073741824 + proximityPlacementGroupId := utils.NormalizeNilableString(&item.ProximityPlacementGroupId) exportPolicyRule := expandNetAppVolumeGroupVolumeExportPolicyRule(item.ExportPolicy) dataProtectionReplication := expandNetAppVolumeGroupDataProtectionReplication(item.DataProtectionReplication) dataProtectionSnapshotPolicy := expandNetAppVolumeGroupDataProtectionSnapshotPolicy(item.DataProtectionSnapshotPolicy) @@ -254,7 +255,7 @@ func expandNetAppVolumeGroupVolumes(input []NetAppVolumeGroupVolume, id volumegr ExportPolicy: exportPolicyRule, SnapshotDirectoryVisible: utils.Bool(snapshotDirectoryVisible), ThroughputMibps: utils.Float(item.ThroughputInMibps), - ProximityPlacementGroup: utils.String(item.ProximityPlacementGroupId), + ProximityPlacementGroup: &proximityPlacementGroupId, VolumeSpecName: utils.String(item.VolumeSpecName), DataProtection: &volumegroups.VolumePropertiesDataProtection{ Replication: dataProtectionReplication.Replication, @@ -852,6 +853,7 @@ func translateSDKSchedule(scheduleName string) string { func validateNetAppVolumeGroupVolumes(volumeList *[]volumegroups.VolumeGroupVolumeProperties, applicationType volumegroups.ApplicationType) []error { errors := make([]error, 0) requiredVolumes := make([]string, 0) + volumeSpecRepeatCount := make(map[string]int) if applicationType == volumegroups.ApplicationTypeSAPNegativeHANA { // Validating maximum number of volumes @@ -889,11 +891,6 @@ func validateNetAppVolumeGroupVolumes(volumeList *[]volumegroups.VolumeGroupVolu } } - // Adding volume to required volumes list for checking if all required volumes are present, total of 2 for SAP HANA - if strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameSapHanaData)) || strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameSapHanaLog)) { - requiredVolumes = append(requiredVolumes, *volume.Properties.VolumeSpecName) - } - // Checking CRR rule that log cannot be DataProtection type if strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameSapHanaLog)) && volume.Properties.DataProtection != nil && @@ -910,11 +907,44 @@ func validateNetAppVolumeGroupVolumes(volumeList *[]volumegroups.VolumeGroupVolu errors = append(errors, fmt.Errorf("'snapshot policy cannot be enabled on a data protection volume for %v on volume %v'", applicationType, *volume.Name)) } + + // Validating that data-backup and log-backup don't have PPG defined + if (strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameSapHanaDataBackup)) || + strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameSapHanaLogBackup))) && + utils.NormalizeNilableString(volume.Properties.ProximityPlacementGroup) != "" { + + errors = append(errors, fmt.Errorf("'%v volume spec type cannot have PPG defined for %v on volume %v'", *volume.Properties.VolumeSpecName, applicationType, *volume.Name)) + } + + // Validating that data, log and shared have PPG defined. + if (strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameSapHanaData)) || + strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameSapHanaLog)) || + strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameSapHanaShared))) && + utils.NormalizeNilableString(volume.Properties.ProximityPlacementGroup) == "" { + + errors = append(errors, fmt.Errorf("'%v volume spec type must have PPG defined for %v on volume %v'", *volume.Properties.VolumeSpecName, applicationType, *volume.Name)) + } + + // Adding volume to required volumes list for checking if all required volumes are present after the loop, total of 2 for SAP HANA + if strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameSapHanaData)) || strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameSapHanaLog)) { + requiredVolumes = append(requiredVolumes, *volume.Properties.VolumeSpecName) + } + + // Adding volume spec name to hashmap for post volume loop check + volumeSpecRepeatCount[*volume.Properties.VolumeSpecName] += 1 } + // Validating required volumes if len(requiredVolumes) != 2 { errors = append(errors, fmt.Errorf("'required volume spec types are not present for %v, missing ones: %v'", applicationType, diffSliceString(requiredVolumes, RequiredVolumesForSAPHANA()))) } + + // Validating that volume spec does not repeat + for volumeSpecName, count := range volumeSpecRepeatCount { + if count > 1 { + errors = append(errors, fmt.Errorf("'volume spec type %v cannot be repeated for %v'", volumeSpecName, applicationType)) + } + } } return errors From e0152963434b458c4799430697e7be4aa191e00e Mon Sep 17 00:00:00 2001 From: Paulo Date: Thu, 13 Apr 2023 14:40:04 +0000 Subject: [PATCH 63/83] Simplifying required volume specs check. --- internal/services/netapp/netapp_volume_helper.go | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/internal/services/netapp/netapp_volume_helper.go b/internal/services/netapp/netapp_volume_helper.go index 5bcae6753649..fc38d503888a 100644 --- a/internal/services/netapp/netapp_volume_helper.go +++ b/internal/services/netapp/netapp_volume_helper.go @@ -852,8 +852,8 @@ func translateSDKSchedule(scheduleName string) string { func validateNetAppVolumeGroupVolumes(volumeList *[]volumegroups.VolumeGroupVolumeProperties, applicationType volumegroups.ApplicationType) []error { errors := make([]error, 0) - requiredVolumes := make([]string, 0) volumeSpecRepeatCount := make(map[string]int) + if applicationType == volumegroups.ApplicationTypeSAPNegativeHANA { // Validating maximum number of volumes @@ -925,18 +925,15 @@ func validateNetAppVolumeGroupVolumes(volumeList *[]volumegroups.VolumeGroupVolu errors = append(errors, fmt.Errorf("'%v volume spec type must have PPG defined for %v on volume %v'", *volume.Properties.VolumeSpecName, applicationType, *volume.Name)) } - // Adding volume to required volumes list for checking if all required volumes are present after the loop, total of 2 for SAP HANA - if strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameSapHanaData)) || strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameSapHanaLog)) { - requiredVolumes = append(requiredVolumes, *volume.Properties.VolumeSpecName) - } - // Adding volume spec name to hashmap for post volume loop check volumeSpecRepeatCount[*volume.Properties.VolumeSpecName] += 1 } - // Validating required volumes - if len(requiredVolumes) != 2 { - errors = append(errors, fmt.Errorf("'required volume spec types are not present for %v, missing ones: %v'", applicationType, diffSliceString(requiredVolumes, RequiredVolumesForSAPHANA()))) + // Validating required volume spec types + for _, requiredVolumeSpec := range RequiredVolumesForSAPHANA() { + if _, ok := volumeSpecRepeatCount[requiredVolumeSpec]; !ok { + errors = append(errors, fmt.Errorf("'required volume spec type %v is not present for %v'", requiredVolumeSpec, applicationType)) + } } // Validating that volume spec does not repeat From e5249e39a9505a8d682fcd8ba656f246d3035de5 Mon Sep 17 00:00:00 2001 From: Paulo Date: Thu, 13 Apr 2023 16:52:56 +0000 Subject: [PATCH 64/83] Fixing linting issues --- .../netapp/netapp_volume_group_sap_hana_resource.go | 2 +- internal/services/netapp/netapp_volume_helper.go | 12 +----------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/internal/services/netapp/netapp_volume_group_sap_hana_resource.go b/internal/services/netapp/netapp_volume_group_sap_hana_resource.go index d5ea75737e24..14cf10862f88 100644 --- a/internal/services/netapp/netapp_volume_group_sap_hana_resource.go +++ b/internal/services/netapp/netapp_volume_group_sap_hana_resource.go @@ -323,7 +323,7 @@ func (r NetAppVolumeGroupSapHanaResource) Create() sdk.ResourceFunc { applicationType := volumegroups.ApplicationTypeSAPNegativeHANA - volumeList, err := expandNetAppVolumeGroupVolumes(model.Volumes, id) + volumeList, err := expandNetAppVolumeGroupVolumes(model.Volumes) if err != nil { return err } diff --git a/internal/services/netapp/netapp_volume_helper.go b/internal/services/netapp/netapp_volume_helper.go index fc38d503888a..2c88183bfb49 100644 --- a/internal/services/netapp/netapp_volume_helper.go +++ b/internal/services/netapp/netapp_volume_helper.go @@ -220,7 +220,7 @@ func expandNetAppVolumeGroupDataProtectionSnapshotPolicy(input []DataProtectionS } } -func expandNetAppVolumeGroupVolumes(input []NetAppVolumeGroupVolume, id volumegroups.VolumeGroupId) (*[]volumegroups.VolumeGroupVolumeProperties, error) { +func expandNetAppVolumeGroupVolumes(input []NetAppVolumeGroupVolume) (*[]volumegroups.VolumeGroupVolumeProperties, error) { if len(input) == 0 || input == nil { return &[]volumegroups.VolumeGroupVolumeProperties{}, fmt.Errorf("received empty NetAppVolumeGroupVolume slice") } @@ -968,16 +968,6 @@ func validateNetAppVolumeGroupExportPolicyRule(rule volumegroups.ExportPolicyRul return errors } -func diffSliceString(slice1, slice2 []string) []string { - var diff []string - for _, v := range slice2 { - if !FindStringInSlice(slice1, v) { - diff = append(diff, v) - } - } - return diff -} - func FindStringInSlice(slice []string, val string) bool { for _, item := range slice { if strings.EqualFold(item, val) { From d8a803bd91d30df23a88c99750705010d32ac305 Mon Sep 17 00:00:00 2001 From: Paulo Marques Date: Thu, 13 Apr 2023 15:26:32 -0700 Subject: [PATCH 65/83] Update internal/services/netapp/netapp_volume_helper.go Co-authored-by: Matthew Frahry --- internal/services/netapp/netapp_volume_helper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/services/netapp/netapp_volume_helper.go b/internal/services/netapp/netapp_volume_helper.go index 2c88183bfb49..4017d997ce1b 100644 --- a/internal/services/netapp/netapp_volume_helper.go +++ b/internal/services/netapp/netapp_volume_helper.go @@ -407,7 +407,7 @@ func flattenNetAppVolumeGroupVolumes(ctx context.Context, input *[]volumegroups. volumeGroupVolume.Protocols = *props.ProtocolTypes volumeGroupVolume.SecurityStyle = string(*props.SecurityStyle) volumeGroupVolume.SnapshotDirectoryVisible = *props.SnapshotDirectoryVisible - volumeGroupVolume.ThroughputInMibps = *props.ThroughputMibps + volumeGroupVolume.ThroughputInMibps = pointer.From(props.ThroughputMibps) volumeGroupVolume.Tags = *item.Tags volumeGroupVolume.ProximityPlacementGroupId = utils.NormalizeNilableString(props.ProximityPlacementGroup) volumeGroupVolume.VolumeSpecName = *props.VolumeSpecName From b99eff5df8a72deb9269c26a4d4fcb49f6642a9e Mon Sep 17 00:00:00 2001 From: Paulo Marques Date: Thu, 13 Apr 2023 15:27:11 -0700 Subject: [PATCH 66/83] Update internal/services/netapp/netapp_volume_helper.go Co-authored-by: Matthew Frahry --- internal/services/netapp/netapp_volume_helper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/services/netapp/netapp_volume_helper.go b/internal/services/netapp/netapp_volume_helper.go index 4017d997ce1b..dd908c723779 100644 --- a/internal/services/netapp/netapp_volume_helper.go +++ b/internal/services/netapp/netapp_volume_helper.go @@ -408,7 +408,7 @@ func flattenNetAppVolumeGroupVolumes(ctx context.Context, input *[]volumegroups. volumeGroupVolume.SecurityStyle = string(*props.SecurityStyle) volumeGroupVolume.SnapshotDirectoryVisible = *props.SnapshotDirectoryVisible volumeGroupVolume.ThroughputInMibps = pointer.From(props.ThroughputMibps) - volumeGroupVolume.Tags = *item.Tags + volumeGroupVolume.Tags = pointer.From(item.Tags) volumeGroupVolume.ProximityPlacementGroupId = utils.NormalizeNilableString(props.ProximityPlacementGroup) volumeGroupVolume.VolumeSpecName = *props.VolumeSpecName From 53574f104ad996fc8805aec7be3bc0b522bcc99d Mon Sep 17 00:00:00 2001 From: Paulo Marques Date: Thu, 13 Apr 2023 15:28:19 -0700 Subject: [PATCH 67/83] Update internal/services/netapp/netapp_volume_helper.go Co-authored-by: Matthew Frahry --- internal/services/netapp/netapp_volume_helper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/services/netapp/netapp_volume_helper.go b/internal/services/netapp/netapp_volume_helper.go index dd908c723779..9c80a3fd8f0f 100644 --- a/internal/services/netapp/netapp_volume_helper.go +++ b/internal/services/netapp/netapp_volume_helper.go @@ -428,7 +428,7 @@ func flattenNetAppVolumeGroupVolumes(ctx context.Context, input *[]volumegroups. // Getting volume resource directly from standalone volume // since VolumeGroup Volumes don't return DataProtection information volumeClient := metadata.Client.NetApp.VolumeClient - id, err := volumes.ParseVolumeID(*item.Id) + id, err := volumes.ParseVolumeID(pointer.From(item.Id)) if err != nil { return []NetAppVolumeGroupVolume{}, err } From b764a8e9c7aff1d996760a7232f58045a589bc6b Mon Sep 17 00:00:00 2001 From: Paulo Marques Date: Thu, 13 Apr 2023 15:28:40 -0700 Subject: [PATCH 68/83] Update internal/services/netapp/netapp_volume_helper.go Co-authored-by: Matthew Frahry --- internal/services/netapp/netapp_volume_helper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/services/netapp/netapp_volume_helper.go b/internal/services/netapp/netapp_volume_helper.go index 9c80a3fd8f0f..a59f55530856 100644 --- a/internal/services/netapp/netapp_volume_helper.go +++ b/internal/services/netapp/netapp_volume_helper.go @@ -446,7 +446,7 @@ func flattenNetAppVolumeGroupVolumes(ctx context.Context, input *[]volumegroups. volumeGroupVolume.DataProtectionSnapshotPolicy = flattenNetAppVolumeGroupVolumesDPSnapshotPolicy(standaloneVol.Model.Properties.DataProtection.Snapshot) } - volumeGroupVolume.Id = *standaloneVol.Model.Id + volumeGroupVolume.Id = pointer.From(standaloneVol.Model.Id) results = append(results, volumeGroupVolume) } From 50bef3e283a330aee9822ea19d83df789ceeae6b Mon Sep 17 00:00:00 2001 From: Paulo Date: Fri, 14 Apr 2023 17:27:14 +0000 Subject: [PATCH 69/83] WIP: Fixing PR comments --- ...etapp_volume_group_sap_hana_data_source.go | 7 +- .../netapp_volume_group_sap_hana_resource.go | 71 ++-- ...app_volume_group_sap_hana_resource_test.go | 2 - .../services/netapp/netapp_volume_helper.go | 306 ++++-------------- .../services/netapp/netapp_volume_resource.go | 5 +- ...olume_group_sap_hana_volumes_validation.go | 179 ++++++++++ ..._group_sap_hana_volumes_validation_test.go | 51 +++ 7 files changed, 343 insertions(+), 278 deletions(-) create mode 100644 internal/services/netapp/validate/volume_group_sap_hana_volumes_validation.go create mode 100644 internal/services/netapp/validate/volume_group_sap_hana_volumes_validation_test.go diff --git a/internal/services/netapp/netapp_volume_group_sap_hana_data_source.go b/internal/services/netapp/netapp_volume_group_sap_hana_data_source.go index f79dfc15d75c..fc2722012eb4 100644 --- a/internal/services/netapp/netapp_volume_group_sap_hana_data_source.go +++ b/internal/services/netapp/netapp_volume_group_sap_hana_data_source.go @@ -6,6 +6,7 @@ import ( "net/http" "time" + "github.com/hashicorp/go-azure-helpers/lang/pointer" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups" @@ -265,9 +266,9 @@ func (r NetAppVolumeGroupSapHanaDataSource) Read() sdk.ResourceFunc { return fmt.Errorf("retrieving %s: model was nil", id) } - state.Location = location.Normalize(*model.Location) - state.ApplicationIdentifier = *model.Properties.GroupMetaData.ApplicationIdentifier - state.GroupDescription = *model.Properties.GroupMetaData.GroupDescription + state.Location = location.Normalize(pointer.From(model.Location)) + state.ApplicationIdentifier = pointer.From(model.Properties.GroupMetaData.ApplicationIdentifier) + state.GroupDescription = pointer.From(model.Properties.GroupMetaData.GroupDescription) volumes, err := flattenNetAppVolumeGroupVolumes(ctx, model.Properties.Volumes, metadata) if err != nil { diff --git a/internal/services/netapp/netapp_volume_group_sap_hana_resource.go b/internal/services/netapp/netapp_volume_group_sap_hana_resource.go index 14cf10862f88..417dfc9209af 100644 --- a/internal/services/netapp/netapp_volume_group_sap_hana_resource.go +++ b/internal/services/netapp/netapp_volume_group_sap_hana_resource.go @@ -8,14 +8,17 @@ import ( "strings" "time" + "github.com/hashicorp/go-azure-helpers/lang/pointer" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/capacitypools" "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups" "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes" "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumesreplication" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/netapp/validate" netAppValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/netapp/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" @@ -119,7 +122,7 @@ func (r NetAppVolumeGroupSapHanaResource) Arguments() map[string]*pluginsdk.Sche Type: pluginsdk.TypeString, Required: true, ForceNew: true, - ValidateFunc: validation.StringInSlice(PossibleValuesForVolumeSpecNameSapHana(), false), + ValidateFunc: validation.StringInSlice(validate.PossibleValuesForVolumeSpecNameSapHana(), false), }, "volume_path": { @@ -151,10 +154,11 @@ func (r NetAppVolumeGroupSapHanaResource) Arguments() map[string]*pluginsdk.Sche Type: pluginsdk.TypeList, ForceNew: true, Required: true, + MinItems: 1, MaxItems: 1, Elem: &pluginsdk.Schema{ Type: pluginsdk.TypeString, - ValidateFunc: validation.StringInSlice(PossibleValuesForProtocolTypeVolumeGroupSapHana(), false), + ValidateFunc: validation.StringInSlice(validate.PossibleValuesForProtocolTypeVolumeGroupSapHana(), false), }, }, @@ -162,7 +166,7 @@ func (r NetAppVolumeGroupSapHanaResource) Arguments() map[string]*pluginsdk.Sche Type: pluginsdk.TypeString, Required: true, ForceNew: true, - ValidateFunc: validation.StringInSlice(PossibleValuesForSecurityStyle(), false), + ValidateFunc: validation.StringInSlice(validate.PossibleValuesForSecurityStyle(), false), }, "storage_quota_in_gb": { @@ -208,17 +212,20 @@ func (r NetAppVolumeGroupSapHanaResource) Arguments() map[string]*pluginsdk.Sche "unix_read_only": { Type: pluginsdk.TypeBool, - Required: true, + Optional: true, + Default: false, }, "unix_read_write": { Type: pluginsdk.TypeBool, - Required: true, + Optional: true, + Default: true, }, "root_access_enabled": { Type: pluginsdk.TypeBool, - Required: true, + Optional: true, + Default: true, }, }, }, @@ -321,27 +328,25 @@ func (r NetAppVolumeGroupSapHanaResource) Create() sdk.ResourceFunc { return metadata.ResourceRequiresImport(r.ResourceType(), id) } - applicationType := volumegroups.ApplicationTypeSAPNegativeHANA - volumeList, err := expandNetAppVolumeGroupVolumes(model.Volumes) if err != nil { return err } // Performing some basic validations that are not possible in the schema - if errorList := validateNetAppVolumeGroupVolumes(volumeList, applicationType); len(errorList) > 0 { + if errorList := validate.ValidateNetAppVolumeGroupSAPHanaVolumes(volumeList); len(errorList) > 0 { return fmt.Errorf("one or more issues found while performing deeper validations for %s:\n%+v", id, errorList) } // Parse volume list to set secondary volumes for CRR - for i, volumeCrr := range *volumeList { + for i, volumeCrr := range pointer.From(volumeList) { if volumeCrr.Properties.DataProtection != nil && volumeCrr.Properties.DataProtection.Replication != nil && - strings.EqualFold(string(*volumeCrr.Properties.DataProtection.Replication.EndpointType), string(volumegroups.EndpointTypeDst)) { + strings.EqualFold(string(pointer.From(volumeCrr.Properties.DataProtection.Replication.EndpointType)), string(volumegroups.EndpointTypeDst)) { // Modify volumeType as data protection type on main volumeList // so it gets created correctly as data protection volume - (*volumeList)[i].Properties.VolumeType = utils.String("DataProtection") + (pointer.From(volumeList))[i].Properties.VolumeType = utils.String("DataProtection") } } @@ -354,7 +359,7 @@ func (r NetAppVolumeGroupSapHanaResource) Create() sdk.ResourceFunc { Properties: &volumegroups.VolumeGroupProperties{ GroupMetaData: &volumegroups.VolumeGroupMetaData{ GroupDescription: utils.String(model.GroupDescription), - ApplicationType: &applicationType, + ApplicationType: pointer.To(volumegroups.ApplicationTypeSAPNegativeHANA), ApplicationIdentifier: utils.String(model.ApplicationIdentifier), DeploymentSpecId: utils.String(deploymentSpecId), }, @@ -373,17 +378,22 @@ func (r NetAppVolumeGroupSapHanaResource) Create() sdk.ResourceFunc { } // CRR - Authorizing secondaries from primary volumes - for _, volumeCrr := range *volumeList { + for _, volumeCrr := range pointer.From(volumeList) { if volumeCrr.Properties.DataProtection != nil && volumeCrr.Properties.DataProtection.Replication != nil && - strings.EqualFold(string(*volumeCrr.Properties.DataProtection.Replication.EndpointType), string(volumegroups.EndpointTypeDst)) { + strings.EqualFold(string(pointer.From(volumeCrr.Properties.DataProtection.Replication.EndpointType)), string(volumegroups.EndpointTypeDst)) { + + capacityPoolId, err := capacitypools.ParseCapacityPoolID(metadata.ResourceData.Get(fmt.Sprintf("%v.capacity_pool_id", volumeCrr)).(string)) + if err != nil { + return err + } // Getting secondary volume resource id secondaryId := volumes.NewVolumeID(subscriptionId, model.ResourceGroupName, model.AccountName, - getResourceNameString(volumeCrr.Properties.CapacityPoolResourceId), - getResourceNameString(volumeCrr.Name), + capacityPoolId.CapacityPoolName, + getUserDefinedVolumeName(volumeCrr.Name), ) // Getting primary resource id @@ -393,7 +403,7 @@ func (r NetAppVolumeGroupSapHanaResource) Create() sdk.ResourceFunc { } // Authorizing - if err = replicationClient.VolumesAuthorizeReplicationThenPoll(ctx, *primaryId, volumesreplication.AuthorizeRequest{ + if err = replicationClient.VolumesAuthorizeReplicationThenPoll(ctx, pointer.From(primaryId), volumesreplication.AuthorizeRequest{ RemoteVolumeResourceId: utils.String(secondaryId.ID()), }, ); err != nil { @@ -402,7 +412,7 @@ func (r NetAppVolumeGroupSapHanaResource) Create() sdk.ResourceFunc { // Wait for volume replication authorization to complete log.Printf("[DEBUG] Waiting for replication authorization on %s to complete", id) - if err := waitForReplAuthorization(ctx, replicationClient, *primaryId); err != nil { + if err := waitForReplAuthorization(ctx, replicationClient, pointer.From(primaryId)); err != nil { return err } } @@ -441,15 +451,18 @@ func (r NetAppVolumeGroupSapHanaResource) Update() sdk.ResourceFunc { // Checking if individual volume has a change volumeItem := fmt.Sprintf("volume.%v", i) - capacityPoolId := metadata.ResourceData.Get(fmt.Sprintf("%v.capacity_pool_id", volumeItem)).(string) - capacityPoolName := getResourceNameString(&capacityPoolId) + + capacityPoolId, err := capacitypools.ParseCapacityPoolID(metadata.ResourceData.Get(fmt.Sprintf("%v.capacity_pool_id", volumeItem)).(string)) + if err != nil { + return err + } if metadata.ResourceData.HasChange(volumeItem) { volumeId := volumes.NewVolumeID(id.SubscriptionId, id.ResourceGroupName, id.NetAppAccountName, - capacityPoolName, + capacityPoolId.CapacityPoolName, metadata.ResourceData.Get(fmt.Sprintf("%v.name", volumeItem)).(string)) update := volumes.VolumePatch{ @@ -477,7 +490,7 @@ func (r NetAppVolumeGroupSapHanaResource) Update() sdk.ResourceFunc { rule.Nfsv3 = utils.Bool(v["nfsv3_enabled"].(bool)) rule.Nfsv41 = utils.Bool(v["nfsv41_enabled"].(bool)) - errors = append(errors, validateNetAppVolumeGroupExportPolicyRule(rule, volumeProtocol)...) + errors = append(errors, validate.ValidateNetAppVolumeGroupExportPolicyRule(rule, volumeProtocol)...) } } @@ -497,7 +510,7 @@ func (r NetAppVolumeGroupSapHanaResource) Update() sdk.ResourceFunc { if dataProtectionReplication != nil && dataProtectionReplication.Replication != nil && dataProtectionReplication.Replication.EndpointType != nil && - strings.EqualFold(string(*dataProtectionReplication.Replication.EndpointType), string(volumegroups.EndpointTypeDst)) { + strings.EqualFold(string(pointer.From(dataProtectionReplication.Replication.EndpointType)), string(volumegroups.EndpointTypeDst)) { return fmt.Errorf("snapshot policy cannot be enabled on a data protection volume, %s", volumeId) } @@ -552,7 +565,7 @@ func (r NetAppVolumeGroupSapHanaResource) Read() sdk.ResourceFunc { return err } - existing, err := client.VolumeGroupsGet(ctx, *id) + existing, err := client.VolumeGroupsGet(ctx, pointer.From(id)) if err != nil { if existing.HttpResponse.StatusCode == http.StatusNotFound { return metadata.MarkAsGone(id) @@ -598,7 +611,7 @@ func (r NetAppVolumeGroupSapHanaResource) Delete() sdk.ResourceFunc { return err } - existing, err := client.VolumeGroupsGet(ctx, *id) + existing, err := client.VolumeGroupsGet(ctx, pointer.From(id)) if err != nil { if existing.HttpResponse.StatusCode == http.StatusNotFound { return metadata.MarkAsGone(id) @@ -610,7 +623,7 @@ func (r NetAppVolumeGroupSapHanaResource) Delete() sdk.ResourceFunc { if props := existing.Model.Properties; props != nil { if volumeList := props.Volumes; volumeList != nil { for _, volume := range *volumeList { - if err := deleteVolume(ctx, metadata, *volume.Id); err != nil { + if err := deleteVolume(ctx, metadata, pointer.From(volume.Id)); err != nil { return fmt.Errorf("deleting `volume`: %+v", err) } } @@ -618,8 +631,8 @@ func (r NetAppVolumeGroupSapHanaResource) Delete() sdk.ResourceFunc { } // Removing Volume Group - if err = client.VolumeGroupsDeleteThenPoll(ctx, *id); err != nil { - return fmt.Errorf("deleting %s: %+v", *id, err) + if err = client.VolumeGroupsDeleteThenPoll(ctx, pointer.From(id)); err != nil { + return fmt.Errorf("deleting %s: %+v", pointer.From(id), err) } return nil diff --git a/internal/services/netapp/netapp_volume_group_sap_hana_resource_test.go b/internal/services/netapp/netapp_volume_group_sap_hana_resource_test.go index e0d8d8236754..76cb3c3d0e24 100644 --- a/internal/services/netapp/netapp_volume_group_sap_hana_resource_test.go +++ b/internal/services/netapp/netapp_volume_group_sap_hana_resource_test.go @@ -763,7 +763,6 @@ resource "azurerm_netapp_volume_group_sap_hana" "test_primary" { service_level = "Standard" capacity_pool_id = azurerm_netapp_pool.test.id subnet_id = azurerm_subnet.test.id - proximity_placement_group_id = azurerm_proximity_placement_group.test.id volume_spec_name = "data-backup" storage_quota_in_gb = 1024 throughput_in_mibps = 24 @@ -793,7 +792,6 @@ resource "azurerm_netapp_volume_group_sap_hana" "test_primary" { service_level = "Standard" capacity_pool_id = azurerm_netapp_pool.test.id subnet_id = azurerm_subnet.test.id - proximity_placement_group_id = azurerm_proximity_placement_group.test.id volume_spec_name = "log-backup" storage_quota_in_gb = 1024 throughput_in_mibps = 24 diff --git a/internal/services/netapp/netapp_volume_helper.go b/internal/services/netapp/netapp_volume_helper.go index a59f55530856..0984b0b88009 100644 --- a/internal/services/netapp/netapp_volume_helper.go +++ b/internal/services/netapp/netapp_volume_helper.go @@ -8,6 +8,7 @@ import ( "strings" "time" + "github.com/hashicorp/go-azure-helpers/lang/pointer" "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups" "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumes" @@ -59,56 +60,6 @@ type DataProtectionSnapshotPolicy struct { DataProtectionSnapshotPolicy string `tfschema:"snapshot_policy_id"` } -type VolumeSpecNameSapHana string - -const ( - VolumeSpecNameSapHanaData VolumeSpecNameSapHana = "data" - VolumeSpecNameSapHanaLog VolumeSpecNameSapHana = "log" - VolumeSpecNameSapHanaShared VolumeSpecNameSapHana = "shared" - VolumeSpecNameSapHanaDataBackup VolumeSpecNameSapHana = "data-backup" - VolumeSpecNameSapHanaLogBackup VolumeSpecNameSapHana = "log-backup" -) - -func PossibleValuesForVolumeSpecNameSapHana() []string { - return []string{ - string(VolumeSpecNameSapHanaData), - string(VolumeSpecNameSapHanaLog), - string(VolumeSpecNameSapHanaShared), - string(VolumeSpecNameSapHanaDataBackup), - string(VolumeSpecNameSapHanaLogBackup), - } -} - -func RequiredVolumesForSAPHANA() []string { - return []string{ - string(VolumeSpecNameSapHanaData), - string(VolumeSpecNameSapHanaLog), - } -} - -type ProtocolType string - -const ( - ProtocolTypeNfsV41 ProtocolType = "NFSv4.1" - ProtocolTypeNfsV3 ProtocolType = "NFSv3" - ProtocolTypeCifs ProtocolType = "CIFS" -) - -func PossibleValuesForProtocolType() []string { - return []string{ - string(ProtocolTypeNfsV41), - string(ProtocolTypeNfsV3), - string(ProtocolTypeCifs), - } -} - -func PossibleValuesForProtocolTypeVolumeGroupSapHana() []string { - return []string{ - string(ProtocolTypeNfsV41), - string(ProtocolTypeNfsV3), - } -} - type ReplicationSchedule string const ( @@ -125,24 +76,9 @@ func PossibleValuesForReplicationSchedule() []string { } } -// Diverging from the SDK volumegroups.SecurityStyle since it is defined as lower case -// but the backend changes it to Pascal case on GET. Please refer to https://github.com/Azure/azure-sdk-for-go/issues/14684 -type SecurityStyle string - -const ( - SecurityStyleUnix SecurityStyle = "Unix" - SecurityStyleNtfs SecurityStyle = "Ntfs" -) - -func PossibleValuesForSecurityStyle() []string { - return []string{ - string(SecurityStyleUnix), - } -} - func expandNetAppVolumeGroupVolumeExportPolicyRule(input []ExportPolicyRule) *volumegroups.VolumePropertiesExportPolicy { - if len(input) == 0 || input == nil { + if len(input) == 0 { return &volumegroups.VolumePropertiesExportPolicy{} } @@ -187,7 +123,7 @@ func expandNetAppVolumeGroupVolumeExportPolicyRule(input []ExportPolicyRule) *vo } func expandNetAppVolumeGroupDataProtectionReplication(input []DataProtectionReplication) *volumegroups.VolumePropertiesDataProtection { - if len(input) == 0 || input == nil { + if input == nil || len(input) == 0 { return &volumegroups.VolumePropertiesDataProtection{} } @@ -208,7 +144,7 @@ func expandNetAppVolumeGroupDataProtectionReplication(input []DataProtectionRepl } func expandNetAppVolumeGroupDataProtectionSnapshotPolicy(input []DataProtectionSnapshotPolicy) *volumegroups.VolumePropertiesDataProtection { - if len(input) == 0 || input == nil { + if input == nil || len(input) == 0 { return &volumegroups.VolumePropertiesDataProtection{} } @@ -221,7 +157,7 @@ func expandNetAppVolumeGroupDataProtectionSnapshotPolicy(input []DataProtectionS } func expandNetAppVolumeGroupVolumes(input []NetAppVolumeGroupVolume) (*[]volumegroups.VolumeGroupVolumeProperties, error) { - if len(input) == 0 || input == nil { + if input == nil || len(input) == 0 { return &[]volumegroups.VolumeGroupVolumeProperties{}, fmt.Errorf("received empty NetAppVolumeGroupVolume slice") } @@ -272,6 +208,10 @@ func expandNetAppVolumeGroupVolumes(input []NetAppVolumeGroupVolume) (*[]volumeg } func expandNetAppVolumeGroupVolumeExportPolicyRulePatch(input []interface{}) *volumes.VolumePatchPropertiesExportPolicy { + if input == nil || len(input) == 0 { + return &volumes.VolumePatchPropertiesExportPolicy{} + } + results := make([]volumes.ExportPolicyRule, 0) for _, item := range input { if item != nil { @@ -323,7 +263,7 @@ func expandNetAppVolumeGroupVolumeExportPolicyRulePatch(input []interface{}) *vo } func expandNetAppVolumeDataProtectionReplication(input []interface{}) *volumes.VolumePropertiesDataProtection { - if len(input) == 0 || input[0] == nil { + if input == nil || len(input) == 0 { return &volumes.VolumePropertiesDataProtection{} } @@ -352,7 +292,7 @@ func expandNetAppVolumeDataProtectionReplication(input []interface{}) *volumes.V } func expandNetAppVolumeDataProtectionSnapshotPolicy(input []interface{}) *volumes.VolumePropertiesDataProtection { - if len(input) == 0 || input[0] == nil { + if input == nil || len(input) == 0 { return &volumes.VolumePropertiesDataProtection{} } @@ -370,7 +310,7 @@ func expandNetAppVolumeDataProtectionSnapshotPolicy(input []interface{}) *volume } func expandNetAppVolumeDataProtectionSnapshotPolicyPatch(input []interface{}) *volumes.VolumePatchPropertiesDataProtection { - if len(input) == 0 || input[0] == nil { + if input == nil || len(input) == 0 { return &volumes.VolumePatchPropertiesDataProtection{} } @@ -390,7 +330,7 @@ func expandNetAppVolumeDataProtectionSnapshotPolicyPatch(input []interface{}) *v func flattenNetAppVolumeGroupVolumes(ctx context.Context, input *[]volumegroups.VolumeGroupVolumeProperties, metadata sdk.ResourceMetaData) ([]NetAppVolumeGroupVolume, error) { results := make([]NetAppVolumeGroupVolume, 0) - if len(*input) == 0 || input == nil { + if input == nil || len(pointer.From(input)) == 0 { return results, fmt.Errorf("received empty volumegroups.VolumeGroupVolumeProperties slice") } @@ -398,30 +338,29 @@ func flattenNetAppVolumeGroupVolumes(ctx context.Context, input *[]volumegroups. volumeGroupVolume := NetAppVolumeGroupVolume{} props := item.Properties - - volumeGroupVolume.Name = getResourceNameString(item.Name) + volumeGroupVolume.Name = getUserDefinedVolumeName(item.Name) volumeGroupVolume.VolumePath = props.CreationToken - volumeGroupVolume.ServiceLevel = string(*props.ServiceLevel) + volumeGroupVolume.ServiceLevel = string(pointer.From(props.ServiceLevel)) volumeGroupVolume.SubnetId = props.SubnetId volumeGroupVolume.CapacityPoolId = utils.NormalizeNilableString(props.CapacityPoolResourceId) - volumeGroupVolume.Protocols = *props.ProtocolTypes - volumeGroupVolume.SecurityStyle = string(*props.SecurityStyle) - volumeGroupVolume.SnapshotDirectoryVisible = *props.SnapshotDirectoryVisible + volumeGroupVolume.Protocols = pointer.From(props.ProtocolTypes) + volumeGroupVolume.SecurityStyle = string(pointer.From(props.SecurityStyle)) + volumeGroupVolume.SnapshotDirectoryVisible = pointer.From(props.SnapshotDirectoryVisible) volumeGroupVolume.ThroughputInMibps = pointer.From(props.ThroughputMibps) volumeGroupVolume.Tags = pointer.From(item.Tags) volumeGroupVolume.ProximityPlacementGroupId = utils.NormalizeNilableString(props.ProximityPlacementGroup) - volumeGroupVolume.VolumeSpecName = *props.VolumeSpecName + volumeGroupVolume.VolumeSpecName = pointer.From(props.VolumeSpecName) if props.UsageThreshold > 0 { usageThreshold := props.UsageThreshold / 1073741824 volumeGroupVolume.StorageQuotaInGB = usageThreshold } - if props.ExportPolicy != nil && len(*props.ExportPolicy.Rules) > 0 { + if props.ExportPolicy != nil && props.ExportPolicy.Rules != nil && len(pointer.From(props.ExportPolicy.Rules)) > 0 { volumeGroupVolume.ExportPolicy = flattenNetAppVolumeGroupVolumesExportPolicies(props.ExportPolicy.Rules) } - if props.MountTargets != nil && len(*props.MountTargets) > 0 { + if props.MountTargets != nil && len(pointer.From(props.MountTargets)) > 0 { volumeGroupVolume.MountIpAddresses = flattenNetAppVolumeGroupVolumesMountIpAddresses(props.MountTargets) } @@ -433,7 +372,7 @@ func flattenNetAppVolumeGroupVolumes(ctx context.Context, input *[]volumegroups. return []NetAppVolumeGroupVolume{}, err } - standaloneVol, err := volumeClient.Get(ctx, *id) + standaloneVol, err := volumeClient.Get(ctx, pointer.From(id)) if err != nil { return []NetAppVolumeGroupVolume{}, fmt.Errorf("retrieving %s: %v", id, err) } @@ -457,20 +396,20 @@ func flattenNetAppVolumeGroupVolumes(ctx context.Context, input *[]volumegroups. func flattenNetAppVolumeGroupVolumesExportPolicies(input *[]volumegroups.ExportPolicyRule) []ExportPolicyRule { results := make([]ExportPolicyRule, 0) - if len(*input) == 0 || input == nil { + if input == nil || len(pointer.From(input)) == 0 { return results } - for _, item := range *input { + for _, item := range pointer.From(input) { rule := ExportPolicyRule{} - rule.RuleIndex = int(*item.RuleIndex) - rule.AllowedClients = *item.AllowedClients - rule.Nfsv3Enabled = *item.Nfsv3 - rule.Nfsv41Enabled = *item.Nfsv41 - rule.UnixReadOnly = *item.UnixReadOnly - rule.UnixReadWrite = *item.UnixReadWrite - rule.RootAccessEnabled = *item.HasRootAccess + rule.RuleIndex = int(pointer.From(item.RuleIndex)) + rule.AllowedClients = pointer.From(item.AllowedClients) + rule.Nfsv3Enabled = pointer.From(item.Nfsv3) + rule.Nfsv41Enabled = pointer.From(item.Nfsv41) + rule.UnixReadOnly = pointer.From(item.UnixReadOnly) + rule.UnixReadWrite = pointer.From(item.UnixReadWrite) + rule.RootAccessEnabled = pointer.From(item.HasRootAccess) results = append(results, rule) } @@ -481,13 +420,13 @@ func flattenNetAppVolumeGroupVolumesExportPolicies(input *[]volumegroups.ExportP func flattenNetAppVolumeGroupVolumesMountIpAddresses(input *[]volumegroups.MountTargetProperties) []string { results := make([]string, 0) - if len(*input) == 0 || input == nil { + if input == nil || len(pointer.From(input)) == 0 { return results } - for _, item := range *input { + for _, item := range pointer.From(input) { if item.IPAddress != nil { - results = append(results, *item.IPAddress) + results = append(results, pointer.From(item.IPAddress)) } } @@ -498,19 +437,19 @@ func flattenNetAppVolumeGroupVolumesDPReplication(input *volumes.ReplicationObje if input == nil { return []DataProtectionReplication{} } - if string(*input.EndpointType) == "" || !strings.EqualFold(string(*input.EndpointType), string(volumes.EndpointTypeDst)) { + if string(pointer.From(input.EndpointType)) == "" || !strings.EqualFold(string(pointer.From(input.EndpointType)), string(volumes.EndpointTypeDst)) { return []DataProtectionReplication{} } replicationFrequency := "" if input.ReplicationSchedule != nil { - replicationFrequency = translateSDKSchedule(strings.ToLower(string(*input.ReplicationSchedule))) + replicationFrequency = translateSDKSchedule(strings.ToLower(string(pointer.From(input.ReplicationSchedule)))) } return []DataProtectionReplication{ { - EndpointType: strings.ToLower(string(*input.EndpointType)), - RemoteVolumeLocation: *input.RemoteVolumeRegion, + EndpointType: strings.ToLower(string(pointer.From(input.EndpointType))), + RemoteVolumeLocation: pointer.From(input.RemoteVolumeRegion), RemoteVolumeResourceId: input.RemoteVolumeResourceId, ReplicationFrequency: replicationFrequency, }, @@ -524,18 +463,21 @@ func flattenNetAppVolumeGroupVolumesDPSnapshotPolicy(input *volumes.VolumeSnapsh return []DataProtectionSnapshotPolicy{ { - DataProtectionSnapshotPolicy: *input.SnapshotPolicyId, + DataProtectionSnapshotPolicy: pointer.From(input.SnapshotPolicyId), }, } } -func getResourceNameString(input *string) string { - segments := len(strings.Split(*input, "/")) - if segments == 0 { +func getUserDefinedVolumeName(input *string) string { + volumeName := pointer.From(input) + + if volumeName == "" { return "" } - return strings.Split(*input, "/")[segments-1] + segments := len(strings.Split(volumeName, "/")) + + return strings.Split(volumeName, "/")[segments-1] } func deleteVolume(ctx context.Context, metadata sdk.ResourceMetaData, volumeId string) error { @@ -546,7 +488,7 @@ func deleteVolume(ctx context.Context, metadata sdk.ResourceMetaData, volumeId s return err } - existing, err := client.Get(ctx, *id) + existing, err := client.Get(ctx, pointer.From(id)) if err != nil { if existing.HttpResponse.StatusCode == http.StatusNotFound { return metadata.MarkAsGone(id) @@ -561,7 +503,7 @@ func deleteVolume(ctx context.Context, metadata sdk.ResourceMetaData, volumeId s if err != nil { return err } - if dataProtectionReplication.Replication.EndpointType != nil && !strings.EqualFold(string(*dataProtectionReplication.Replication.EndpointType), string(volumes.EndpointTypeDst)) { + if dataProtectionReplication.Replication.EndpointType != nil && !strings.EqualFold(string(pointer.From(dataProtectionReplication.Replication.EndpointType)), string(volumes.EndpointTypeDst)) { // This is the case where primary volume started the deletion, in this case, to be consistent we will remove replication from secondary replicaVolumeId, err = volumesreplication.ParseVolumeID(dataProtectionReplication.Replication.RemoteVolumeResourceId) if err != nil { @@ -571,49 +513,49 @@ func deleteVolume(ctx context.Context, metadata sdk.ResourceMetaData, volumeId s replicationClient := metadata.Client.NetApp.VolumeReplicationClient // Checking replication status before deletion, it need to be broken before proceeding with deletion - if res, err := replicationClient.VolumesReplicationStatus(ctx, *replicaVolumeId); err == nil { + if res, err := replicationClient.VolumesReplicationStatus(ctx, pointer.From(replicaVolumeId)); err == nil { // Wait for replication state = "mirrored" if model := res.Model; model != nil { - if model.MirrorState != nil && strings.ToLower(string(*model.MirrorState)) == "uninitialized" { - if err := waitForReplMirrorState(ctx, replicationClient, *replicaVolumeId, "mirrored"); err != nil { - return fmt.Errorf("waiting for replica %s to become 'mirrored': %+v", *replicaVolumeId, err) + if model.MirrorState != nil && strings.ToLower(string(pointer.From(model.MirrorState))) == "uninitialized" { + if err := waitForReplMirrorState(ctx, replicationClient, pointer.From(replicaVolumeId), "mirrored"); err != nil { + return fmt.Errorf("waiting for replica %s to become 'mirrored': %+v", pointer.From(replicaVolumeId), err) } } } // Breaking replication - if err = replicationClient.VolumesBreakReplicationThenPoll(ctx, *replicaVolumeId, volumesreplication.BreakReplicationRequest{ + if err = replicationClient.VolumesBreakReplicationThenPoll(ctx, pointer.From(replicaVolumeId), volumesreplication.BreakReplicationRequest{ ForceBreakReplication: utils.Bool(true), }); err != nil { - return fmt.Errorf("breaking replication for %s: %+v", *replicaVolumeId, err) + return fmt.Errorf("breaking replication for %s: %+v", pointer.From(replicaVolumeId), err) } // Waiting for replication be in broken state - metadata.Logger.Infof("waiting for the replication of %s to be in broken state", *replicaVolumeId) - if err := waitForReplMirrorState(ctx, replicationClient, *replicaVolumeId, "broken"); err != nil { - return fmt.Errorf("waiting for the breaking of replication for %s: %+v", *replicaVolumeId, err) + metadata.Logger.Infof("waiting for the replication of %s to be in broken state", pointer.From(replicaVolumeId)) + if err := waitForReplMirrorState(ctx, replicationClient, pointer.From(replicaVolumeId), "broken"); err != nil { + return fmt.Errorf("waiting for the breaking of replication for %s: %+v", pointer.From(replicaVolumeId), err) } } // Deleting replication and waiting for it to fully complete the operation - if err = replicationClient.VolumesDeleteReplicationThenPoll(ctx, *replicaVolumeId); err != nil { - return fmt.Errorf("deleting replicate %s: %+v", *replicaVolumeId, err) + if err = replicationClient.VolumesDeleteReplicationThenPoll(ctx, pointer.From(replicaVolumeId)); err != nil { + return fmt.Errorf("deleting replicate %s: %+v", pointer.From(replicaVolumeId), err) } - if err := waitForReplicationDeletion(ctx, replicationClient, *replicaVolumeId); err != nil { - return fmt.Errorf("waiting for the replica %s to be deleted: %+v", *replicaVolumeId, err) + if err := waitForReplicationDeletion(ctx, replicationClient, pointer.From(replicaVolumeId)); err != nil { + return fmt.Errorf("waiting for the replica %s to be deleted: %+v", pointer.From(replicaVolumeId), err) } } // Deleting volume and waiting for it fo fully complete the operation - if err = client.DeleteThenPoll(ctx, *id, volumes.DeleteOperationOptions{ + if err = client.DeleteThenPoll(ctx, pointer.From(id), volumes.DeleteOperationOptions{ ForceDelete: utils.Bool(true), }); err != nil { - return fmt.Errorf("deleting %s: %+v", *id, err) + return fmt.Errorf("deleting %s: %+v", pointer.From(id), err) } - if err = waitForVolumeDeletion(ctx, client, *id); err != nil { - return fmt.Errorf("waiting for deletion of %s: %+v", *id, err) + if err = waitForVolumeDeletion(ctx, client, pointer.From(id)); err != nil { + return fmt.Errorf("waiting for deletion of %s: %+v", pointer.From(id), err) } return nil @@ -850,124 +792,6 @@ func translateSDKSchedule(scheduleName string) string { return scheduleName } -func validateNetAppVolumeGroupVolumes(volumeList *[]volumegroups.VolumeGroupVolumeProperties, applicationType volumegroups.ApplicationType) []error { - errors := make([]error, 0) - volumeSpecRepeatCount := make(map[string]int) - - if applicationType == volumegroups.ApplicationTypeSAPNegativeHANA { - - // Validating maximum number of volumes - if len(*volumeList) > 5 { - errors = append(errors, fmt.Errorf("'`volume` list cannot be greater than 5 for %v'", applicationType)) - } - - // Validating each volume - for _, volume := range *volumeList { - // Validating maximum number of protocols - if len(*volume.Properties.ProtocolTypes) > 1 { - errors = append(errors, fmt.Errorf("'`protocols` list cannot be greater than 1 for %v on volume %v'", applicationType, *volume.Name)) - } - - // Validating protocol, it supports only one and that is enforced by the schema - - // Can't be CIFS at all times - if strings.EqualFold((*volume.Properties.ProtocolTypes)[0], string(ProtocolTypeCifs)) { - errors = append(errors, fmt.Errorf("'cifs is not supported for %v on volume %v'", applicationType, *volume.Name)) - } - - // Can't be nfsv3 on data, log and share volumes - if strings.EqualFold((*volume.Properties.ProtocolTypes)[0], string(ProtocolTypeNfsV3)) && - (strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameSapHanaData)) || - strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameSapHanaShared)) || - strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameSapHanaLog))) { - - errors = append(errors, fmt.Errorf("'nfsv3 on data, log and shared volumes for %v is not supported on volume %v'", applicationType, *volume.Name)) - } - - // Validating export policies - if volume.Properties.ExportPolicy != nil { - for _, rule := range *volume.Properties.ExportPolicy.Rules { - errors = append(errors, validateNetAppVolumeGroupExportPolicyRule(rule, (*volume.Properties.ProtocolTypes)[0])...) - } - } - - // Checking CRR rule that log cannot be DataProtection type - if strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameSapHanaLog)) && - volume.Properties.DataProtection != nil && - volume.Properties.DataProtection.Replication != nil && - strings.EqualFold(string(*volume.Properties.DataProtection.Replication.EndpointType), string(volumegroups.EndpointTypeDst)) { - - errors = append(errors, fmt.Errorf("'log volume spec type cannot be DataProtection type for %v on volume %v'", applicationType, *volume.Name)) - } - - // Validating that snapshot policies are not being created in a data protection volume - if volume.Properties.DataProtection != nil && - volume.Properties.DataProtection.Snapshot != nil && - (volume.Properties.DataProtection.Replication != nil && strings.EqualFold(string(*volume.Properties.DataProtection.Replication.EndpointType), string(volumegroups.EndpointTypeDst))) { - - errors = append(errors, fmt.Errorf("'snapshot policy cannot be enabled on a data protection volume for %v on volume %v'", applicationType, *volume.Name)) - } - - // Validating that data-backup and log-backup don't have PPG defined - if (strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameSapHanaDataBackup)) || - strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameSapHanaLogBackup))) && - utils.NormalizeNilableString(volume.Properties.ProximityPlacementGroup) != "" { - - errors = append(errors, fmt.Errorf("'%v volume spec type cannot have PPG defined for %v on volume %v'", *volume.Properties.VolumeSpecName, applicationType, *volume.Name)) - } - - // Validating that data, log and shared have PPG defined. - if (strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameSapHanaData)) || - strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameSapHanaLog)) || - strings.EqualFold(*volume.Properties.VolumeSpecName, string(VolumeSpecNameSapHanaShared))) && - utils.NormalizeNilableString(volume.Properties.ProximityPlacementGroup) == "" { - - errors = append(errors, fmt.Errorf("'%v volume spec type must have PPG defined for %v on volume %v'", *volume.Properties.VolumeSpecName, applicationType, *volume.Name)) - } - - // Adding volume spec name to hashmap for post volume loop check - volumeSpecRepeatCount[*volume.Properties.VolumeSpecName] += 1 - } - - // Validating required volume spec types - for _, requiredVolumeSpec := range RequiredVolumesForSAPHANA() { - if _, ok := volumeSpecRepeatCount[requiredVolumeSpec]; !ok { - errors = append(errors, fmt.Errorf("'required volume spec type %v is not present for %v'", requiredVolumeSpec, applicationType)) - } - } - - // Validating that volume spec does not repeat - for volumeSpecName, count := range volumeSpecRepeatCount { - if count > 1 { - errors = append(errors, fmt.Errorf("'volume spec type %v cannot be repeated for %v'", volumeSpecName, applicationType)) - } - } - } - - return errors -} - -func validateNetAppVolumeGroupExportPolicyRule(rule volumegroups.ExportPolicyRule, protocolType string) []error { - errors := make([]error, 0) - - // Validating that nfsv3 and nfsv4.1 are not enabled in the same rule - if *rule.Nfsv3 && *rule.Nfsv41 { - errors = append(errors, fmt.Errorf("'nfsv3 and nfsv4.1 cannot be enabled at the same time'")) - } - - // Validating that nfsv4.1 export policy is not set on nfsv3 volume - if *rule.Nfsv41 && strings.EqualFold(protocolType, string(ProtocolTypeNfsV3)) { - errors = append(errors, fmt.Errorf("'nfsv4.1 export policy cannot be enabled on nfsv3 volume'")) - } - - // Validating that nfsv3 export policy is not set on nfsv4.1 volume - if *rule.Nfsv3 && strings.EqualFold(protocolType, string(ProtocolTypeNfsV41)) { - errors = append(errors, fmt.Errorf("'nfsv3 export policy cannot be enabled on nfsv4.1 volume'")) - } - - return errors -} - func FindStringInSlice(slice []string, val string) bool { for _, item := range slice { if strings.EqualFold(item, val) { diff --git a/internal/services/netapp/netapp_volume_resource.go b/internal/services/netapp/netapp_volume_resource.go index 9895c66ba48f..d21888c8409a 100644 --- a/internal/services/netapp/netapp_volume_resource.go +++ b/internal/services/netapp/netapp_volume_resource.go @@ -194,19 +194,16 @@ func resourceNetAppVolume() *pluginsdk.Resource { "unix_read_only": { Type: pluginsdk.TypeBool, Optional: true, - Computed: true, }, "unix_read_write": { Type: pluginsdk.TypeBool, Optional: true, - Computed: true, }, "root_access_enabled": { Type: pluginsdk.TypeBool, Optional: true, - Computed: true, }, }, }, @@ -792,6 +789,8 @@ func expandNetAppVolumeExportPolicyRulePatch(input []interface{}) *volumes.Volum for _, protocol := range protocolsEnabled { if protocol != nil { switch strings.ToLower(protocol.(string)) { + case "cifs": + cifsEnabled = true case "nfsv3": nfsv3Enabled = true case "nfsv4.1": diff --git a/internal/services/netapp/validate/volume_group_sap_hana_volumes_validation.go b/internal/services/netapp/validate/volume_group_sap_hana_volumes_validation.go new file mode 100644 index 000000000000..350a78b0867f --- /dev/null +++ b/internal/services/netapp/validate/volume_group_sap_hana_volumes_validation.go @@ -0,0 +1,179 @@ +package validate + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/lang/pointer" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups" + "github.com/hashicorp/terraform-provider-azurerm/utils" +) + +type VolumeSpecNameSapHana string + +const ( + VolumeSpecNameSapHanaData VolumeSpecNameSapHana = "data" + VolumeSpecNameSapHanaLog VolumeSpecNameSapHana = "log" + VolumeSpecNameSapHanaShared VolumeSpecNameSapHana = "shared" + VolumeSpecNameSapHanaDataBackup VolumeSpecNameSapHana = "data-backup" + VolumeSpecNameSapHanaLogBackup VolumeSpecNameSapHana = "log-backup" +) + +func PossibleValuesForVolumeSpecNameSapHana() []string { + return []string{ + string(VolumeSpecNameSapHanaData), + string(VolumeSpecNameSapHanaLog), + string(VolumeSpecNameSapHanaShared), + string(VolumeSpecNameSapHanaDataBackup), + string(VolumeSpecNameSapHanaLogBackup), + } +} + +func RequiredVolumesForSAPHANA() []string { + return []string{ + string(VolumeSpecNameSapHanaData), + string(VolumeSpecNameSapHanaLog), + } +} + +type ProtocolType string + +const ( + ProtocolTypeNfsV41 ProtocolType = "NFSv4.1" + ProtocolTypeNfsV3 ProtocolType = "NFSv3" + ProtocolTypeCifs ProtocolType = "CIFS" +) + +func PossibleValuesForProtocolType() []string { + return []string{ + string(ProtocolTypeNfsV41), + string(ProtocolTypeNfsV3), + string(ProtocolTypeCifs), + } +} + +func PossibleValuesForProtocolTypeVolumeGroupSapHana() []string { + return []string{ + string(ProtocolTypeNfsV41), + string(ProtocolTypeNfsV3), + } +} + +// Diverging from the SDK volumegroups.SecurityStyle since it is defined as lower case +// but the backend changes it to Pascal case on GET. Please refer to https://github.com/Azure/azure-sdk-for-go/issues/14684 +type SecurityStyle string + +const ( + SecurityStyleUnix SecurityStyle = "Unix" + SecurityStyleNtfs SecurityStyle = "Ntfs" +) + +func PossibleValuesForSecurityStyle() []string { + return []string{ + string(SecurityStyleUnix), + } +} + +func ValidateNetAppVolumeGroupSAPHanaVolumes(volumeList *[]volumegroups.VolumeGroupVolumeProperties) []error { + errors := make([]error, 0) + volumeSpecRepeatCount := make(map[string]int) + applicationType := string(volumegroups.ApplicationTypeSAPNegativeHANA) + + // Validating maximum number of volumes + if len(pointer.From(volumeList)) > 5 { + errors = append(errors, fmt.Errorf("'`volume` list cannot be greater than 5 for %v'", applicationType)) + } + + // Validating each volume + for _, volume := range pointer.From(volumeList) { + // Can't be nfsv3 on data, log and share volumes + if strings.EqualFold((pointer.From(volume.Properties.ProtocolTypes))[0], string(ProtocolTypeNfsV3)) && + (strings.EqualFold(pointer.From(volume.Properties.VolumeSpecName), string(VolumeSpecNameSapHanaData)) || + strings.EqualFold(pointer.From(volume.Properties.VolumeSpecName), string(VolumeSpecNameSapHanaShared)) || + strings.EqualFold(pointer.From(volume.Properties.VolumeSpecName), string(VolumeSpecNameSapHanaLog))) { + + errors = append(errors, fmt.Errorf("'nfsv3 on data, log and shared volumes for %v is not supported on volume %v'", applicationType, pointer.From(volume.Name))) + } + + // Validating export policies + if volume.Properties.ExportPolicy != nil { + for _, rule := range pointer.From(volume.Properties.ExportPolicy.Rules) { + errors = append(errors, ValidateNetAppVolumeGroupExportPolicyRule(rule, (pointer.From(volume.Properties.ProtocolTypes))[0])...) + } + } + + // Checking CRR rule that log cannot be DataProtection type + if strings.EqualFold(pointer.From(volume.Properties.VolumeSpecName), string(VolumeSpecNameSapHanaLog)) && + volume.Properties.DataProtection != nil && + volume.Properties.DataProtection.Replication != nil && + strings.EqualFold(string(pointer.From(volume.Properties.DataProtection.Replication.EndpointType)), string(volumegroups.EndpointTypeDst)) { + + errors = append(errors, fmt.Errorf("'log volume spec type cannot be DataProtection type for %v on volume %v'", applicationType, pointer.From(volume.Name))) + } + + // Validating that snapshot policies are not being created in a data protection volume + if volume.Properties.DataProtection != nil && + volume.Properties.DataProtection.Snapshot != nil && + (volume.Properties.DataProtection.Replication != nil && strings.EqualFold(string(pointer.From(volume.Properties.DataProtection.Replication.EndpointType)), string(volumegroups.EndpointTypeDst))) { + + errors = append(errors, fmt.Errorf("'snapshot policy cannot be enabled on a data protection volume for %v on volume %v'", applicationType, pointer.From(volume.Name))) + } + + // Validating that data-backup and log-backup don't have PPG defined + if (strings.EqualFold(pointer.From(volume.Properties.VolumeSpecName), string(VolumeSpecNameSapHanaDataBackup)) || + strings.EqualFold(pointer.From(volume.Properties.VolumeSpecName), string(VolumeSpecNameSapHanaLogBackup))) && + utils.NormalizeNilableString(volume.Properties.ProximityPlacementGroup) != "" { + + errors = append(errors, fmt.Errorf("'%v volume spec type cannot have PPG defined for %v on volume %v'", pointer.From(volume.Properties.VolumeSpecName), applicationType, pointer.From(volume.Name))) + } + + // Validating that data, log and shared have PPG defined. + if (strings.EqualFold(pointer.From(volume.Properties.VolumeSpecName), string(VolumeSpecNameSapHanaData)) || + strings.EqualFold(pointer.From(volume.Properties.VolumeSpecName), string(VolumeSpecNameSapHanaLog)) || + strings.EqualFold(pointer.From(volume.Properties.VolumeSpecName), string(VolumeSpecNameSapHanaShared))) && + utils.NormalizeNilableString(volume.Properties.ProximityPlacementGroup) == "" { + + errors = append(errors, fmt.Errorf("'%v volume spec type must have PPG defined for %v on volume %v'", pointer.From(volume.Properties.VolumeSpecName), applicationType, pointer.From(volume.Name))) + } + + // Adding volume spec name to hashmap for post volume loop check + volumeSpecRepeatCount[pointer.From(volume.Properties.VolumeSpecName)] += 1 + } + + // Validating required volume spec types + for _, requiredVolumeSpec := range RequiredVolumesForSAPHANA() { + if _, ok := volumeSpecRepeatCount[requiredVolumeSpec]; !ok { + errors = append(errors, fmt.Errorf("'required volume spec type %v is not present for %v'", requiredVolumeSpec, applicationType)) + } + } + + // Validating that volume spec does not repeat + for volumeSpecName, count := range volumeSpecRepeatCount { + if count > 1 { + errors = append(errors, fmt.Errorf("'volume spec type %v cannot be repeated for %v'", volumeSpecName, applicationType)) + } + } + + return errors +} + +func ValidateNetAppVolumeGroupExportPolicyRule(rule volumegroups.ExportPolicyRule, protocolType string) []error { + errors := make([]error, 0) + + // Validating that nfsv3 and nfsv4.1 are not enabled in the same rule + if pointer.From(rule.Nfsv3) && pointer.From(rule.Nfsv41) { + errors = append(errors, fmt.Errorf("'nfsv3 and nfsv4.1 cannot be enabled at the same time'")) + } + + // Validating that nfsv4.1 export policy is not set on nfsv3 volume + if pointer.From(rule.Nfsv41) && strings.EqualFold(protocolType, string(ProtocolTypeNfsV3)) { + errors = append(errors, fmt.Errorf("'nfsv4.1 export policy cannot be enabled on nfsv3 volume'")) + } + + // Validating that nfsv3 export policy is not set on nfsv4.1 volume + if pointer.From(rule.Nfsv3) && strings.EqualFold(protocolType, string(ProtocolTypeNfsV41)) { + errors = append(errors, fmt.Errorf("'nfsv3 export policy cannot be enabled on nfsv4.1 volume'")) + } + + return errors +} diff --git a/internal/services/netapp/validate/volume_group_sap_hana_volumes_validation_test.go b/internal/services/netapp/validate/volume_group_sap_hana_volumes_validation_test.go new file mode 100644 index 000000000000..69919263f9a6 --- /dev/null +++ b/internal/services/netapp/validate/volume_group_sap_hana_volumes_validation_test.go @@ -0,0 +1,51 @@ +package validate + +import ( + "testing" + + "github.com/hashicorp/go-azure-helpers/lang/pointer" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups" +) + +func TestValidateNetAppVolumeGroupSAPHanaVolumes(t *testing.T) { + cases := []struct { + Name string + VolumesData []volumegroups.VolumeGroupVolumeProperties + Errors int + }{ + { + Name: "ValidateCorrectSettings", + VolumesData: []volumegroups.VolumeGroupVolumeProperties{ + { // data + Properties: volumeGroups + ExportPolicy: &volumegroups.ExportPolicy{ + Rules: []volumegroups.ExportPolicyRule{ + { + RuleIndex: pointer.ToInt32(1), + AllowedClients: pointer.ToString("0.0.0.0/0"), + Cifs: pointer.ToBool(false), + Nfsv3: pointer.ToBool(false), + Nfsv41: pointer.ToBool(true), + UnixReadOnly: pointer.ToBool(false), + UnixReadWrite: pointer.ToBool(true), + HasRootAccess: pointer.ToBoll(true), + }, + }, + }, + }, + }, + + Errors: 0, + }, + } + + for _, tc := range cases { + t.Run(tc.Name, func(t *testing.T) { + errors := ValidateNetAppVolumeGroupSAPHanaVolumes(pointer.To(tc.VolumesData)) + + if len(errors) != tc.Errors { + t.Fatalf("expected ValidateNetAppVolumeGroupSAPHanaVolumes to return %d error(s) not %d", tc.Errors, len(errors)) + } + }) + } +} From 184502659dd5515ec8f5b110238817d8112ba7f8 Mon Sep 17 00:00:00 2001 From: Paulo Date: Fri, 14 Apr 2023 21:53:43 +0000 Subject: [PATCH 70/83] Unit testing for ValidateNetAppVolumeGroupSAPHanaVolumes and ValidateNetAppVolumeGroupExportPolicyRuleSAPHanna --- .../netapp_volume_group_sap_hana_resource.go | 2 +- ...p_hana_volumes_export_policy_validation.go | 30 ++ ...a_volumes_export_policy_validation_test.go | 83 +++++ ...olume_group_sap_hana_volumes_validation.go | 36 +- ..._group_sap_hana_volumes_validation_test.go | 329 +++++++++++++++++- 5 files changed, 436 insertions(+), 44 deletions(-) create mode 100644 internal/services/netapp/validate/volume_group_sap_hana_volumes_export_policy_validation.go create mode 100644 internal/services/netapp/validate/volume_group_sap_hana_volumes_export_policy_validation_test.go diff --git a/internal/services/netapp/netapp_volume_group_sap_hana_resource.go b/internal/services/netapp/netapp_volume_group_sap_hana_resource.go index 417dfc9209af..8f2c157cd1a1 100644 --- a/internal/services/netapp/netapp_volume_group_sap_hana_resource.go +++ b/internal/services/netapp/netapp_volume_group_sap_hana_resource.go @@ -490,7 +490,7 @@ func (r NetAppVolumeGroupSapHanaResource) Update() sdk.ResourceFunc { rule.Nfsv3 = utils.Bool(v["nfsv3_enabled"].(bool)) rule.Nfsv41 = utils.Bool(v["nfsv41_enabled"].(bool)) - errors = append(errors, validate.ValidateNetAppVolumeGroupExportPolicyRule(rule, volumeProtocol)...) + errors = append(errors, validate.ValidateNetAppVolumeGroupExportPolicyRuleSAPHanna(rule, volumeProtocol)...) } } diff --git a/internal/services/netapp/validate/volume_group_sap_hana_volumes_export_policy_validation.go b/internal/services/netapp/validate/volume_group_sap_hana_volumes_export_policy_validation.go new file mode 100644 index 000000000000..b388894bfd86 --- /dev/null +++ b/internal/services/netapp/validate/volume_group_sap_hana_volumes_export_policy_validation.go @@ -0,0 +1,30 @@ +package validate + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/lang/pointer" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups" +) + +func ValidateNetAppVolumeGroupExportPolicyRuleSAPHanna(rule volumegroups.ExportPolicyRule, protocolType string) []error { + errors := make([]error, 0) + + // Validating that nfsv3 and nfsv4.1 are not enabled in the same rule + if pointer.From(rule.Nfsv3) && pointer.From(rule.Nfsv41) { + errors = append(errors, fmt.Errorf("'nfsv3 and nfsv4.1 cannot be enabled at the same time'")) + } + + // Validating that nfsv4.1 export policy is not set on nfsv3 volume + if pointer.From(rule.Nfsv41) && strings.EqualFold(protocolType, string(ProtocolTypeNfsV3)) { + errors = append(errors, fmt.Errorf("'nfsv4.1 export policy cannot be enabled on nfsv3 volume'")) + } + + // Validating that nfsv3 export policy is not set on nfsv4.1 volume + if pointer.From(rule.Nfsv3) && strings.EqualFold(protocolType, string(ProtocolTypeNfsV41)) { + errors = append(errors, fmt.Errorf("'nfsv3 export policy cannot be enabled on nfsv4.1 volume'")) + } + + return errors +} diff --git a/internal/services/netapp/validate/volume_group_sap_hana_volumes_export_policy_validation_test.go b/internal/services/netapp/validate/volume_group_sap_hana_volumes_export_policy_validation_test.go new file mode 100644 index 000000000000..4c1766628736 --- /dev/null +++ b/internal/services/netapp/validate/volume_group_sap_hana_volumes_export_policy_validation_test.go @@ -0,0 +1,83 @@ +package validate + +import ( + "testing" + + "github.com/hashicorp/go-azure-helpers/lang/pointer" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups" + "github.com/hashicorp/terraform-provider-azurerm/utils" +) + +func TestValidateNetAppVolumeGroupExportPolicyRuleSAPHanna(t *testing.T) { + cases := []struct { + Name string + Protocol string + Rule volumegroups.ExportPolicyRule + Errors int + }{ + { + Name: "ValidateNFSv41EnabledOnNFSv41Volume", + Protocol: string(ProtocolTypeNfsV41), + Rule: volumegroups.ExportPolicyRule{ + Nfsv3: pointer.To(false), + Nfsv41: utils.Bool(true), + }, + Errors: 0, + }, + { + Name: "ValidateNFSv3EnabledOnNFSv3Volume", + Protocol: string(ProtocolTypeNfsV3), + Rule: volumegroups.ExportPolicyRule{ + Nfsv3: pointer.To(true), + Nfsv41: utils.Bool(false), + }, + Errors: 0, + }, + { + Name: "ValidateBothProtocolsNotEnabledAtSameTimeOnNFSv41Volume", + Protocol: string(ProtocolTypeNfsV41), + Rule: volumegroups.ExportPolicyRule{ + Nfsv3: pointer.To(true), + Nfsv41: utils.Bool(true), + }, + Errors: 2, + }, + { + Name: "ValidateBothProtocolsNotEnabledAtSameTimeOnNFSv3Volume", + Protocol: string(ProtocolTypeNfsV3), + Rule: volumegroups.ExportPolicyRule{ + Nfsv3: pointer.To(true), + Nfsv41: utils.Bool(true), + }, + Errors: 2, + }, + { + Name: "ValidateNFSv3NotEnabledOnNFSv41Volume", + Protocol: string(ProtocolTypeNfsV41), + Rule: volumegroups.ExportPolicyRule{ + Nfsv3: pointer.To(true), + Nfsv41: utils.Bool(false), + }, + Errors: 1, + }, + { + Name: "ValidateNFSv41NotEnabledOnNFSv3Volume", + Protocol: string(ProtocolTypeNfsV3), + Rule: volumegroups.ExportPolicyRule{ + Nfsv3: pointer.To(false), + Nfsv41: utils.Bool(true), + }, + Errors: 1, + }, + } + + for _, tc := range cases { + t.Run(tc.Name, func(t *testing.T) { + errors := ValidateNetAppVolumeGroupExportPolicyRuleSAPHanna(tc.Rule, tc.Protocol) + + if len(errors) != tc.Errors { + t.Fatalf("expected ValidateNetAppVolumeGroupSAPHanaVolumes to return %d error(s) not %d", tc.Errors, len(errors)) + } + }) + } +} diff --git a/internal/services/netapp/validate/volume_group_sap_hana_volumes_validation.go b/internal/services/netapp/validate/volume_group_sap_hana_volumes_validation.go index 350a78b0867f..08101a0cf37f 100644 --- a/internal/services/netapp/validate/volume_group_sap_hana_volumes_validation.go +++ b/internal/services/netapp/validate/volume_group_sap_hana_volumes_validation.go @@ -79,15 +79,16 @@ func ValidateNetAppVolumeGroupSAPHanaVolumes(volumeList *[]volumegroups.VolumeGr volumeSpecRepeatCount := make(map[string]int) applicationType := string(volumegroups.ApplicationTypeSAPNegativeHANA) - // Validating maximum number of volumes - if len(pointer.From(volumeList)) > 5 { - errors = append(errors, fmt.Errorf("'`volume` list cannot be greater than 5 for %v'", applicationType)) - } - // Validating each volume for _, volume := range pointer.From(volumeList) { + protocolTypeList := pointer.From(volume.Properties.ProtocolTypes) + protocolType := "" + if len(protocolTypeList) > 0 { + protocolType = protocolTypeList[0] + } + // Can't be nfsv3 on data, log and share volumes - if strings.EqualFold((pointer.From(volume.Properties.ProtocolTypes))[0], string(ProtocolTypeNfsV3)) && + if strings.EqualFold(protocolType, string(ProtocolTypeNfsV3)) && (strings.EqualFold(pointer.From(volume.Properties.VolumeSpecName), string(VolumeSpecNameSapHanaData)) || strings.EqualFold(pointer.From(volume.Properties.VolumeSpecName), string(VolumeSpecNameSapHanaShared)) || strings.EqualFold(pointer.From(volume.Properties.VolumeSpecName), string(VolumeSpecNameSapHanaLog))) { @@ -98,7 +99,7 @@ func ValidateNetAppVolumeGroupSAPHanaVolumes(volumeList *[]volumegroups.VolumeGr // Validating export policies if volume.Properties.ExportPolicy != nil { for _, rule := range pointer.From(volume.Properties.ExportPolicy.Rules) { - errors = append(errors, ValidateNetAppVolumeGroupExportPolicyRule(rule, (pointer.From(volume.Properties.ProtocolTypes))[0])...) + errors = append(errors, ValidateNetAppVolumeGroupExportPolicyRuleSAPHanna(rule, protocolType)...) } } @@ -156,24 +157,3 @@ func ValidateNetAppVolumeGroupSAPHanaVolumes(volumeList *[]volumegroups.VolumeGr return errors } - -func ValidateNetAppVolumeGroupExportPolicyRule(rule volumegroups.ExportPolicyRule, protocolType string) []error { - errors := make([]error, 0) - - // Validating that nfsv3 and nfsv4.1 are not enabled in the same rule - if pointer.From(rule.Nfsv3) && pointer.From(rule.Nfsv41) { - errors = append(errors, fmt.Errorf("'nfsv3 and nfsv4.1 cannot be enabled at the same time'")) - } - - // Validating that nfsv4.1 export policy is not set on nfsv3 volume - if pointer.From(rule.Nfsv41) && strings.EqualFold(protocolType, string(ProtocolTypeNfsV3)) { - errors = append(errors, fmt.Errorf("'nfsv4.1 export policy cannot be enabled on nfsv3 volume'")) - } - - // Validating that nfsv3 export policy is not set on nfsv4.1 volume - if pointer.From(rule.Nfsv3) && strings.EqualFold(protocolType, string(ProtocolTypeNfsV41)) { - errors = append(errors, fmt.Errorf("'nfsv3 export policy cannot be enabled on nfsv4.1 volume'")) - } - - return errors -} diff --git a/internal/services/netapp/validate/volume_group_sap_hana_volumes_validation_test.go b/internal/services/netapp/validate/volume_group_sap_hana_volumes_validation_test.go index 69919263f9a6..c2cd171c12aa 100644 --- a/internal/services/netapp/validate/volume_group_sap_hana_volumes_validation_test.go +++ b/internal/services/netapp/validate/volume_group_sap_hana_volumes_validation_test.go @@ -1,10 +1,12 @@ package validate import ( + "fmt" "testing" "github.com/hashicorp/go-azure-helpers/lang/pointer" "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2022-05-01/volumegroups" + "github.com/hashicorp/terraform-provider-azurerm/utils" ) func TestValidateNetAppVolumeGroupSAPHanaVolumes(t *testing.T) { @@ -14,28 +16,325 @@ func TestValidateNetAppVolumeGroupSAPHanaVolumes(t *testing.T) { Errors int }{ { - Name: "ValidateCorrectSettings", + Name: "ValidateCorrectSettingsAllVolumes", VolumesData: []volumegroups.VolumeGroupVolumeProperties{ { // data - Properties: volumeGroups - ExportPolicy: &volumegroups.ExportPolicy{ - Rules: []volumegroups.ExportPolicyRule{ - { - RuleIndex: pointer.ToInt32(1), - AllowedClients: pointer.ToString("0.0.0.0/0"), - Cifs: pointer.ToBool(false), - Nfsv3: pointer.ToBool(false), - Nfsv41: pointer.ToBool(true), - UnixReadOnly: pointer.ToBool(false), - UnixReadWrite: pointer.ToBool(true), - HasRootAccess: pointer.ToBoll(true), + Name: pointer.To(fmt.Sprintf("volume-%v", string(VolumeSpecNameSapHanaData))), + Properties: volumegroups.VolumeProperties{ + ExportPolicy: &volumegroups.VolumePropertiesExportPolicy{ + Rules: &[]volumegroups.ExportPolicyRule{ + { + Nfsv3: pointer.To(false), + Nfsv41: utils.Bool(true), + }, }, }, + ProtocolTypes: pointer.To([]string{"NFSv4.1"}), + ProximityPlacementGroup: pointer.To("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"), + SecurityStyle: pointer.To(volumegroups.SecurityStyle(SecurityStyleUnix)), + VolumeSpecName: pointer.To(string(VolumeSpecNameSapHanaData)), + }, + }, + { // log + Name: pointer.To(fmt.Sprintf("volume-%v", string(VolumeSpecNameSapHanaLog))), + Properties: volumegroups.VolumeProperties{ + ExportPolicy: &volumegroups.VolumePropertiesExportPolicy{ + Rules: &[]volumegroups.ExportPolicyRule{ + { + Nfsv3: pointer.To(false), + Nfsv41: utils.Bool(true), + }, + }, + }, + ProtocolTypes: pointer.To([]string{"NFSv4.1"}), + ProximityPlacementGroup: pointer.To("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"), + SecurityStyle: pointer.To(volumegroups.SecurityStyle(SecurityStyleUnix)), + VolumeSpecName: pointer.To(string(VolumeSpecNameSapHanaLog)), + }, + }, + { // shared + Name: pointer.To(fmt.Sprintf("volume-%v", string(VolumeSpecNameSapHanaShared))), + Properties: volumegroups.VolumeProperties{ + ExportPolicy: &volumegroups.VolumePropertiesExportPolicy{ + Rules: &[]volumegroups.ExportPolicyRule{ + { + Nfsv3: pointer.To(false), + Nfsv41: utils.Bool(true), + }, + }, + }, + ProtocolTypes: pointer.To([]string{"NFSv4.1"}), + ProximityPlacementGroup: pointer.To("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"), + SecurityStyle: pointer.To(volumegroups.SecurityStyle(SecurityStyleUnix)), + VolumeSpecName: pointer.To(string(VolumeSpecNameSapHanaShared)), + }, + }, + { // data-backup + Name: pointer.To(fmt.Sprintf("volume-%v", string(VolumeSpecNameSapHanaDataBackup))), + Properties: volumegroups.VolumeProperties{ + ExportPolicy: &volumegroups.VolumePropertiesExportPolicy{ + Rules: &[]volumegroups.ExportPolicyRule{ + { + Nfsv3: pointer.To(false), + Nfsv41: utils.Bool(true), + }, + }, + }, + ProtocolTypes: pointer.To([]string{"NFSv4.1"}), + SecurityStyle: pointer.To(volumegroups.SecurityStyle(SecurityStyleUnix)), + VolumeSpecName: pointer.To(string(VolumeSpecNameSapHanaDataBackup)), + }, + }, + { // log-backup + Name: pointer.To(fmt.Sprintf("volume-%v", string(VolumeSpecNameSapHanaLogBackup))), + Properties: volumegroups.VolumeProperties{ + ExportPolicy: &volumegroups.VolumePropertiesExportPolicy{ + Rules: &[]volumegroups.ExportPolicyRule{ + { + Nfsv3: pointer.To(false), + Nfsv41: utils.Bool(true), + }, + }, + }, + ProtocolTypes: pointer.To([]string{"NFSv4.1"}), + SecurityStyle: pointer.To(volumegroups.SecurityStyle(SecurityStyleUnix)), + VolumeSpecName: pointer.To(string(VolumeSpecNameSapHanaLogBackup)), }, }, }, - - Errors: 0, + Errors: 0, + }, + { + Name: "ValidateMinimumVolumes", + VolumesData: []volumegroups.VolumeGroupVolumeProperties{ + { // data + Name: pointer.To(fmt.Sprintf("volume-%v", string(VolumeSpecNameSapHanaData))), + Properties: volumegroups.VolumeProperties{ + ExportPolicy: &volumegroups.VolumePropertiesExportPolicy{ + Rules: &[]volumegroups.ExportPolicyRule{ + { + Nfsv3: pointer.To(false), + Nfsv41: utils.Bool(true), + }, + }, + }, + ProtocolTypes: pointer.To([]string{"NFSv4.1"}), + ProximityPlacementGroup: pointer.To("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"), + SecurityStyle: pointer.To(volumegroups.SecurityStyle(SecurityStyleUnix)), + VolumeSpecName: pointer.To(string(VolumeSpecNameSapHanaData)), + }, + }, + { // log + Name: pointer.To(fmt.Sprintf("volume-%v", string(VolumeSpecNameSapHanaLog))), + Properties: volumegroups.VolumeProperties{ + ExportPolicy: &volumegroups.VolumePropertiesExportPolicy{ + Rules: &[]volumegroups.ExportPolicyRule{ + { + Nfsv3: pointer.To(false), + Nfsv41: utils.Bool(true), + }, + }, + }, + ProtocolTypes: pointer.To([]string{"NFSv4.1"}), + ProximityPlacementGroup: pointer.To("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"), + SecurityStyle: pointer.To(volumegroups.SecurityStyle(SecurityStyleUnix)), + VolumeSpecName: pointer.To(string(VolumeSpecNameSapHanaLog)), + }, + }, + }, + Errors: 0, + }, + { + Name: "ValidateNoNfsVersionThreeOnDataLogAndSharedVolumes", + VolumesData: []volumegroups.VolumeGroupVolumeProperties{ + { // data + Name: pointer.To(fmt.Sprintf("volume-%v", string(VolumeSpecNameSapHanaData))), + Properties: volumegroups.VolumeProperties{ + ProtocolTypes: pointer.To([]string{"NFSv3"}), + ProximityPlacementGroup: pointer.To("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"), + VolumeSpecName: pointer.To(string(VolumeSpecNameSapHanaData)), + }, + }, + { // log + Name: pointer.To(fmt.Sprintf("volume-%v", string(VolumeSpecNameSapHanaLog))), + Properties: volumegroups.VolumeProperties{ + ProtocolTypes: pointer.To([]string{"NFSv3"}), + ProximityPlacementGroup: pointer.To("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"), + VolumeSpecName: pointer.To(string(VolumeSpecNameSapHanaLog)), + }, + }, + { // shared + Name: pointer.To(fmt.Sprintf("volume-%v", string(VolumeSpecNameSapHanaShared))), + Properties: volumegroups.VolumeProperties{ + ProtocolTypes: pointer.To([]string{"NFSv3"}), + ProximityPlacementGroup: pointer.To("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"), + VolumeSpecName: pointer.To(string(VolumeSpecNameSapHanaShared)), + }, + }, + }, + Errors: 3, + }, + { + Name: "ValidateNoPPGBackupVolumes", + VolumesData: []volumegroups.VolumeGroupVolumeProperties{ + { // data + Name: pointer.To(fmt.Sprintf("volume-%v", string(VolumeSpecNameSapHanaData))), + Properties: volumegroups.VolumeProperties{ + ProtocolTypes: pointer.To([]string{"NFSv4.1"}), + ProximityPlacementGroup: pointer.To("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"), + SecurityStyle: pointer.To(volumegroups.SecurityStyle(SecurityStyleUnix)), + VolumeSpecName: pointer.To(string(VolumeSpecNameSapHanaData)), + }, + }, + { // log + Name: pointer.To(fmt.Sprintf("volume-%v", string(VolumeSpecNameSapHanaLog))), + Properties: volumegroups.VolumeProperties{ + ProtocolTypes: pointer.To([]string{"NFSv4.1"}), + ProximityPlacementGroup: pointer.To("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"), + SecurityStyle: pointer.To(volumegroups.SecurityStyle(SecurityStyleUnix)), + VolumeSpecName: pointer.To(string(VolumeSpecNameSapHanaLog)), + }, + }, + { // data-backup + Name: pointer.To(fmt.Sprintf("volume-%v", string(VolumeSpecNameSapHanaDataBackup))), + Properties: volumegroups.VolumeProperties{ + ProximityPlacementGroup: pointer.To("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"), + VolumeSpecName: pointer.To(string(VolumeSpecNameSapHanaDataBackup)), + }, + }, + { // log-backup + Name: pointer.To(fmt.Sprintf("volume-%v", string(VolumeSpecNameSapHanaLogBackup))), + Properties: volumegroups.VolumeProperties{ + ProximityPlacementGroup: pointer.To("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"), + VolumeSpecName: pointer.To(string(VolumeSpecNameSapHanaLogBackup)), + }, + }, + }, + Errors: 2, + }, + { + Name: "ValidateRequiredPpgForNonBackupVolumes", + VolumesData: []volumegroups.VolumeGroupVolumeProperties{ + { // data + Name: pointer.To(fmt.Sprintf("volume-%v", string(VolumeSpecNameSapHanaData))), + Properties: volumegroups.VolumeProperties{ + ProtocolTypes: pointer.To([]string{"NFSv4.1"}), + SecurityStyle: pointer.To(volumegroups.SecurityStyle(SecurityStyleUnix)), + VolumeSpecName: pointer.To(string(VolumeSpecNameSapHanaData)), + }, + }, + { // log + Name: pointer.To(fmt.Sprintf("volume-%v", string(VolumeSpecNameSapHanaLog))), + Properties: volumegroups.VolumeProperties{ + ProtocolTypes: pointer.To([]string{"NFSv4.1"}), + SecurityStyle: pointer.To(volumegroups.SecurityStyle(SecurityStyleUnix)), + VolumeSpecName: pointer.To(string(VolumeSpecNameSapHanaLog)), + }, + }, + { // shared + Name: pointer.To(fmt.Sprintf("volume-%v", string(VolumeSpecNameSapHanaShared))), + Properties: volumegroups.VolumeProperties{ + ProtocolTypes: pointer.To([]string{"NFSv4.1"}), + SecurityStyle: pointer.To(volumegroups.SecurityStyle(SecurityStyleUnix)), + VolumeSpecName: pointer.To(string(VolumeSpecNameSapHanaShared)), + }, + }, + }, + Errors: 3, + }, + { + Name: "ValidateVolumeSpecCantRepeat", + VolumesData: []volumegroups.VolumeGroupVolumeProperties{ + { // data + Name: pointer.To(fmt.Sprintf("volume-%v", string(VolumeSpecNameSapHanaData))), + Properties: volumegroups.VolumeProperties{ + ProtocolTypes: pointer.To([]string{"NFSv4.1"}), + ProximityPlacementGroup: pointer.To("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"), + SecurityStyle: pointer.To(volumegroups.SecurityStyle(SecurityStyleUnix)), + VolumeSpecName: pointer.To(string(VolumeSpecNameSapHanaData)), + }, + }, + { // log + Name: pointer.To(fmt.Sprintf("volume-%v", string(VolumeSpecNameSapHanaLog))), + Properties: volumegroups.VolumeProperties{ + ProtocolTypes: pointer.To([]string{"NFSv4.1"}), + ProximityPlacementGroup: pointer.To("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"), + SecurityStyle: pointer.To(volumegroups.SecurityStyle(SecurityStyleUnix)), + VolumeSpecName: pointer.To(string(VolumeSpecNameSapHanaLog)), + }, + }, + { // shared + Name: pointer.To(fmt.Sprintf("volume-%v", string(VolumeSpecNameSapHanaShared))), + Properties: volumegroups.VolumeProperties{ + ProtocolTypes: pointer.To([]string{"NFSv4.1"}), + ProximityPlacementGroup: pointer.To("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"), + SecurityStyle: pointer.To(volumegroups.SecurityStyle(SecurityStyleUnix)), + VolumeSpecName: pointer.To(string(VolumeSpecNameSapHanaData)), + }, + }, + }, + Errors: 1, + }, + { + Name: "ValidateEndpointDstNotEnabledOnLogVolume", + VolumesData: []volumegroups.VolumeGroupVolumeProperties{ + { // data + Name: pointer.To(fmt.Sprintf("volume-%v", string(VolumeSpecNameSapHanaData))), + Properties: volumegroups.VolumeProperties{ + ProtocolTypes: pointer.To([]string{"NFSv4.1"}), + ProximityPlacementGroup: pointer.To("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"), + SecurityStyle: pointer.To(volumegroups.SecurityStyle(SecurityStyleUnix)), + VolumeSpecName: pointer.To(string(VolumeSpecNameSapHanaData)), + }, + }, + { // log + Name: pointer.To(fmt.Sprintf("volume-%v", string(VolumeSpecNameSapHanaLog))), + Properties: volumegroups.VolumeProperties{ + ProtocolTypes: pointer.To([]string{"NFSv4.1"}), + ProximityPlacementGroup: pointer.To("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"), + SecurityStyle: pointer.To(volumegroups.SecurityStyle(SecurityStyleUnix)), + VolumeSpecName: pointer.To(string(VolumeSpecNameSapHanaLog)), + DataProtection: &volumegroups.VolumePropertiesDataProtection{ + Replication: &volumegroups.ReplicationObject{ + EndpointType: pointer.To(volumegroups.EndpointTypeDst), + }, + }, + }, + }, + }, + Errors: 1, + }, + { + Name: "ValidateSnapshotPolicyNotEnabledOnEndpointDstVolume", + VolumesData: []volumegroups.VolumeGroupVolumeProperties{ + { // data + Name: pointer.To(fmt.Sprintf("volume-%v", string(VolumeSpecNameSapHanaData))), + Properties: volumegroups.VolumeProperties{ + ProtocolTypes: pointer.To([]string{"NFSv4.1"}), + ProximityPlacementGroup: pointer.To("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"), + SecurityStyle: pointer.To(volumegroups.SecurityStyle(SecurityStyleUnix)), + VolumeSpecName: pointer.To(string(VolumeSpecNameSapHanaData)), + DataProtection: &volumegroups.VolumePropertiesDataProtection{ + Replication: &volumegroups.ReplicationObject{ + EndpointType: pointer.To(volumegroups.EndpointTypeDst), + }, + Snapshot: &volumegroups.VolumeSnapshotProperties{ + SnapshotPolicyId: pointer.To("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1/snapshotPolicies/snapshotPolicy1"), + }, + }, + }, + }, + { // log + Name: pointer.To(fmt.Sprintf("volume-%v", string(VolumeSpecNameSapHanaLog))), + Properties: volumegroups.VolumeProperties{ + ProtocolTypes: pointer.To([]string{"NFSv4.1"}), + ProximityPlacementGroup: pointer.To("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"), + SecurityStyle: pointer.To(volumegroups.SecurityStyle(SecurityStyleUnix)), + VolumeSpecName: pointer.To(string(VolumeSpecNameSapHanaLog)), + }, + }, + }, + Errors: 1, }, } From 2d05da5ae62b4d7e8a58de0cac2746a77494cc91 Mon Sep 17 00:00:00 2001 From: Paulo Date: Fri, 14 Apr 2023 22:05:11 +0000 Subject: [PATCH 71/83] Changing test for example --- ...netapp_volume_group_sap_hana.html.markdown | 108 +++++++++--------- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/website/docs/r/netapp_volume_group_sap_hana.html.markdown b/website/docs/r/netapp_volume_group_sap_hana.html.markdown index 751903a42c85..8f1585e71c09 100644 --- a/website/docs/r/netapp_volume_group_sap_hana.html.markdown +++ b/website/docs/r/netapp_volume_group_sap_hana.html.markdown @@ -23,32 +23,32 @@ provider "azurerm" { } } -resource "random_string" "test" { +resource "random_string" "example" { length = 12 special = true } locals { - admin_username = "testadmin" - admin_password = random_string.test.result + admin_username = "exampleadmin" + admin_password = random_string.example.result } -resource "azurerm_resource_group" "test" { +resource "azurerm_resource_group" "example" { name = "${var.prefix}-resources" location = var.location } -resource "azurerm_virtual_network" "test" { +resource "azurerm_virtual_network" "example" { name = "${var.prefix}-vnet" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.example.location + resource_group_name = azurerm_resource_group.example.name address_space = ["10.6.0.0/16"] } -resource "azurerm_subnet" "test" { +resource "azurerm_subnet" "example" { name = "${var.prefix}-delegated-subnet" - resource_group_name = azurerm_resource_group.test.name - virtual_network_name = azurerm_virtual_network.test.name + resource_group_name = azurerm_resource_group.example.name + virtual_network_name = azurerm_virtual_network.example.name address_prefixes = ["10.6.2.0/24"] delegation { @@ -61,51 +61,51 @@ resource "azurerm_subnet" "test" { } } -resource "azurerm_subnet" "test1" { +resource "azurerm_subnet" "example1" { name = "${var.prefix}-hosts-subnet" - resource_group_name = azurerm_resource_group.test.name - virtual_network_name = azurerm_virtual_network.test.name + resource_group_name = azurerm_resource_group.example.name + virtual_network_name = azurerm_virtual_network.example.name address_prefixes = ["10.6.1.0/24"] } -resource "azurerm_proximity_placement_group" "test" { +resource "azurerm_proximity_placement_group" "example" { name = "${var.prefix}-ppg" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.example.location + resource_group_name = azurerm_resource_group.example.name } -resource "azurerm_availability_set" "test" { +resource "azurerm_availability_set" "example" { name = "${var.prefix}-avset" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.example.location + resource_group_name = azurerm_resource_group.example.name - proximity_placement_group_id = azurerm_proximity_placement_group.test.id + proximity_placement_group_id = azurerm_proximity_placement_group.example.id } -resource "azurerm_network_interface" "test" { +resource "azurerm_network_interface" "example" { name = "${var.prefix}-nic" - resource_group_name = azurerm_resource_group.test.name - location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.example.name + location = azurerm_resource_group.example.location ip_configuration { name = "internal" - subnet_id = azurerm_subnet.test1.id + subnet_id = azurerm_subnet.example1.id private_ip_address_allocation = "Dynamic" } } -resource "azurerm_linux_virtual_machine" "test" { +resource "azurerm_linux_virtual_machine" "example" { name = "${var.prefix}-vm" - resource_group_name = azurerm_resource_group.test.name - location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.example.name + location = azurerm_resource_group.example.location size = "Standard_M8ms" admin_username = local.admin_username admin_password = local.admin_password disable_password_authentication = false - proximity_placement_group_id = azurerm_proximity_placement_group.test.id - availability_set_id = azurerm_availability_set.test.id + proximity_placement_group_id = azurerm_proximity_placement_group.example.id + availability_set_id = azurerm_availability_set.example.id network_interface_ids = [ - azurerm_network_interface.test.id + azurerm_network_interface.example.id ] source_image_reference { @@ -121,32 +121,32 @@ resource "azurerm_linux_virtual_machine" "test" { } } -resource "azurerm_netapp_account" "test" { +resource "azurerm_netapp_account" "example" { name = "${var.prefix}-netapp-account" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.example.location + resource_group_name = azurerm_resource_group.example.name depends_on = [ - azurerm_subnet.test, - azurerm_subnet.test1 + azurerm_subnet.example, + azurerm_subnet.example1 ] } -resource "azurerm_netapp_pool" "test" { +resource "azurerm_netapp_pool" "example" { name = "${var.prefix}-netapp-pool" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - account_name = azurerm_netapp_account.test.name + location = azurerm_resource_group.example.location + resource_group_name = azurerm_resource_group.example.name + account_name = azurerm_netapp_account.example.name service_level = "Standard" size_in_tb = 8 qos_type = "Manual" } -resource "azurerm_netapp_volume_group_sap_hana" "test" { +resource "azurerm_netapp_volume_group_sap_hana" "example" { name = "${var.prefix}-netapp-volumegroup" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - account_name = azurerm_netapp_account.test.name + location = azurerm_resource_group.example.location + resource_group_name = azurerm_resource_group.example.name + account_name = azurerm_netapp_account.example.name group_description = "Test volume group" application_identifier = "TST" @@ -154,9 +154,9 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" { name = "${var.prefix}-netapp-volume-1" volume_path = "my-unique-file-path-1" service_level = "Standard" - capacity_pool_id = azurerm_netapp_pool.test.id - subnet_id = azurerm_subnet.test.id - proximity_placement_group_id = azurerm_proximity_placement_group.test.id + capacity_pool_id = azurerm_netapp_pool.example.id + subnet_id = azurerm_subnet.example.id + proximity_placement_group_id = azurerm_proximity_placement_group.example.id volume_spec_name = "data" storage_quota_in_gb = 1024 throughput_in_mibps = 24 @@ -183,9 +183,9 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" { name = "${var.prefix}-netapp-volume-2" volume_path = "my-unique-file-path-2" service_level = "Standard" - capacity_pool_id = azurerm_netapp_pool.test.id - subnet_id = azurerm_subnet.test.id - proximity_placement_group_id = azurerm_proximity_placement_group.test.id + capacity_pool_id = azurerm_netapp_pool.example.id + subnet_id = azurerm_subnet.example.id + proximity_placement_group_id = azurerm_proximity_placement_group.example.id volume_spec_name = "log" storage_quota_in_gb = 1024 throughput_in_mibps = 24 @@ -212,9 +212,9 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" { name = "${var.prefix}-netapp-volume-3" volume_path = "my-unique-file-path-3" service_level = "Standard" - capacity_pool_id = azurerm_netapp_pool.test.id - subnet_id = azurerm_subnet.test.id - proximity_placement_group_id = azurerm_proximity_placement_group.test.id + capacity_pool_id = azurerm_netapp_pool.example.id + subnet_id = azurerm_subnet.example.id + proximity_placement_group_id = azurerm_proximity_placement_group.example.id volume_spec_name = "shared" storage_quota_in_gb = 1024 throughput_in_mibps = 24 @@ -234,8 +234,8 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" { } depends_on = [ - azurerm_linux_virtual_machine.test, - azurerm_proximity_placement_group.test + azurerm_linux_virtual_machine.example, + azurerm_proximity_placement_group.example ] } ``` From 739355b5c8b2a3d95d106b97e9b925a726d8e9ed Mon Sep 17 00:00:00 2001 From: Paulo Date: Fri, 14 Apr 2023 22:22:39 +0000 Subject: [PATCH 72/83] Fixing go linting 'should omit nil check' gosimple recommendations --- internal/services/netapp/netapp_volume_helper.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/services/netapp/netapp_volume_helper.go b/internal/services/netapp/netapp_volume_helper.go index 0984b0b88009..71106e51db75 100644 --- a/internal/services/netapp/netapp_volume_helper.go +++ b/internal/services/netapp/netapp_volume_helper.go @@ -123,7 +123,7 @@ func expandNetAppVolumeGroupVolumeExportPolicyRule(input []ExportPolicyRule) *vo } func expandNetAppVolumeGroupDataProtectionReplication(input []DataProtectionReplication) *volumegroups.VolumePropertiesDataProtection { - if input == nil || len(input) == 0 { + if len(input) == 0 { return &volumegroups.VolumePropertiesDataProtection{} } @@ -144,7 +144,7 @@ func expandNetAppVolumeGroupDataProtectionReplication(input []DataProtectionRepl } func expandNetAppVolumeGroupDataProtectionSnapshotPolicy(input []DataProtectionSnapshotPolicy) *volumegroups.VolumePropertiesDataProtection { - if input == nil || len(input) == 0 { + if len(input) == 0 { return &volumegroups.VolumePropertiesDataProtection{} } @@ -157,7 +157,7 @@ func expandNetAppVolumeGroupDataProtectionSnapshotPolicy(input []DataProtectionS } func expandNetAppVolumeGroupVolumes(input []NetAppVolumeGroupVolume) (*[]volumegroups.VolumeGroupVolumeProperties, error) { - if input == nil || len(input) == 0 { + if len(input) == 0 { return &[]volumegroups.VolumeGroupVolumeProperties{}, fmt.Errorf("received empty NetAppVolumeGroupVolume slice") } @@ -208,7 +208,7 @@ func expandNetAppVolumeGroupVolumes(input []NetAppVolumeGroupVolume) (*[]volumeg } func expandNetAppVolumeGroupVolumeExportPolicyRulePatch(input []interface{}) *volumes.VolumePatchPropertiesExportPolicy { - if input == nil || len(input) == 0 { + if len(input) == 0 { return &volumes.VolumePatchPropertiesExportPolicy{} } @@ -263,7 +263,7 @@ func expandNetAppVolumeGroupVolumeExportPolicyRulePatch(input []interface{}) *vo } func expandNetAppVolumeDataProtectionReplication(input []interface{}) *volumes.VolumePropertiesDataProtection { - if input == nil || len(input) == 0 { + if len(input) == 0 { return &volumes.VolumePropertiesDataProtection{} } @@ -292,7 +292,7 @@ func expandNetAppVolumeDataProtectionReplication(input []interface{}) *volumes.V } func expandNetAppVolumeDataProtectionSnapshotPolicy(input []interface{}) *volumes.VolumePropertiesDataProtection { - if input == nil || len(input) == 0 { + if len(input) == 0 { return &volumes.VolumePropertiesDataProtection{} } @@ -310,7 +310,7 @@ func expandNetAppVolumeDataProtectionSnapshotPolicy(input []interface{}) *volume } func expandNetAppVolumeDataProtectionSnapshotPolicyPatch(input []interface{}) *volumes.VolumePatchPropertiesDataProtection { - if input == nil || len(input) == 0 { + if len(input) == 0 { return &volumes.VolumePatchPropertiesDataProtection{} } From 8435f6f49a046c94c1b16cdf6090881921272246 Mon Sep 17 00:00:00 2001 From: Paulo Date: Fri, 14 Apr 2023 22:24:56 +0000 Subject: [PATCH 73/83] Fixing tflint issues --- ..._volume_group_sap_hana_data_source_test.go | 6 +- ...app_volume_group_sap_hana_resource_test.go | 707 +++++++++--------- 2 files changed, 357 insertions(+), 356 deletions(-) diff --git a/internal/services/netapp/netapp_volume_group_sap_hana_data_source_test.go b/internal/services/netapp/netapp_volume_group_sap_hana_data_source_test.go index f64aebdb9d99..83ca739e910e 100644 --- a/internal/services/netapp/netapp_volume_group_sap_hana_data_source_test.go +++ b/internal/services/netapp/netapp_volume_group_sap_hana_data_source_test.go @@ -31,9 +31,9 @@ func (d NetAppVolumeGroupSapHanaDataSource) basic(data acceptance.TestData) stri %s data "azurerm_netapp_volume_group_sap_hana" "test" { - name = azurerm_netapp_volume_group_sap_hana.test.name - resource_group_name = azurerm_netapp_volume_group_sap_hana.test.resource_group_name - account_name = azurerm_netapp_volume_group_sap_hana.test.account_name + name = azurerm_netapp_volume_group_sap_hana.test.name + resource_group_name = azurerm_netapp_volume_group_sap_hana.test.resource_group_name + account_name = azurerm_netapp_volume_group_sap_hana.test.account_name } `, NetAppVolumeGroupSapHanaResource{}.basic(data)) } diff --git a/internal/services/netapp/netapp_volume_group_sap_hana_resource_test.go b/internal/services/netapp/netapp_volume_group_sap_hana_resource_test.go index 76cb3c3d0e24..975692f94fe8 100644 --- a/internal/services/netapp/netapp_volume_group_sap_hana_resource_test.go +++ b/internal/services/netapp/netapp_volume_group_sap_hana_resource_test.go @@ -119,7 +119,7 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" { account_name = azurerm_netapp_account.test.name group_description = "Test volume group" application_identifier = "TST" - + volume { name = "acctest-NetAppVolume-1-%[2]d" volume_path = "my-unique-file-path-1-%[2]d" @@ -133,17 +133,17 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" { protocols = ["NFSv4.1"] security_style = "Unix" snapshot_directory_visible = false - + export_policy_rule { - rule_index = 1 - allowed_clients = "0.0.0.0/0" - nfsv3_enabled = false - nfsv41_enabled = true - unix_read_only = false - unix_read_write = true - root_access_enabled = false + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false } - + tags = { "CreatedOnDate" = "2022-07-08T23:50:21Z", "SkipASMAzSecPack" = "true" @@ -163,17 +163,17 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" { protocols = ["NFSv4.1"] security_style = "Unix" snapshot_directory_visible = false - + export_policy_rule { - rule_index = 1 - allowed_clients = "0.0.0.0/0" - nfsv3_enabled = false - nfsv41_enabled = true - unix_read_only = false - unix_read_write = true - root_access_enabled = false + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false } - + tags = { "CreatedOnDate" = "2022-07-08T23:50:21Z", "SkipASMAzSecPack" = "true" @@ -193,17 +193,17 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" { protocols = ["NFSv4.1"] security_style = "Unix" snapshot_directory_visible = false - + export_policy_rule { - rule_index = 1 - allowed_clients = "0.0.0.0/0" - nfsv3_enabled = false - nfsv41_enabled = true - unix_read_only = false - unix_read_write = true - root_access_enabled = false + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false } - + tags = { "CreatedOnDate" = "2022-07-08T23:50:21Z", "SkipASMAzSecPack" = "true" @@ -211,28 +211,28 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" { } volume { - name = "acctest-NetAppVolume-4-%[2]d" - volume_path = "my-unique-file-path-4-%[2]d" - service_level = "Standard" - capacity_pool_id = azurerm_netapp_pool.test.id - subnet_id = azurerm_subnet.test.id - volume_spec_name = "data-backup" - storage_quota_in_gb = 1024 - throughput_in_mibps = 24 - protocols = ["NFSv4.1"] - security_style = "Unix" - snapshot_directory_visible = false - + name = "acctest-NetAppVolume-4-%[2]d" + volume_path = "my-unique-file-path-4-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + volume_spec_name = "data-backup" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv4.1"] + security_style = "Unix" + snapshot_directory_visible = false + export_policy_rule { - rule_index = 1 - allowed_clients = "0.0.0.0/0" - nfsv3_enabled = false - nfsv41_enabled = true - unix_read_only = false - unix_read_write = true - root_access_enabled = false + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false } - + tags = { "CreatedOnDate" = "2022-07-08T23:50:21Z", "SkipASMAzSecPack" = "true" @@ -240,34 +240,34 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" { } volume { - name = "acctest-NetAppVolume-5-%[2]d" - volume_path = "my-unique-file-path-5-%[2]d" - service_level = "Standard" - capacity_pool_id = azurerm_netapp_pool.test.id - subnet_id = azurerm_subnet.test.id - volume_spec_name = "log-backup" - storage_quota_in_gb = 1024 - throughput_in_mibps = 24 - protocols = ["NFSv4.1"] - security_style = "Unix" - snapshot_directory_visible = false - + name = "acctest-NetAppVolume-5-%[2]d" + volume_path = "my-unique-file-path-5-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + volume_spec_name = "log-backup" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv4.1"] + security_style = "Unix" + snapshot_directory_visible = false + export_policy_rule { - rule_index = 1 - allowed_clients = "0.0.0.0/0" - nfsv3_enabled = false - nfsv41_enabled = true - unix_read_only = false - unix_read_write = true - root_access_enabled = false + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false } - + tags = { "CreatedOnDate" = "2022-07-08T23:50:21Z", "SkipASMAzSecPack" = "true" } } - + depends_on = [ azurerm_linux_virtual_machine.test, azurerm_proximity_placement_group.test @@ -308,7 +308,7 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" { account_name = azurerm_netapp_account.test.name group_description = "Test volume group" application_identifier = "TST" - + volume { name = "acctest-NetAppVolume-1-%[2]d" volume_path = "my-unique-file-path-1-%[2]d" @@ -322,21 +322,21 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" { protocols = ["NFSv4.1"] security_style = "Unix" snapshot_directory_visible = false - + export_policy_rule { - rule_index = 1 - allowed_clients = "0.0.0.0/0" - nfsv3_enabled = false - nfsv41_enabled = true - unix_read_only = false - unix_read_write = true - root_access_enabled = false + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false } data_protection_snapshot_policy { snapshot_policy_id = azurerm_netapp_snapshot_policy.test.id } - + tags = { "CreatedOnDate" = "2022-07-08T23:50:21Z", "SkipASMAzSecPack" = "true" @@ -356,21 +356,21 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" { protocols = ["NFSv4.1"] security_style = "Unix" snapshot_directory_visible = false - + export_policy_rule { - rule_index = 1 - allowed_clients = "0.0.0.0/0" - nfsv3_enabled = false - nfsv41_enabled = true - unix_read_only = false - unix_read_write = true - root_access_enabled = false + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false } data_protection_snapshot_policy { snapshot_policy_id = azurerm_netapp_snapshot_policy.test.id } - + tags = { "CreatedOnDate" = "2022-07-08T23:50:21Z", "SkipASMAzSecPack" = "true" @@ -390,21 +390,21 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" { protocols = ["NFSv4.1"] security_style = "Unix" snapshot_directory_visible = false - + export_policy_rule { - rule_index = 1 - allowed_clients = "0.0.0.0/0" - nfsv3_enabled = false - nfsv41_enabled = true - unix_read_only = false - unix_read_write = true - root_access_enabled = false + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false } data_protection_snapshot_policy { snapshot_policy_id = azurerm_netapp_snapshot_policy.test.id } - + tags = { "CreatedOnDate" = "2022-07-08T23:50:21Z", "SkipASMAzSecPack" = "true" @@ -412,32 +412,32 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" { } volume { - name = "acctest-NetAppVolume-4-%[2]d" - volume_path = "my-unique-file-path-4-%[2]d" - service_level = "Standard" - capacity_pool_id = azurerm_netapp_pool.test.id - subnet_id = azurerm_subnet.test.id - volume_spec_name = "data-backup" - storage_quota_in_gb = 1024 - throughput_in_mibps = 24 - protocols = ["NFSv4.1"] - security_style = "Unix" - snapshot_directory_visible = false - + name = "acctest-NetAppVolume-4-%[2]d" + volume_path = "my-unique-file-path-4-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + volume_spec_name = "data-backup" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv4.1"] + security_style = "Unix" + snapshot_directory_visible = false + export_policy_rule { - rule_index = 1 - allowed_clients = "0.0.0.0/0" - nfsv3_enabled = false - nfsv41_enabled = true - unix_read_only = false - unix_read_write = true - root_access_enabled = false + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false } data_protection_snapshot_policy { snapshot_policy_id = azurerm_netapp_snapshot_policy.test.id } - + tags = { "CreatedOnDate" = "2022-07-08T23:50:21Z", "SkipASMAzSecPack" = "true" @@ -445,32 +445,32 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" { } volume { - name = "acctest-NetAppVolume-5-%[2]d" - volume_path = "my-unique-file-path-5-%[2]d" - service_level = "Standard" - capacity_pool_id = azurerm_netapp_pool.test.id - subnet_id = azurerm_subnet.test.id - volume_spec_name = "log-backup" - storage_quota_in_gb = 1024 - throughput_in_mibps = 24 - protocols = ["NFSv4.1"] - security_style = "Unix" - snapshot_directory_visible = false - + name = "acctest-NetAppVolume-5-%[2]d" + volume_path = "my-unique-file-path-5-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + volume_spec_name = "log-backup" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv4.1"] + security_style = "Unix" + snapshot_directory_visible = false + export_policy_rule { - rule_index = 1 - allowed_clients = "0.0.0.0/0" - nfsv3_enabled = false - nfsv41_enabled = true - unix_read_only = false - unix_read_write = true - root_access_enabled = false + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false } data_protection_snapshot_policy { snapshot_policy_id = azurerm_netapp_snapshot_policy.test.id } - + tags = { "CreatedOnDate" = "2022-07-08T23:50:21Z", "SkipASMAzSecPack" = "true" @@ -497,7 +497,7 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" { account_name = azurerm_netapp_account.test.name group_description = "Test volume group" application_identifier = "TST" - + volume { name = "acctest-NetAppVolume-1-%[2]d" volume_path = "my-unique-file-path-1-%[2]d" @@ -511,17 +511,17 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" { protocols = ["NFSv4.1"] security_style = "Unix" snapshot_directory_visible = false - + export_policy_rule { - rule_index = 1 - allowed_clients = "0.0.0.0/0" - nfsv3_enabled = false - nfsv41_enabled = true - unix_read_only = false - unix_read_write = true - root_access_enabled = false + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false } - + tags = { "CreatedOnDate" = "2022-07-08T23:50:21Z", "SkipASMAzSecPack" = "true" @@ -541,17 +541,17 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" { protocols = ["NFSv4.1"] security_style = "Unix" snapshot_directory_visible = false - + export_policy_rule { - rule_index = 1 - allowed_clients = "10.0.0.0/8" - nfsv3_enabled = false - nfsv41_enabled = true - unix_read_only = false - unix_read_write = true - root_access_enabled = false + rule_index = 1 + allowed_clients = "10.0.0.0/8" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false } - + tags = { "CreatedOnDate" = "2022-07-08T23:50:21Z", "SkipASMAzSecPack" = "true" @@ -571,17 +571,17 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" { protocols = ["NFSv4.1"] security_style = "Unix" snapshot_directory_visible = false - + export_policy_rule { - rule_index = 1 - allowed_clients = "0.0.0.0/0" - nfsv3_enabled = false - nfsv41_enabled = true - unix_read_only = false - unix_read_write = true - root_access_enabled = false + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false } - + tags = { "CreatedOnDate" = "2022-07-27T12:00:00Z", "SkipASMAzSecPack" = "true" @@ -589,28 +589,28 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" { } volume { - name = "acctest-NetAppVolume-4-%[2]d" - volume_path = "my-unique-file-path-4-%[2]d" - service_level = "Standard" - capacity_pool_id = azurerm_netapp_pool.test.id - subnet_id = azurerm_subnet.test.id - volume_spec_name = "data-backup" - storage_quota_in_gb = 1024 - throughput_in_mibps = 24 - protocols = ["NFSv4.1"] - security_style = "Unix" - snapshot_directory_visible = false - + name = "acctest-NetAppVolume-4-%[2]d" + volume_path = "my-unique-file-path-4-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + volume_spec_name = "data-backup" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv4.1"] + security_style = "Unix" + snapshot_directory_visible = false + export_policy_rule { - rule_index = 1 - allowed_clients = "0.0.0.0/0" - nfsv3_enabled = false - nfsv41_enabled = true - unix_read_only = false - unix_read_write = true - root_access_enabled = false + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false } - + tags = { "CreatedOnDate" = "2022-07-08T23:50:21Z", "SkipASMAzSecPack" = "true" @@ -618,28 +618,28 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" { } volume { - name = "acctest-NetAppVolume-5-%[2]d" - volume_path = "my-unique-file-path-5-%[2]d" - service_level = "Standard" - capacity_pool_id = azurerm_netapp_pool.test.id - subnet_id = azurerm_subnet.test.id - volume_spec_name = "log-backup" - storage_quota_in_gb = 1200 - throughput_in_mibps = 24 - protocols = ["NFSv4.1"] - security_style = "Unix" - snapshot_directory_visible = false - + name = "acctest-NetAppVolume-5-%[2]d" + volume_path = "my-unique-file-path-5-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + volume_spec_name = "log-backup" + storage_quota_in_gb = 1200 + throughput_in_mibps = 24 + protocols = ["NFSv4.1"] + security_style = "Unix" + snapshot_directory_visible = false + export_policy_rule { - rule_index = 1 - allowed_clients = "192.168.0.0/24" - nfsv3_enabled = false - nfsv41_enabled = true - unix_read_only = false - unix_read_write = true - root_access_enabled = false + rule_index = 1 + allowed_clients = "192.168.0.0/24" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false } - + tags = { "CreatedOnDate" = "2022-07-28T11:00:00Z", "SkipASMAzSecPack" = "true" @@ -666,7 +666,7 @@ resource "azurerm_netapp_volume_group_sap_hana" "test_primary" { account_name = azurerm_netapp_account.test.name group_description = "Test volume group" application_identifier = "TST" - + volume { name = "acctest-NetAppVolume-1-Primary-%[2]d" volume_path = "my-unique-file-path-1-Primary-%[2]d" @@ -680,17 +680,17 @@ resource "azurerm_netapp_volume_group_sap_hana" "test_primary" { protocols = ["NFSv4.1"] security_style = "Unix" snapshot_directory_visible = false - + export_policy_rule { - rule_index = 1 - allowed_clients = "0.0.0.0/0" - nfsv3_enabled = false - nfsv41_enabled = true - unix_read_only = false - unix_read_write = true - root_access_enabled = false + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false } - + tags = { "CreatedOnDate" = "2022-07-08T23:50:21Z", "SkipASMAzSecPack" = "true" @@ -710,17 +710,17 @@ resource "azurerm_netapp_volume_group_sap_hana" "test_primary" { protocols = ["NFSv4.1"] security_style = "Unix" snapshot_directory_visible = false - + export_policy_rule { - rule_index = 1 - allowed_clients = "0.0.0.0/0" - nfsv3_enabled = false - nfsv41_enabled = true - unix_read_only = false - unix_read_write = true - root_access_enabled = false + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false } - + tags = { "CreatedOnDate" = "2022-07-08T23:50:21Z", "SkipASMAzSecPack" = "true" @@ -740,17 +740,17 @@ resource "azurerm_netapp_volume_group_sap_hana" "test_primary" { protocols = ["NFSv4.1"] security_style = "Unix" snapshot_directory_visible = false - + export_policy_rule { - rule_index = 1 - allowed_clients = "0.0.0.0/0" - nfsv3_enabled = false - nfsv41_enabled = true - unix_read_only = false - unix_read_write = true - root_access_enabled = false + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false } - + tags = { "CreatedOnDate" = "2022-07-08T23:50:21Z", "SkipASMAzSecPack" = "true" @@ -758,57 +758,57 @@ resource "azurerm_netapp_volume_group_sap_hana" "test_primary" { } volume { - name = "acctest-NetAppVolume-4-Primary-%[2]d" - volume_path = "my-unique-file-path-4-Primary-%[2]d" - service_level = "Standard" - capacity_pool_id = azurerm_netapp_pool.test.id - subnet_id = azurerm_subnet.test.id - volume_spec_name = "data-backup" - storage_quota_in_gb = 1024 - throughput_in_mibps = 24 - protocols = ["NFSv4.1"] - security_style = "Unix" - snapshot_directory_visible = false - + name = "acctest-NetAppVolume-4-Primary-%[2]d" + volume_path = "my-unique-file-path-4-Primary-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + volume_spec_name = "data-backup" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv4.1"] + security_style = "Unix" + snapshot_directory_visible = false + export_policy_rule { - rule_index = 1 - allowed_clients = "0.0.0.0/0" - nfsv3_enabled = false - nfsv41_enabled = true - unix_read_only = false - unix_read_write = true - root_access_enabled = false + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false } - + tags = { "CreatedOnDate" = "2022-07-08T23:50:21Z", "SkipASMAzSecPack" = "true" } } - + volume { - name = "acctest-NetAppVolume-5-Primary-%[2]d" - volume_path = "my-unique-file-path-5-Primary-%[2]d" - service_level = "Standard" - capacity_pool_id = azurerm_netapp_pool.test.id - subnet_id = azurerm_subnet.test.id - volume_spec_name = "log-backup" - storage_quota_in_gb = 1024 - throughput_in_mibps = 24 - protocols = ["NFSv4.1"] - security_style = "Unix" - snapshot_directory_visible = false - + name = "acctest-NetAppVolume-5-Primary-%[2]d" + volume_path = "my-unique-file-path-5-Primary-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + volume_spec_name = "log-backup" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv4.1"] + security_style = "Unix" + snapshot_directory_visible = false + export_policy_rule { - rule_index = 1 - allowed_clients = "0.0.0.0/0" - nfsv3_enabled = false - nfsv41_enabled = true - unix_read_only = false - unix_read_write = true - root_access_enabled = false + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false } - + tags = { "CreatedOnDate" = "2022-07-08T23:50:21Z", "SkipASMAzSecPack" = "true" @@ -828,7 +828,7 @@ resource "azurerm_netapp_volume_group_sap_hana" "test_secondary" { account_name = azurerm_netapp_account.test_secondary.name group_description = "Test volume group" application_identifier = "TST" - + volume { name = "acctest-NetAppVolume-1-Secondary-%[2]d" volume_path = "my-unique-file-path-1-Secondary-%[2]d" @@ -842,15 +842,15 @@ resource "azurerm_netapp_volume_group_sap_hana" "test_secondary" { protocols = ["NFSv4.1"] security_style = "Unix" snapshot_directory_visible = false - + export_policy_rule { - rule_index = 1 - allowed_clients = "0.0.0.0/0" - nfsv3_enabled = false - nfsv41_enabled = true - unix_read_only = false - unix_read_write = true - root_access_enabled = false + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false } data_protection_replication { @@ -879,17 +879,17 @@ resource "azurerm_netapp_volume_group_sap_hana" "test_secondary" { protocols = ["NFSv4.1"] security_style = "Unix" snapshot_directory_visible = false - + export_policy_rule { - rule_index = 1 - allowed_clients = "0.0.0.0/0" - nfsv3_enabled = false - nfsv41_enabled = true - unix_read_only = false - unix_read_write = true - root_access_enabled = false + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false } - + tags = { "CreatedOnDate" = "2022-07-08T23:50:21Z", "SkipASMAzSecPack" = "true" @@ -909,17 +909,17 @@ resource "azurerm_netapp_volume_group_sap_hana" "test_secondary" { protocols = ["NFSv4.1"] security_style = "Unix" snapshot_directory_visible = false - + export_policy_rule { - rule_index = 1 - allowed_clients = "0.0.0.0/0" - nfsv3_enabled = false - nfsv41_enabled = true - unix_read_only = false - unix_read_write = true - root_access_enabled = false + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false } - + data_protection_replication { endpoint_type = "dst" remote_volume_location = azurerm_netapp_volume_group_sap_hana.test_primary.location @@ -934,26 +934,26 @@ resource "azurerm_netapp_volume_group_sap_hana" "test_secondary" { } volume { - name = "acctest-NetAppVolume-4-Secondary-%[2]d" - volume_path = "my-unique-file-path-4-Secondary-%[2]d" - service_level = "Standard" - capacity_pool_id = azurerm_netapp_pool.test_secondary.id - subnet_id = azurerm_subnet.test_secondary.id - volume_spec_name = "data-backup" - storage_quota_in_gb = 1024 - throughput_in_mibps = 24 - protocols = ["NFSv4.1"] - security_style = "Unix" - snapshot_directory_visible = false - + name = "acctest-NetAppVolume-4-Secondary-%[2]d" + volume_path = "my-unique-file-path-4-Secondary-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test_secondary.id + subnet_id = azurerm_subnet.test_secondary.id + volume_spec_name = "data-backup" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv4.1"] + security_style = "Unix" + snapshot_directory_visible = false + export_policy_rule { - rule_index = 1 - allowed_clients = "0.0.0.0/0" - nfsv3_enabled = false - nfsv41_enabled = true - unix_read_only = false - unix_read_write = true - root_access_enabled = false + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false } data_protection_replication { @@ -962,7 +962,7 @@ resource "azurerm_netapp_volume_group_sap_hana" "test_secondary" { remote_volume_resource_id = azurerm_netapp_volume_group_sap_hana.test_primary.volume[3].id replication_frequency = "10minutes" } - + tags = { "CreatedOnDate" = "2022-07-08T23:50:21Z", "SkipASMAzSecPack" = "true" @@ -970,26 +970,26 @@ resource "azurerm_netapp_volume_group_sap_hana" "test_secondary" { } volume { - name = "acctest-NetAppVolume-5-Secondary-%[2]d" - volume_path = "my-unique-file-path-5-Secondary-%[2]d" - service_level = "Standard" - capacity_pool_id = azurerm_netapp_pool.test_secondary.id - subnet_id = azurerm_subnet.test_secondary.id - volume_spec_name = "log-backup" - storage_quota_in_gb = 1024 - throughput_in_mibps = 24 - protocols = ["NFSv4.1"] - security_style = "Unix" - snapshot_directory_visible = false - + name = "acctest-NetAppVolume-5-Secondary-%[2]d" + volume_path = "my-unique-file-path-5-Secondary-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test_secondary.id + subnet_id = azurerm_subnet.test_secondary.id + volume_spec_name = "log-backup" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv4.1"] + security_style = "Unix" + snapshot_directory_visible = false + export_policy_rule { - rule_index = 1 - allowed_clients = "0.0.0.0/0" - nfsv3_enabled = false - nfsv41_enabled = true - unix_read_only = false - unix_read_write = true - root_access_enabled = false + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false } data_protection_replication { @@ -998,7 +998,7 @@ resource "azurerm_netapp_volume_group_sap_hana" "test_secondary" { remote_volume_resource_id = azurerm_netapp_volume_group_sap_hana.test_primary.volume[4].id replication_frequency = "10minutes" } - + tags = { "CreatedOnDate" = "2022-07-08T23:50:21Z", "SkipASMAzSecPack" = "true" @@ -1012,6 +1012,7 @@ resource "azurerm_netapp_volume_group_sap_hana" "test_secondary" { ] } + `, template, data.RandomInteger, "eastus") } @@ -1060,10 +1061,10 @@ resource "azurerm_subnet" "test_secondary" { } resource "azurerm_subnet" "test1_secondary" { - name = "acctest-HostsSubnet-%[2]d" - resource_group_name = azurerm_resource_group.test.name - virtual_network_name = azurerm_virtual_network.test_secondary.name - address_prefixes = ["10.6.1.0/24"] + name = "acctest-HostsSubnet-%[2]d" + resource_group_name = azurerm_resource_group.test.name + virtual_network_name = azurerm_virtual_network.test_secondary.name + address_prefixes = ["10.6.1.0/24"] } resource "azurerm_subnet_network_security_group_association" "test_secondary" { @@ -1088,7 +1089,7 @@ resource "azurerm_availability_set" "test_secondary" { resource_group_name = azurerm_resource_group.test.name proximity_placement_group_id = azurerm_proximity_placement_group.test_secondary.id - + tags = { "CreatedOnDate" = "2022-07-08T23:50:21Z", "SkipASMAzSecPack" = "true" @@ -1191,8 +1192,8 @@ provider "azurerm" { } locals { - admin_username = "testadmin%[1]d" - admin_password = "Password1234!%[1]d" + admin_username = "testadmin%[1]d" + admin_password = "Password1234!%[1]d" } resource "azurerm_resource_group" "test" { @@ -1246,10 +1247,10 @@ resource "azurerm_subnet" "test" { } resource "azurerm_subnet" "test1" { - name = "acctest-HostsSubnet-%[1]d" - resource_group_name = azurerm_resource_group.test.name - virtual_network_name = azurerm_virtual_network.test.name - address_prefixes = ["10.6.1.0/24"] + name = "acctest-HostsSubnet-%[1]d" + resource_group_name = azurerm_resource_group.test.name + virtual_network_name = azurerm_virtual_network.test.name + address_prefixes = ["10.6.1.0/24"] } resource "azurerm_subnet_network_security_group_association" "public" { @@ -1274,7 +1275,7 @@ resource "azurerm_availability_set" "test" { resource_group_name = azurerm_resource_group.test.name proximity_placement_group_id = azurerm_proximity_placement_group.test.id - + tags = { "CreatedOnDate" = "2022-07-08T23:50:21Z", "SkipASMAzSecPack" = "true" From be87b5bfce41f57d62412cf576251cb15e845163 Mon Sep 17 00:00:00 2001 From: Paulo Date: Fri, 14 Apr 2023 23:44:34 +0000 Subject: [PATCH 74/83] Fixing website CI issues --- internal/services/netapp/registration.go | 4 ++-- website/allowed-subcategories | 4 ++-- website/docs/d/netapp_account.html.markdown | 2 +- website/docs/d/netapp_pool.html.markdown | 2 +- website/docs/d/netapp_snapshot.html.markdown | 2 +- website/docs/d/netapp_snapshot_policy.html.markdown | 2 +- website/docs/d/netapp_volume.html.markdown | 2 +- website/docs/d/netapp_volume_group_sap_hana.html.markdown | 2 +- website/docs/r/netapp_account.html.markdown | 2 +- website/docs/r/netapp_pool.html.markdown | 2 +- website/docs/r/netapp_snapshot.html.markdown | 2 +- website/docs/r/netapp_snapshot_policy.html.markdown | 2 +- website/docs/r/netapp_volume.html.markdown | 2 +- website/docs/r/netapp_volume_group_sap_hana.html.markdown | 2 +- 14 files changed, 16 insertions(+), 16 deletions(-) diff --git a/internal/services/netapp/registration.go b/internal/services/netapp/registration.go index 95855d592b0f..0d6c2f770ae1 100644 --- a/internal/services/netapp/registration.go +++ b/internal/services/netapp/registration.go @@ -17,12 +17,12 @@ func (r Registration) AssociatedGitHubLabel() string { } func (r Registration) Name() string { - return "netapp" + return "NetApp" } func (r Registration) WebsiteCategories() []string { return []string{ - "netapp", + "NetApp", } } diff --git a/website/allowed-subcategories b/website/allowed-subcategories index 3fe6c3deb958..901500582c34 100644 --- a/website/allowed-subcategories +++ b/website/allowed-subcategories @@ -69,6 +69,7 @@ Messaging Mixed Reality Mobile Network Monitor +NetApp Network Nginx Orbital @@ -96,5 +97,4 @@ Time Series Insights VMware (AVS) Video Analyzer Voice Services -Web PubSub -netapp \ No newline at end of file +Web PubSub \ No newline at end of file diff --git a/website/docs/d/netapp_account.html.markdown b/website/docs/d/netapp_account.html.markdown index a4d688539dd4..22e97e5151b7 100644 --- a/website/docs/d/netapp_account.html.markdown +++ b/website/docs/d/netapp_account.html.markdown @@ -1,5 +1,5 @@ --- -subcategory: "netapp" +subcategory: "NetApp" layout: "azurerm" page_title: "Azure Resource Manager: azurerm_netapp_account" description: |- diff --git a/website/docs/d/netapp_pool.html.markdown b/website/docs/d/netapp_pool.html.markdown index 1760210d9dff..c0edd7b1fc25 100644 --- a/website/docs/d/netapp_pool.html.markdown +++ b/website/docs/d/netapp_pool.html.markdown @@ -1,5 +1,5 @@ --- -subcategory: "netapp" +subcategory: "NetApp" layout: "azurerm" page_title: "Azure Resource Manager: azurerm_netapp_pool" description: |- diff --git a/website/docs/d/netapp_snapshot.html.markdown b/website/docs/d/netapp_snapshot.html.markdown index aa579f5630da..ec87b779d59f 100644 --- a/website/docs/d/netapp_snapshot.html.markdown +++ b/website/docs/d/netapp_snapshot.html.markdown @@ -1,5 +1,5 @@ --- -subcategory: "netapp" +subcategory: "NetApp" layout: "azurerm" page_title: "Azure Resource Manager: azurerm_netapp_snapshot" description: |- diff --git a/website/docs/d/netapp_snapshot_policy.html.markdown b/website/docs/d/netapp_snapshot_policy.html.markdown index 345015d23b12..6d73e9407150 100644 --- a/website/docs/d/netapp_snapshot_policy.html.markdown +++ b/website/docs/d/netapp_snapshot_policy.html.markdown @@ -1,5 +1,5 @@ --- -subcategory: "netapp" +subcategory: "NetApp" layout: "azurerm" page_title: "Azure Resource Manager: azurerm_netapp_snapshot_policy" description: |- diff --git a/website/docs/d/netapp_volume.html.markdown b/website/docs/d/netapp_volume.html.markdown index caba37ac3131..b19af556d80f 100644 --- a/website/docs/d/netapp_volume.html.markdown +++ b/website/docs/d/netapp_volume.html.markdown @@ -1,5 +1,5 @@ --- -subcategory: "netapp" +subcategory: "NetApp" layout: "azurerm" page_title: "Azure Resource Manager: azurerm_netapp_volume" description: |- diff --git a/website/docs/d/netapp_volume_group_sap_hana.html.markdown b/website/docs/d/netapp_volume_group_sap_hana.html.markdown index 799d419e5685..4f29b9ea1c43 100644 --- a/website/docs/d/netapp_volume_group_sap_hana.html.markdown +++ b/website/docs/d/netapp_volume_group_sap_hana.html.markdown @@ -1,5 +1,5 @@ --- -subcategory: "netapp" +subcategory: "NetApp" layout: "azurerm" page_title: "Azure Resource Manager: Data Source: azurerm_netapp_volume_group_sap_hana" description: |- diff --git a/website/docs/r/netapp_account.html.markdown b/website/docs/r/netapp_account.html.markdown index d18f4bb5e61a..99f2e16f25bd 100644 --- a/website/docs/r/netapp_account.html.markdown +++ b/website/docs/r/netapp_account.html.markdown @@ -1,5 +1,5 @@ --- -subcategory: "netapp" +subcategory: "NetApp" layout: "azurerm" page_title: "Azure Resource Manager: azurerm_netapp_account" description: |- diff --git a/website/docs/r/netapp_pool.html.markdown b/website/docs/r/netapp_pool.html.markdown index a0cbdf695867..cb9180d6ec95 100644 --- a/website/docs/r/netapp_pool.html.markdown +++ b/website/docs/r/netapp_pool.html.markdown @@ -1,5 +1,5 @@ --- -subcategory: "netapp" +subcategory: "NetApp" layout: "azurerm" page_title: "Azure Resource Manager: azurerm_netapp_pool" description: |- diff --git a/website/docs/r/netapp_snapshot.html.markdown b/website/docs/r/netapp_snapshot.html.markdown index 49508b7ec128..e8b1c56cddb6 100644 --- a/website/docs/r/netapp_snapshot.html.markdown +++ b/website/docs/r/netapp_snapshot.html.markdown @@ -1,5 +1,5 @@ --- -subcategory: "netapp" +subcategory: "NetApp" layout: "azurerm" page_title: "Azure Resource Manager: azurerm_netapp_snapshot" description: |- diff --git a/website/docs/r/netapp_snapshot_policy.html.markdown b/website/docs/r/netapp_snapshot_policy.html.markdown index 257637029be4..ed54b12d17a6 100644 --- a/website/docs/r/netapp_snapshot_policy.html.markdown +++ b/website/docs/r/netapp_snapshot_policy.html.markdown @@ -1,5 +1,5 @@ --- -subcategory: "netapp" +subcategory: "NetApp" layout: "azurerm" page_title: "Azure Resource Manager: azurerm_netapp_snapshot_policy" description: |- diff --git a/website/docs/r/netapp_volume.html.markdown b/website/docs/r/netapp_volume.html.markdown index d36305376378..65220ce5141d 100644 --- a/website/docs/r/netapp_volume.html.markdown +++ b/website/docs/r/netapp_volume.html.markdown @@ -1,5 +1,5 @@ --- -subcategory: "netapp" +subcategory: "NetApp" layout: "azurerm" page_title: "Azure Resource Manager: azurerm_netapp_volume" description: |- diff --git a/website/docs/r/netapp_volume_group_sap_hana.html.markdown b/website/docs/r/netapp_volume_group_sap_hana.html.markdown index 8f1585e71c09..7201885babd6 100644 --- a/website/docs/r/netapp_volume_group_sap_hana.html.markdown +++ b/website/docs/r/netapp_volume_group_sap_hana.html.markdown @@ -1,5 +1,5 @@ --- -subcategory: "netapp" +subcategory: "NetApp" layout: "azurerm" page_title: "Azure Resource Manager: azurerm_netapp_volume_group_sap_hana" description: |- From 100bedeaddccca83edc11aec9268180b4bf86824 Mon Sep 17 00:00:00 2001 From: Paulo Date: Fri, 14 Apr 2023 23:56:53 +0000 Subject: [PATCH 75/83] Changing casing --- .teamcity/components/generated/services.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.teamcity/components/generated/services.kt b/.teamcity/components/generated/services.kt index 2756ad8836f9..9901d5230a56 100644 --- a/.teamcity/components/generated/services.kt +++ b/.teamcity/components/generated/services.kt @@ -79,6 +79,7 @@ var services = mapOf( "mobilenetwork" to "Mobile Network", "monitor" to "Monitor", "mysql" to "MySQL", + "netapp" to "NetApp" "network" to "Network", "nginx" to "Nginx", "notificationhub" to "Notification Hub", @@ -115,6 +116,5 @@ var services = mapOf( "vmware" to "VMware", "videoanalyzer" to "Video Analyzer", "voiceservices" to "Voice Services", - "web" to "Web", - "netapp" to "netapp" + "web" to "Web" ) \ No newline at end of file From c04520e09f2a431657af1c1311322279312161b9 Mon Sep 17 00:00:00 2001 From: Paulo Date: Sat, 15 Apr 2023 00:00:21 +0000 Subject: [PATCH 76/83] Adding comma back --- .teamcity/components/generated/services.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.teamcity/components/generated/services.kt b/.teamcity/components/generated/services.kt index 9901d5230a56..bf2372189ede 100644 --- a/.teamcity/components/generated/services.kt +++ b/.teamcity/components/generated/services.kt @@ -79,7 +79,7 @@ var services = mapOf( "mobilenetwork" to "Mobile Network", "monitor" to "Monitor", "mysql" to "MySQL", - "netapp" to "NetApp" + "netapp" to "NetApp", "network" to "Network", "nginx" to "Nginx", "notificationhub" to "Notification Hub", From cfa7252ee2a8feadcdbe23442a3bfa2cacd3bb56 Mon Sep 17 00:00:00 2001 From: Paulo Date: Mon, 17 Apr 2023 20:01:45 +0000 Subject: [PATCH 77/83] Fixing Capacity Pool Id --- .../services/netapp/netapp_volume_group_sap_hana_resource.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/services/netapp/netapp_volume_group_sap_hana_resource.go b/internal/services/netapp/netapp_volume_group_sap_hana_resource.go index 8f2c157cd1a1..b862362c8f65 100644 --- a/internal/services/netapp/netapp_volume_group_sap_hana_resource.go +++ b/internal/services/netapp/netapp_volume_group_sap_hana_resource.go @@ -383,7 +383,7 @@ func (r NetAppVolumeGroupSapHanaResource) Create() sdk.ResourceFunc { volumeCrr.Properties.DataProtection.Replication != nil && strings.EqualFold(string(pointer.From(volumeCrr.Properties.DataProtection.Replication.EndpointType)), string(volumegroups.EndpointTypeDst)) { - capacityPoolId, err := capacitypools.ParseCapacityPoolID(metadata.ResourceData.Get(fmt.Sprintf("%v.capacity_pool_id", volumeCrr)).(string)) + capacityPoolId, err := capacitypools.ParseCapacityPoolID(pointer.From(volumeCrr.Properties.CapacityPoolResourceId)) if err != nil { return err } From baa739cdc12aeffcd5e7e9205fec1bff2ad3316d Mon Sep 17 00:00:00 2001 From: Matthew Frahry Date: Mon, 17 Apr 2023 13:31:27 -0700 Subject: [PATCH 78/83] Update netapp_volume_group_sap_hana.html.markdown --- website/docs/r/netapp_volume_group_sap_hana.html.markdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/website/docs/r/netapp_volume_group_sap_hana.html.markdown b/website/docs/r/netapp_volume_group_sap_hana.html.markdown index 7201885babd6..6030c7340261 100644 --- a/website/docs/r/netapp_volume_group_sap_hana.html.markdown +++ b/website/docs/r/netapp_volume_group_sap_hana.html.markdown @@ -324,13 +324,13 @@ A `export_policy_rule` block supports the following: * `nfsv41_enabled` - (Required) Enables NFSv4.1. Please note that this cannot be enabled if volume has NFSv3 as its protocol. -* `root_access_enabled` - (Required) Is root access permitted to this volume? +* `root_access_enabled` - (Optional) Is root access permitted to this volume? Defaults to `true`. * `rule_index` - (Required) The index number of the rule, must start at 1 and maximum 5. -* `unix_read_only` - (Required) Is the file system on unix read only? +* `unix_read_only` - (Optional) Is the file system on unix read only? Defaults to `false. -* `unix_read_write` - (Required) Is the file system on unix read and write? +* `unix_read_write` - (Optional) Is the file system on unix read and write? Defaults to `true`. --- From 249644449d22ead9f7bffc4b29d95e3b1b7ac3f2 Mon Sep 17 00:00:00 2001 From: Paulo Date: Tue, 18 Apr 2023 00:23:15 +0000 Subject: [PATCH 79/83] Few new tests --- ...app_volume_group_sap_hana_resource_test.go | 184 ++++++++++++++++++ .../services/netapp/netapp_volume_helper.go | 9 - ...p_hana_volumes_export_policy_validation.go | 5 + ...a_volumes_export_policy_validation_test.go | 18 ++ 4 files changed, 207 insertions(+), 9 deletions(-) diff --git a/internal/services/netapp/netapp_volume_group_sap_hana_resource_test.go b/internal/services/netapp/netapp_volume_group_sap_hana_resource_test.go index 975692f94fe8..7e584318a239 100644 --- a/internal/services/netapp/netapp_volume_group_sap_hana_resource_test.go +++ b/internal/services/netapp/netapp_volume_group_sap_hana_resource_test.go @@ -31,6 +31,21 @@ func TestAccNetAppVolumeGroupSapHana_basic(t *testing.T) { }) } +func TestAccNetAppVolumeGroupSapHana_backupVolumeSpecsNfsv3(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_netapp_volume_group_sap_hana", "test") + r := NetAppVolumeGroupSapHanaResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.backupVolumeSpecsNfsv3(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + }) +} + func TestAccNetAppVolumeGroupSapHana_snapshotPolicy(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_netapp_volume_group_sap_hana", "test") r := NetAppVolumeGroupSapHanaResource{} @@ -276,6 +291,175 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" { `, template, data.RandomInteger) } +func (NetAppVolumeGroupSapHanaResource) backupVolumeSpecsNfsv3(data acceptance.TestData) string { + template := NetAppVolumeGroupSapHanaResource{}.templatePPG(data) + return fmt.Sprintf(` +%[1]s + +resource "azurerm_netapp_volume_group_sap_hana" "test" { + name = "acctest-NetAppVolumeGroup-%[2]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + account_name = azurerm_netapp_account.test.name + group_description = "Test volume group" + application_identifier = "TST" + + volume { + name = "acctest-NetAppVolume-1-%[2]d" + volume_path = "my-unique-file-path-1-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + proximity_placement_group_id = azurerm_proximity_placement_group.test.id + volume_spec_name = "data" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv4.1"] + security_style = "Unix" + snapshot_directory_visible = false + + export_policy_rule { + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false + } + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } + } + + volume { + name = "acctest-NetAppVolume-2-%[2]d" + volume_path = "my-unique-file-path-2-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + proximity_placement_group_id = azurerm_proximity_placement_group.test.id + volume_spec_name = "log" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv4.1"] + security_style = "Unix" + snapshot_directory_visible = false + + export_policy_rule { + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false + } + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } + } + + volume { + name = "acctest-NetAppVolume-3-%[2]d" + volume_path = "my-unique-file-path-3-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + proximity_placement_group_id = azurerm_proximity_placement_group.test.id + volume_spec_name = "shared" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv4.1"] + security_style = "Unix" + snapshot_directory_visible = false + + export_policy_rule { + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false + } + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } + } + + volume { + name = "acctest-NetAppVolume-4-%[2]d" + volume_path = "my-unique-file-path-4-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + volume_spec_name = "data-backup" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv3"] + security_style = "Unix" + snapshot_directory_visible = false + + export_policy_rule { + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = true + nfsv41_enabled = false + unix_read_only = false + unix_read_write = true + root_access_enabled = false + } + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } + } + + volume { + name = "acctest-NetAppVolume-5-%[2]d" + volume_path = "my-unique-file-path-5-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + volume_spec_name = "log-backup" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv3"] + security_style = "Unix" + snapshot_directory_visible = false + + export_policy_rule { + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = true + nfsv41_enabled = false + unix_read_only = false + unix_read_write = true + root_access_enabled = false + } + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } + } + + depends_on = [ + azurerm_linux_virtual_machine.test, + azurerm_proximity_placement_group.test + ] +} +`, template, data.RandomInteger) +} + func (NetAppVolumeGroupSapHanaResource) avgSnapshotPolicy(data acceptance.TestData) string { template := NetAppVolumeGroupSapHanaResource{}.templatePPG(data) return fmt.Sprintf(` diff --git a/internal/services/netapp/netapp_volume_helper.go b/internal/services/netapp/netapp_volume_helper.go index 71106e51db75..66bb1e3aaa27 100644 --- a/internal/services/netapp/netapp_volume_helper.go +++ b/internal/services/netapp/netapp_volume_helper.go @@ -791,12 +791,3 @@ func translateSDKSchedule(scheduleName string) string { return scheduleName } - -func FindStringInSlice(slice []string, val string) bool { - for _, item := range slice { - if strings.EqualFold(item, val) { - return true - } - } - return false -} diff --git a/internal/services/netapp/validate/volume_group_sap_hana_volumes_export_policy_validation.go b/internal/services/netapp/validate/volume_group_sap_hana_volumes_export_policy_validation.go index b388894bfd86..a27dcddf4663 100644 --- a/internal/services/netapp/validate/volume_group_sap_hana_volumes_export_policy_validation.go +++ b/internal/services/netapp/validate/volume_group_sap_hana_volumes_export_policy_validation.go @@ -16,6 +16,11 @@ func ValidateNetAppVolumeGroupExportPolicyRuleSAPHanna(rule volumegroups.ExportP errors = append(errors, fmt.Errorf("'nfsv3 and nfsv4.1 cannot be enabled at the same time'")) } + // Validating that nfsv3 and nfsv4.1 are not disabled in the same rule + if !pointer.From(rule.Nfsv3) && !pointer.From(rule.Nfsv41) { + errors = append(errors, fmt.Errorf("'nfsv3 and nfsv4.1 cannot be enabled at the same time'")) + } + // Validating that nfsv4.1 export policy is not set on nfsv3 volume if pointer.From(rule.Nfsv41) && strings.EqualFold(protocolType, string(ProtocolTypeNfsV3)) { errors = append(errors, fmt.Errorf("'nfsv4.1 export policy cannot be enabled on nfsv3 volume'")) diff --git a/internal/services/netapp/validate/volume_group_sap_hana_volumes_export_policy_validation_test.go b/internal/services/netapp/validate/volume_group_sap_hana_volumes_export_policy_validation_test.go index 4c1766628736..03ed00c85072 100644 --- a/internal/services/netapp/validate/volume_group_sap_hana_volumes_export_policy_validation_test.go +++ b/internal/services/netapp/validate/volume_group_sap_hana_volumes_export_policy_validation_test.go @@ -51,6 +51,24 @@ func TestValidateNetAppVolumeGroupExportPolicyRuleSAPHanna(t *testing.T) { }, Errors: 2, }, + { + Name: "ValidateBothProtocolsNotDisabledAtSameTimeOnNFSv3Volume", + Protocol: string(ProtocolTypeNfsV3), + Rule: volumegroups.ExportPolicyRule{ + Nfsv3: pointer.To(false), + Nfsv41: utils.Bool(false), + }, + Errors: 1, + }, + { + Name: "ValidateBothProtocolsNotDisabledAtSameTimeOnNFSv41Volume", + Protocol: string(ProtocolTypeNfsV41), + Rule: volumegroups.ExportPolicyRule{ + Nfsv3: pointer.To(false), + Nfsv41: utils.Bool(false), + }, + Errors: 1, + }, { Name: "ValidateNFSv3NotEnabledOnNFSv41Volume", Protocol: string(ProtocolTypeNfsV41), From 3108095c2355fa3345fdab1166c5c9b4d4bbcfec Mon Sep 17 00:00:00 2001 From: Paulo Date: Tue, 25 Apr 2023 00:49:57 +0000 Subject: [PATCH 80/83] Adding snapshot update test --- ...app_volume_group_sap_hana_resource_test.go | 231 ++++++++++++++++++ 1 file changed, 231 insertions(+) diff --git a/internal/services/netapp/netapp_volume_group_sap_hana_resource_test.go b/internal/services/netapp/netapp_volume_group_sap_hana_resource_test.go index 7e584318a239..930467386f8f 100644 --- a/internal/services/netapp/netapp_volume_group_sap_hana_resource_test.go +++ b/internal/services/netapp/netapp_volume_group_sap_hana_resource_test.go @@ -61,6 +61,28 @@ func TestAccNetAppVolumeGroupSapHana_snapshotPolicy(t *testing.T) { }) } +func TestAccNetAppVolumeGroupSapHana_snapshotPolicyUpdate(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_netapp_volume_group_sap_hana", "test") + r := NetAppVolumeGroupSapHanaResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + { + Config: r.updateAvgSnapshotPolicy(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + }) +} + func TestAccNetAppVolumeGroupSapHana_volumeUpdates(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_netapp_volume_group_sap_hana", "test") r := NetAppVolumeGroupSapHanaResource{} @@ -669,6 +691,215 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" { `, template, data.RandomInteger) } +func (NetAppVolumeGroupSapHanaResource) updateAvgSnapshotPolicy(data acceptance.TestData) string { + template := NetAppVolumeGroupSapHanaResource{}.templatePPG(data) + return fmt.Sprintf(` +%[1]s + +resource "azurerm_netapp_snapshot_policy" "test" { + name = "acctest-NetAppSnapshotPolicy-New-%[2]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + account_name = azurerm_netapp_account.test.name + enabled = true + + monthly_schedule { + snapshots_to_keep = 3 + days_of_month = [10, 25] + hour = 23 + minute = 30 + } + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } +} + +resource "azurerm_netapp_volume_group_sap_hana" "test" { + name = "acctest-NetAppVolumeGroup-%[2]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + account_name = azurerm_netapp_account.test.name + group_description = "Test volume group" + application_identifier = "TST" + + volume { + name = "acctest-NetAppVolume-1-%[2]d" + volume_path = "my-unique-file-path-1-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + proximity_placement_group_id = azurerm_proximity_placement_group.test.id + volume_spec_name = "data" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv4.1"] + security_style = "Unix" + snapshot_directory_visible = false + + export_policy_rule { + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false + } + + data_protection_snapshot_policy { + snapshot_policy_id = azurerm_netapp_snapshot_policy.test.id + } + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } + } + + volume { + name = "acctest-NetAppVolume-2-%[2]d" + volume_path = "my-unique-file-path-2-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + proximity_placement_group_id = azurerm_proximity_placement_group.test.id + volume_spec_name = "log" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv4.1"] + security_style = "Unix" + snapshot_directory_visible = false + + export_policy_rule { + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false + } + + data_protection_snapshot_policy { + snapshot_policy_id = azurerm_netapp_snapshot_policy.test.id + } + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } + } + + volume { + name = "acctest-NetAppVolume-3-%[2]d" + volume_path = "my-unique-file-path-3-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + proximity_placement_group_id = azurerm_proximity_placement_group.test.id + volume_spec_name = "shared" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv4.1"] + security_style = "Unix" + snapshot_directory_visible = false + + export_policy_rule { + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false + } + + data_protection_snapshot_policy { + snapshot_policy_id = azurerm_netapp_snapshot_policy.test.id + } + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } + } + + volume { + name = "acctest-NetAppVolume-4-%[2]d" + volume_path = "my-unique-file-path-4-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + volume_spec_name = "data-backup" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv4.1"] + security_style = "Unix" + snapshot_directory_visible = false + + export_policy_rule { + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false + } + + data_protection_snapshot_policy { + snapshot_policy_id = azurerm_netapp_snapshot_policy.test.id + } + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } + } + + volume { + name = "acctest-NetAppVolume-5-%[2]d" + volume_path = "my-unique-file-path-5-%[2]d" + service_level = "Standard" + capacity_pool_id = azurerm_netapp_pool.test.id + subnet_id = azurerm_subnet.test.id + volume_spec_name = "log-backup" + storage_quota_in_gb = 1024 + throughput_in_mibps = 24 + protocols = ["NFSv4.1"] + security_style = "Unix" + snapshot_directory_visible = false + + export_policy_rule { + rule_index = 1 + allowed_clients = "0.0.0.0/0" + nfsv3_enabled = false + nfsv41_enabled = true + unix_read_only = false + unix_read_write = true + root_access_enabled = false + } + + data_protection_snapshot_policy { + snapshot_policy_id = azurerm_netapp_snapshot_policy.test.id + } + + tags = { + "CreatedOnDate" = "2022-07-08T23:50:21Z", + "SkipASMAzSecPack" = "true" + } + } + + depends_on = [ + azurerm_linux_virtual_machine.test, + azurerm_proximity_placement_group.test + ] +} +`, template, data.RandomInteger) +} + func (NetAppVolumeGroupSapHanaResource) updateVolumes(data acceptance.TestData) string { template := NetAppVolumeGroupSapHanaResource{}.templatePPG(data) return fmt.Sprintf(` From 298c3d664df8db1e9d96d1deb372549b6d2db068 Mon Sep 17 00:00:00 2001 From: Paulo Date: Tue, 25 Apr 2023 13:45:50 +0000 Subject: [PATCH 81/83] Finishing addressing remaining PR comments --- ...olume_group_sap_hana_volumes_validation.go | 40 ++++ ..._group_sap_hana_volumes_validation_test.go | 197 +++++++++++++++++- 2 files changed, 236 insertions(+), 1 deletion(-) diff --git a/internal/services/netapp/validate/volume_group_sap_hana_volumes_validation.go b/internal/services/netapp/validate/volume_group_sap_hana_volumes_validation.go index 08101a0cf37f..deb64458faf1 100644 --- a/internal/services/netapp/validate/volume_group_sap_hana_volumes_validation.go +++ b/internal/services/netapp/validate/volume_group_sap_hana_volumes_validation.go @@ -79,14 +79,45 @@ func ValidateNetAppVolumeGroupSAPHanaVolumes(volumeList *[]volumegroups.VolumeGr volumeSpecRepeatCount := make(map[string]int) applicationType := string(volumegroups.ApplicationTypeSAPNegativeHANA) + // Validating minimum volume count + if len(*volumeList) < len(RequiredVolumesForSAPHANA()) { + errors = append(errors, fmt.Errorf("'minimum %v volumes are required for %v'", len(RequiredVolumesForSAPHANA()), applicationType)) + } + // Validating each volume for _, volume := range pointer.From(volumeList) { + + // Get protocol list protocolTypeList := pointer.From(volume.Properties.ProtocolTypes) protocolType := "" + + // Validate protocol list is not empty + if len(protocolTypeList) == 0 { + errors = append(errors, fmt.Errorf("'protocol type list cannot be empty'")) + } + + // Validate protocol list is not > 1 + if len(protocolTypeList) > 1 { + errors = append(errors, fmt.Errorf("'multi-protocol volumes are not supported, protocol count is %v'", len(protocolTypeList))) + } + + // Getting protocol for next validations if len(protocolTypeList) > 0 { protocolType = protocolTypeList[0] } + // Validate protocol list does not contain invalid protocols + for _, protocol := range protocolTypeList { + if !findStringInSlice(PossibleValuesForProtocolType(), protocolType) { + errors = append(errors, fmt.Errorf("'protocol %v is invalid'", protocol)) + } + } + + // Validate that protocol is valid for SAP Hana + if !findStringInSlice(PossibleValuesForProtocolTypeVolumeGroupSapHana(), protocolType) { + errors = append(errors, fmt.Errorf("'protocol %v is invalid for SAP Hana'", protocolType)) + } + // Can't be nfsv3 on data, log and share volumes if strings.EqualFold(protocolType, string(ProtocolTypeNfsV3)) && (strings.EqualFold(pointer.From(volume.Properties.VolumeSpecName), string(VolumeSpecNameSapHanaData)) || @@ -157,3 +188,12 @@ func ValidateNetAppVolumeGroupSAPHanaVolumes(volumeList *[]volumegroups.VolumeGr return errors } + +func findStringInSlice(slice []string, val string) bool { + for _, item := range slice { + if strings.EqualFold(item, val) { + return true + } + } + return false +} diff --git a/internal/services/netapp/validate/volume_group_sap_hana_volumes_validation_test.go b/internal/services/netapp/validate/volume_group_sap_hana_volumes_validation_test.go index c2cd171c12aa..3a1a2494fdc6 100644 --- a/internal/services/netapp/validate/volume_group_sap_hana_volumes_validation_test.go +++ b/internal/services/netapp/validate/volume_group_sap_hana_volumes_validation_test.go @@ -144,6 +144,199 @@ func TestValidateNetAppVolumeGroupSAPHanaVolumes(t *testing.T) { }, Errors: 0, }, + { + Name: "ValidateRequiredVolumeSpecs", + VolumesData: []volumegroups.VolumeGroupVolumeProperties{ + { // shared + Name: pointer.To(fmt.Sprintf("volume-%v", string(VolumeSpecNameSapHanaShared))), + Properties: volumegroups.VolumeProperties{ + ExportPolicy: &volumegroups.VolumePropertiesExportPolicy{ + Rules: &[]volumegroups.ExportPolicyRule{ + { + Nfsv3: pointer.To(false), + Nfsv41: utils.Bool(true), + }, + }, + }, + ProtocolTypes: pointer.To([]string{"NFSv4.1"}), + ProximityPlacementGroup: pointer.To("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"), + SecurityStyle: pointer.To(volumegroups.SecurityStyle(SecurityStyleUnix)), + VolumeSpecName: pointer.To(string(VolumeSpecNameSapHanaShared)), + }, + }, + { // data-backup + Name: pointer.To(fmt.Sprintf("volume-%v", string(VolumeSpecNameSapHanaDataBackup))), + Properties: volumegroups.VolumeProperties{ + ExportPolicy: &volumegroups.VolumePropertiesExportPolicy{ + Rules: &[]volumegroups.ExportPolicyRule{ + { + Nfsv3: pointer.To(false), + Nfsv41: utils.Bool(true), + }, + }, + }, + ProtocolTypes: pointer.To([]string{"NFSv4.1"}), + SecurityStyle: pointer.To(volumegroups.SecurityStyle(SecurityStyleUnix)), + VolumeSpecName: pointer.To(string(VolumeSpecNameSapHanaDataBackup)), + }, + }, + { // log-backup + Name: pointer.To(fmt.Sprintf("volume-%v", string(VolumeSpecNameSapHanaLogBackup))), + Properties: volumegroups.VolumeProperties{ + ExportPolicy: &volumegroups.VolumePropertiesExportPolicy{ + Rules: &[]volumegroups.ExportPolicyRule{ + { + Nfsv3: pointer.To(false), + Nfsv41: utils.Bool(true), + }, + }, + }, + ProtocolTypes: pointer.To([]string{"NFSv4.1"}), + SecurityStyle: pointer.To(volumegroups.SecurityStyle(SecurityStyleUnix)), + VolumeSpecName: pointer.To(string(VolumeSpecNameSapHanaLogBackup)), + }, + }, + }, + Errors: 2, + }, + { + Name: "ValidateLessThanMinimumVolumes", + VolumesData: []volumegroups.VolumeGroupVolumeProperties{ + { // data + Name: pointer.To(fmt.Sprintf("volume-%v", string(VolumeSpecNameSapHanaData))), + Properties: volumegroups.VolumeProperties{ + ExportPolicy: &volumegroups.VolumePropertiesExportPolicy{ + Rules: &[]volumegroups.ExportPolicyRule{ + { + Nfsv3: pointer.To(false), + Nfsv41: utils.Bool(true), + }, + }, + }, + ProtocolTypes: pointer.To([]string{"NFSv4.1"}), + ProximityPlacementGroup: pointer.To("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"), + SecurityStyle: pointer.To(volumegroups.SecurityStyle(SecurityStyleUnix)), + VolumeSpecName: pointer.To(string(VolumeSpecNameSapHanaData)), + }, + }, + }, + Errors: 2, + }, + { + Name: "ValidateMultiProtocolFails", + VolumesData: []volumegroups.VolumeGroupVolumeProperties{ + { // data + Name: pointer.To(fmt.Sprintf("volume-%v", string(VolumeSpecNameSapHanaData))), + Properties: volumegroups.VolumeProperties{ + ExportPolicy: &volumegroups.VolumePropertiesExportPolicy{ + Rules: &[]volumegroups.ExportPolicyRule{ + { + Nfsv3: pointer.To(false), + Nfsv41: utils.Bool(true), + }, + }, + }, + ProtocolTypes: pointer.To([]string{"NFSv4.1", "NFSv3"}), + ProximityPlacementGroup: pointer.To("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"), + SecurityStyle: pointer.To(volumegroups.SecurityStyle(SecurityStyleUnix)), + VolumeSpecName: pointer.To(string(VolumeSpecNameSapHanaData)), + }, + }, + }, + Errors: 3, + }, + { + Name: "ValidateNoProtocolFails", + VolumesData: []volumegroups.VolumeGroupVolumeProperties{ + { // data + Name: pointer.To(fmt.Sprintf("volume-%v", string(VolumeSpecNameSapHanaData))), + Properties: volumegroups.VolumeProperties{ + ExportPolicy: &volumegroups.VolumePropertiesExportPolicy{ + Rules: &[]volumegroups.ExportPolicyRule{ + { + Nfsv3: pointer.To(false), + Nfsv41: utils.Bool(true), + }, + }, + }, + ProtocolTypes: pointer.To([]string{}), + ProximityPlacementGroup: pointer.To("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"), + SecurityStyle: pointer.To(volumegroups.SecurityStyle(SecurityStyleUnix)), + VolumeSpecName: pointer.To(string(VolumeSpecNameSapHanaData)), + }, + }, + }, + Errors: 4, + }, + { + Name: "ValidateInvalidProtocolList", + VolumesData: []volumegroups.VolumeGroupVolumeProperties{ + { // data + Name: pointer.To(fmt.Sprintf("volume-%v", string(VolumeSpecNameSapHanaData))), + Properties: volumegroups.VolumeProperties{ + ExportPolicy: &volumegroups.VolumePropertiesExportPolicy{ + Rules: &[]volumegroups.ExportPolicyRule{ + { + Nfsv3: pointer.To(false), + Nfsv41: utils.Bool(true), + }, + }, + }, + ProtocolTypes: pointer.To([]string{"NFSv4.1", "InvalidProtocol"}), + ProximityPlacementGroup: pointer.To("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"), + SecurityStyle: pointer.To(volumegroups.SecurityStyle(SecurityStyleUnix)), + VolumeSpecName: pointer.To(string(VolumeSpecNameSapHanaData)), + }, + }, + }, + Errors: 3, + }, + { + Name: "ValidateInvalidProtocol", + VolumesData: []volumegroups.VolumeGroupVolumeProperties{ + { // data + Name: pointer.To(fmt.Sprintf("volume-%v", string(VolumeSpecNameSapHanaData))), + Properties: volumegroups.VolumeProperties{ + ExportPolicy: &volumegroups.VolumePropertiesExportPolicy{ + Rules: &[]volumegroups.ExportPolicyRule{ + { + Nfsv3: pointer.To(false), + Nfsv41: utils.Bool(true), + }, + }, + }, + ProtocolTypes: pointer.To([]string{"InvalidProtocol"}), + ProximityPlacementGroup: pointer.To("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"), + SecurityStyle: pointer.To(volumegroups.SecurityStyle(SecurityStyleUnix)), + VolumeSpecName: pointer.To(string(VolumeSpecNameSapHanaData)), + }, + }, + }, + Errors: 4, + }, + { + Name: "ValidateCIFSInvalidProtocolForSAPHana", + VolumesData: []volumegroups.VolumeGroupVolumeProperties{ + { // data + Name: pointer.To(fmt.Sprintf("volume-%v", string(VolumeSpecNameSapHanaData))), + Properties: volumegroups.VolumeProperties{ + ExportPolicy: &volumegroups.VolumePropertiesExportPolicy{ + Rules: &[]volumegroups.ExportPolicyRule{ + { + Nfsv3: pointer.To(false), + Nfsv41: utils.Bool(true), + }, + }, + }, + ProtocolTypes: pointer.To([]string{"CIFS"}), + ProximityPlacementGroup: pointer.To("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"), + SecurityStyle: pointer.To(volumegroups.SecurityStyle(SecurityStyleUnix)), + VolumeSpecName: pointer.To(string(VolumeSpecNameSapHanaData)), + }, + }, + }, + Errors: 3, + }, { Name: "ValidateNoNfsVersionThreeOnDataLogAndSharedVolumes", VolumesData: []volumegroups.VolumeGroupVolumeProperties{ @@ -198,6 +391,7 @@ func TestValidateNetAppVolumeGroupSAPHanaVolumes(t *testing.T) { { // data-backup Name: pointer.To(fmt.Sprintf("volume-%v", string(VolumeSpecNameSapHanaDataBackup))), Properties: volumegroups.VolumeProperties{ + ProtocolTypes: pointer.To([]string{"NFSv4.1"}), ProximityPlacementGroup: pointer.To("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"), VolumeSpecName: pointer.To(string(VolumeSpecNameSapHanaDataBackup)), }, @@ -205,6 +399,7 @@ func TestValidateNetAppVolumeGroupSAPHanaVolumes(t *testing.T) { { // log-backup Name: pointer.To(fmt.Sprintf("volume-%v", string(VolumeSpecNameSapHanaLogBackup))), Properties: volumegroups.VolumeProperties{ + ProtocolTypes: pointer.To([]string{"NFSv4.1"}), ProximityPlacementGroup: pointer.To("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"), VolumeSpecName: pointer.To(string(VolumeSpecNameSapHanaLogBackup)), }, @@ -343,7 +538,7 @@ func TestValidateNetAppVolumeGroupSAPHanaVolumes(t *testing.T) { errors := ValidateNetAppVolumeGroupSAPHanaVolumes(pointer.To(tc.VolumesData)) if len(errors) != tc.Errors { - t.Fatalf("expected ValidateNetAppVolumeGroupSAPHanaVolumes to return %d error(s) not %d", tc.Errors, len(errors)) + t.Fatalf("expected ValidateNetAppVolumeGroupSAPHanaVolumes to return %d error(s) not %d\nError List: \n%v", tc.Errors, len(errors), errors) } }) } From ef278ef43d49db77db1246f307481aedf4396d79 Mon Sep 17 00:00:00 2001 From: Matthew Frahry Date: Tue, 25 Apr 2023 15:15:21 -0700 Subject: [PATCH 82/83] Update netapp_volume_group_sap_hana_resource_test.go Remove "eastus" usages --- .../netapp/netapp_volume_group_sap_hana_resource_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/services/netapp/netapp_volume_group_sap_hana_resource_test.go b/internal/services/netapp/netapp_volume_group_sap_hana_resource_test.go index 930467386f8f..ee2b29f83622 100644 --- a/internal/services/netapp/netapp_volume_group_sap_hana_resource_test.go +++ b/internal/services/netapp/netapp_volume_group_sap_hana_resource_test.go @@ -1428,7 +1428,7 @@ resource "azurerm_netapp_volume_group_sap_hana" "test_secondary" { } -`, template, data.RandomInteger, "eastus") +`, template, data.RandomInteger, data.Locations.Secondary) } func (r NetAppVolumeGroupSapHanaResource) templateForAvgCrossRegionReplication(data acceptance.TestData) string { @@ -1592,7 +1592,7 @@ resource "azurerm_netapp_pool" "test_secondary" { "SkipASMAzSecPack" = "true" } } -`, template, data.RandomInteger, "eastus") +`, template, data.RandomInteger, data.Locations.Secondary) } func (NetAppVolumeGroupSapHanaResource) templatePPG(data acceptance.TestData) string { From a1d268909564dd266ce800a928c41a8a88ff5e18 Mon Sep 17 00:00:00 2001 From: Matthew Frahry Date: Tue, 25 Apr 2023 16:27:45 -0700 Subject: [PATCH 83/83] Reverting netapp_volume_group_sap_hana_resource_test.go Swapping back to`eastus` --- .../netapp/netapp_volume_group_sap_hana_resource_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/services/netapp/netapp_volume_group_sap_hana_resource_test.go b/internal/services/netapp/netapp_volume_group_sap_hana_resource_test.go index ee2b29f83622..930467386f8f 100644 --- a/internal/services/netapp/netapp_volume_group_sap_hana_resource_test.go +++ b/internal/services/netapp/netapp_volume_group_sap_hana_resource_test.go @@ -1428,7 +1428,7 @@ resource "azurerm_netapp_volume_group_sap_hana" "test_secondary" { } -`, template, data.RandomInteger, data.Locations.Secondary) +`, template, data.RandomInteger, "eastus") } func (r NetAppVolumeGroupSapHanaResource) templateForAvgCrossRegionReplication(data acceptance.TestData) string { @@ -1592,7 +1592,7 @@ resource "azurerm_netapp_pool" "test_secondary" { "SkipASMAzSecPack" = "true" } } -`, template, data.RandomInteger, data.Locations.Secondary) +`, template, data.RandomInteger, "eastus") } func (NetAppVolumeGroupSapHanaResource) templatePPG(data acceptance.TestData) string {