From 2063a2db0b6fc35165b988aff6b267f37684cce9 Mon Sep 17 00:00:00 2001 From: Paulo Date: Thu, 12 May 2022 09:34:49 -0700 Subject: [PATCH 01/12] Adding support for network features and LRO --- internal/services/netapp/client/client.go | 2 +- .../netapp/netapp_account_resource.go | 2 +- .../services/netapp/netapp_pool_resource.go | 2 +- .../netapp/netapp_snapshot_policy_resource.go | 13 ++++- .../netapp/netapp_snapshot_resource.go | 2 +- .../netapp/netapp_volume_data_source.go | 6 +++ .../netapp/netapp_volume_data_source_test.go | 1 + .../services/netapp/netapp_volume_resource.go | 51 ++++++++++++++----- .../netapp/netapp_volume_resource_test.go | 39 ++++++++++++++ website/docs/d/netapp_volume.html.markdown | 4 +- website/docs/r/netapp_volume.html.markdown | 3 ++ 11 files changed, 106 insertions(+), 19 deletions(-) diff --git a/internal/services/netapp/client/client.go b/internal/services/netapp/client/client.go index 3f1b3bea437a..16c7c10fbee2 100644 --- a/internal/services/netapp/client/client.go +++ b/internal/services/netapp/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp" + "github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp" "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/netapp/netapp_account_resource.go b/internal/services/netapp/netapp_account_resource.go index 5b096fefb8b3..4dc362e895b8 100644 --- a/internal/services/netapp/netapp_account_resource.go +++ b/internal/services/netapp/netapp_account_resource.go @@ -9,7 +9,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp" + "github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp" "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_pool_resource.go b/internal/services/netapp/netapp_pool_resource.go index 4bd7843f483e..944ee8063cb9 100644 --- a/internal/services/netapp/netapp_pool_resource.go +++ b/internal/services/netapp/netapp_pool_resource.go @@ -7,7 +7,7 @@ import ( "strconv" "time" - "github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp" + "github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp" "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_resource.go b/internal/services/netapp/netapp_snapshot_policy_resource.go index bb9074d8f8b7..fe96e7d8384f 100644 --- a/internal/services/netapp/netapp_snapshot_policy_resource.go +++ b/internal/services/netapp/netapp_snapshot_policy_resource.go @@ -298,10 +298,15 @@ func resourceNetAppSnapshotPolicyUpdate(d *pluginsdk.ResourceData, meta interfac Tags: tags.Expand(d.Get("tags").(map[string]interface{})), } - if _, err := client.Update(ctx, parameters, resourceGroup, accountName, name); err != nil { + future, err := client.Update(ctx, parameters, resourceGroup, accountName, name) + if err != nil { return fmt.Errorf("updating NetApp SnapshotPolicy %q (Resource Group %q): %+v", name, resourceGroup, err) } + if err := future.WaitForCompletionRef(ctx, client.Client); err != nil { + return fmt.Errorf("waiting for creation/update of %q (Resource Group %q): %+v", name, resourceGroup, err) + } + return resourceNetAppSnapshotPolicyRead(d, meta) } @@ -361,11 +366,15 @@ func resourceNetAppSnapshotPolicyDelete(d *pluginsdk.ResourceData, meta interfac } // Deleting snapshot policy and waiting for it fo fully complete the operation - if _, err = client.Delete(ctx, id.ResourceGroup, id.NetAppAccountName, id.Name); err != nil { + future, err := client.Delete(ctx, id.ResourceGroup, id.NetAppAccountName, id.Name) + if err != nil { return fmt.Errorf("deleting NetApp Snapshot Policy %q (Resource Group %q): %+v", id.Name, id.ResourceGroup, err) } log.Printf("[DEBUG] Waiting for NetApp SnapshotPolicy Provisioning Service %q (Resource Group %q) to be deleted", id.Name, id.ResourceGroup) + if err := future.WaitForCompletionRef(ctx, client.Client); err != nil { + return fmt.Errorf("waiting for deletion of %q: %+v", id, err) + } if err := waitForSnapshotPolicyDeletion(ctx, client, *id, d.Timeout(pluginsdk.TimeoutDelete)); err != nil { return err } diff --git a/internal/services/netapp/netapp_snapshot_resource.go b/internal/services/netapp/netapp_snapshot_resource.go index 8dbbeab58276..f776c66d478a 100644 --- a/internal/services/netapp/netapp_snapshot_resource.go +++ b/internal/services/netapp/netapp_snapshot_resource.go @@ -7,7 +7,7 @@ import ( "strconv" "time" - "github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp" + "github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp" "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_data_source.go b/internal/services/netapp/netapp_volume_data_source.go index 68f11acbe24c..e75c445984bf 100644 --- a/internal/services/netapp/netapp_volume_data_source.go +++ b/internal/services/netapp/netapp_volume_data_source.go @@ -96,6 +96,11 @@ func dataSourceNetAppVolume() *pluginsdk.Resource { Computed: true, }, + "network_features": { + Type: pluginsdk.TypeString, + Computed: true, + }, + "storage_quota_in_gb": { Type: pluginsdk.TypeInt, Computed: true, @@ -151,6 +156,7 @@ func dataSourceNetAppVolumeRead(d *pluginsdk.ResourceData, meta interface{}) err d.Set("volume_path", props.CreationToken) d.Set("service_level", props.ServiceLevel) d.Set("subnet_id", props.SubnetID) + d.Set("network_features", props.NetworkFeatures) protocolTypes := make([]string, 0) if prtclTypes := props.ProtocolTypes; prtclTypes != nil { diff --git a/internal/services/netapp/netapp_volume_data_source_test.go b/internal/services/netapp/netapp_volume_data_source_test.go index 7bd0e4db1479..bcf738b31d14 100644 --- a/internal/services/netapp/netapp_volume_data_source_test.go +++ b/internal/services/netapp/netapp_volume_data_source_test.go @@ -21,6 +21,7 @@ func TestAccDataSourceNetAppVolume_basic(t *testing.T) { check.That(data.ResourceName).Key("volume_path").Exists(), check.That(data.ResourceName).Key("service_level").Exists(), check.That(data.ResourceName).Key("subnet_id").Exists(), + check.That(data.ResourceName).Key("network_features").HasValue("Basic"), check.That(data.ResourceName).Key("storage_quota_in_gb").Exists(), check.That(data.ResourceName).Key("protocols.0").Exists(), check.That(data.ResourceName).Key("mount_ip_addresses.#").HasValue("1"), diff --git a/internal/services/netapp/netapp_volume_resource.go b/internal/services/netapp/netapp_volume_resource.go index d7f25337908e..b096502c4d0c 100644 --- a/internal/services/netapp/netapp_volume_resource.go +++ b/internal/services/netapp/netapp_volume_resource.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/go-azure-helpers/resourcemanager/location" - "github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp" + "github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" @@ -174,6 +174,17 @@ func resourceNetAppVolume() *pluginsdk.Resource { ValidateFunc: netAppValidate.SnapshotID, }, + "network_features": { + Type: pluginsdk.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + ValidateFunc: validation.StringInSlice([]string{ + string(netapp.NetworkFeaturesBasic), + string(netapp.NetworkFeaturesStandard), + }, false), + }, + "protocols": { Type: pluginsdk.TypeSet, ForceNew: true, @@ -316,6 +327,12 @@ func resourceNetAppVolumeCreate(d *pluginsdk.ResourceData, meta interface{}) err volumePath := d.Get("volume_path").(string) serviceLevel := d.Get("service_level").(string) subnetID := d.Get("subnet_id").(string) + + networkFeatures := d.Get("network_features").(string) + if networkFeatures == "" { + networkFeatures = string(netapp.NetworkFeaturesBasic) + } + protocols := d.Get("protocols").(*pluginsdk.Set).List() if len(protocols) == 0 { protocols = append(protocols, "NFSv3") @@ -425,15 +442,16 @@ func resourceNetAppVolumeCreate(d *pluginsdk.ResourceData, meta interface{}) err parameters := netapp.Volume{ Location: utils.String(location), VolumeProperties: &netapp.VolumeProperties{ - CreationToken: utils.String(volumePath), - ServiceLevel: netapp.ServiceLevel(serviceLevel), - SubnetID: utils.String(subnetID), - ProtocolTypes: utils.ExpandStringSlice(protocols), - SecurityStyle: netapp.SecurityStyle(securityStyle), - UsageThreshold: utils.Int64(storageQuotaInGB), - ExportPolicy: exportPolicyRule, - VolumeType: utils.String(volumeType), - SnapshotID: utils.String(snapshotID), + CreationToken: utils.String(volumePath), + ServiceLevel: netapp.ServiceLevel(serviceLevel), + SubnetID: utils.String(subnetID), + NetworkFeatures: netapp.NetworkFeatures(networkFeatures), + ProtocolTypes: utils.ExpandStringSlice(protocols), + SecurityStyle: netapp.SecurityStyle(securityStyle), + UsageThreshold: utils.Int64(storageQuotaInGB), + ExportPolicy: exportPolicyRule, + VolumeType: utils.String(volumeType), + SnapshotID: utils.String(snapshotID), DataProtection: &netapp.VolumePropertiesDataProtection{ Replication: dataProtectionReplication.Replication, Snapshot: dataProtectionSnapshotPolicy.Snapshot, @@ -601,6 +619,7 @@ func resourceNetAppVolumeRead(d *pluginsdk.ResourceData, meta interface{}) error d.Set("volume_path", props.CreationToken) d.Set("service_level", props.ServiceLevel) d.Set("subnet_id", props.SubnetID) + d.Set("network_features", props.NetworkFeatures) d.Set("protocols", props.ProtocolTypes) d.Set("security_style", props.SecurityStyle) d.Set("snapshot_directory_visible", props.SnapshotDirectoryVisible) @@ -683,22 +702,30 @@ func resourceNetAppVolumeDelete(d *pluginsdk.ResourceData, meta interface{}) err } // Deleting replication and waiting for it to fully complete the operation - if _, err = client.DeleteReplication(ctx, replicaVolumeId.ResourceGroup, replicaVolumeId.NetAppAccountName, replicaVolumeId.CapacityPoolName, replicaVolumeId.Name); err != nil { + future, err := client.DeleteReplication(ctx, replicaVolumeId.ResourceGroup, replicaVolumeId.NetAppAccountName, replicaVolumeId.CapacityPoolName, replicaVolumeId.Name) + if err != nil { return fmt.Errorf("deleting replicate %s: %+v", *replicaVolumeId, err) } log.Printf("[DEBUG] Waiting for the replica of %s to be deleted", replicaVolumeId) + if err := future.WaitForCompletionRef(ctx, client.Client); err != nil { + return fmt.Errorf("waiting for the replica %s to be deleted: %+v", *replicaVolumeId, err) + } if err := waitForReplicationDeletion(ctx, client, *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.Delete(ctx, id.ResourceGroup, id.NetAppAccountName, id.CapacityPoolName, id.Name); err != nil { + future, err := client.Delete(ctx, id.ResourceGroup, id.NetAppAccountName, id.CapacityPoolName, id.Name, utils.Bool(true)) + if err != nil { return fmt.Errorf("deleting %s: %+v", *id, err) } log.Printf("[DEBUG] Waiting for %s to be deleted", *id) + if err := future.WaitForCompletionRef(ctx, client.Client); err != nil { + return fmt.Errorf("waiting for deletion of %q: %+v", id, err) + } if err := waitForVolumeDeletion(ctx, client, *id); err != nil { return fmt.Errorf("waiting for deletion of %s: %+v", *id, err) } diff --git a/internal/services/netapp/netapp_volume_resource_test.go b/internal/services/netapp/netapp_volume_resource_test.go index 5c297dac9f42..e7446864dcdf 100644 --- a/internal/services/netapp/netapp_volume_resource_test.go +++ b/internal/services/netapp/netapp_volume_resource_test.go @@ -6,6 +6,7 @@ import ( "os" "testing" + "github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp" "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" @@ -40,6 +41,23 @@ func TestAccNetAppVolume_nfsv41(t *testing.T) { Config: r.nfsv41(data), Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("network_features").HasValue(string(netapp.NetworkFeaturesBasic)), + ), + }, + data.ImportStep(), + }) +} + +func TestAccNetAppVolume_standardNetworkFeature(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_netapp_volume", "test") + r := NetAppVolumeResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.standardNetworkFeature(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("network_features").HasValue(string(netapp.NetworkFeaturesStandard)), ), }, data.ImportStep(), @@ -301,6 +319,27 @@ resource "azurerm_netapp_volume" "test" { `, template, data.RandomInteger, data.RandomInteger) } +func (NetAppVolumeResource) standardNetworkFeature(data acceptance.TestData) string { + template := NetAppVolumeResource{}.template(data) + return fmt.Sprintf(` +%s + +resource "azurerm_netapp_volume" "test" { + name = "acctest-NetAppVolume-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + account_name = azurerm_netapp_account.test.name + pool_name = azurerm_netapp_pool.test.name + volume_path = "my-unique-file-path-%d" + service_level = "Standard" + subnet_id = azurerm_subnet.test.id + network_features = "Standard" + protocols = ["NFSv3"] + storage_quota_in_gb = 100 +} +`, template, data.RandomInteger, data.RandomInteger) +} + func (NetAppVolumeResource) snapshotPolicy(data acceptance.TestData) string { template := NetAppVolumeResource{}.template(data) return fmt.Sprintf(` diff --git a/website/docs/d/netapp_volume.html.markdown b/website/docs/d/netapp_volume.html.markdown index 89f5518d142b..e27d6fa89b60 100644 --- a/website/docs/d/netapp_volume.html.markdown +++ b/website/docs/d/netapp_volume.html.markdown @@ -51,12 +51,14 @@ The following attributes are exported: * `subnet_id` - The ID of a Subnet in which the NetApp Volume resides. +* `network_features` - Network features in use `Basic` or `Standard`. + * `storage_quota_in_gb` - The maximum Storage Quota in Gigabytes allowed for a file system. * `security_style` - Volume security style * `data_protection_replication` - Volume data protection block -* + * `volume_path` - The unique file path of the volume. --- diff --git a/website/docs/r/netapp_volume.html.markdown b/website/docs/r/netapp_volume.html.markdown index 729304428125..d92e65367e0d 100644 --- a/website/docs/r/netapp_volume.html.markdown +++ b/website/docs/r/netapp_volume.html.markdown @@ -69,6 +69,7 @@ resource "azurerm_netapp_volume" "example" { volume_path = "my-unique-file-path" service_level = "Premium" subnet_id = azurerm_subnet.example.id + network_features = "Basic" protocols = ["NFSv4.1"] security_style = "Unix" storage_quota_in_gb = 100 @@ -118,6 +119,8 @@ The following arguments are supported: * `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 resource to be created. +* `network_features` - (Optional) Indicates which network feature to use, accepted values are `Basic` or `Standard`, it defaults to `Basic` if not defined. This is a feature in public preview and for more information about it and how to register, please refer to [Configure network features for an Azure NetApp Files volume](https://docs.microsoft.com/en-us/azure/azure-netapp-files/configure-network-features). + * `storage_quota_in_gb` - (Required) The maximum Storage Quota allowed for a file system in Gigabytes. * `snapshot_directory_visible` - (Optional) Specifies whether the .snapshot (NFS clients) or ~snapshot (SMB clients) path of a volume is visible, default value is true. From ad2111b38666fe217ccecca26f37ea18c6e77616 Mon Sep 17 00:00:00 2001 From: Paulo Date: Thu, 12 May 2022 09:55:27 -0700 Subject: [PATCH 02/12] Updated ANF SDK version, adding resource_group prevent deletion to be off --- .../services/netapp/netapp_snapshot_policy_resource.go | 2 +- .../services/netapp/netapp_volume_data_source_test.go | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/internal/services/netapp/netapp_snapshot_policy_resource.go b/internal/services/netapp/netapp_snapshot_policy_resource.go index fe96e7d8384f..78c363e8bc0e 100644 --- a/internal/services/netapp/netapp_snapshot_policy_resource.go +++ b/internal/services/netapp/netapp_snapshot_policy_resource.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp" + "github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp" "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_data_source_test.go b/internal/services/netapp/netapp_volume_data_source_test.go index bcf738b31d14..ee50c354b6bd 100644 --- a/internal/services/netapp/netapp_volume_data_source_test.go +++ b/internal/services/netapp/netapp_volume_data_source_test.go @@ -34,6 +34,15 @@ func (NetAppVolumeDataSource) basic(data acceptance.TestData) string { return fmt.Sprintf(` %s +provider "azurerm" { + alias = "all" + features { + resource_group { + prevent_deletion_if_contains_resources = false + } + } +} + data "azurerm_netapp_volume" "test" { resource_group_name = azurerm_netapp_volume.test.resource_group_name account_name = azurerm_netapp_volume.test.account_name From b8f8c5492fbddf6719dce4ce3bb99ce053ffe24b Mon Sep 17 00:00:00 2001 From: Paulo Date: Tue, 31 May 2022 14:48:43 -0700 Subject: [PATCH 03/12] Adding tags to avoid issues on MSFT testing environment --- .../netapp/netapp_volume_resource_test.go | 129 ++++++++++++++++-- 1 file changed, 119 insertions(+), 10 deletions(-) diff --git a/internal/services/netapp/netapp_volume_resource_test.go b/internal/services/netapp/netapp_volume_resource_test.go index e7446864dcdf..dc23140d5ede 100644 --- a/internal/services/netapp/netapp_volume_resource_test.go +++ b/internal/services/netapp/netapp_volume_resource_test.go @@ -157,7 +157,7 @@ func TestAccNetAppVolume_complete(t *testing.T) { check.That(data.ResourceName).Key("service_level").HasValue("Standard"), check.That(data.ResourceName).Key("storage_quota_in_gb").HasValue("101"), check.That(data.ResourceName).Key("export_policy_rule.#").HasValue("3"), - check.That(data.ResourceName).Key("tags.%").HasValue("1"), + check.That(data.ResourceName).Key("tags.%").HasValue("2"), check.That(data.ResourceName).Key("tags.FoO").HasValue("BaR"), check.That(data.ResourceName).Key("mount_ip_addresses.#").HasValue("1"), ), @@ -177,7 +177,7 @@ func TestAccNetAppVolume_update(t *testing.T) { check.That(data.ResourceName).ExistsInAzure(r), check.That(data.ResourceName).Key("storage_quota_in_gb").HasValue("100"), check.That(data.ResourceName).Key("export_policy_rule.#").HasValue("3"), - check.That(data.ResourceName).Key("tags.%").HasValue("1"), + check.That(data.ResourceName).Key("tags.%").HasValue("2"), check.That(data.ResourceName).Key("throughput_in_mibps").HasValue("1.6"), ), }, @@ -188,7 +188,7 @@ func TestAccNetAppVolume_update(t *testing.T) { check.That(data.ResourceName).ExistsInAzure(r), check.That(data.ResourceName).Key("storage_quota_in_gb").HasValue("101"), check.That(data.ResourceName).Key("export_policy_rule.#").HasValue("2"), - check.That(data.ResourceName).Key("tags.%").HasValue("2"), + check.That(data.ResourceName).Key("tags.%").HasValue("3"), check.That(data.ResourceName).Key("tags.FoO").HasValue("BaR"), check.That(data.ResourceName).Key("tags.bAr").HasValue("fOo"), check.That(data.ResourceName).Key("throughput_in_mibps").HasValue("65"), @@ -285,6 +285,10 @@ resource "azurerm_netapp_volume" "test" { service_level = "Standard" subnet_id = azurerm_subnet.test.id storage_quota_in_gb = 100 + + tags = { + "SkipASMAzSecPack" = "true" + } } `, template, data.RandomInteger, data.RandomInteger) } @@ -315,6 +319,10 @@ resource "azurerm_netapp_volume" "test" { unix_read_only = false unix_read_write = true } + + tags = { + "SkipASMAzSecPack" = "true" + } } `, template, data.RandomInteger, data.RandomInteger) } @@ -336,6 +344,10 @@ resource "azurerm_netapp_volume" "test" { network_features = "Standard" protocols = ["NFSv3"] storage_quota_in_gb = 100 + + tags = { + "SkipASMAzSecPack" = "true" + } } `, template, data.RandomInteger, data.RandomInteger) } @@ -377,6 +389,10 @@ resource "azurerm_netapp_volume" "test" { data_protection_snapshot_policy { snapshot_policy_id = azurerm_netapp_snapshot_policy.test.id } + + tags = { + "SkipASMAzSecPack" = "true" + } } `, template, data.RandomInteger) } @@ -406,6 +422,10 @@ resource "azurerm_netapp_volume" "test_primary" { unix_read_only = false unix_read_write = true } + + tags = { + "SkipASMAzSecPack" = "true" + } } resource "azurerm_netapp_volume" "test_secondary" { @@ -436,6 +456,10 @@ resource "azurerm_netapp_volume" "test_secondary" { remote_volume_resource_id = azurerm_netapp_volume.test_primary.id replication_frequency = "10minutes" } + + tags = { + "SkipASMAzSecPack" = "true" + } } `, template, data.RandomInteger, "germanywestcentral") } @@ -464,6 +488,10 @@ resource "azurerm_netapp_volume" "test" { protocols_enabled = ["NFSv3"] unix_read_only = false unix_read_write = true + }, + + tags = { + "SkipASMAzSecPack" = "true" } } @@ -496,6 +524,10 @@ resource "azurerm_netapp_volume" "test_snapshot_vol" { protocols_enabled = ["NFSv3"] unix_read_write = true } + + tags = { + "SkipASMAzSecPack" = "true" + } } `, template, data.RandomInteger) } @@ -526,6 +558,10 @@ resource "azurerm_netapp_volume" "test_snapshot_directory_visible_false" { unix_read_only = false unix_read_write = true } + + tags = { + "SkipASMAzSecPack" = "true" + } } `, template, data.RandomInteger) } @@ -590,7 +626,8 @@ resource "azurerm_netapp_volume" "test" { } tags = { - "FoO" = "BaR" + "FoO" = "BaR", + "SkipASMAzSecPack" = "true" } } `, r.template(data), data.RandomInteger, data.RandomInteger) @@ -638,7 +675,8 @@ resource "azurerm_netapp_volume" "test" { } tags = { - "FoO" = "BaR" + "FoO" = "BaR", + "SkipASMAzSecPack" = "true" } } `, r.templatePoolQosManual(data), data.RandomInteger, data.RandomInteger) @@ -679,7 +717,8 @@ resource "azurerm_netapp_volume" "test" { tags = { "FoO" = "BaR", - "bAr" = "fOo" + "bAr" = "fOo", + "SkipASMAzSecPack" = "true" } } `, r.templatePoolQosManual(data), data.RandomInteger, data.RandomInteger) @@ -694,6 +733,10 @@ resource "azurerm_virtual_network" "updated" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name address_space = ["10.1.0.0/16"] + + tags = { + "SkipASMAzSecPack" = "true" + } } resource "azurerm_subnet" "updated" { @@ -724,6 +767,10 @@ resource "azurerm_netapp_volume" "test" { protocols = ["NFSv3"] storage_quota_in_gb = 100 throughput_in_mibps = 1.6 + + tags = { + "SkipASMAzSecPack" = "true" + } } `, r.template(data), data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger) } @@ -754,7 +801,8 @@ resource "azurerm_netapp_volume" "test" { } tags = { - "FoO" = "BaR" + "FoO" = "BaR", + "SkipASMAzSecPack" = "true" } } `, r.template(data), data.RandomInteger, data.RandomInteger) @@ -769,6 +817,10 @@ resource "azurerm_virtual_network" "test_secondary" { location = "%[3]s" resource_group_name = azurerm_resource_group.test.name address_space = ["10.6.0.0/16"] + + tags = { + "SkipASMAzSecPack" = "true" + } } resource "azurerm_subnet" "test_secondary" { @@ -791,6 +843,10 @@ resource "azurerm_netapp_account" "test_secondary" { name = "acctest-NetAppAccount-secondary-%[2]d" location = "%[3]s" resource_group_name = azurerm_resource_group.test.name + + tags = { + "SkipASMAzSecPack" = "true" + } } resource "azurerm_netapp_pool" "test_secondary" { @@ -801,6 +857,10 @@ resource "azurerm_netapp_pool" "test_secondary" { service_level = "Standard" size_in_tb = 4 qos_type = "Manual" + + tags = { + "SkipASMAzSecPack" = "true" + } } `, r.template(data), data.RandomInteger, "germanywestcentral") } @@ -808,12 +868,21 @@ resource "azurerm_netapp_pool" "test_secondary" { func (NetAppVolumeResource) template(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { - features {} + alias = "all1" + features { + resource_group { + prevent_deletion_if_contains_resources = false + } + } } resource "azurerm_resource_group" "test" { name = "acctestRG-netapp-%d" location = "%s" + + tags = { + "SkipASMAzSecPack" = "true" + } } resource "azurerm_virtual_network" "test" { @@ -821,6 +890,10 @@ resource "azurerm_virtual_network" "test" { 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" { @@ -852,6 +925,10 @@ resource "azurerm_netapp_pool" "test" { account_name = azurerm_netapp_account.test.name service_level = "Standard" size_in_tb = 4 + + tags = { + "SkipASMAzSecPack" = "true" + } } `, data.RandomInteger, data.Locations.Ternary, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger) } @@ -859,12 +936,32 @@ resource "azurerm_netapp_pool" "test" { func (NetAppVolumeResource) templatePoolQosManual(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { - features {} + alias = "all2" + features { + resource_group { + prevent_deletion_if_contains_resources = false + } + } } resource "azurerm_resource_group" "test" { name = "acctestRG-netapp-%d" location = "%s" + + tags = { + "SkipASMAzSecPack" = "true" + } +} + +resource "azurerm_network_security_group" "test" { + name = "acctest-NSG-%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" { @@ -872,6 +969,10 @@ resource "azurerm_virtual_network" "test" { 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" { @@ -894,6 +995,10 @@ resource "azurerm_netapp_account" "test" { name = "acctest-NetAppAccount-%d" location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name + + tags = { + "SkipASMAzSecPack" = "true" + } } resource "azurerm_netapp_pool" "test" { @@ -904,6 +1009,10 @@ resource "azurerm_netapp_pool" "test" { service_level = "Standard" size_in_tb = 4 qos_type = "Manual" + + tags = { + "SkipASMAzSecPack" = "true" + } } -`, data.RandomInteger, data.Locations.Ternary, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger) +`, data.RandomInteger, data.Locations.Ternary, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger) } From 15e72c8b6ecbb3e079d52f60c1b47113260170b2 Mon Sep 17 00:00:00 2001 From: Paulo Date: Tue, 31 May 2022 16:29:05 -0700 Subject: [PATCH 04/12] Adding newer ANF SDK --- .../mgmt/2021-10-01/netapp/CHANGELOG.md | 2 + .../netapp/mgmt/2021-10-01/netapp/_meta.json | 11 + .../mgmt/2021-10-01/netapp/accountbackups.go | 290 + .../netapp/mgmt/2021-10-01/netapp/accounts.go | 629 ++ .../mgmt/2021-10-01/netapp/backuppolicies.go | 485 ++ .../netapp/mgmt/2021-10-01/netapp/backups.go | 741 +++ .../netapp/mgmt/2021-10-01/netapp/client.go | 41 + .../netapp/mgmt/2021-10-01/netapp/enums.go | 346 + .../netapp/mgmt/2021-10-01/netapp/models.go | 5721 +++++++++++++++++ .../mgmt/2021-10-01/netapp/operations.go | 98 + .../netapp/mgmt/2021-10-01/netapp/pools.go | 550 ++ .../netapp/mgmt/2021-10-01/netapp/resource.go | 284 + .../2021-10-01/netapp/resourcequotalimits.go | 182 + .../2021-10-01/netapp/snapshotpolicies.go | 569 ++ .../mgmt/2021-10-01/netapp/snapshots.go | 654 ++ .../mgmt/2021-10-01/netapp/subvolumes.go | 698 ++ .../netapp/mgmt/2021-10-01/netapp/vaults.go | 116 + .../netapp/mgmt/2021-10-01/netapp/version.go | 19 + .../mgmt/2021-10-01/netapp/volumegroups.go | 397 ++ .../netapp/mgmt/2021-10-01/netapp/volumes.go | 1422 ++++ 20 files changed, 13255 insertions(+) create mode 100755 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/CHANGELOG.md create mode 100755 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/_meta.json create mode 100755 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/accountbackups.go create mode 100755 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/accounts.go create mode 100755 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/backuppolicies.go create mode 100755 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/backups.go create mode 100755 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/client.go create mode 100755 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/enums.go create mode 100755 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/models.go create mode 100755 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/operations.go create mode 100755 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/pools.go create mode 100755 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/resource.go create mode 100755 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/resourcequotalimits.go create mode 100755 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/snapshotpolicies.go create mode 100755 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/snapshots.go create mode 100755 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/subvolumes.go create mode 100755 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/vaults.go create mode 100755 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/version.go create mode 100755 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/volumegroups.go create mode 100755 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/volumes.go diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/CHANGELOG.md new file mode 100755 index 000000000000..52911e4cc5e4 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/CHANGELOG.md @@ -0,0 +1,2 @@ +# Change History + diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/_meta.json b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/_meta.json new file mode 100755 index 000000000000..85e4ce68e842 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/_meta.json @@ -0,0 +1,11 @@ +{ + "commit": "bb9f1204f9a337404ff7e7b73b4c7b4ddde7f8f1", + "readme": "/_/azure-rest-api-specs/specification/netapp/resource-manager/readme.md", + "tag": "package-netapp-2021-10-01", + "use": "@microsoft.azure/autorest.go@2.1.187", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-netapp-2021-10-01 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix /_/azure-rest-api-specs/specification/netapp/resource-manager/readme.md", + "additional_properties": { + "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix" + } +} \ No newline at end of file diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/accountbackups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/accountbackups.go new file mode 100755 index 000000000000..0c1f8bb6327c --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/accountbackups.go @@ -0,0 +1,290 @@ +package netapp + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// AccountBackupsClient is the microsoft NetApp Files Azure Resource Provider specification +type AccountBackupsClient struct { + BaseClient +} + +// NewAccountBackupsClient creates an instance of the AccountBackupsClient client. +func NewAccountBackupsClient(subscriptionID string) AccountBackupsClient { + return NewAccountBackupsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAccountBackupsClientWithBaseURI creates an instance of the AccountBackupsClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewAccountBackupsClientWithBaseURI(baseURI string, subscriptionID string) AccountBackupsClient { + return AccountBackupsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Delete delete the specified Backup for a Netapp Account +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// backupName - the name of the backup +func (client AccountBackupsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, backupName string) (result AccountBackupsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountBackupsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.AccountBackupsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, backupName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.AccountBackupsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.AccountBackupsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client AccountBackupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, backupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "backupName": autorest.Encode("path", backupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups/{backupName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client AccountBackupsClient) DeleteSender(req *http.Request) (future AccountBackupsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client AccountBackupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the specified backup for a Netapp Account +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// backupName - the name of the backup +func (client AccountBackupsClient) Get(ctx context.Context, resourceGroupName string, accountName string, backupName string) (result Backup, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountBackupsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.AccountBackupsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, accountName, backupName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.AccountBackupsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.AccountBackupsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.AccountBackupsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client AccountBackupsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, backupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "backupName": autorest.Encode("path", backupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups/{backupName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client AccountBackupsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client AccountBackupsClient) GetResponder(resp *http.Response) (result Backup, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list all Backups for a Netapp Account +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +func (client AccountBackupsClient) List(ctx context.Context, resourceGroupName string, accountName string) (result BackupsList, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountBackupsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.AccountBackupsClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.AccountBackupsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.AccountBackupsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.AccountBackupsClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client AccountBackupsClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client AccountBackupsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client AccountBackupsClient) ListResponder(resp *http.Response) (result BackupsList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/accounts.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/accounts.go new file mode 100755 index 000000000000..2e1934acc518 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/accounts.go @@ -0,0 +1,629 @@ +package netapp + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// AccountsClient is the microsoft NetApp Files Azure Resource Provider specification +type AccountsClient struct { + BaseClient +} + +// NewAccountsClient creates an instance of the AccountsClient client. +func NewAccountsClient(subscriptionID string) AccountsClient { + return NewAccountsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAccountsClientWithBaseURI creates an instance of the AccountsClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewAccountsClientWithBaseURI(baseURI string, subscriptionID string) AccountsClient { + return AccountsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or update the specified NetApp account within the resource group +// Parameters: +// body - netApp Account object supplied in the body of the operation. +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +func (client AccountsClient) CreateOrUpdate(ctx context.Context, body Account, resourceGroupName string, accountName string) (result AccountsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: body, + Constraints: []validation.Constraint{{Target: "body.Location", Name: validation.Null, Rule: true, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.AccountsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, body, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client AccountsClient) CreateOrUpdatePreparer(ctx context.Context, body Account, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + body.ID = nil + body.Name = nil + body.Etag = nil + body.Type = nil + body.SystemData = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client AccountsClient) CreateOrUpdateSender(req *http.Request) (future AccountsCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client AccountsClient) CreateOrUpdateResponder(resp *http.Response) (result Account, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the specified NetApp account +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +func (client AccountsClient) Delete(ctx context.Context, resourceGroupName string, accountName string) (result AccountsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.AccountsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client AccountsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client AccountsClient) DeleteSender(req *http.Request) (future AccountsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client AccountsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get the NetApp account +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +func (client AccountsClient) Get(ctx context.Context, resourceGroupName string, accountName string) (result Account, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.AccountsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client AccountsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client AccountsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client AccountsClient) GetResponder(resp *http.Response) (result Account, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list and describe all NetApp accounts in the resource group. +// Parameters: +// resourceGroupName - the name of the resource group. +func (client AccountsClient) List(ctx context.Context, resourceGroupName string) (result AccountListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.List") + defer func() { + sc := -1 + if result.al.Response.Response != nil { + sc = result.al.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.AccountsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.al.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "List", resp, "Failure sending request") + return + } + + result.al, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "List", resp, "Failure responding to request") + return + } + if result.al.hasNextLink() && result.al.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client AccountsClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client AccountsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client AccountsClient) ListResponder(resp *http.Response) (result AccountList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client AccountsClient) listNextResults(ctx context.Context, lastResults AccountList) (result AccountList, err error) { + req, err := lastResults.accountListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "netapp.AccountsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "netapp.AccountsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client AccountsClient) ListComplete(ctx context.Context, resourceGroupName string) (result AccountListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName) + return +} + +// ListBySubscription list and describe all NetApp accounts in the subscription. +func (client AccountsClient) ListBySubscription(ctx context.Context) (result AccountListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.ListBySubscription") + defer func() { + sc := -1 + if result.al.Response.Response != nil { + sc = result.al.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.al.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.al, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "ListBySubscription", resp, "Failure responding to request") + return + } + if result.al.hasNextLink() && result.al.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client AccountsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/netAppAccounts", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySubscriptionSender sends the ListBySubscription request. The method will close the +// http.Response Body if it receives an error. +func (client AccountsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always +// closes the http.Response Body. +func (client AccountsClient) ListBySubscriptionResponder(resp *http.Response) (result AccountList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySubscriptionNextResults retrieves the next set of results, if any. +func (client AccountsClient) listBySubscriptionNextResults(ctx context.Context, lastResults AccountList) (result AccountList, err error) { + req, err := lastResults.accountListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "netapp.AccountsClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "netapp.AccountsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client AccountsClient) ListBySubscriptionComplete(ctx context.Context) (result AccountListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.ListBySubscription") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListBySubscription(ctx) + return +} + +// Update patch the specified NetApp account +// Parameters: +// body - netApp Account object supplied in the body of the operation. +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +func (client AccountsClient) Update(ctx context.Context, body AccountPatch, resourceGroupName string, accountName string) (result AccountsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.AccountsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, body, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client AccountsClient) UpdatePreparer(ctx context.Context, body AccountPatch, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + body.ID = nil + body.Name = nil + body.Type = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client AccountsClient) UpdateSender(req *http.Request) (future AccountsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client AccountsClient) UpdateResponder(resp *http.Response) (result Account, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/backuppolicies.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/backuppolicies.go new file mode 100755 index 000000000000..2073c2dd3d49 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/backuppolicies.go @@ -0,0 +1,485 @@ +package netapp + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// BackupPoliciesClient is the microsoft NetApp Files Azure Resource Provider specification +type BackupPoliciesClient struct { + BaseClient +} + +// NewBackupPoliciesClient creates an instance of the BackupPoliciesClient client. +func NewBackupPoliciesClient(subscriptionID string) BackupPoliciesClient { + return NewBackupPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewBackupPoliciesClientWithBaseURI creates an instance of the BackupPoliciesClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewBackupPoliciesClientWithBaseURI(baseURI string, subscriptionID string) BackupPoliciesClient { + return BackupPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create create a backup policy for Netapp Account +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// backupPolicyName - backup policy Name which uniquely identify backup policy. +// body - backup policy object supplied in the body of the operation. +func (client BackupPoliciesClient) Create(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string, body BackupPolicy) (result BackupPoliciesCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BackupPoliciesClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: body, + Constraints: []validation.Constraint{{Target: "body.Location", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "body.BackupPolicyProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.BackupPoliciesClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, accountName, backupPolicyName, body) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client BackupPoliciesClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string, body BackupPolicy) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "backupPolicyName": autorest.Encode("path", backupPolicyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + body.ID = nil + body.Name = nil + body.Etag = nil + body.Type = nil + body.SystemData = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client BackupPoliciesClient) CreateSender(req *http.Request) (future BackupPoliciesCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client BackupPoliciesClient) CreateResponder(resp *http.Response) (result BackupPolicy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete backup policy +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// backupPolicyName - backup policy Name which uniquely identify backup policy. +func (client BackupPoliciesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string) (result BackupPoliciesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BackupPoliciesClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.BackupPoliciesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, backupPolicyName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client BackupPoliciesClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "backupPolicyName": autorest.Encode("path", backupPolicyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client BackupPoliciesClient) DeleteSender(req *http.Request) (future BackupPoliciesDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client BackupPoliciesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get a particular backup Policy +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// backupPolicyName - backup policy Name which uniquely identify backup policy. +func (client BackupPoliciesClient) Get(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string) (result BackupPolicy, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BackupPoliciesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.BackupPoliciesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, accountName, backupPolicyName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client BackupPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "backupPolicyName": autorest.Encode("path", backupPolicyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client BackupPoliciesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client BackupPoliciesClient) GetResponder(resp *http.Response) (result BackupPolicy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list backup policies for Netapp Account +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +func (client BackupPoliciesClient) List(ctx context.Context, resourceGroupName string, accountName string) (result BackupPoliciesList, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BackupPoliciesClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.BackupPoliciesClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client BackupPoliciesClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client BackupPoliciesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client BackupPoliciesClient) ListResponder(resp *http.Response) (result BackupPoliciesList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update patch a backup policy for Netapp Account +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// backupPolicyName - backup policy Name which uniquely identify backup policy. +// body - backup policy object supplied in the body of the operation. +func (client BackupPoliciesClient) Update(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string, body BackupPolicyPatch) (result BackupPoliciesUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BackupPoliciesClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.BackupPoliciesClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, accountName, backupPolicyName, body) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client BackupPoliciesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string, body BackupPolicyPatch) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "backupPolicyName": autorest.Encode("path", backupPolicyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + body.ID = nil + body.Name = nil + body.Type = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client BackupPoliciesClient) UpdateSender(req *http.Request) (future BackupPoliciesUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client BackupPoliciesClient) UpdateResponder(resp *http.Response) (result BackupPolicy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/backups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/backups.go new file mode 100755 index 000000000000..e430721365de --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/backups.go @@ -0,0 +1,741 @@ +package netapp + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// BackupsClient is the microsoft NetApp Files Azure Resource Provider specification +type BackupsClient struct { + BaseClient +} + +// NewBackupsClient creates an instance of the BackupsClient client. +func NewBackupsClient(subscriptionID string) BackupsClient { + return NewBackupsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewBackupsClientWithBaseURI creates an instance of the BackupsClient client using a custom endpoint. Use this when +// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewBackupsClientWithBaseURI(baseURI string, subscriptionID string) BackupsClient { + return BackupsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create create a backup for the volume +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +// volumeName - the name of the volume +// backupName - the name of the backup +// body - backup object supplied in the body of the operation. +func (client BackupsClient) Create(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string, body Backup) (result BackupsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BackupsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: poolName, + Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, + {TargetValue: volumeName, + Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, + {TargetValue: body, + Constraints: []validation.Constraint{{Target: "body.Location", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "body.BackupProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "body.BackupProperties.BackupID", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "body.BackupProperties.BackupID", Name: validation.MaxLength, Rule: 36, Chain: nil}, + {Target: "body.BackupProperties.BackupID", Name: validation.MinLength, Rule: 36, Chain: nil}, + {Target: "body.BackupProperties.BackupID", Name: validation.Pattern, Rule: `^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$`, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("netapp.BackupsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, accountName, poolName, volumeName, backupName, body) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client BackupsClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string, body Backup) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "backupName": autorest.Encode("path", backupName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "volumeName": autorest.Encode("path", volumeName), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + body.ID = nil + body.Name = nil + body.Type = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client BackupsClient) CreateSender(req *http.Request) (future BackupsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client BackupsClient) CreateResponder(resp *http.Response) (result Backup, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete a backup of the volume +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +// volumeName - the name of the volume +// backupName - the name of the backup +func (client BackupsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string) (result BackupsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BackupsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: poolName, + Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, + {TargetValue: volumeName, + Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.BackupsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, poolName, volumeName, backupName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client BackupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "backupName": autorest.Encode("path", backupName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "volumeName": autorest.Encode("path", volumeName), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client BackupsClient) DeleteSender(req *http.Request) (future BackupsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client BackupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the specified backup of the volume +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +// volumeName - the name of the volume +// backupName - the name of the backup +func (client BackupsClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string) (result Backup, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BackupsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: poolName, + Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, + {TargetValue: volumeName, + Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.BackupsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, accountName, poolName, volumeName, backupName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client BackupsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "backupName": autorest.Encode("path", backupName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "volumeName": autorest.Encode("path", volumeName), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client BackupsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client BackupsClient) GetResponder(resp *http.Response) (result Backup, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetStatus get the status of the backup for a volume +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +// volumeName - the name of the volume +func (client BackupsClient) GetStatus(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result BackupStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BackupsClient.GetStatus") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: poolName, + Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, + {TargetValue: volumeName, + Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.BackupsClient", "GetStatus", err.Error()) + } + + req, err := client.GetStatusPreparer(ctx, resourceGroupName, accountName, poolName, volumeName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "GetStatus", nil, "Failure preparing request") + return + } + + resp, err := client.GetStatusSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "GetStatus", resp, "Failure sending request") + return + } + + result, err = client.GetStatusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "GetStatus", resp, "Failure responding to request") + return + } + + return +} + +// GetStatusPreparer prepares the GetStatus request. +func (client BackupsClient) GetStatusPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "volumeName": autorest.Encode("path", volumeName), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backupStatus", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetStatusSender sends the GetStatus request. The method will close the +// http.Response Body if it receives an error. +func (client BackupsClient) GetStatusSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetStatusResponder handles the response to the GetStatus request. The method always +// closes the http.Response Body. +func (client BackupsClient) GetStatusResponder(resp *http.Response) (result BackupStatus, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetVolumeRestoreStatus get the status of the restore for a volume +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +// volumeName - the name of the volume +func (client BackupsClient) GetVolumeRestoreStatus(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result RestoreStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BackupsClient.GetVolumeRestoreStatus") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: poolName, + Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, + {TargetValue: volumeName, + Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.BackupsClient", "GetVolumeRestoreStatus", err.Error()) + } + + req, err := client.GetVolumeRestoreStatusPreparer(ctx, resourceGroupName, accountName, poolName, volumeName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "GetVolumeRestoreStatus", nil, "Failure preparing request") + return + } + + resp, err := client.GetVolumeRestoreStatusSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "GetVolumeRestoreStatus", resp, "Failure sending request") + return + } + + result, err = client.GetVolumeRestoreStatusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "GetVolumeRestoreStatus", resp, "Failure responding to request") + return + } + + return +} + +// GetVolumeRestoreStatusPreparer prepares the GetVolumeRestoreStatus request. +func (client BackupsClient) GetVolumeRestoreStatusPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "volumeName": autorest.Encode("path", volumeName), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/restoreStatus", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetVolumeRestoreStatusSender sends the GetVolumeRestoreStatus request. The method will close the +// http.Response Body if it receives an error. +func (client BackupsClient) GetVolumeRestoreStatusSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetVolumeRestoreStatusResponder handles the response to the GetVolumeRestoreStatus request. The method always +// closes the http.Response Body. +func (client BackupsClient) GetVolumeRestoreStatusResponder(resp *http.Response) (result RestoreStatus, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list all backups for a volume +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +// volumeName - the name of the volume +func (client BackupsClient) List(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result BackupsList, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BackupsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: poolName, + Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, + {TargetValue: volumeName, + Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.BackupsClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, resourceGroupName, accountName, poolName, volumeName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client BackupsClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "volumeName": autorest.Encode("path", volumeName), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client BackupsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client BackupsClient) ListResponder(resp *http.Response) (result BackupsList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update patch a backup for the volume +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +// volumeName - the name of the volume +// backupName - the name of the backup +// body - backup object supplied in the body of the operation. +func (client BackupsClient) Update(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string, body *BackupPatch) (result BackupsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BackupsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: poolName, + Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, + {TargetValue: volumeName, + Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.BackupsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, accountName, poolName, volumeName, backupName, body) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client BackupsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string, body *BackupPatch) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "backupName": autorest.Encode("path", backupName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "volumeName": autorest.Encode("path", volumeName), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if body != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(body)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client BackupsClient) UpdateSender(req *http.Request) (future BackupsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client BackupsClient) UpdateResponder(resp *http.Response) (result Backup, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/client.go new file mode 100755 index 000000000000..780c3590d75f --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/client.go @@ -0,0 +1,41 @@ +// Package netapp implements the Azure ARM Netapp service API version 2021-10-01. +// +// Microsoft NetApp Files Azure Resource Provider specification +package netapp + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // DefaultBaseURI is the default URI used for the service Netapp + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Netapp. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with +// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + } +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/enums.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/enums.go new file mode 100755 index 000000000000..8fa945a3125e --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/enums.go @@ -0,0 +1,346 @@ +package netapp + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// ActiveDirectoryStatus enumerates the values for active directory status. +type ActiveDirectoryStatus string + +const ( + // ActiveDirectoryStatusCreated Active Directory created but not in use + ActiveDirectoryStatusCreated ActiveDirectoryStatus = "Created" + // ActiveDirectoryStatusDeleted Active Directory Deleted + ActiveDirectoryStatusDeleted ActiveDirectoryStatus = "Deleted" + // ActiveDirectoryStatusError Error with the Active Directory + ActiveDirectoryStatusError ActiveDirectoryStatus = "Error" + // ActiveDirectoryStatusInUse Active Directory in use by SMB Volume + ActiveDirectoryStatusInUse ActiveDirectoryStatus = "InUse" + // ActiveDirectoryStatusUpdating Active Directory Updating + ActiveDirectoryStatusUpdating ActiveDirectoryStatus = "Updating" +) + +// PossibleActiveDirectoryStatusValues returns an array of possible values for the ActiveDirectoryStatus const type. +func PossibleActiveDirectoryStatusValues() []ActiveDirectoryStatus { + return []ActiveDirectoryStatus{ActiveDirectoryStatusCreated, ActiveDirectoryStatusDeleted, ActiveDirectoryStatusError, ActiveDirectoryStatusInUse, ActiveDirectoryStatusUpdating} +} + +// ApplicationType enumerates the values for application type. +type ApplicationType string + +const ( + // ApplicationTypeSAPHANA ... + ApplicationTypeSAPHANA ApplicationType = "SAP-HANA" +) + +// PossibleApplicationTypeValues returns an array of possible values for the ApplicationType const type. +func PossibleApplicationTypeValues() []ApplicationType { + return []ApplicationType{ApplicationTypeSAPHANA} +} + +// AvsDataStore enumerates the values for avs data store. +type AvsDataStore string + +const ( + // AvsDataStoreDisabled avsDataStore is disabled + AvsDataStoreDisabled AvsDataStore = "Disabled" + // AvsDataStoreEnabled avsDataStore is enabled + AvsDataStoreEnabled AvsDataStore = "Enabled" +) + +// PossibleAvsDataStoreValues returns an array of possible values for the AvsDataStore const type. +func PossibleAvsDataStoreValues() []AvsDataStore { + return []AvsDataStore{AvsDataStoreDisabled, AvsDataStoreEnabled} +} + +// BackupType enumerates the values for backup type. +type BackupType string + +const ( + // BackupTypeManual Manual backup + BackupTypeManual BackupType = "Manual" + // BackupTypeScheduled Scheduled backup + BackupTypeScheduled BackupType = "Scheduled" +) + +// PossibleBackupTypeValues returns an array of possible values for the BackupType const type. +func PossibleBackupTypeValues() []BackupType { + return []BackupType{BackupTypeManual, BackupTypeScheduled} +} + +// CheckNameResourceTypes enumerates the values for check name resource types. +type CheckNameResourceTypes string + +const ( + // CheckNameResourceTypesMicrosoftNetAppnetAppAccounts ... + CheckNameResourceTypesMicrosoftNetAppnetAppAccounts CheckNameResourceTypes = "Microsoft.NetApp/netAppAccounts" + // CheckNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPools ... + CheckNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPools CheckNameResourceTypes = "Microsoft.NetApp/netAppAccounts/capacityPools" + // CheckNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumes ... + CheckNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumes CheckNameResourceTypes = "Microsoft.NetApp/netAppAccounts/capacityPools/volumes" + // CheckNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumessnapshots ... + CheckNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumessnapshots CheckNameResourceTypes = "Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots" +) + +// PossibleCheckNameResourceTypesValues returns an array of possible values for the CheckNameResourceTypes const type. +func PossibleCheckNameResourceTypesValues() []CheckNameResourceTypes { + return []CheckNameResourceTypes{CheckNameResourceTypesMicrosoftNetAppnetAppAccounts, CheckNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPools, CheckNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumes, CheckNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumessnapshots} +} + +// CheckQuotaNameResourceTypes enumerates the values for check quota name resource types. +type CheckQuotaNameResourceTypes string + +const ( + // CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccounts ... + CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccounts CheckQuotaNameResourceTypes = "Microsoft.NetApp/netAppAccounts" + // CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPools ... + CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPools CheckQuotaNameResourceTypes = "Microsoft.NetApp/netAppAccounts/capacityPools" + // CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumes ... + CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumes CheckQuotaNameResourceTypes = "Microsoft.NetApp/netAppAccounts/capacityPools/volumes" + // CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumessnapshots ... + CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumessnapshots CheckQuotaNameResourceTypes = "Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots" +) + +// PossibleCheckQuotaNameResourceTypesValues returns an array of possible values for the CheckQuotaNameResourceTypes const type. +func PossibleCheckQuotaNameResourceTypesValues() []CheckQuotaNameResourceTypes { + return []CheckQuotaNameResourceTypes{CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccounts, CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPools, CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumes, CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumessnapshots} +} + +// ChownMode enumerates the values for chown mode. +type ChownMode string + +const ( + // ChownModeRestricted ... + ChownModeRestricted ChownMode = "Restricted" + // ChownModeUnrestricted ... + ChownModeUnrestricted ChownMode = "Unrestricted" +) + +// PossibleChownModeValues returns an array of possible values for the ChownMode const type. +func PossibleChownModeValues() []ChownMode { + return []ChownMode{ChownModeRestricted, ChownModeUnrestricted} +} + +// CreatedByType enumerates the values for created by type. +type CreatedByType string + +const ( + // CreatedByTypeApplication ... + CreatedByTypeApplication CreatedByType = "Application" + // CreatedByTypeKey ... + CreatedByTypeKey CreatedByType = "Key" + // CreatedByTypeManagedIdentity ... + CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" + // CreatedByTypeUser ... + CreatedByTypeUser CreatedByType = "User" +) + +// PossibleCreatedByTypeValues returns an array of possible values for the CreatedByType const type. +func PossibleCreatedByTypeValues() []CreatedByType { + return []CreatedByType{CreatedByTypeApplication, CreatedByTypeKey, CreatedByTypeManagedIdentity, CreatedByTypeUser} +} + +// EnableSubvolumes enumerates the values for enable subvolumes. +type EnableSubvolumes string + +const ( + // EnableSubvolumesDisabled subvolumes are not enabled + EnableSubvolumesDisabled EnableSubvolumes = "Disabled" + // EnableSubvolumesEnabled subvolumes are enabled + EnableSubvolumesEnabled EnableSubvolumes = "Enabled" +) + +// PossibleEnableSubvolumesValues returns an array of possible values for the EnableSubvolumes const type. +func PossibleEnableSubvolumesValues() []EnableSubvolumes { + return []EnableSubvolumes{EnableSubvolumesDisabled, EnableSubvolumesEnabled} +} + +// EncryptionType enumerates the values for encryption type. +type EncryptionType string + +const ( + // EncryptionTypeDouble EncryptionType Double, volumes will use double encryption at rest + EncryptionTypeDouble EncryptionType = "Double" + // EncryptionTypeSingle EncryptionType Single, volumes will use single encryption at rest + EncryptionTypeSingle EncryptionType = "Single" +) + +// PossibleEncryptionTypeValues returns an array of possible values for the EncryptionType const type. +func PossibleEncryptionTypeValues() []EncryptionType { + return []EncryptionType{EncryptionTypeDouble, EncryptionTypeSingle} +} + +// EndpointType enumerates the values for endpoint type. +type EndpointType string + +const ( + // EndpointTypeDst ... + EndpointTypeDst EndpointType = "dst" + // EndpointTypeSrc ... + EndpointTypeSrc EndpointType = "src" +) + +// PossibleEndpointTypeValues returns an array of possible values for the EndpointType const type. +func PossibleEndpointTypeValues() []EndpointType { + return []EndpointType{EndpointTypeDst, EndpointTypeSrc} +} + +// InAvailabilityReasonType enumerates the values for in availability reason type. +type InAvailabilityReasonType string + +const ( + // InAvailabilityReasonTypeAlreadyExists ... + InAvailabilityReasonTypeAlreadyExists InAvailabilityReasonType = "AlreadyExists" + // InAvailabilityReasonTypeInvalid ... + InAvailabilityReasonTypeInvalid InAvailabilityReasonType = "Invalid" +) + +// PossibleInAvailabilityReasonTypeValues returns an array of possible values for the InAvailabilityReasonType const type. +func PossibleInAvailabilityReasonTypeValues() []InAvailabilityReasonType { + return []InAvailabilityReasonType{InAvailabilityReasonTypeAlreadyExists, InAvailabilityReasonTypeInvalid} +} + +// MetricAggregationType enumerates the values for metric aggregation type. +type MetricAggregationType string + +const ( + // MetricAggregationTypeAverage ... + MetricAggregationTypeAverage MetricAggregationType = "Average" +) + +// PossibleMetricAggregationTypeValues returns an array of possible values for the MetricAggregationType const type. +func PossibleMetricAggregationTypeValues() []MetricAggregationType { + return []MetricAggregationType{MetricAggregationTypeAverage} +} + +// MirrorState enumerates the values for mirror state. +type MirrorState string + +const ( + // MirrorStateBroken ... + MirrorStateBroken MirrorState = "Broken" + // MirrorStateMirrored ... + MirrorStateMirrored MirrorState = "Mirrored" + // MirrorStateUninitialized ... + MirrorStateUninitialized MirrorState = "Uninitialized" +) + +// PossibleMirrorStateValues returns an array of possible values for the MirrorState const type. +func PossibleMirrorStateValues() []MirrorState { + return []MirrorState{MirrorStateBroken, MirrorStateMirrored, MirrorStateUninitialized} +} + +// NetworkFeatures enumerates the values for network features. +type NetworkFeatures string + +const ( + // NetworkFeaturesBasic Basic network feature. + NetworkFeaturesBasic NetworkFeatures = "Basic" + // NetworkFeaturesStandard Standard network feature. + NetworkFeaturesStandard NetworkFeatures = "Standard" +) + +// PossibleNetworkFeaturesValues returns an array of possible values for the NetworkFeatures const type. +func PossibleNetworkFeaturesValues() []NetworkFeatures { + return []NetworkFeatures{NetworkFeaturesBasic, NetworkFeaturesStandard} +} + +// QosType enumerates the values for qos type. +type QosType string + +const ( + // QosTypeAuto qos type Auto + QosTypeAuto QosType = "Auto" + // QosTypeManual qos type Manual + QosTypeManual QosType = "Manual" +) + +// PossibleQosTypeValues returns an array of possible values for the QosType const type. +func PossibleQosTypeValues() []QosType { + return []QosType{QosTypeAuto, QosTypeManual} +} + +// RelationshipStatus enumerates the values for relationship status. +type RelationshipStatus string + +const ( + // RelationshipStatusIdle ... + RelationshipStatusIdle RelationshipStatus = "Idle" + // RelationshipStatusTransferring ... + RelationshipStatusTransferring RelationshipStatus = "Transferring" +) + +// PossibleRelationshipStatusValues returns an array of possible values for the RelationshipStatus const type. +func PossibleRelationshipStatusValues() []RelationshipStatus { + return []RelationshipStatus{RelationshipStatusIdle, RelationshipStatusTransferring} +} + +// ReplicationSchedule enumerates the values for replication schedule. +type ReplicationSchedule string + +const ( + // ReplicationSchedule10minutely ... + ReplicationSchedule10minutely ReplicationSchedule = "_10minutely" + // ReplicationScheduleDaily ... + ReplicationScheduleDaily ReplicationSchedule = "daily" + // ReplicationScheduleHourly ... + ReplicationScheduleHourly ReplicationSchedule = "hourly" +) + +// PossibleReplicationScheduleValues returns an array of possible values for the ReplicationSchedule const type. +func PossibleReplicationScheduleValues() []ReplicationSchedule { + return []ReplicationSchedule{ReplicationSchedule10minutely, ReplicationScheduleDaily, ReplicationScheduleHourly} +} + +// SecurityStyle enumerates the values for security style. +type SecurityStyle string + +const ( + // SecurityStyleNtfs ... + SecurityStyleNtfs SecurityStyle = "ntfs" + // SecurityStyleUnix ... + SecurityStyleUnix SecurityStyle = "unix" +) + +// PossibleSecurityStyleValues returns an array of possible values for the SecurityStyle const type. +func PossibleSecurityStyleValues() []SecurityStyle { + return []SecurityStyle{SecurityStyleNtfs, SecurityStyleUnix} +} + +// ServiceLevel enumerates the values for service level. +type ServiceLevel string + +const ( + // ServiceLevelPremium Premium service level + ServiceLevelPremium ServiceLevel = "Premium" + // ServiceLevelStandard Standard service level + ServiceLevelStandard ServiceLevel = "Standard" + // ServiceLevelStandardZRS Zone redundant storage service level + ServiceLevelStandardZRS ServiceLevel = "StandardZRS" + // ServiceLevelUltra Ultra service level + ServiceLevelUltra ServiceLevel = "Ultra" +) + +// PossibleServiceLevelValues returns an array of possible values for the ServiceLevel const type. +func PossibleServiceLevelValues() []ServiceLevel { + return []ServiceLevel{ServiceLevelPremium, ServiceLevelStandard, ServiceLevelStandardZRS, ServiceLevelUltra} +} + +// VolumeStorageToNetworkProximity enumerates the values for volume storage to network proximity. +type VolumeStorageToNetworkProximity string + +const ( + // VolumeStorageToNetworkProximityDefault Basic storage to network connectivity. + VolumeStorageToNetworkProximityDefault VolumeStorageToNetworkProximity = "Default" + // VolumeStorageToNetworkProximityT1 Standard T1 storage to network connectivity. + VolumeStorageToNetworkProximityT1 VolumeStorageToNetworkProximity = "T1" + // VolumeStorageToNetworkProximityT2 Standard T2 storage to network connectivity. + VolumeStorageToNetworkProximityT2 VolumeStorageToNetworkProximity = "T2" +) + +// PossibleVolumeStorageToNetworkProximityValues returns an array of possible values for the VolumeStorageToNetworkProximity const type. +func PossibleVolumeStorageToNetworkProximityValues() []VolumeStorageToNetworkProximity { + return []VolumeStorageToNetworkProximity{VolumeStorageToNetworkProximityDefault, VolumeStorageToNetworkProximityT1, VolumeStorageToNetworkProximityT2} +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/models.go new file mode 100755 index 000000000000..81c786643da8 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/models.go @@ -0,0 +1,5721 @@ +package netapp + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp" + +// Account netApp account resource +type Account struct { + autorest.Response `json:"-"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` + // AccountProperties - NetApp Account properties + *AccountProperties `json:"properties,omitempty"` + // SystemData - READ-ONLY; The system meta data relating to this resource. + SystemData *SystemData `json:"systemData,omitempty"` +} + +// MarshalJSON is the custom marshaler for Account. +func (a Account) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if a.Location != nil { + objectMap["location"] = a.Location + } + if a.Tags != nil { + objectMap["tags"] = a.Tags + } + if a.AccountProperties != nil { + objectMap["properties"] = a.AccountProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Account struct. +func (a *Account) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + a.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + a.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + a.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + a.Etag = &etag + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + a.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + a.Tags = tags + } + case "properties": + if v != nil { + var accountProperties AccountProperties + err = json.Unmarshal(*v, &accountProperties) + if err != nil { + return err + } + a.AccountProperties = &accountProperties + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + a.SystemData = &systemData + } + } + } + + return nil +} + +// AccountBackupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type AccountBackupsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AccountBackupsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AccountBackupsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AccountBackupsDeleteFuture.Result. +func (future *AccountBackupsDeleteFuture) result(client AccountBackupsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.AccountBackupsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("netapp.AccountBackupsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// AccountEncryption encryption settings +type AccountEncryption struct { + // KeySource - Encryption Key Source. Possible values are: 'Microsoft.NetApp'. + KeySource *string `json:"keySource,omitempty"` +} + +// AccountList list of NetApp account resources +type AccountList struct { + autorest.Response `json:"-"` + // Value - Multiple NetApp accounts + Value *[]Account `json:"value,omitempty"` + // NextLink - URL to get the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// AccountListIterator provides access to a complete listing of Account values. +type AccountListIterator struct { + i int + page AccountListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *AccountListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *AccountListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AccountListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter AccountListIterator) Response() AccountList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter AccountListIterator) Value() Account { + if !iter.page.NotDone() { + return Account{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the AccountListIterator type. +func NewAccountListIterator(page AccountListPage) AccountListIterator { + return AccountListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (al AccountList) IsEmpty() bool { + return al.Value == nil || len(*al.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (al AccountList) hasNextLink() bool { + return al.NextLink != nil && len(*al.NextLink) != 0 +} + +// accountListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (al AccountList) accountListPreparer(ctx context.Context) (*http.Request, error) { + if !al.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(al.NextLink))) +} + +// AccountListPage contains a page of Account values. +type AccountListPage struct { + fn func(context.Context, AccountList) (AccountList, error) + al AccountList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *AccountListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.al) + if err != nil { + return err + } + page.al = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *AccountListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AccountListPage) NotDone() bool { + return !page.al.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AccountListPage) Response() AccountList { + return page.al +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AccountListPage) Values() []Account { + if page.al.IsEmpty() { + return nil + } + return *page.al.Value +} + +// Creates a new instance of the AccountListPage type. +func NewAccountListPage(cur AccountList, getNextPage func(context.Context, AccountList) (AccountList, error)) AccountListPage { + return AccountListPage{ + fn: getNextPage, + al: cur, + } +} + +// AccountPatch netApp account patch resource +type AccountPatch struct { + // Location - Resource location + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` + // AccountProperties - NetApp Account properties + *AccountProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for AccountPatch. +func (ap AccountPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ap.Location != nil { + objectMap["location"] = ap.Location + } + if ap.Tags != nil { + objectMap["tags"] = ap.Tags + } + if ap.AccountProperties != nil { + objectMap["properties"] = ap.AccountProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AccountPatch struct. +func (ap *AccountPatch) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ap.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ap.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ap.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ap.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ap.Tags = tags + } + case "properties": + if v != nil { + var accountProperties AccountProperties + err = json.Unmarshal(*v, &accountProperties) + if err != nil { + return err + } + ap.AccountProperties = &accountProperties + } + } + } + + return nil +} + +// AccountProperties netApp account properties +type AccountProperties struct { + // ProvisioningState - READ-ONLY; Azure lifecycle management + ProvisioningState *string `json:"provisioningState,omitempty"` + // ActiveDirectories - Active Directories + ActiveDirectories *[]ActiveDirectory `json:"activeDirectories,omitempty"` + // Encryption - Encryption settings + Encryption *AccountEncryption `json:"encryption,omitempty"` +} + +// MarshalJSON is the custom marshaler for AccountProperties. +func (ap AccountProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ap.ActiveDirectories != nil { + objectMap["activeDirectories"] = ap.ActiveDirectories + } + if ap.Encryption != nil { + objectMap["encryption"] = ap.Encryption + } + return json.Marshal(objectMap) +} + +// AccountsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type AccountsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AccountsClient) (Account, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AccountsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AccountsCreateOrUpdateFuture.Result. +func (future *AccountsCreateOrUpdateFuture) result(client AccountsClient) (a Account, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.AccountsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + a.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("netapp.AccountsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if a.Response.Response, err = future.GetResult(sender); err == nil && a.Response.Response.StatusCode != http.StatusNoContent { + a, err = client.CreateOrUpdateResponder(a.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.AccountsCreateOrUpdateFuture", "Result", a.Response.Response, "Failure responding to request") + } + } + return +} + +// AccountsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type AccountsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AccountsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AccountsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AccountsDeleteFuture.Result. +func (future *AccountsDeleteFuture) result(client AccountsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.AccountsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("netapp.AccountsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// AccountsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type AccountsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AccountsClient) (Account, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AccountsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AccountsUpdateFuture.Result. +func (future *AccountsUpdateFuture) result(client AccountsClient) (a Account, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.AccountsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + a.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("netapp.AccountsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if a.Response.Response, err = future.GetResult(sender); err == nil && a.Response.Response.StatusCode != http.StatusNoContent { + a, err = client.UpdateResponder(a.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.AccountsUpdateFuture", "Result", a.Response.Response, "Failure responding to request") + } + } + return +} + +// ActiveDirectory active Directory +type ActiveDirectory struct { + // ActiveDirectoryID - Id of the Active Directory + ActiveDirectoryID *string `json:"activeDirectoryId,omitempty"` + // Username - Username of Active Directory domain administrator + Username *string `json:"username,omitempty"` + // Password - Plain text password of Active Directory domain administrator, value is masked in the response + Password *string `json:"password,omitempty"` + // Domain - Name of the Active Directory domain + Domain *string `json:"domain,omitempty"` + // DNS - Comma separated list of DNS server IP addresses (IPv4 only) for the Active Directory domain + DNS *string `json:"dns,omitempty"` + // Status - READ-ONLY; Status of the Active Directory. Possible values include: 'ActiveDirectoryStatusCreated', 'ActiveDirectoryStatusInUse', 'ActiveDirectoryStatusDeleted', 'ActiveDirectoryStatusError', 'ActiveDirectoryStatusUpdating' + Status ActiveDirectoryStatus `json:"status,omitempty"` + // StatusDetails - READ-ONLY; Any details in regards to the Status of the Active Directory + StatusDetails *string `json:"statusDetails,omitempty"` + // SmbServerName - NetBIOS name of the SMB server. This name will be registered as a computer account in the AD and used to mount volumes + SmbServerName *string `json:"smbServerName,omitempty"` + // OrganizationalUnit - The Organizational Unit (OU) within the Windows Active Directory + OrganizationalUnit *string `json:"organizationalUnit,omitempty"` + // Site - The Active Directory site the service will limit Domain Controller discovery to + Site *string `json:"site,omitempty"` + // BackupOperators - Users to be added to the Built-in Backup Operator active directory group. A list of unique usernames without domain specifier + BackupOperators *[]string `json:"backupOperators,omitempty"` + // Administrators - Users to be added to the Built-in Administrators active directory group. A list of unique usernames without domain specifier + Administrators *[]string `json:"administrators,omitempty"` + // KdcIP - kdc server IP addresses for the active directory machine. This optional parameter is used only while creating kerberos volume. + KdcIP *string `json:"kdcIP,omitempty"` + // AdName - Name of the active directory machine. This optional parameter is used only while creating kerberos volume + AdName *string `json:"adName,omitempty"` + // ServerRootCACertificate - When LDAP over SSL/TLS is enabled, the LDAP client is required to have base64 encoded Active Directory Certificate Service's self-signed root CA certificate, this optional parameter is used only for dual protocol with LDAP user-mapping volumes. + ServerRootCACertificate *string `json:"serverRootCACertificate,omitempty"` + // AesEncryption - If enabled, AES encryption will be enabled for SMB communication. + AesEncryption *bool `json:"aesEncryption,omitempty"` + // LdapSigning - Specifies whether or not the LDAP traffic needs to be signed. + LdapSigning *bool `json:"ldapSigning,omitempty"` + // SecurityOperators - Domain Users in the Active directory to be given SeSecurityPrivilege privilege (Needed for SMB Continuously available shares for SQL). A list of unique usernames without domain specifier + SecurityOperators *[]string `json:"securityOperators,omitempty"` + // LdapOverTLS - Specifies whether or not the LDAP traffic needs to be secured via TLS. + LdapOverTLS *bool `json:"ldapOverTLS,omitempty"` + // AllowLocalNfsUsersWithLdap - If enabled, NFS client local users can also (in addition to LDAP users) access the NFS volumes. + AllowLocalNfsUsersWithLdap *bool `json:"allowLocalNfsUsersWithLdap,omitempty"` + // EncryptDCConnections - If enabled, Traffic between the SMB server to Domain Controller (DC) will be encrypted. + EncryptDCConnections *bool `json:"encryptDCConnections,omitempty"` + // LdapSearchScope - LDAP Search scope options + LdapSearchScope *LdapSearchScopeOpt `json:"ldapSearchScope,omitempty"` +} + +// MarshalJSON is the custom marshaler for ActiveDirectory. +func (ad ActiveDirectory) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ad.ActiveDirectoryID != nil { + objectMap["activeDirectoryId"] = ad.ActiveDirectoryID + } + if ad.Username != nil { + objectMap["username"] = ad.Username + } + if ad.Password != nil { + objectMap["password"] = ad.Password + } + if ad.Domain != nil { + objectMap["domain"] = ad.Domain + } + if ad.DNS != nil { + objectMap["dns"] = ad.DNS + } + if ad.SmbServerName != nil { + objectMap["smbServerName"] = ad.SmbServerName + } + if ad.OrganizationalUnit != nil { + objectMap["organizationalUnit"] = ad.OrganizationalUnit + } + if ad.Site != nil { + objectMap["site"] = ad.Site + } + if ad.BackupOperators != nil { + objectMap["backupOperators"] = ad.BackupOperators + } + if ad.Administrators != nil { + objectMap["administrators"] = ad.Administrators + } + if ad.KdcIP != nil { + objectMap["kdcIP"] = ad.KdcIP + } + if ad.AdName != nil { + objectMap["adName"] = ad.AdName + } + if ad.ServerRootCACertificate != nil { + objectMap["serverRootCACertificate"] = ad.ServerRootCACertificate + } + if ad.AesEncryption != nil { + objectMap["aesEncryption"] = ad.AesEncryption + } + if ad.LdapSigning != nil { + objectMap["ldapSigning"] = ad.LdapSigning + } + if ad.SecurityOperators != nil { + objectMap["securityOperators"] = ad.SecurityOperators + } + if ad.LdapOverTLS != nil { + objectMap["ldapOverTLS"] = ad.LdapOverTLS + } + if ad.AllowLocalNfsUsersWithLdap != nil { + objectMap["allowLocalNfsUsersWithLdap"] = ad.AllowLocalNfsUsersWithLdap + } + if ad.EncryptDCConnections != nil { + objectMap["encryptDCConnections"] = ad.EncryptDCConnections + } + if ad.LdapSearchScope != nil { + objectMap["ldapSearchScope"] = ad.LdapSearchScope + } + return json.Marshal(objectMap) +} + +// AuthorizeRequest authorize request +type AuthorizeRequest struct { + // RemoteVolumeResourceID - Resource id of the remote volume + RemoteVolumeResourceID *string `json:"remoteVolumeResourceId,omitempty"` +} + +// AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag. +type AzureEntityResource struct { + // Etag - READ-ONLY; Resource Etag. + Etag *string `json:"etag,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureEntityResource. +func (aer AzureEntityResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// Backup backup of a Volume +type Backup struct { + autorest.Response `json:"-"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // BackupProperties - Backup Properties + *BackupProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for Backup. +func (b Backup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if b.Location != nil { + objectMap["location"] = b.Location + } + if b.BackupProperties != nil { + objectMap["properties"] = b.BackupProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Backup struct. +func (b *Backup) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + b.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + b.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + b.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + b.Type = &typeVar + } + case "properties": + if v != nil { + var backupProperties BackupProperties + err = json.Unmarshal(*v, &backupProperties) + if err != nil { + return err + } + b.BackupProperties = &backupProperties + } + } + } + + return nil +} + +// BackupPatch backup patch +type BackupPatch struct { + // Tags - Resource tags + Tags map[string]*string `json:"tags"` + // BackupProperties - Backup Properties + *BackupProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for BackupPatch. +func (bp BackupPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if bp.Tags != nil { + objectMap["tags"] = bp.Tags + } + if bp.BackupProperties != nil { + objectMap["properties"] = bp.BackupProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for BackupPatch struct. +func (bp *BackupPatch) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + bp.Tags = tags + } + case "properties": + if v != nil { + var backupProperties BackupProperties + err = json.Unmarshal(*v, &backupProperties) + if err != nil { + return err + } + bp.BackupProperties = &backupProperties + } + } + } + + return nil +} + +// BackupPoliciesCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type BackupPoliciesCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(BackupPoliciesClient) (BackupPolicy, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *BackupPoliciesCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for BackupPoliciesCreateFuture.Result. +func (future *BackupPoliciesCreateFuture) result(client BackupPoliciesClient) (bp BackupPolicy, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + bp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("netapp.BackupPoliciesCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if bp.Response.Response, err = future.GetResult(sender); err == nil && bp.Response.Response.StatusCode != http.StatusNoContent { + bp, err = client.CreateResponder(bp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesCreateFuture", "Result", bp.Response.Response, "Failure responding to request") + } + } + return +} + +// BackupPoliciesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type BackupPoliciesDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(BackupPoliciesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *BackupPoliciesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for BackupPoliciesDeleteFuture.Result. +func (future *BackupPoliciesDeleteFuture) result(client BackupPoliciesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("netapp.BackupPoliciesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// BackupPoliciesList list of Backup Policies +type BackupPoliciesList struct { + autorest.Response `json:"-"` + // Value - A list of backup policies + Value *[]BackupPolicy `json:"value,omitempty"` +} + +// BackupPoliciesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type BackupPoliciesUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(BackupPoliciesClient) (BackupPolicy, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *BackupPoliciesUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for BackupPoliciesUpdateFuture.Result. +func (future *BackupPoliciesUpdateFuture) result(client BackupPoliciesClient) (bp BackupPolicy, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + bp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("netapp.BackupPoliciesUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if bp.Response.Response, err = future.GetResult(sender); err == nil && bp.Response.Response.StatusCode != http.StatusNoContent { + bp, err = client.UpdateResponder(bp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesUpdateFuture", "Result", bp.Response.Response, "Failure responding to request") + } + } + return +} + +// BackupPolicy backup policy information +type BackupPolicy struct { + autorest.Response `json:"-"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` + // BackupPolicyProperties - Backup policy Properties + *BackupPolicyProperties `json:"properties,omitempty"` + // SystemData - READ-ONLY; The system meta data relating to this resource. + SystemData *SystemData `json:"systemData,omitempty"` +} + +// MarshalJSON is the custom marshaler for BackupPolicy. +func (bp BackupPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if bp.Location != nil { + objectMap["location"] = bp.Location + } + if bp.Tags != nil { + objectMap["tags"] = bp.Tags + } + if bp.BackupPolicyProperties != nil { + objectMap["properties"] = bp.BackupPolicyProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for BackupPolicy struct. +func (bp *BackupPolicy) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + bp.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + bp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + bp.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + bp.Etag = &etag + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + bp.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + bp.Tags = tags + } + case "properties": + if v != nil { + var backupPolicyProperties BackupPolicyProperties + err = json.Unmarshal(*v, &backupPolicyProperties) + if err != nil { + return err + } + bp.BackupPolicyProperties = &backupPolicyProperties + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + bp.SystemData = &systemData + } + } + } + + return nil +} + +// BackupPolicyDetails backup policy properties +type BackupPolicyDetails struct { + // Location - Resource location + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` + // BackupPolicyProperties - Backup policy Properties + *BackupPolicyProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for BackupPolicyDetails. +func (bpd BackupPolicyDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if bpd.Location != nil { + objectMap["location"] = bpd.Location + } + if bpd.Tags != nil { + objectMap["tags"] = bpd.Tags + } + if bpd.BackupPolicyProperties != nil { + objectMap["properties"] = bpd.BackupPolicyProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for BackupPolicyDetails struct. +func (bpd *BackupPolicyDetails) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + bpd.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + bpd.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + bpd.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + bpd.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + bpd.Tags = tags + } + case "properties": + if v != nil { + var backupPolicyProperties BackupPolicyProperties + err = json.Unmarshal(*v, &backupPolicyProperties) + if err != nil { + return err + } + bpd.BackupPolicyProperties = &backupPolicyProperties + } + } + } + + return nil +} + +// BackupPolicyPatch backup policy Details for create and update +type BackupPolicyPatch struct { + // Location - Resource location + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` + // BackupPolicyProperties - Backup policy Properties + *BackupPolicyProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for BackupPolicyPatch. +func (bpp BackupPolicyPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if bpp.Location != nil { + objectMap["location"] = bpp.Location + } + if bpp.Tags != nil { + objectMap["tags"] = bpp.Tags + } + if bpp.BackupPolicyProperties != nil { + objectMap["properties"] = bpp.BackupPolicyProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for BackupPolicyPatch struct. +func (bpp *BackupPolicyPatch) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + bpp.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + bpp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + bpp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + bpp.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + bpp.Tags = tags + } + case "properties": + if v != nil { + var backupPolicyProperties BackupPolicyProperties + err = json.Unmarshal(*v, &backupPolicyProperties) + if err != nil { + return err + } + bpp.BackupPolicyProperties = &backupPolicyProperties + } + } + } + + return nil +} + +// BackupPolicyProperties backup policy properties +type BackupPolicyProperties struct { + // BackupPolicyID - READ-ONLY; Backup Policy Resource ID + BackupPolicyID *string `json:"backupPolicyId,omitempty"` + // ProvisioningState - READ-ONLY; Azure lifecycle management + ProvisioningState *string `json:"provisioningState,omitempty"` + // DailyBackupsToKeep - Daily backups count to keep + DailyBackupsToKeep *int32 `json:"dailyBackupsToKeep,omitempty"` + // WeeklyBackupsToKeep - Weekly backups count to keep + WeeklyBackupsToKeep *int32 `json:"weeklyBackupsToKeep,omitempty"` + // MonthlyBackupsToKeep - Monthly backups count to keep + MonthlyBackupsToKeep *int32 `json:"monthlyBackupsToKeep,omitempty"` + // VolumesAssigned - READ-ONLY; Volumes using current backup policy + VolumesAssigned *int32 `json:"volumesAssigned,omitempty"` + // Enabled - The property to decide policy is enabled or not + Enabled *bool `json:"enabled,omitempty"` + // VolumeBackups - READ-ONLY; A list of volumes assigned to this policy + VolumeBackups *[]VolumeBackups `json:"volumeBackups,omitempty"` +} + +// MarshalJSON is the custom marshaler for BackupPolicyProperties. +func (bpp BackupPolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if bpp.DailyBackupsToKeep != nil { + objectMap["dailyBackupsToKeep"] = bpp.DailyBackupsToKeep + } + if bpp.WeeklyBackupsToKeep != nil { + objectMap["weeklyBackupsToKeep"] = bpp.WeeklyBackupsToKeep + } + if bpp.MonthlyBackupsToKeep != nil { + objectMap["monthlyBackupsToKeep"] = bpp.MonthlyBackupsToKeep + } + if bpp.Enabled != nil { + objectMap["enabled"] = bpp.Enabled + } + return json.Marshal(objectMap) +} + +// BackupProperties backup properties +type BackupProperties struct { + // BackupID - READ-ONLY; UUID v4 used to identify the Backup + BackupID *string `json:"backupId,omitempty"` + // CreationDate - READ-ONLY; The creation date of the backup + CreationDate *date.Time `json:"creationDate,omitempty"` + // ProvisioningState - READ-ONLY; Azure lifecycle management + ProvisioningState *string `json:"provisioningState,omitempty"` + // Size - READ-ONLY; Size of backup + Size *int64 `json:"size,omitempty"` + // Label - Label for backup + Label *string `json:"label,omitempty"` + // BackupType - READ-ONLY; Type of backup Manual or Scheduled. Possible values include: 'BackupTypeManual', 'BackupTypeScheduled' + BackupType BackupType `json:"backupType,omitempty"` + // FailureReason - READ-ONLY; Failure reason + FailureReason *string `json:"failureReason,omitempty"` + // VolumeName - READ-ONLY; Volume name + VolumeName *string `json:"volumeName,omitempty"` + // UseExistingSnapshot - Manual backup an already existing snapshot. This will always be false for scheduled backups and true/false for manual backups + UseExistingSnapshot *bool `json:"useExistingSnapshot,omitempty"` +} + +// MarshalJSON is the custom marshaler for BackupProperties. +func (bp BackupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if bp.Label != nil { + objectMap["label"] = bp.Label + } + if bp.UseExistingSnapshot != nil { + objectMap["useExistingSnapshot"] = bp.UseExistingSnapshot + } + return json.Marshal(objectMap) +} + +// BackupsCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type BackupsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(BackupsClient) (Backup, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *BackupsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for BackupsCreateFuture.Result. +func (future *BackupsCreateFuture) result(client BackupsClient) (b Backup, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.BackupsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + b.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("netapp.BackupsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if b.Response.Response, err = future.GetResult(sender); err == nil && b.Response.Response.StatusCode != http.StatusNoContent { + b, err = client.CreateResponder(b.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.BackupsCreateFuture", "Result", b.Response.Response, "Failure responding to request") + } + } + return +} + +// BackupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type BackupsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(BackupsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *BackupsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for BackupsDeleteFuture.Result. +func (future *BackupsDeleteFuture) result(client BackupsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.BackupsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("netapp.BackupsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// BackupsList list of Backups +type BackupsList struct { + autorest.Response `json:"-"` + // Value - A list of Backups + Value *[]Backup `json:"value,omitempty"` +} + +// BackupStatus backup status +type BackupStatus struct { + autorest.Response `json:"-"` + // Healthy - READ-ONLY; Backup health status + Healthy *bool `json:"healthy,omitempty"` + // RelationshipStatus - READ-ONLY; Status of the backup mirror relationship. Possible values include: 'RelationshipStatusIdle', 'RelationshipStatusTransferring' + RelationshipStatus RelationshipStatus `json:"relationshipStatus,omitempty"` + // MirrorState - READ-ONLY; The status of the backup. Possible values include: 'MirrorStateUninitialized', 'MirrorStateMirrored', 'MirrorStateBroken' + MirrorState MirrorState `json:"mirrorState,omitempty"` + // UnhealthyReason - READ-ONLY; Reason for the unhealthy backup relationship + UnhealthyReason *string `json:"unhealthyReason,omitempty"` + // ErrorMessage - READ-ONLY; Displays error message if the backup is in an error state + ErrorMessage *string `json:"errorMessage,omitempty"` + // LastTransferSize - READ-ONLY; Displays the last transfer size + LastTransferSize *int64 `json:"lastTransferSize,omitempty"` + // LastTransferType - READ-ONLY; Displays the last transfer type + LastTransferType *string `json:"lastTransferType,omitempty"` + // TotalTransferBytes - READ-ONLY; Displays the total bytes transferred + TotalTransferBytes *int64 `json:"totalTransferBytes,omitempty"` +} + +// MarshalJSON is the custom marshaler for BackupStatus. +func (bs BackupStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// BackupsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type BackupsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(BackupsClient) (Backup, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *BackupsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for BackupsUpdateFuture.Result. +func (future *BackupsUpdateFuture) result(client BackupsClient) (b Backup, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.BackupsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + b.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("netapp.BackupsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if b.Response.Response, err = future.GetResult(sender); err == nil && b.Response.Response.StatusCode != http.StatusNoContent { + b, err = client.UpdateResponder(b.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.BackupsUpdateFuture", "Result", b.Response.Response, "Failure responding to request") + } + } + return +} + +// BreakReplicationRequest break replication request +type BreakReplicationRequest struct { + // ForceBreakReplication - If replication is in status transferring and you want to force break the replication, set to true + ForceBreakReplication *bool `json:"forceBreakReplication,omitempty"` +} + +// CapacityPool capacity pool resource +type CapacityPool struct { + autorest.Response `json:"-"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` + // PoolProperties - Capacity pool properties + *PoolProperties `json:"properties,omitempty"` + // SystemData - READ-ONLY; The system meta data relating to this resource. + SystemData *SystemData `json:"systemData,omitempty"` +} + +// MarshalJSON is the custom marshaler for CapacityPool. +func (cp CapacityPool) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cp.Location != nil { + objectMap["location"] = cp.Location + } + if cp.Tags != nil { + objectMap["tags"] = cp.Tags + } + if cp.PoolProperties != nil { + objectMap["properties"] = cp.PoolProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CapacityPool struct. +func (cp *CapacityPool) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + cp.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + cp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cp.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + cp.Etag = &etag + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cp.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + cp.Tags = tags + } + case "properties": + if v != nil { + var poolProperties PoolProperties + err = json.Unmarshal(*v, &poolProperties) + if err != nil { + return err + } + cp.PoolProperties = &poolProperties + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + cp.SystemData = &systemData + } + } + } + + return nil +} + +// CapacityPoolList list of capacity pool resources +type CapacityPoolList struct { + autorest.Response `json:"-"` + // Value - List of Capacity pools + Value *[]CapacityPool `json:"value,omitempty"` + // NextLink - URL to get the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// CapacityPoolListIterator provides access to a complete listing of CapacityPool values. +type CapacityPoolListIterator struct { + i int + page CapacityPoolListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *CapacityPoolListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CapacityPoolListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *CapacityPoolListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter CapacityPoolListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter CapacityPoolListIterator) Response() CapacityPoolList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter CapacityPoolListIterator) Value() CapacityPool { + if !iter.page.NotDone() { + return CapacityPool{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the CapacityPoolListIterator type. +func NewCapacityPoolListIterator(page CapacityPoolListPage) CapacityPoolListIterator { + return CapacityPoolListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (cpl CapacityPoolList) IsEmpty() bool { + return cpl.Value == nil || len(*cpl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (cpl CapacityPoolList) hasNextLink() bool { + return cpl.NextLink != nil && len(*cpl.NextLink) != 0 +} + +// capacityPoolListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (cpl CapacityPoolList) capacityPoolListPreparer(ctx context.Context) (*http.Request, error) { + if !cpl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(cpl.NextLink))) +} + +// CapacityPoolListPage contains a page of CapacityPool values. +type CapacityPoolListPage struct { + fn func(context.Context, CapacityPoolList) (CapacityPoolList, error) + cpl CapacityPoolList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *CapacityPoolListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CapacityPoolListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.cpl) + if err != nil { + return err + } + page.cpl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *CapacityPoolListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page CapacityPoolListPage) NotDone() bool { + return !page.cpl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page CapacityPoolListPage) Response() CapacityPoolList { + return page.cpl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page CapacityPoolListPage) Values() []CapacityPool { + if page.cpl.IsEmpty() { + return nil + } + return *page.cpl.Value +} + +// Creates a new instance of the CapacityPoolListPage type. +func NewCapacityPoolListPage(cur CapacityPoolList, getNextPage func(context.Context, CapacityPoolList) (CapacityPoolList, error)) CapacityPoolListPage { + return CapacityPoolListPage{ + fn: getNextPage, + cpl: cur, + } +} + +// CapacityPoolPatch capacity pool patch resource +type CapacityPoolPatch struct { + // Location - Resource location + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` + // PoolPatchProperties - Capacity pool properties + *PoolPatchProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for CapacityPoolPatch. +func (cpp CapacityPoolPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cpp.Location != nil { + objectMap["location"] = cpp.Location + } + if cpp.Tags != nil { + objectMap["tags"] = cpp.Tags + } + if cpp.PoolPatchProperties != nil { + objectMap["properties"] = cpp.PoolPatchProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CapacityPoolPatch struct. +func (cpp *CapacityPoolPatch) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + cpp.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + cpp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cpp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cpp.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + cpp.Tags = tags + } + case "properties": + if v != nil { + var poolPatchProperties PoolPatchProperties + err = json.Unmarshal(*v, &poolPatchProperties) + if err != nil { + return err + } + cpp.PoolPatchProperties = &poolPatchProperties + } + } + } + + return nil +} + +// CheckAvailabilityResponse information regarding availability of a resource. +type CheckAvailabilityResponse struct { + autorest.Response `json:"-"` + // IsAvailable - true indicates name is valid and available. false indicates the name is invalid, unavailable, or both. + IsAvailable *bool `json:"isAvailable,omitempty"` + // Reason - Invalid indicates the name provided does not match Azure App Service naming requirements. AlreadyExists indicates that the name is already in use and is therefore unavailable. Possible values include: 'InAvailabilityReasonTypeInvalid', 'InAvailabilityReasonTypeAlreadyExists' + Reason InAvailabilityReasonType `json:"reason,omitempty"` + // Message - If reason == invalid, provide the user with the reason why the given name is invalid, and provide the resource naming requirements so that the user can select a valid name. If reason == AlreadyExists, explain that resource name is already in use, and direct them to select a different name. + Message *string `json:"message,omitempty"` +} + +// CloudError an error response from the service. +type CloudError struct { + // Error - Cloud error body. + Error *CloudErrorBody `json:"error,omitempty"` +} + +// CloudErrorBody an error response from the service. +type CloudErrorBody struct { + // Code - An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + Code *string `json:"code,omitempty"` + // Message - A message describing the error, intended to be suitable for display in a user interface. + Message *string `json:"message,omitempty"` +} + +// DailySchedule daily Schedule properties +type DailySchedule struct { + // SnapshotsToKeep - Daily snapshot count to keep + SnapshotsToKeep *int32 `json:"snapshotsToKeep,omitempty"` + // Hour - Indicates which hour in UTC timezone a snapshot should be taken + Hour *int32 `json:"hour,omitempty"` + // Minute - Indicates which minute snapshot should be taken + Minute *int32 `json:"minute,omitempty"` + // UsedBytes - Resource size in bytes, current storage usage for the volume in bytes + UsedBytes *int64 `json:"usedBytes,omitempty"` +} + +// Dimension dimension of blobs, possibly be blob type or access tier. +type Dimension struct { + // Name - Display name of dimension. + Name *string `json:"name,omitempty"` + // DisplayName - Display name of dimension. + DisplayName *string `json:"displayName,omitempty"` +} + +// ExportPolicyRule volume Export Policy Rule +type ExportPolicyRule struct { + // RuleIndex - Order index + RuleIndex *int32 `json:"ruleIndex,omitempty"` + // UnixReadOnly - Read only access + UnixReadOnly *bool `json:"unixReadOnly,omitempty"` + // UnixReadWrite - Read and write access + UnixReadWrite *bool `json:"unixReadWrite,omitempty"` + // Kerberos5ReadOnly - Kerberos5 Read only access. To be use with swagger version 2020-05-01 or later + Kerberos5ReadOnly *bool `json:"kerberos5ReadOnly,omitempty"` + // Kerberos5ReadWrite - Kerberos5 Read and write access. To be use with swagger version 2020-05-01 or later + Kerberos5ReadWrite *bool `json:"kerberos5ReadWrite,omitempty"` + // Kerberos5iReadOnly - Kerberos5i Read only access. To be use with swagger version 2020-05-01 or later + Kerberos5iReadOnly *bool `json:"kerberos5iReadOnly,omitempty"` + // Kerberos5iReadWrite - Kerberos5i Read and write access. To be use with swagger version 2020-05-01 or later + Kerberos5iReadWrite *bool `json:"kerberos5iReadWrite,omitempty"` + // Kerberos5pReadOnly - Kerberos5p Read only access. To be use with swagger version 2020-05-01 or later + Kerberos5pReadOnly *bool `json:"kerberos5pReadOnly,omitempty"` + // Kerberos5pReadWrite - Kerberos5p Read and write access. To be use with swagger version 2020-05-01 or later + Kerberos5pReadWrite *bool `json:"kerberos5pReadWrite,omitempty"` + // Cifs - Allows CIFS protocol + Cifs *bool `json:"cifs,omitempty"` + // Nfsv3 - Allows NFSv3 protocol. Enable only for NFSv3 type volumes + Nfsv3 *bool `json:"nfsv3,omitempty"` + // Nfsv41 - Allows NFSv4.1 protocol. Enable only for NFSv4.1 type volumes + Nfsv41 *bool `json:"nfsv41,omitempty"` + // AllowedClients - Client ingress specification as comma separated string with IPv4 CIDRs, IPv4 host addresses and host names + AllowedClients *string `json:"allowedClients,omitempty"` + // HasRootAccess - Has root access to volume + HasRootAccess *bool `json:"hasRootAccess,omitempty"` + // ChownMode - This parameter specifies who is authorized to change the ownership of a file. restricted - Only root user can change the ownership of the file. unrestricted - Non-root users can change ownership of files that they own. Possible values include: 'ChownModeRestricted', 'ChownModeUnrestricted' + ChownMode ChownMode `json:"chownMode,omitempty"` +} + +// FilePathAvailabilityRequest file path availability request content - availability is based on the name +// and the subnetId. +type FilePathAvailabilityRequest struct { + // Name - File path to verify. + Name *string `json:"name,omitempty"` + // SubnetID - The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes + SubnetID *string `json:"subnetId,omitempty"` +} + +// HourlySchedule hourly Schedule properties +type HourlySchedule struct { + // SnapshotsToKeep - Hourly snapshot count to keep + SnapshotsToKeep *int32 `json:"snapshotsToKeep,omitempty"` + // Minute - Indicates which minute snapshot should be taken + Minute *int32 `json:"minute,omitempty"` + // UsedBytes - Resource size in bytes, current storage usage for the volume in bytes + UsedBytes *int64 `json:"usedBytes,omitempty"` +} + +// LdapSearchScopeOpt LDAP search scope +type LdapSearchScopeOpt struct { + // UserDN - This specifies the user DN, which overrides the base DN for user lookups. + UserDN *string `json:"userDN,omitempty"` + // GroupDN - This specifies the group DN, which overrides the base DN for group lookups. + GroupDN *string `json:"groupDN,omitempty"` + // GroupMembershipFilter - This specifies the custom LDAP search filter to be used when looking up group membership from LDAP server. + GroupMembershipFilter *string `json:"groupMembershipFilter,omitempty"` +} + +// LogSpecification log Definition of a single resource metric. +type LogSpecification struct { + // Name - Name of log specification. + Name *string `json:"name,omitempty"` + // DisplayName - Display name of log specification. + DisplayName *string `json:"displayName,omitempty"` +} + +// MetricSpecification metric specification of operation. +type MetricSpecification struct { + // Name - Name of metric specification. + Name *string `json:"name,omitempty"` + // DisplayName - Display name of metric specification. + DisplayName *string `json:"displayName,omitempty"` + // DisplayDescription - Display description of metric specification. + DisplayDescription *string `json:"displayDescription,omitempty"` + // Unit - Unit could be Bytes or Count. + Unit *string `json:"unit,omitempty"` + // SupportedAggregationTypes - Support metric aggregation type. + SupportedAggregationTypes *[]MetricAggregationType `json:"supportedAggregationTypes,omitempty"` + // SupportedTimeGrainTypes - The supported time grain types for the metrics. + SupportedTimeGrainTypes *[]string `json:"supportedTimeGrainTypes,omitempty"` + // InternalMetricName - The internal metric name. + InternalMetricName *string `json:"internalMetricName,omitempty"` + // EnableRegionalMdmAccount - Whether or not the service is using regional MDM accounts. + EnableRegionalMdmAccount *bool `json:"enableRegionalMdmAccount,omitempty"` + // SourceMdmAccount - The source MDM account. + SourceMdmAccount *string `json:"sourceMdmAccount,omitempty"` + // SourceMdmNamespace - The source MDM namespace. + SourceMdmNamespace *string `json:"sourceMdmNamespace,omitempty"` + // Dimensions - Dimensions of blobs, including blob type and access tier. + Dimensions *[]Dimension `json:"dimensions,omitempty"` + // AggregationType - Aggregation type could be Average. + AggregationType *string `json:"aggregationType,omitempty"` + // FillGapWithZero - The property to decide fill gap with zero or not. + FillGapWithZero *bool `json:"fillGapWithZero,omitempty"` + // Category - The category this metric specification belong to, could be Capacity. + Category *string `json:"category,omitempty"` + // ResourceIDDimensionNameOverride - Account Resource Id. + ResourceIDDimensionNameOverride *string `json:"resourceIdDimensionNameOverride,omitempty"` + // IsInternal - Whether the metric is internal. + IsInternal *bool `json:"isInternal,omitempty"` +} + +// MonthlySchedule monthly Schedule properties +type MonthlySchedule struct { + // SnapshotsToKeep - Monthly snapshot count to keep + SnapshotsToKeep *int32 `json:"snapshotsToKeep,omitempty"` + // DaysOfMonth - Indicates which days of the month snapshot should be taken. A comma delimited string. + DaysOfMonth *string `json:"daysOfMonth,omitempty"` + // Hour - Indicates which hour in UTC timezone a snapshot should be taken + Hour *int32 `json:"hour,omitempty"` + // Minute - Indicates which minute snapshot should be taken + Minute *int32 `json:"minute,omitempty"` + // UsedBytes - Resource size in bytes, current storage usage for the volume in bytes + UsedBytes *int64 `json:"usedBytes,omitempty"` +} + +// MountTarget mount Target +type MountTarget struct { + // Location - Resource location + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` + // MountTargetProperties - Mount Target Properties + *MountTargetProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for MountTarget. +func (mt MountTarget) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mt.Location != nil { + objectMap["location"] = mt.Location + } + if mt.Tags != nil { + objectMap["tags"] = mt.Tags + } + if mt.MountTargetProperties != nil { + objectMap["properties"] = mt.MountTargetProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for MountTarget struct. +func (mt *MountTarget) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + mt.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mt.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mt.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mt.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + mt.Tags = tags + } + case "properties": + if v != nil { + var mountTargetProperties MountTargetProperties + err = json.Unmarshal(*v, &mountTargetProperties) + if err != nil { + return err + } + mt.MountTargetProperties = &mountTargetProperties + } + } + } + + return nil +} + +// MountTargetProperties mount target properties +type MountTargetProperties struct { + // MountTargetID - READ-ONLY; UUID v4 used to identify the MountTarget + MountTargetID *string `json:"mountTargetId,omitempty"` + // FileSystemID - UUID v4 used to identify the MountTarget + FileSystemID *string `json:"fileSystemId,omitempty"` + // IPAddress - READ-ONLY; The mount target's IPv4 address + IPAddress *string `json:"ipAddress,omitempty"` + // SmbServerFqdn - The SMB server's Fully Qualified Domain Name, FQDN + SmbServerFqdn *string `json:"smbServerFqdn,omitempty"` +} + +// MarshalJSON is the custom marshaler for MountTargetProperties. +func (mtp MountTargetProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mtp.FileSystemID != nil { + objectMap["fileSystemId"] = mtp.FileSystemID + } + if mtp.SmbServerFqdn != nil { + objectMap["smbServerFqdn"] = mtp.SmbServerFqdn + } + return json.Marshal(objectMap) +} + +// Operation microsoft.NetApp REST API operation definition. +type Operation struct { + // Name - Operation name: {provider}/{resource}/{operation} + Name *string `json:"name,omitempty"` + // Display - Display metadata associated with the operation. + Display *OperationDisplay `json:"display,omitempty"` + // Origin - The origin of operations. + Origin *string `json:"origin,omitempty"` + // OperationProperties - Properties of operation, include metric specifications. + *OperationProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if o.Name != nil { + objectMap["name"] = o.Name + } + if o.Display != nil { + objectMap["display"] = o.Display + } + if o.Origin != nil { + objectMap["origin"] = o.Origin + } + if o.OperationProperties != nil { + objectMap["properties"] = o.OperationProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Operation struct. +func (o *Operation) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + o.Name = &name + } + case "display": + if v != nil { + var display OperationDisplay + err = json.Unmarshal(*v, &display) + if err != nil { + return err + } + o.Display = &display + } + case "origin": + if v != nil { + var origin string + err = json.Unmarshal(*v, &origin) + if err != nil { + return err + } + o.Origin = &origin + } + case "properties": + if v != nil { + var operationProperties OperationProperties + err = json.Unmarshal(*v, &operationProperties) + if err != nil { + return err + } + o.OperationProperties = &operationProperties + } + } + } + + return nil +} + +// OperationDisplay display metadata associated with the operation. +type OperationDisplay struct { + // Provider - Service provider: Microsoft NetApp. + Provider *string `json:"provider,omitempty"` + // Resource - Resource on which the operation is performed etc. + Resource *string `json:"resource,omitempty"` + // Operation - Type of operation: get, read, delete, etc. + Operation *string `json:"operation,omitempty"` + // Description - Operation description. + Description *string `json:"description,omitempty"` +} + +// OperationListResult result of the request to list Cloud Volume operations. It contains a list of +// operations and a URL link to get the next set of results. +type OperationListResult struct { + autorest.Response `json:"-"` + // Value - List of Storage operations supported by the Storage resource provider. + Value *[]Operation `json:"value,omitempty"` +} + +// OperationProperties properties of operation, include metric specifications. +type OperationProperties struct { + // ServiceSpecification - One property of operation, include metric specifications. + ServiceSpecification *ServiceSpecification `json:"serviceSpecification,omitempty"` +} + +// PlacementKeyValuePairs application specific parameters for the placement of volumes in the volume group +type PlacementKeyValuePairs struct { + // Key - Key for an application specific parameter for the placement of volumes in the volume group + Key *string `json:"key,omitempty"` + // Value - Value for an application specific parameter for the placement of volumes in the volume group + Value *string `json:"value,omitempty"` +} + +// PoolChangeRequest pool change request +type PoolChangeRequest struct { + // NewPoolResourceID - Resource id of the pool to move volume to + NewPoolResourceID *string `json:"newPoolResourceId,omitempty"` +} + +// PoolPatchProperties patchable pool properties +type PoolPatchProperties struct { + // Size - Provisioned size of the pool (in bytes). Allowed values are in 1TiB chunks (value must be multiply of 4398046511104). + Size *int64 `json:"size,omitempty"` + // QosType - The qos type of the pool. Possible values include: 'QosTypeAuto', 'QosTypeManual' + QosType QosType `json:"qosType,omitempty"` +} + +// PoolProperties pool properties +type PoolProperties struct { + // PoolID - READ-ONLY; UUID v4 used to identify the Pool + PoolID *string `json:"poolId,omitempty"` + // Size - Provisioned size of the pool (in bytes). Allowed values are in 1TiB chunks (value must be multiply of 4398046511104). + Size *int64 `json:"size,omitempty"` + // ServiceLevel - Possible values include: 'ServiceLevelStandard', 'ServiceLevelPremium', 'ServiceLevelUltra', 'ServiceLevelStandardZRS' + ServiceLevel ServiceLevel `json:"serviceLevel,omitempty"` + // ProvisioningState - READ-ONLY; Azure lifecycle management + ProvisioningState *string `json:"provisioningState,omitempty"` + // TotalThroughputMibps - READ-ONLY; Total throughput of pool in Mibps + TotalThroughputMibps *float64 `json:"totalThroughputMibps,omitempty"` + // UtilizedThroughputMibps - READ-ONLY; Utilized throughput of pool in Mibps + UtilizedThroughputMibps *float64 `json:"utilizedThroughputMibps,omitempty"` + // QosType - The qos type of the pool. Possible values include: 'QosTypeAuto', 'QosTypeManual' + QosType QosType `json:"qosType,omitempty"` + // CoolAccess - If enabled (true) the pool can contain cool Access enabled volumes. + CoolAccess *bool `json:"coolAccess,omitempty"` + // EncryptionType - Encryption type of the capacity pool, set encryption type for data at rest for this pool and all volumes in it. This value can only be set when creating new pool. Possible values include: 'EncryptionTypeSingle', 'EncryptionTypeDouble' + EncryptionType EncryptionType `json:"encryptionType,omitempty"` +} + +// MarshalJSON is the custom marshaler for PoolProperties. +func (pp PoolProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pp.Size != nil { + objectMap["size"] = pp.Size + } + if pp.ServiceLevel != "" { + objectMap["serviceLevel"] = pp.ServiceLevel + } + if pp.QosType != "" { + objectMap["qosType"] = pp.QosType + } + if pp.CoolAccess != nil { + objectMap["coolAccess"] = pp.CoolAccess + } + if pp.EncryptionType != "" { + objectMap["encryptionType"] = pp.EncryptionType + } + return json.Marshal(objectMap) +} + +// PoolsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type PoolsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PoolsClient) (CapacityPool, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PoolsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for PoolsCreateOrUpdateFuture.Result. +func (future *PoolsCreateOrUpdateFuture) result(client PoolsClient) (cp CapacityPool, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.PoolsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + cp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("netapp.PoolsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if cp.Response.Response, err = future.GetResult(sender); err == nil && cp.Response.Response.StatusCode != http.StatusNoContent { + cp, err = client.CreateOrUpdateResponder(cp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.PoolsCreateOrUpdateFuture", "Result", cp.Response.Response, "Failure responding to request") + } + } + return +} + +// PoolsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type PoolsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PoolsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PoolsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for PoolsDeleteFuture.Result. +func (future *PoolsDeleteFuture) result(client PoolsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.PoolsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("netapp.PoolsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// PoolsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type PoolsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PoolsClient) (CapacityPool, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PoolsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for PoolsUpdateFuture.Result. +func (future *PoolsUpdateFuture) result(client PoolsClient) (cp CapacityPool, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.PoolsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + cp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("netapp.PoolsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if cp.Response.Response, err = future.GetResult(sender); err == nil && cp.Response.Response.StatusCode != http.StatusNoContent { + cp, err = client.UpdateResponder(cp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.PoolsUpdateFuture", "Result", cp.Response.Response, "Failure responding to request") + } + } + return +} + +// ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not +// have tags and a location +type ProxyResource struct { + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProxyResource. +func (pr ProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// QuotaAvailabilityRequest quota availability request content. +type QuotaAvailabilityRequest struct { + // Name - Name of the resource to verify. + Name *string `json:"name,omitempty"` + // Type - Resource type used for verification. Possible values include: 'CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccounts', 'CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPools', 'CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumes', 'CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumessnapshots' + Type CheckQuotaNameResourceTypes `json:"type,omitempty"` + // ResourceGroup - Resource group name. + ResourceGroup *string `json:"resourceGroup,omitempty"` +} + +// ReplicationObject replication properties +type ReplicationObject struct { + // ReplicationID - Id + ReplicationID *string `json:"replicationId,omitempty"` + // EndpointType - Indicates whether the local volume is the source or destination for the Volume Replication. Possible values include: 'EndpointTypeSrc', 'EndpointTypeDst' + EndpointType EndpointType `json:"endpointType,omitempty"` + // ReplicationSchedule - Schedule. Possible values include: 'ReplicationSchedule10minutely', 'ReplicationScheduleHourly', 'ReplicationScheduleDaily' + ReplicationSchedule ReplicationSchedule `json:"replicationSchedule,omitempty"` + // RemoteVolumeResourceID - The resource ID of the remote volume. + RemoteVolumeResourceID *string `json:"remoteVolumeResourceId,omitempty"` + // RemoteVolumeRegion - The remote region for the other end of the Volume Replication. + RemoteVolumeRegion *string `json:"remoteVolumeRegion,omitempty"` +} + +// ReplicationStatus replication status +type ReplicationStatus struct { + autorest.Response `json:"-"` + // Healthy - Replication health check + Healthy *bool `json:"healthy,omitempty"` + // RelationshipStatus - Status of the mirror relationship. Possible values include: 'RelationshipStatusIdle', 'RelationshipStatusTransferring' + RelationshipStatus RelationshipStatus `json:"relationshipStatus,omitempty"` + // MirrorState - The status of the replication. Possible values include: 'MirrorStateUninitialized', 'MirrorStateMirrored', 'MirrorStateBroken' + MirrorState MirrorState `json:"mirrorState,omitempty"` + // TotalProgress - The progress of the replication + TotalProgress *string `json:"totalProgress,omitempty"` + // ErrorMessage - Displays error message if the replication is in an error state + ErrorMessage *string `json:"errorMessage,omitempty"` +} + +// Resource common fields that are returned in the response for all Azure Resource Manager resources +type Resource struct { + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ResourceIdentity identity for the resource. +type ResourceIdentity struct { + // PrincipalID - READ-ONLY; Object id of the identity resource + PrincipalID *string `json:"principalId,omitempty"` + // TenantID - READ-ONLY; The tenant id of the resource + TenantID *string `json:"tenantId,omitempty"` + // Type - Type of Identity. Supported values are: 'None', 'SystemAssigned' + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceIdentity. +func (ri ResourceIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ri.Type != nil { + objectMap["type"] = ri.Type + } + return json.Marshal(objectMap) +} + +// ResourceNameAvailabilityRequest resource name availability request content. +type ResourceNameAvailabilityRequest struct { + // Name - Resource name to verify. + Name *string `json:"name,omitempty"` + // Type - Resource type used for verification. Possible values include: 'CheckNameResourceTypesMicrosoftNetAppnetAppAccounts', 'CheckNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPools', 'CheckNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumes', 'CheckNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumessnapshots' + Type CheckNameResourceTypes `json:"type,omitempty"` + // ResourceGroup - Resource group name. + ResourceGroup *string `json:"resourceGroup,omitempty"` +} + +// RestoreStatus restore status +type RestoreStatus struct { + autorest.Response `json:"-"` + // Healthy - READ-ONLY; Restore health status + Healthy *bool `json:"healthy,omitempty"` + // RelationshipStatus - READ-ONLY; Status of the restore SnapMirror relationship. Possible values include: 'RelationshipStatusIdle', 'RelationshipStatusTransferring' + RelationshipStatus RelationshipStatus `json:"relationshipStatus,omitempty"` + // MirrorState - READ-ONLY; The status of the restore. Possible values include: 'MirrorStateUninitialized', 'MirrorStateMirrored', 'MirrorStateBroken' + MirrorState MirrorState `json:"mirrorState,omitempty"` + // UnhealthyReason - READ-ONLY; Reason for the unhealthy restore relationship + UnhealthyReason *string `json:"unhealthyReason,omitempty"` + // ErrorMessage - READ-ONLY; Displays error message if the restore is in an error state + ErrorMessage *string `json:"errorMessage,omitempty"` + // TotalTransferBytes - READ-ONLY; Displays the total bytes transferred + TotalTransferBytes *int64 `json:"totalTransferBytes,omitempty"` +} + +// MarshalJSON is the custom marshaler for RestoreStatus. +func (rs RestoreStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ServiceSpecification one property of operation, include metric specifications. +type ServiceSpecification struct { + // MetricSpecifications - Metric specifications of operation. + MetricSpecifications *[]MetricSpecification `json:"metricSpecifications,omitempty"` + // LogSpecifications - Log specification of operation. + LogSpecifications *[]LogSpecification `json:"logSpecifications,omitempty"` +} + +// Snapshot snapshot of a Volume +type Snapshot struct { + autorest.Response `json:"-"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // SnapshotProperties - Snapshot Properties + *SnapshotProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for Snapshot. +func (s Snapshot) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if s.Location != nil { + objectMap["location"] = s.Location + } + if s.SnapshotProperties != nil { + objectMap["properties"] = s.SnapshotProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Snapshot struct. +func (s *Snapshot) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + s.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + s.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + s.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + s.Type = &typeVar + } + case "properties": + if v != nil { + var snapshotProperties SnapshotProperties + err = json.Unmarshal(*v, &snapshotProperties) + if err != nil { + return err + } + s.SnapshotProperties = &snapshotProperties + } + } + } + + return nil +} + +// SnapshotPoliciesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type SnapshotPoliciesDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SnapshotPoliciesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SnapshotPoliciesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SnapshotPoliciesDeleteFuture.Result. +func (future *SnapshotPoliciesDeleteFuture) result(client SnapshotPoliciesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("netapp.SnapshotPoliciesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// SnapshotPoliciesList list of Snapshot Policies +type SnapshotPoliciesList struct { + autorest.Response `json:"-"` + // Value - A list of snapshot policies + Value *[]SnapshotPolicy `json:"value,omitempty"` +} + +// SnapshotPoliciesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type SnapshotPoliciesUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SnapshotPoliciesClient) (SnapshotPolicy, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SnapshotPoliciesUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SnapshotPoliciesUpdateFuture.Result. +func (future *SnapshotPoliciesUpdateFuture) result(client SnapshotPoliciesClient) (sp SnapshotPolicy, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + sp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("netapp.SnapshotPoliciesUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if sp.Response.Response, err = future.GetResult(sender); err == nil && sp.Response.Response.StatusCode != http.StatusNoContent { + sp, err = client.UpdateResponder(sp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesUpdateFuture", "Result", sp.Response.Response, "Failure responding to request") + } + } + return +} + +// SnapshotPolicy snapshot policy information +type SnapshotPolicy struct { + autorest.Response `json:"-"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` + // SnapshotPolicyProperties - Snapshot policy Properties + *SnapshotPolicyProperties `json:"properties,omitempty"` + // SystemData - READ-ONLY; The system meta data relating to this resource. + SystemData *SystemData `json:"systemData,omitempty"` +} + +// MarshalJSON is the custom marshaler for SnapshotPolicy. +func (sp SnapshotPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sp.Location != nil { + objectMap["location"] = sp.Location + } + if sp.Tags != nil { + objectMap["tags"] = sp.Tags + } + if sp.SnapshotPolicyProperties != nil { + objectMap["properties"] = sp.SnapshotPolicyProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SnapshotPolicy struct. +func (sp *SnapshotPolicy) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + sp.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sp.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + sp.Etag = &etag + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sp.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + sp.Tags = tags + } + case "properties": + if v != nil { + var snapshotPolicyProperties SnapshotPolicyProperties + err = json.Unmarshal(*v, &snapshotPolicyProperties) + if err != nil { + return err + } + sp.SnapshotPolicyProperties = &snapshotPolicyProperties + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + sp.SystemData = &systemData + } + } + } + + return nil +} + +// SnapshotPolicyDetails snapshot policy properties +type SnapshotPolicyDetails struct { + // Location - Resource location + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` + // SnapshotPolicyProperties - Snapshot policy Properties + *SnapshotPolicyProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SnapshotPolicyDetails. +func (spd SnapshotPolicyDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if spd.Location != nil { + objectMap["location"] = spd.Location + } + if spd.Tags != nil { + objectMap["tags"] = spd.Tags + } + if spd.SnapshotPolicyProperties != nil { + objectMap["properties"] = spd.SnapshotPolicyProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SnapshotPolicyDetails struct. +func (spd *SnapshotPolicyDetails) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + spd.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + spd.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + spd.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + spd.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + spd.Tags = tags + } + case "properties": + if v != nil { + var snapshotPolicyProperties SnapshotPolicyProperties + err = json.Unmarshal(*v, &snapshotPolicyProperties) + if err != nil { + return err + } + spd.SnapshotPolicyProperties = &snapshotPolicyProperties + } + } + } + + return nil +} + +// SnapshotPolicyPatch snapshot policy Details for create and update +type SnapshotPolicyPatch struct { + // Location - Resource location + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` + // SnapshotPolicyProperties - Snapshot Policy properties + *SnapshotPolicyProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SnapshotPolicyPatch. +func (spp SnapshotPolicyPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if spp.Location != nil { + objectMap["location"] = spp.Location + } + if spp.Tags != nil { + objectMap["tags"] = spp.Tags + } + if spp.SnapshotPolicyProperties != nil { + objectMap["properties"] = spp.SnapshotPolicyProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SnapshotPolicyPatch struct. +func (spp *SnapshotPolicyPatch) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + spp.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + spp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + spp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + spp.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + spp.Tags = tags + } + case "properties": + if v != nil { + var snapshotPolicyProperties SnapshotPolicyProperties + err = json.Unmarshal(*v, &snapshotPolicyProperties) + if err != nil { + return err + } + spp.SnapshotPolicyProperties = &snapshotPolicyProperties + } + } + } + + return nil +} + +// SnapshotPolicyProperties snapshot policy properties +type SnapshotPolicyProperties struct { + // HourlySchedule - Schedule for hourly snapshots + HourlySchedule *HourlySchedule `json:"hourlySchedule,omitempty"` + // DailySchedule - Schedule for daily snapshots + DailySchedule *DailySchedule `json:"dailySchedule,omitempty"` + // WeeklySchedule - Schedule for weekly snapshots + WeeklySchedule *WeeklySchedule `json:"weeklySchedule,omitempty"` + // MonthlySchedule - Schedule for monthly snapshots + MonthlySchedule *MonthlySchedule `json:"monthlySchedule,omitempty"` + // Enabled - The property to decide policy is enabled or not + Enabled *bool `json:"enabled,omitempty"` + // ProvisioningState - READ-ONLY; Azure lifecycle management + ProvisioningState *string `json:"provisioningState,omitempty"` +} + +// MarshalJSON is the custom marshaler for SnapshotPolicyProperties. +func (spp SnapshotPolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if spp.HourlySchedule != nil { + objectMap["hourlySchedule"] = spp.HourlySchedule + } + if spp.DailySchedule != nil { + objectMap["dailySchedule"] = spp.DailySchedule + } + if spp.WeeklySchedule != nil { + objectMap["weeklySchedule"] = spp.WeeklySchedule + } + if spp.MonthlySchedule != nil { + objectMap["monthlySchedule"] = spp.MonthlySchedule + } + if spp.Enabled != nil { + objectMap["enabled"] = spp.Enabled + } + return json.Marshal(objectMap) +} + +// SnapshotPolicyVolumeList volumes associated with snapshot policy +type SnapshotPolicyVolumeList struct { + autorest.Response `json:"-"` + // Value - List of volumes + Value *[]Volume `json:"value,omitempty"` +} + +// SnapshotProperties snapshot properties +type SnapshotProperties struct { + // SnapshotID - READ-ONLY; UUID v4 used to identify the Snapshot + SnapshotID *string `json:"snapshotId,omitempty"` + // Created - READ-ONLY; The creation date of the snapshot + Created *date.Time `json:"created,omitempty"` + // ProvisioningState - READ-ONLY; Azure lifecycle management + ProvisioningState *string `json:"provisioningState,omitempty"` +} + +// MarshalJSON is the custom marshaler for SnapshotProperties. +func (sp SnapshotProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// SnapshotRestoreFiles restore payload for Single File Snapshot Restore +type SnapshotRestoreFiles struct { + // FilePaths - List of files to be restored + FilePaths *[]string `json:"filePaths,omitempty"` + // DestinationPath - Destination folder where the files will be restored + DestinationPath *string `json:"destinationPath,omitempty"` +} + +// SnapshotsCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type SnapshotsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SnapshotsClient) (Snapshot, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SnapshotsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SnapshotsCreateFuture.Result. +func (future *SnapshotsCreateFuture) result(client SnapshotsClient) (s Snapshot, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SnapshotsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + s.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("netapp.SnapshotsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { + s, err = client.CreateResponder(s.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SnapshotsCreateFuture", "Result", s.Response.Response, "Failure responding to request") + } + } + return +} + +// SnapshotsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type SnapshotsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SnapshotsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SnapshotsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SnapshotsDeleteFuture.Result. +func (future *SnapshotsDeleteFuture) result(client SnapshotsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SnapshotsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("netapp.SnapshotsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// SnapshotsList list of Snapshots +type SnapshotsList struct { + autorest.Response `json:"-"` + // Value - A list of Snapshots + Value *[]Snapshot `json:"value,omitempty"` +} + +// SnapshotsRestoreFilesFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type SnapshotsRestoreFilesFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SnapshotsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SnapshotsRestoreFilesFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SnapshotsRestoreFilesFuture.Result. +func (future *SnapshotsRestoreFilesFuture) result(client SnapshotsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SnapshotsRestoreFilesFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("netapp.SnapshotsRestoreFilesFuture") + return + } + ar.Response = future.Response() + return +} + +// SnapshotsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type SnapshotsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SnapshotsClient) (Snapshot, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SnapshotsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SnapshotsUpdateFuture.Result. +func (future *SnapshotsUpdateFuture) result(client SnapshotsClient) (s Snapshot, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SnapshotsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + s.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("netapp.SnapshotsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { + s, err = client.UpdateResponder(s.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SnapshotsUpdateFuture", "Result", s.Response.Response, "Failure responding to request") + } + } + return +} + +// SubscriptionQuotaItem information regarding Subscription Quota Item. +type SubscriptionQuotaItem struct { + autorest.Response `json:"-"` + // SubscriptionQuotaItemProperties - SubscriptionQuotaItem properties + *SubscriptionQuotaItemProperties `json:"properties,omitempty"` + // SystemData - READ-ONLY; The system meta data relating to this resource. + SystemData *SystemData `json:"systemData,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SubscriptionQuotaItem. +func (sqi SubscriptionQuotaItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sqi.SubscriptionQuotaItemProperties != nil { + objectMap["properties"] = sqi.SubscriptionQuotaItemProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SubscriptionQuotaItem struct. +func (sqi *SubscriptionQuotaItem) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var subscriptionQuotaItemProperties SubscriptionQuotaItemProperties + err = json.Unmarshal(*v, &subscriptionQuotaItemProperties) + if err != nil { + return err + } + sqi.SubscriptionQuotaItemProperties = &subscriptionQuotaItemProperties + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + sqi.SystemData = &systemData + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sqi.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sqi.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sqi.Type = &typeVar + } + } + } + + return nil +} + +// SubscriptionQuotaItemList list of Subscription Quota Items +type SubscriptionQuotaItemList struct { + autorest.Response `json:"-"` + // Value - A list of SubscriptionQuotaItems + Value *[]SubscriptionQuotaItem `json:"value,omitempty"` +} + +// SubscriptionQuotaItemProperties subscriptionQuotaItem Properties +type SubscriptionQuotaItemProperties struct { + // Current - READ-ONLY; The current quota value. + Current *int32 `json:"current,omitempty"` + // Default - READ-ONLY; The default quota value. + Default *int32 `json:"default,omitempty"` +} + +// MarshalJSON is the custom marshaler for SubscriptionQuotaItemProperties. +func (sqip SubscriptionQuotaItemProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// SubvolumeInfo subvolume Information properties +type SubvolumeInfo struct { + autorest.Response `json:"-"` + // SubvolumeProperties - Subvolume Properties + *SubvolumeProperties `json:"properties,omitempty"` + // SystemData - READ-ONLY; The system meta data relating to this resource. + SystemData *SystemData `json:"systemData,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SubvolumeInfo. +func (si SubvolumeInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if si.SubvolumeProperties != nil { + objectMap["properties"] = si.SubvolumeProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SubvolumeInfo struct. +func (si *SubvolumeInfo) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var subvolumeProperties SubvolumeProperties + err = json.Unmarshal(*v, &subvolumeProperties) + if err != nil { + return err + } + si.SubvolumeProperties = &subvolumeProperties + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + si.SystemData = &systemData + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + si.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + si.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + si.Type = &typeVar + } + } + } + + return nil +} + +// SubvolumeModel result of the post subvolume and action is to get metadata of the subvolume. +type SubvolumeModel struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // SubvolumeModelProperties - It represents the minimal properties of the subvolume. + *SubvolumeModelProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SubvolumeModel. +func (sm SubvolumeModel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sm.SubvolumeModelProperties != nil { + objectMap["properties"] = sm.SubvolumeModelProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SubvolumeModel struct. +func (sm *SubvolumeModel) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sm.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sm.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sm.Type = &typeVar + } + case "properties": + if v != nil { + var subvolumeModelProperties SubvolumeModelProperties + err = json.Unmarshal(*v, &subvolumeModelProperties) + if err != nil { + return err + } + sm.SubvolumeModelProperties = &subvolumeModelProperties + } + } + } + + return nil +} + +// SubvolumeModelProperties properties which represents actual subvolume model which is stored as a file in +// the system. +type SubvolumeModelProperties struct { + // Path - Path to the subvolume + Path *string `json:"path,omitempty"` + // ParentPath - Path to the parent subvolume + ParentPath *string `json:"parentPath,omitempty"` + // Size - Size of subvolume + Size *int64 `json:"size,omitempty"` + // BytesUsed - Bytes used + BytesUsed *int64 `json:"bytesUsed,omitempty"` + // Permissions - Permissions of the subvolume + Permissions *string `json:"permissions,omitempty"` + // CreationTimeStamp - Creation time and date + CreationTimeStamp *date.Time `json:"creationTimeStamp,omitempty"` + // AccessedTimeStamp - Most recent access time and date + AccessedTimeStamp *date.Time `json:"accessedTimeStamp,omitempty"` + // ModifiedTimeStamp - Most recent modification time and date + ModifiedTimeStamp *date.Time `json:"modifiedTimeStamp,omitempty"` + // ChangedTimeStamp - Most recent change time and date + ChangedTimeStamp *date.Time `json:"changedTimeStamp,omitempty"` + // ProvisioningState - Azure lifecycle management + ProvisioningState *string `json:"provisioningState,omitempty"` +} + +// SubvolumePatchParams parameters with which a subvolume can be updated +type SubvolumePatchParams struct { + // Size - Truncate subvolume to the provided size in bytes + Size *int64 `json:"size,omitempty"` + // Path - path to the subvolume + Path *string `json:"path,omitempty"` +} + +// SubvolumePatchRequest subvolume Patch Request properties +type SubvolumePatchRequest struct { + // SubvolumePatchParams - Subvolume Properties + *SubvolumePatchParams `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SubvolumePatchRequest. +func (spr SubvolumePatchRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if spr.SubvolumePatchParams != nil { + objectMap["properties"] = spr.SubvolumePatchParams + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SubvolumePatchRequest struct. +func (spr *SubvolumePatchRequest) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var subvolumePatchParams SubvolumePatchParams + err = json.Unmarshal(*v, &subvolumePatchParams) + if err != nil { + return err + } + spr.SubvolumePatchParams = &subvolumePatchParams + } + } + } + + return nil +} + +// SubvolumeProperties this represents path associated with the subvolume +type SubvolumeProperties struct { + // Path - Path to the subvolume + Path *string `json:"path,omitempty"` + // Size - Truncate subvolume to the provided size in bytes + Size *int64 `json:"size,omitempty"` + // ParentPath - parent path to the subvolume + ParentPath *string `json:"parentPath,omitempty"` + // ProvisioningState - READ-ONLY; Azure lifecycle management + ProvisioningState *string `json:"provisioningState,omitempty"` +} + +// MarshalJSON is the custom marshaler for SubvolumeProperties. +func (sp SubvolumeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sp.Path != nil { + objectMap["path"] = sp.Path + } + if sp.Size != nil { + objectMap["size"] = sp.Size + } + if sp.ParentPath != nil { + objectMap["parentPath"] = sp.ParentPath + } + return json.Marshal(objectMap) +} + +// SubvolumesCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type SubvolumesCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SubvolumesClient) (SubvolumeInfo, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SubvolumesCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SubvolumesCreateFuture.Result. +func (future *SubvolumesCreateFuture) result(client SubvolumesClient) (si SubvolumeInfo, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SubvolumesCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + si.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("netapp.SubvolumesCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if si.Response.Response, err = future.GetResult(sender); err == nil && si.Response.Response.StatusCode != http.StatusNoContent { + si, err = client.CreateResponder(si.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SubvolumesCreateFuture", "Result", si.Response.Response, "Failure responding to request") + } + } + return +} + +// SubvolumesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type SubvolumesDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SubvolumesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SubvolumesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SubvolumesDeleteFuture.Result. +func (future *SubvolumesDeleteFuture) result(client SubvolumesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SubvolumesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("netapp.SubvolumesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// SubvolumesGetMetadataFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type SubvolumesGetMetadataFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SubvolumesClient) (SubvolumeModel, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SubvolumesGetMetadataFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SubvolumesGetMetadataFuture.Result. +func (future *SubvolumesGetMetadataFuture) result(client SubvolumesClient) (sm SubvolumeModel, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SubvolumesGetMetadataFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + sm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("netapp.SubvolumesGetMetadataFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if sm.Response.Response, err = future.GetResult(sender); err == nil && sm.Response.Response.StatusCode != http.StatusNoContent { + sm, err = client.GetMetadataResponder(sm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SubvolumesGetMetadataFuture", "Result", sm.Response.Response, "Failure responding to request") + } + } + return +} + +// SubvolumesList list of Subvolumes +type SubvolumesList struct { + autorest.Response `json:"-"` + // Value - A list of Subvolumes + Value *[]SubvolumeInfo `json:"value,omitempty"` + // NextLink - URL to get the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// SubvolumesListIterator provides access to a complete listing of SubvolumeInfo values. +type SubvolumesListIterator struct { + i int + page SubvolumesListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *SubvolumesListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubvolumesListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *SubvolumesListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SubvolumesListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter SubvolumesListIterator) Response() SubvolumesList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter SubvolumesListIterator) Value() SubvolumeInfo { + if !iter.page.NotDone() { + return SubvolumeInfo{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SubvolumesListIterator type. +func NewSubvolumesListIterator(page SubvolumesListPage) SubvolumesListIterator { + return SubvolumesListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (sl SubvolumesList) IsEmpty() bool { + return sl.Value == nil || len(*sl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (sl SubvolumesList) hasNextLink() bool { + return sl.NextLink != nil && len(*sl.NextLink) != 0 +} + +// subvolumesListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sl SubvolumesList) subvolumesListPreparer(ctx context.Context) (*http.Request, error) { + if !sl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sl.NextLink))) +} + +// SubvolumesListPage contains a page of SubvolumeInfo values. +type SubvolumesListPage struct { + fn func(context.Context, SubvolumesList) (SubvolumesList, error) + sl SubvolumesList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *SubvolumesListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubvolumesListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.sl) + if err != nil { + return err + } + page.sl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *SubvolumesListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SubvolumesListPage) NotDone() bool { + return !page.sl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SubvolumesListPage) Response() SubvolumesList { + return page.sl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SubvolumesListPage) Values() []SubvolumeInfo { + if page.sl.IsEmpty() { + return nil + } + return *page.sl.Value +} + +// Creates a new instance of the SubvolumesListPage type. +func NewSubvolumesListPage(cur SubvolumesList, getNextPage func(context.Context, SubvolumesList) (SubvolumesList, error)) SubvolumesListPage { + return SubvolumesListPage{ + fn: getNextPage, + sl: cur, + } +} + +// SubvolumesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type SubvolumesUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SubvolumesClient) (SubvolumeInfo, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SubvolumesUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SubvolumesUpdateFuture.Result. +func (future *SubvolumesUpdateFuture) result(client SubvolumesClient) (si SubvolumeInfo, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SubvolumesUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + si.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("netapp.SubvolumesUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if si.Response.Response, err = future.GetResult(sender); err == nil && si.Response.Response.StatusCode != http.StatusNoContent { + si, err = client.UpdateResponder(si.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SubvolumesUpdateFuture", "Result", si.Response.Response, "Failure responding to request") + } + } + return +} + +// SystemData metadata pertaining to creation and last modification of the resource. +type SystemData struct { + // CreatedBy - The identity that created the resource. + CreatedBy *string `json:"createdBy,omitempty"` + // CreatedByType - The type of identity that created the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey' + CreatedByType CreatedByType `json:"createdByType,omitempty"` + // CreatedAt - The timestamp of resource creation (UTC). + CreatedAt *date.Time `json:"createdAt,omitempty"` + // LastModifiedBy - The identity that last modified the resource. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + // LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey' + LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"` + // LastModifiedAt - The timestamp of resource last modification (UTC) + LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"` +} + +// TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource +// which has 'tags' and a 'location' +type TrackedResource struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for TrackedResource. +func (tr TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tr.Tags != nil { + objectMap["tags"] = tr.Tags + } + if tr.Location != nil { + objectMap["location"] = tr.Location + } + return json.Marshal(objectMap) +} + +// Vault vault information +type Vault struct { + // Location - Resource location + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // VaultProperties - Vault Properties + *VaultProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for Vault. +func (vVar Vault) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vVar.Location != nil { + objectMap["location"] = vVar.Location + } + if vVar.VaultProperties != nil { + objectMap["properties"] = vVar.VaultProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Vault struct. +func (vVar *Vault) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + vVar.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vVar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vVar.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vVar.Type = &typeVar + } + case "properties": + if v != nil { + var vaultProperties VaultProperties + err = json.Unmarshal(*v, &vaultProperties) + if err != nil { + return err + } + vVar.VaultProperties = &vaultProperties + } + } + } + + return nil +} + +// VaultList list of Vaults +type VaultList struct { + autorest.Response `json:"-"` + // Value - A list of vaults + Value *[]Vault `json:"value,omitempty"` +} + +// VaultProperties vault properties +type VaultProperties struct { + // VaultName - Vault Name + VaultName *string `json:"vaultName,omitempty"` +} + +// Volume volume resource +type Volume struct { + autorest.Response `json:"-"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` + // VolumeProperties - Volume properties + *VolumeProperties `json:"properties,omitempty"` + // SystemData - READ-ONLY; The system meta data relating to this resource. + SystemData *SystemData `json:"systemData,omitempty"` +} + +// MarshalJSON is the custom marshaler for Volume. +func (vVar Volume) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vVar.Location != nil { + objectMap["location"] = vVar.Location + } + if vVar.Tags != nil { + objectMap["tags"] = vVar.Tags + } + if vVar.VolumeProperties != nil { + objectMap["properties"] = vVar.VolumeProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Volume struct. +func (vVar *Volume) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + vVar.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vVar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vVar.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + vVar.Etag = &etag + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vVar.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + vVar.Tags = tags + } + case "properties": + if v != nil { + var volumeProperties VolumeProperties + err = json.Unmarshal(*v, &volumeProperties) + if err != nil { + return err + } + vVar.VolumeProperties = &volumeProperties + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + vVar.SystemData = &systemData + } + } + } + + return nil +} + +// VolumeBackupProperties volume Backup Properties +type VolumeBackupProperties struct { + // BackupPolicyID - Backup Policy Resource ID + BackupPolicyID *string `json:"backupPolicyId,omitempty"` + // PolicyEnforced - Policy Enforced + PolicyEnforced *bool `json:"policyEnforced,omitempty"` + // VaultID - Vault Resource ID + VaultID *string `json:"vaultId,omitempty"` + // BackupEnabled - Backup Enabled + BackupEnabled *bool `json:"backupEnabled,omitempty"` +} + +// VolumeBackups volume details using the backup policy +type VolumeBackups struct { + // VolumeName - Volume name + VolumeName *string `json:"volumeName,omitempty"` + // BackupsCount - Total count of backups for volume + BackupsCount *int32 `json:"backupsCount,omitempty"` + // PolicyEnabled - Policy enabled + PolicyEnabled *bool `json:"policyEnabled,omitempty"` +} + +// VolumeGroup volume group resource +type VolumeGroup struct { + // Location - Resource location + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` + // VolumeGroupListProperties - Volume group properties + *VolumeGroupListProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for VolumeGroup. +func (vg VolumeGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vg.Location != nil { + objectMap["location"] = vg.Location + } + if vg.Tags != nil { + objectMap["tags"] = vg.Tags + } + if vg.VolumeGroupListProperties != nil { + objectMap["properties"] = vg.VolumeGroupListProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VolumeGroup struct. +func (vg *VolumeGroup) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + vg.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vg.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vg.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vg.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + vg.Tags = tags + } + case "properties": + if v != nil { + var volumeGroupListProperties VolumeGroupListProperties + err = json.Unmarshal(*v, &volumeGroupListProperties) + if err != nil { + return err + } + vg.VolumeGroupListProperties = &volumeGroupListProperties + } + } + } + + return nil +} + +// VolumeGroupDetails volume group resource for create +type VolumeGroupDetails struct { + autorest.Response `json:"-"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` + // VolumeGroupProperties - Volume group properties + *VolumeGroupProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for VolumeGroupDetails. +func (vgd VolumeGroupDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vgd.Location != nil { + objectMap["location"] = vgd.Location + } + if vgd.Tags != nil { + objectMap["tags"] = vgd.Tags + } + if vgd.VolumeGroupProperties != nil { + objectMap["properties"] = vgd.VolumeGroupProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VolumeGroupDetails struct. +func (vgd *VolumeGroupDetails) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + vgd.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vgd.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vgd.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vgd.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + vgd.Tags = tags + } + case "properties": + if v != nil { + var volumeGroupProperties VolumeGroupProperties + err = json.Unmarshal(*v, &volumeGroupProperties) + if err != nil { + return err + } + vgd.VolumeGroupProperties = &volumeGroupProperties + } + } + } + + return nil +} + +// VolumeGroupList list of volume group resources +type VolumeGroupList struct { + autorest.Response `json:"-"` + // Value - List of volume Groups + Value *[]VolumeGroup `json:"value,omitempty"` +} + +// VolumeGroupListProperties volume group properties +type VolumeGroupListProperties struct { + // ProvisioningState - READ-ONLY; Azure lifecycle management + ProvisioningState *string `json:"provisioningState,omitempty"` + // GroupMetaData - Volume group details + GroupMetaData *VolumeGroupMetaData `json:"groupMetaData,omitempty"` +} + +// MarshalJSON is the custom marshaler for VolumeGroupListProperties. +func (vglp VolumeGroupListProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vglp.GroupMetaData != nil { + objectMap["groupMetaData"] = vglp.GroupMetaData + } + return json.Marshal(objectMap) +} + +// VolumeGroupMetaData volume group properties +type VolumeGroupMetaData struct { + // GroupDescription - Group Description + GroupDescription *string `json:"groupDescription,omitempty"` + // ApplicationType - Application Type. Possible values include: 'ApplicationTypeSAPHANA' + ApplicationType ApplicationType `json:"applicationType,omitempty"` + // ApplicationIdentifier - Application specific identifier + ApplicationIdentifier *string `json:"applicationIdentifier,omitempty"` + // GlobalPlacementRules - Application specific placement rules for the volume group + GlobalPlacementRules *[]PlacementKeyValuePairs `json:"globalPlacementRules,omitempty"` + // DeploymentSpecID - Application specific identifier of deployment rules for the volume group + DeploymentSpecID *string `json:"deploymentSpecId,omitempty"` + // VolumesCount - READ-ONLY; Number of volumes in volume group + VolumesCount *int64 `json:"volumesCount,omitempty"` +} + +// MarshalJSON is the custom marshaler for VolumeGroupMetaData. +func (vgmd VolumeGroupMetaData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vgmd.GroupDescription != nil { + objectMap["groupDescription"] = vgmd.GroupDescription + } + if vgmd.ApplicationType != "" { + objectMap["applicationType"] = vgmd.ApplicationType + } + if vgmd.ApplicationIdentifier != nil { + objectMap["applicationIdentifier"] = vgmd.ApplicationIdentifier + } + if vgmd.GlobalPlacementRules != nil { + objectMap["globalPlacementRules"] = vgmd.GlobalPlacementRules + } + if vgmd.DeploymentSpecID != nil { + objectMap["deploymentSpecId"] = vgmd.DeploymentSpecID + } + return json.Marshal(objectMap) +} + +// VolumeGroupProperties volume group properties +type VolumeGroupProperties struct { + // ProvisioningState - READ-ONLY; Azure lifecycle management + ProvisioningState *string `json:"provisioningState,omitempty"` + // GroupMetaData - Volume group details + GroupMetaData *VolumeGroupMetaData `json:"groupMetaData,omitempty"` + // Volumes - List of volumes from group + Volumes *[]VolumeGroupVolumeProperties `json:"volumes,omitempty"` +} + +// MarshalJSON is the custom marshaler for VolumeGroupProperties. +func (vgp VolumeGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vgp.GroupMetaData != nil { + objectMap["groupMetaData"] = vgp.GroupMetaData + } + if vgp.Volumes != nil { + objectMap["volumes"] = vgp.Volumes + } + return json.Marshal(objectMap) +} + +// VolumeGroupsCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type VolumeGroupsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VolumeGroupsClient) (VolumeGroupDetails, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VolumeGroupsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VolumeGroupsCreateFuture.Result. +func (future *VolumeGroupsCreateFuture) result(client VolumeGroupsClient) (vgd VolumeGroupDetails, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumeGroupsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vgd.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("netapp.VolumeGroupsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vgd.Response.Response, err = future.GetResult(sender); err == nil && vgd.Response.Response.StatusCode != http.StatusNoContent { + vgd, err = client.CreateResponder(vgd.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumeGroupsCreateFuture", "Result", vgd.Response.Response, "Failure responding to request") + } + } + return +} + +// VolumeGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type VolumeGroupsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VolumeGroupsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VolumeGroupsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VolumeGroupsDeleteFuture.Result. +func (future *VolumeGroupsDeleteFuture) result(client VolumeGroupsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumeGroupsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("netapp.VolumeGroupsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// VolumeGroupVolumeProperties volume resource +type VolumeGroupVolumeProperties struct { + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` + // VolumeProperties - Volume properties + *VolumeProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for VolumeGroupVolumeProperties. +func (vgvp VolumeGroupVolumeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vgvp.Name != nil { + objectMap["name"] = vgvp.Name + } + if vgvp.Tags != nil { + objectMap["tags"] = vgvp.Tags + } + if vgvp.VolumeProperties != nil { + objectMap["properties"] = vgvp.VolumeProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VolumeGroupVolumeProperties struct. +func (vgvp *VolumeGroupVolumeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vgvp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vgvp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vgvp.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + vgvp.Tags = tags + } + case "properties": + if v != nil { + var volumeProperties VolumeProperties + err = json.Unmarshal(*v, &volumeProperties) + if err != nil { + return err + } + vgvp.VolumeProperties = &volumeProperties + } + } + } + + return nil +} + +// VolumeList list of volume resources +type VolumeList struct { + autorest.Response `json:"-"` + // Value - List of volumes + Value *[]Volume `json:"value,omitempty"` + // NextLink - URL to get the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// VolumeListIterator provides access to a complete listing of Volume values. +type VolumeListIterator struct { + i int + page VolumeListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *VolumeListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VolumeListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *VolumeListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter VolumeListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter VolumeListIterator) Response() VolumeList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter VolumeListIterator) Value() Volume { + if !iter.page.NotDone() { + return Volume{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the VolumeListIterator type. +func NewVolumeListIterator(page VolumeListPage) VolumeListIterator { + return VolumeListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (vl VolumeList) IsEmpty() bool { + return vl.Value == nil || len(*vl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (vl VolumeList) hasNextLink() bool { + return vl.NextLink != nil && len(*vl.NextLink) != 0 +} + +// volumeListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (vl VolumeList) volumeListPreparer(ctx context.Context) (*http.Request, error) { + if !vl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(vl.NextLink))) +} + +// VolumeListPage contains a page of Volume values. +type VolumeListPage struct { + fn func(context.Context, VolumeList) (VolumeList, error) + vl VolumeList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *VolumeListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VolumeListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.vl) + if err != nil { + return err + } + page.vl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *VolumeListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page VolumeListPage) NotDone() bool { + return !page.vl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page VolumeListPage) Response() VolumeList { + return page.vl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page VolumeListPage) Values() []Volume { + if page.vl.IsEmpty() { + return nil + } + return *page.vl.Value +} + +// Creates a new instance of the VolumeListPage type. +func NewVolumeListPage(cur VolumeList, getNextPage func(context.Context, VolumeList) (VolumeList, error)) VolumeListPage { + return VolumeListPage{ + fn: getNextPage, + vl: cur, + } +} + +// VolumePatch volume patch resource +type VolumePatch struct { + // Location - Resource location + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` + // VolumePatchProperties - Patchable volume properties + *VolumePatchProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for VolumePatch. +func (vp VolumePatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vp.Location != nil { + objectMap["location"] = vp.Location + } + if vp.Tags != nil { + objectMap["tags"] = vp.Tags + } + if vp.VolumePatchProperties != nil { + objectMap["properties"] = vp.VolumePatchProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VolumePatch struct. +func (vp *VolumePatch) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + vp.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vp.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + vp.Tags = tags + } + case "properties": + if v != nil { + var volumePatchProperties VolumePatchProperties + err = json.Unmarshal(*v, &volumePatchProperties) + if err != nil { + return err + } + vp.VolumePatchProperties = &volumePatchProperties + } + } + } + + return nil +} + +// VolumePatchProperties patchable volume properties +type VolumePatchProperties struct { + // ServiceLevel - Possible values include: 'ServiceLevelStandard', 'ServiceLevelPremium', 'ServiceLevelUltra', 'ServiceLevelStandardZRS' + ServiceLevel ServiceLevel `json:"serviceLevel,omitempty"` + // UsageThreshold - Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. Minimum size is 100 GiB. Upper limit is 100TiB. Specified in bytes. + UsageThreshold *int64 `json:"usageThreshold,omitempty"` + // ExportPolicy - Set of export policy rules + ExportPolicy *VolumePatchPropertiesExportPolicy `json:"exportPolicy,omitempty"` + ThroughputMibps *float64 `json:"throughputMibps,omitempty"` + // DataProtection - DataProtection type volumes include an object containing details of the replication + DataProtection *VolumePatchPropertiesDataProtection `json:"dataProtection,omitempty"` + // IsDefaultQuotaEnabled - Specifies if default quota is enabled for the volume. + IsDefaultQuotaEnabled *bool `json:"isDefaultQuotaEnabled,omitempty"` + // DefaultUserQuotaInKiBs - Default user quota for volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies . + DefaultUserQuotaInKiBs *int64 `json:"defaultUserQuotaInKiBs,omitempty"` + // DefaultGroupQuotaInKiBs - Default group quota for volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies. + DefaultGroupQuotaInKiBs *int64 `json:"defaultGroupQuotaInKiBs,omitempty"` + // UnixPermissions - UNIX permissions for NFS volume accepted in octal 4 digit format. First digit selects the set user ID(4), set group ID (2) and sticky (1) attributes. Second digit selects permission for the owner of the file: read (4), write (2) and execute (1). Third selects permissions for other users in the same group. the fourth for other users not in the group. 0755 - gives read/write/execute permissions to owner and read/execute to group and other users. + UnixPermissions *string `json:"unixPermissions,omitempty"` +} + +// VolumePatchPropertiesDataProtection dataProtection type volumes include an object containing details of +// the replication +type VolumePatchPropertiesDataProtection struct { + // Backup - Backup Properties + Backup *VolumeBackupProperties `json:"backup,omitempty"` + // Snapshot - Snapshot properties. + Snapshot *VolumeSnapshotProperties `json:"snapshot,omitempty"` +} + +// VolumePatchPropertiesExportPolicy set of export policy rules +type VolumePatchPropertiesExportPolicy struct { + // Rules - Export policy rule + Rules *[]ExportPolicyRule `json:"rules,omitempty"` +} + +// VolumeProperties volume properties +type VolumeProperties struct { + // FileSystemID - READ-ONLY; Unique FileSystem Identifier. + FileSystemID *string `json:"fileSystemId,omitempty"` + // CreationToken - A unique file path for the volume. Used when creating mount targets + CreationToken *string `json:"creationToken,omitempty"` + // ServiceLevel - Possible values include: 'ServiceLevelStandard', 'ServiceLevelPremium', 'ServiceLevelUltra', 'ServiceLevelStandardZRS' + ServiceLevel ServiceLevel `json:"serviceLevel,omitempty"` + // UsageThreshold - Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. Minimum size is 100 GiB. Upper limit is 100TiB. Specified in bytes. + UsageThreshold *int64 `json:"usageThreshold,omitempty"` + // ExportPolicy - Set of export policy rules + ExportPolicy *VolumePropertiesExportPolicy `json:"exportPolicy,omitempty"` + // ProtocolTypes - Set of protocol types, default NFSv3, CIFS for SMB protocol + ProtocolTypes *[]string `json:"protocolTypes,omitempty"` + // ProvisioningState - READ-ONLY; Azure lifecycle management + ProvisioningState *string `json:"provisioningState,omitempty"` + // SnapshotID - UUID v4 or resource identifier used to identify the Snapshot. + SnapshotID *string `json:"snapshotId,omitempty"` + // BackupID - UUID v4 or resource identifier used to identify the Backup. + BackupID *string `json:"backupId,omitempty"` + // BaremetalTenantID - READ-ONLY; Unique Baremetal Tenant Identifier. + BaremetalTenantID *string `json:"baremetalTenantId,omitempty"` + // SubnetID - The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes + SubnetID *string `json:"subnetId,omitempty"` + // NetworkFeatures - Basic network, or Standard features available to the volume. Possible values include: 'NetworkFeaturesBasic', 'NetworkFeaturesStandard' + NetworkFeatures NetworkFeatures `json:"networkFeatures,omitempty"` + // NetworkSiblingSetID - READ-ONLY; Network Sibling Set ID for the the group of volumes sharing networking resources. + NetworkSiblingSetID *string `json:"networkSiblingSetId,omitempty"` + // StorageToNetworkProximity - READ-ONLY; Provides storage to network proximity information for the volume. Possible values include: 'VolumeStorageToNetworkProximityDefault', 'VolumeStorageToNetworkProximityT1', 'VolumeStorageToNetworkProximityT2' + StorageToNetworkProximity VolumeStorageToNetworkProximity `json:"storageToNetworkProximity,omitempty"` + // MountTargets - READ-ONLY; List of mount targets + MountTargets *[]MountTargetProperties `json:"mountTargets,omitempty"` + // VolumeType - What type of volume is this. For destination volumes in Cross Region Replication, set type to DataProtection + VolumeType *string `json:"volumeType,omitempty"` + // DataProtection - DataProtection type volumes include an object containing details of the replication + DataProtection *VolumePropertiesDataProtection `json:"dataProtection,omitempty"` + // IsRestoring - Restoring + IsRestoring *bool `json:"isRestoring,omitempty"` + // SnapshotDirectoryVisible - If enabled (true) the volume will contain a read-only snapshot directory which provides access to each of the volume's snapshots (default to true). + SnapshotDirectoryVisible *bool `json:"snapshotDirectoryVisible,omitempty"` + // KerberosEnabled - Describe if a volume is KerberosEnabled. To be use with swagger version 2020-05-01 or later + KerberosEnabled *bool `json:"kerberosEnabled,omitempty"` + // SecurityStyle - The security style of volume, default unix, defaults to ntfs for dual protocol or CIFS protocol. Possible values include: 'SecurityStyleNtfs', 'SecurityStyleUnix' + SecurityStyle SecurityStyle `json:"securityStyle,omitempty"` + // SmbEncryption - Enables encryption for in-flight smb3 data. Only applicable for SMB/DualProtocol volume. To be used with swagger version 2020-08-01 or later + SmbEncryption *bool `json:"smbEncryption,omitempty"` + // SmbContinuouslyAvailable - Enables continuously available share property for smb volume. Only applicable for SMB volume + SmbContinuouslyAvailable *bool `json:"smbContinuouslyAvailable,omitempty"` + ThroughputMibps *float64 `json:"throughputMibps,omitempty"` + // EncryptionKeySource - Encryption Key Source. Possible values are: 'Microsoft.NetApp' + EncryptionKeySource *string `json:"encryptionKeySource,omitempty"` + // LdapEnabled - Specifies whether LDAP is enabled or not for a given NFS volume. + LdapEnabled *bool `json:"ldapEnabled,omitempty"` + // CoolAccess - Specifies whether Cool Access(tiering) is enabled for the volume. + CoolAccess *bool `json:"coolAccess,omitempty"` + // CoolnessPeriod - Specifies the number of days after which data that is not accessed by clients will be tiered. + CoolnessPeriod *int32 `json:"coolnessPeriod,omitempty"` + // UnixPermissions - UNIX permissions for NFS volume accepted in octal 4 digit format. First digit selects the set user ID(4), set group ID (2) and sticky (1) attributes. Second digit selects permission for the owner of the file: read (4), write (2) and execute (1). Third selects permissions for other users in the same group. the fourth for other users not in the group. 0755 - gives read/write/execute permissions to owner and read/execute to group and other users. + UnixPermissions *string `json:"unixPermissions,omitempty"` + // CloneProgress - READ-ONLY; When a volume is being restored from another volume's snapshot, will show the percentage completion of this cloning process. When this value is empty/null there is no cloning process currently happening on this volume. This value will update every 5 minutes during cloning. + CloneProgress *int32 `json:"cloneProgress,omitempty"` + // AvsDataStore - Specifies whether the volume is enabled for Azure VMware Solution (AVS) datastore purpose. Possible values include: 'AvsDataStoreEnabled', 'AvsDataStoreDisabled' + AvsDataStore AvsDataStore `json:"avsDataStore,omitempty"` + // IsDefaultQuotaEnabled - Specifies if default quota is enabled for the volume. + IsDefaultQuotaEnabled *bool `json:"isDefaultQuotaEnabled,omitempty"` + // DefaultUserQuotaInKiBs - Default user quota for volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies . + DefaultUserQuotaInKiBs *int64 `json:"defaultUserQuotaInKiBs,omitempty"` + // DefaultGroupQuotaInKiBs - Default group quota for volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies. + DefaultGroupQuotaInKiBs *int64 `json:"defaultGroupQuotaInKiBs,omitempty"` + // MaximumNumberOfFiles - READ-ONLY; Maximum number of files allowed. Needs a service request in order to be changed. Only allowed to be changed if volume quota is more than 4TiB. + MaximumNumberOfFiles *int64 `json:"maximumNumberOfFiles,omitempty"` + // VolumeGroupName - READ-ONLY; Volume Group Name + VolumeGroupName *string `json:"volumeGroupName,omitempty"` + // CapacityPoolResourceID - Pool Resource Id used in case of creating a volume through volume group + CapacityPoolResourceID *string `json:"capacityPoolResourceId,omitempty"` + // ProximityPlacementGroup - Proximity placement group associated with the volume + ProximityPlacementGroup *string `json:"proximityPlacementGroup,omitempty"` + // T2Network - READ-ONLY; T2 network information + T2Network *string `json:"t2Network,omitempty"` + // VolumeSpecName - Volume spec name is the application specific designation or identifier for the particular volume in a volume group for e.g. data, log + VolumeSpecName *string `json:"volumeSpecName,omitempty"` + // PlacementRules - Application specific placement rules for the particular volume + PlacementRules *[]PlacementKeyValuePairs `json:"placementRules,omitempty"` + // EnableSubvolumes - Flag indicating whether subvolume operations are enabled on the volume. Possible values include: 'EnableSubvolumesEnabled', 'EnableSubvolumesDisabled' + EnableSubvolumes EnableSubvolumes `json:"enableSubvolumes,omitempty"` +} + +// MarshalJSON is the custom marshaler for VolumeProperties. +func (vp VolumeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vp.CreationToken != nil { + objectMap["creationToken"] = vp.CreationToken + } + if vp.ServiceLevel != "" { + objectMap["serviceLevel"] = vp.ServiceLevel + } + if vp.UsageThreshold != nil { + objectMap["usageThreshold"] = vp.UsageThreshold + } + if vp.ExportPolicy != nil { + objectMap["exportPolicy"] = vp.ExportPolicy + } + if vp.ProtocolTypes != nil { + objectMap["protocolTypes"] = vp.ProtocolTypes + } + if vp.SnapshotID != nil { + objectMap["snapshotId"] = vp.SnapshotID + } + if vp.BackupID != nil { + objectMap["backupId"] = vp.BackupID + } + if vp.SubnetID != nil { + objectMap["subnetId"] = vp.SubnetID + } + if vp.NetworkFeatures != "" { + objectMap["networkFeatures"] = vp.NetworkFeatures + } + if vp.VolumeType != nil { + objectMap["volumeType"] = vp.VolumeType + } + if vp.DataProtection != nil { + objectMap["dataProtection"] = vp.DataProtection + } + if vp.IsRestoring != nil { + objectMap["isRestoring"] = vp.IsRestoring + } + if vp.SnapshotDirectoryVisible != nil { + objectMap["snapshotDirectoryVisible"] = vp.SnapshotDirectoryVisible + } + if vp.KerberosEnabled != nil { + objectMap["kerberosEnabled"] = vp.KerberosEnabled + } + if vp.SecurityStyle != "" { + objectMap["securityStyle"] = vp.SecurityStyle + } + if vp.SmbEncryption != nil { + objectMap["smbEncryption"] = vp.SmbEncryption + } + if vp.SmbContinuouslyAvailable != nil { + objectMap["smbContinuouslyAvailable"] = vp.SmbContinuouslyAvailable + } + if vp.ThroughputMibps != nil { + objectMap["throughputMibps"] = vp.ThroughputMibps + } + if vp.EncryptionKeySource != nil { + objectMap["encryptionKeySource"] = vp.EncryptionKeySource + } + if vp.LdapEnabled != nil { + objectMap["ldapEnabled"] = vp.LdapEnabled + } + if vp.CoolAccess != nil { + objectMap["coolAccess"] = vp.CoolAccess + } + if vp.CoolnessPeriod != nil { + objectMap["coolnessPeriod"] = vp.CoolnessPeriod + } + if vp.UnixPermissions != nil { + objectMap["unixPermissions"] = vp.UnixPermissions + } + if vp.AvsDataStore != "" { + objectMap["avsDataStore"] = vp.AvsDataStore + } + if vp.IsDefaultQuotaEnabled != nil { + objectMap["isDefaultQuotaEnabled"] = vp.IsDefaultQuotaEnabled + } + if vp.DefaultUserQuotaInKiBs != nil { + objectMap["defaultUserQuotaInKiBs"] = vp.DefaultUserQuotaInKiBs + } + if vp.DefaultGroupQuotaInKiBs != nil { + objectMap["defaultGroupQuotaInKiBs"] = vp.DefaultGroupQuotaInKiBs + } + if vp.CapacityPoolResourceID != nil { + objectMap["capacityPoolResourceId"] = vp.CapacityPoolResourceID + } + if vp.ProximityPlacementGroup != nil { + objectMap["proximityPlacementGroup"] = vp.ProximityPlacementGroup + } + if vp.VolumeSpecName != nil { + objectMap["volumeSpecName"] = vp.VolumeSpecName + } + if vp.PlacementRules != nil { + objectMap["placementRules"] = vp.PlacementRules + } + if vp.EnableSubvolumes != "" { + objectMap["enableSubvolumes"] = vp.EnableSubvolumes + } + return json.Marshal(objectMap) +} + +// VolumePropertiesDataProtection dataProtection type volumes include an object containing details of the +// replication +type VolumePropertiesDataProtection struct { + // Backup - Backup Properties + Backup *VolumeBackupProperties `json:"backup,omitempty"` + // Replication - Replication properties + Replication *ReplicationObject `json:"replication,omitempty"` + // Snapshot - Snapshot properties. + Snapshot *VolumeSnapshotProperties `json:"snapshot,omitempty"` +} + +// VolumePropertiesExportPolicy set of export policy rules +type VolumePropertiesExportPolicy struct { + // Rules - Export policy rule + Rules *[]ExportPolicyRule `json:"rules,omitempty"` +} + +// VolumeRevert revert a volume to the snapshot +type VolumeRevert struct { + // SnapshotID - Resource id of the snapshot + SnapshotID *string `json:"snapshotId,omitempty"` +} + +// VolumesAuthorizeReplicationFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VolumesAuthorizeReplicationFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VolumesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VolumesAuthorizeReplicationFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VolumesAuthorizeReplicationFuture.Result. +func (future *VolumesAuthorizeReplicationFuture) result(client VolumesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesAuthorizeReplicationFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("netapp.VolumesAuthorizeReplicationFuture") + return + } + ar.Response = future.Response() + return +} + +// VolumesBreakReplicationFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type VolumesBreakReplicationFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VolumesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VolumesBreakReplicationFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VolumesBreakReplicationFuture.Result. +func (future *VolumesBreakReplicationFuture) result(client VolumesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesBreakReplicationFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("netapp.VolumesBreakReplicationFuture") + return + } + ar.Response = future.Response() + return +} + +// VolumesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type VolumesCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VolumesClient) (Volume, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VolumesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VolumesCreateOrUpdateFuture.Result. +func (future *VolumesCreateOrUpdateFuture) result(client VolumesClient) (vVar Volume, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vVar.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("netapp.VolumesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vVar.Response.Response, err = future.GetResult(sender); err == nil && vVar.Response.Response.StatusCode != http.StatusNoContent { + vVar, err = client.CreateOrUpdateResponder(vVar.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesCreateOrUpdateFuture", "Result", vVar.Response.Response, "Failure responding to request") + } + } + return +} + +// VolumesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type VolumesDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VolumesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VolumesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VolumesDeleteFuture.Result. +func (future *VolumesDeleteFuture) result(client VolumesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("netapp.VolumesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// VolumesDeleteReplicationFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VolumesDeleteReplicationFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VolumesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VolumesDeleteReplicationFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VolumesDeleteReplicationFuture.Result. +func (future *VolumesDeleteReplicationFuture) result(client VolumesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesDeleteReplicationFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("netapp.VolumesDeleteReplicationFuture") + return + } + ar.Response = future.Response() + return +} + +// VolumeSnapshotProperties volume Snapshot Properties +type VolumeSnapshotProperties struct { + // SnapshotPolicyID - Snapshot Policy ResourceId + SnapshotPolicyID *string `json:"snapshotPolicyId,omitempty"` +} + +// VolumesPoolChangeFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type VolumesPoolChangeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VolumesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VolumesPoolChangeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VolumesPoolChangeFuture.Result. +func (future *VolumesPoolChangeFuture) result(client VolumesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesPoolChangeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("netapp.VolumesPoolChangeFuture") + return + } + ar.Response = future.Response() + return +} + +// VolumesReInitializeReplicationFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VolumesReInitializeReplicationFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VolumesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VolumesReInitializeReplicationFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VolumesReInitializeReplicationFuture.Result. +func (future *VolumesReInitializeReplicationFuture) result(client VolumesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesReInitializeReplicationFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("netapp.VolumesReInitializeReplicationFuture") + return + } + ar.Response = future.Response() + return +} + +// VolumesResyncReplicationFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VolumesResyncReplicationFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VolumesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VolumesResyncReplicationFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VolumesResyncReplicationFuture.Result. +func (future *VolumesResyncReplicationFuture) result(client VolumesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesResyncReplicationFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("netapp.VolumesResyncReplicationFuture") + return + } + ar.Response = future.Response() + return +} + +// VolumesRevertFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type VolumesRevertFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VolumesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VolumesRevertFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VolumesRevertFuture.Result. +func (future *VolumesRevertFuture) result(client VolumesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesRevertFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("netapp.VolumesRevertFuture") + return + } + ar.Response = future.Response() + return +} + +// VolumesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type VolumesUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VolumesClient) (Volume, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VolumesUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VolumesUpdateFuture.Result. +func (future *VolumesUpdateFuture) result(client VolumesClient) (vVar Volume, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vVar.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("netapp.VolumesUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vVar.Response.Response, err = future.GetResult(sender); err == nil && vVar.Response.Response.StatusCode != http.StatusNoContent { + vVar, err = client.UpdateResponder(vVar.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesUpdateFuture", "Result", vVar.Response.Response, "Failure responding to request") + } + } + return +} + +// WeeklySchedule weekly Schedule properties, make a snapshot every week at a specific day or days +type WeeklySchedule struct { + // SnapshotsToKeep - Weekly snapshot count to keep + SnapshotsToKeep *int32 `json:"snapshotsToKeep,omitempty"` + // Day - Indicates which weekdays snapshot should be taken, accepts a comma separated list of week day names in english + Day *string `json:"day,omitempty"` + // Hour - Indicates which hour in UTC timezone a snapshot should be taken + Hour *int32 `json:"hour,omitempty"` + // Minute - Indicates which minute snapshot should be taken + Minute *int32 `json:"minute,omitempty"` + // UsedBytes - Resource size in bytes, current storage usage for the volume in bytes + UsedBytes *int64 `json:"usedBytes,omitempty"` +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/operations.go new file mode 100755 index 000000000000..d903fa2473a3 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/operations.go @@ -0,0 +1,98 @@ +package netapp + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// OperationsClient is the microsoft NetApp Files Azure Resource Provider specification +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists all of the available Microsoft.NetApp Rest API operations +func (client OperationsClient) List(ctx context.Context) (result OperationListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.OperationsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.OperationsClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.NetApp/operations"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/pools.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/pools.go new file mode 100755 index 000000000000..67284b542dfa --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/pools.go @@ -0,0 +1,550 @@ +package netapp + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// PoolsClient is the microsoft NetApp Files Azure Resource Provider specification +type PoolsClient struct { + BaseClient +} + +// NewPoolsClient creates an instance of the PoolsClient client. +func NewPoolsClient(subscriptionID string) PoolsClient { + return NewPoolsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPoolsClientWithBaseURI creates an instance of the PoolsClient client using a custom endpoint. Use this when +// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewPoolsClientWithBaseURI(baseURI string, subscriptionID string) PoolsClient { + return PoolsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or Update a capacity pool +// Parameters: +// body - capacity pool object supplied in the body of the operation. +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +func (client PoolsClient) CreateOrUpdate(ctx context.Context, body CapacityPool, resourceGroupName string, accountName string, poolName string) (result PoolsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PoolsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: body, + Constraints: []validation.Constraint{{Target: "body.Location", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "body.PoolProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "body.PoolProperties.PoolID", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "body.PoolProperties.PoolID", Name: validation.MaxLength, Rule: 36, Chain: nil}, + {Target: "body.PoolProperties.PoolID", Name: validation.MinLength, Rule: 36, Chain: nil}, + {Target: "body.PoolProperties.PoolID", Name: validation.Pattern, Rule: `^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$`, Chain: nil}, + }}, + {Target: "body.PoolProperties.Size", Name: validation.Null, Rule: true, Chain: nil}, + }}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: poolName, + Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.PoolsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, body, resourceGroupName, accountName, poolName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client PoolsClient) CreateOrUpdatePreparer(ctx context.Context, body CapacityPool, resourceGroupName string, accountName string, poolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + body.ID = nil + body.Name = nil + body.Etag = nil + body.Type = nil + body.SystemData = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client PoolsClient) CreateOrUpdateSender(req *http.Request) (future PoolsCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client PoolsClient) CreateOrUpdateResponder(resp *http.Response) (result CapacityPool, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the specified capacity pool +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +func (client PoolsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string) (result PoolsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PoolsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: poolName, + Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.PoolsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, poolName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client PoolsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client PoolsClient) DeleteSender(req *http.Request) (future PoolsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client PoolsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get details of the specified capacity pool +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +func (client PoolsClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string) (result CapacityPool, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PoolsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: poolName, + Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.PoolsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, accountName, poolName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client PoolsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client PoolsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client PoolsClient) GetResponder(resp *http.Response) (result CapacityPool, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list all capacity pools in the NetApp Account +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +func (client PoolsClient) List(ctx context.Context, resourceGroupName string, accountName string) (result CapacityPoolListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PoolsClient.List") + defer func() { + sc := -1 + if result.cpl.Response.Response != nil { + sc = result.cpl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.PoolsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.cpl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "List", resp, "Failure sending request") + return + } + + result.cpl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "List", resp, "Failure responding to request") + return + } + if result.cpl.hasNextLink() && result.cpl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client PoolsClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client PoolsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client PoolsClient) ListResponder(resp *http.Response) (result CapacityPoolList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client PoolsClient) listNextResults(ctx context.Context, lastResults CapacityPoolList) (result CapacityPoolList, err error) { + req, err := lastResults.capacityPoolListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "netapp.PoolsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "netapp.PoolsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client PoolsClient) ListComplete(ctx context.Context, resourceGroupName string, accountName string) (result CapacityPoolListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PoolsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName, accountName) + return +} + +// Update patch the specified capacity pool +// Parameters: +// body - capacity pool object supplied in the body of the operation. +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +func (client PoolsClient) Update(ctx context.Context, body CapacityPoolPatch, resourceGroupName string, accountName string, poolName string) (result PoolsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PoolsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: poolName, + Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.PoolsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, body, resourceGroupName, accountName, poolName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client PoolsClient) UpdatePreparer(ctx context.Context, body CapacityPoolPatch, resourceGroupName string, accountName string, poolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + body.ID = nil + body.Name = nil + body.Type = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client PoolsClient) UpdateSender(req *http.Request) (future PoolsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client PoolsClient) UpdateResponder(resp *http.Response) (result CapacityPool, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/resource.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/resource.go new file mode 100755 index 000000000000..c2e42cc2ad2b --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/resource.go @@ -0,0 +1,284 @@ +package netapp + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ResourceClient is the microsoft NetApp Files Azure Resource Provider specification +type ResourceClient struct { + BaseClient +} + +// NewResourceClient creates an instance of the ResourceClient client. +func NewResourceClient(subscriptionID string) ResourceClient { + return NewResourceClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewResourceClientWithBaseURI creates an instance of the ResourceClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewResourceClientWithBaseURI(baseURI string, subscriptionID string) ResourceClient { + return ResourceClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CheckFilePathAvailability check if a file path is available. +// Parameters: +// body - file path availability request. +// location - the location +func (client ResourceClient) CheckFilePathAvailability(ctx context.Context, body FilePathAvailabilityRequest, location string) (result CheckAvailabilityResponse, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceClient.CheckFilePathAvailability") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: body, + Constraints: []validation.Constraint{{Target: "body.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "body.SubnetID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.ResourceClient", "CheckFilePathAvailability", err.Error()) + } + + req, err := client.CheckFilePathAvailabilityPreparer(ctx, body, location) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.ResourceClient", "CheckFilePathAvailability", nil, "Failure preparing request") + return + } + + resp, err := client.CheckFilePathAvailabilitySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.ResourceClient", "CheckFilePathAvailability", resp, "Failure sending request") + return + } + + result, err = client.CheckFilePathAvailabilityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.ResourceClient", "CheckFilePathAvailability", resp, "Failure responding to request") + return + } + + return +} + +// CheckFilePathAvailabilityPreparer prepares the CheckFilePathAvailability request. +func (client ResourceClient) CheckFilePathAvailabilityPreparer(ctx context.Context, body FilePathAvailabilityRequest, location string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/checkFilePathAvailability", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckFilePathAvailabilitySender sends the CheckFilePathAvailability request. The method will close the +// http.Response Body if it receives an error. +func (client ResourceClient) CheckFilePathAvailabilitySender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CheckFilePathAvailabilityResponder handles the response to the CheckFilePathAvailability request. The method always +// closes the http.Response Body. +func (client ResourceClient) CheckFilePathAvailabilityResponder(resp *http.Response) (result CheckAvailabilityResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CheckNameAvailability check if a resource name is available. +// Parameters: +// body - name availability request. +// location - the location +func (client ResourceClient) CheckNameAvailability(ctx context.Context, body ResourceNameAvailabilityRequest, location string) (result CheckAvailabilityResponse, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceClient.CheckNameAvailability") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: body, + Constraints: []validation.Constraint{{Target: "body.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "body.ResourceGroup", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.ResourceClient", "CheckNameAvailability", err.Error()) + } + + req, err := client.CheckNameAvailabilityPreparer(ctx, body, location) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.ResourceClient", "CheckNameAvailability", nil, "Failure preparing request") + return + } + + resp, err := client.CheckNameAvailabilitySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.ResourceClient", "CheckNameAvailability", resp, "Failure sending request") + return + } + + result, err = client.CheckNameAvailabilityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.ResourceClient", "CheckNameAvailability", resp, "Failure responding to request") + return + } + + return +} + +// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request. +func (client ResourceClient) CheckNameAvailabilityPreparer(ctx context.Context, body ResourceNameAvailabilityRequest, location string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/checkNameAvailability", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckNameAvailabilitySender sends the CheckNameAvailability request. The method will close the +// http.Response Body if it receives an error. +func (client ResourceClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CheckNameAvailabilityResponder handles the response to the CheckNameAvailability request. The method always +// closes the http.Response Body. +func (client ResourceClient) CheckNameAvailabilityResponder(resp *http.Response) (result CheckAvailabilityResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CheckQuotaAvailability check if a quota is available. +// Parameters: +// body - quota availability request. +// location - the location +func (client ResourceClient) CheckQuotaAvailability(ctx context.Context, body QuotaAvailabilityRequest, location string) (result CheckAvailabilityResponse, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceClient.CheckQuotaAvailability") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: body, + Constraints: []validation.Constraint{{Target: "body.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "body.ResourceGroup", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.ResourceClient", "CheckQuotaAvailability", err.Error()) + } + + req, err := client.CheckQuotaAvailabilityPreparer(ctx, body, location) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.ResourceClient", "CheckQuotaAvailability", nil, "Failure preparing request") + return + } + + resp, err := client.CheckQuotaAvailabilitySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.ResourceClient", "CheckQuotaAvailability", resp, "Failure sending request") + return + } + + result, err = client.CheckQuotaAvailabilityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.ResourceClient", "CheckQuotaAvailability", resp, "Failure responding to request") + return + } + + return +} + +// CheckQuotaAvailabilityPreparer prepares the CheckQuotaAvailability request. +func (client ResourceClient) CheckQuotaAvailabilityPreparer(ctx context.Context, body QuotaAvailabilityRequest, location string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/checkQuotaAvailability", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckQuotaAvailabilitySender sends the CheckQuotaAvailability request. The method will close the +// http.Response Body if it receives an error. +func (client ResourceClient) CheckQuotaAvailabilitySender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CheckQuotaAvailabilityResponder handles the response to the CheckQuotaAvailability request. The method always +// closes the http.Response Body. +func (client ResourceClient) CheckQuotaAvailabilityResponder(resp *http.Response) (result CheckAvailabilityResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/resourcequotalimits.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/resourcequotalimits.go new file mode 100755 index 000000000000..0cd8f587e0b8 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/resourcequotalimits.go @@ -0,0 +1,182 @@ +package netapp + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ResourceQuotaLimitsClient is the microsoft NetApp Files Azure Resource Provider specification +type ResourceQuotaLimitsClient struct { + BaseClient +} + +// NewResourceQuotaLimitsClient creates an instance of the ResourceQuotaLimitsClient client. +func NewResourceQuotaLimitsClient(subscriptionID string) ResourceQuotaLimitsClient { + return NewResourceQuotaLimitsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewResourceQuotaLimitsClientWithBaseURI creates an instance of the ResourceQuotaLimitsClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewResourceQuotaLimitsClientWithBaseURI(baseURI string, subscriptionID string) ResourceQuotaLimitsClient { + return ResourceQuotaLimitsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get get the default and current subscription quota limit +// Parameters: +// location - the location +// quotaLimitName - the name of the Quota Limit +func (client ResourceQuotaLimitsClient) Get(ctx context.Context, location string, quotaLimitName string) (result SubscriptionQuotaItem, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceQuotaLimitsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, location, quotaLimitName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.ResourceQuotaLimitsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.ResourceQuotaLimitsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.ResourceQuotaLimitsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ResourceQuotaLimitsClient) GetPreparer(ctx context.Context, location string, quotaLimitName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "quotaLimitName": autorest.Encode("path", quotaLimitName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/quotaLimits/{quotaLimitName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ResourceQuotaLimitsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ResourceQuotaLimitsClient) GetResponder(resp *http.Response) (result SubscriptionQuotaItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List get the default and current limits for quotas +// Parameters: +// location - the location +func (client ResourceQuotaLimitsClient) List(ctx context.Context, location string) (result SubscriptionQuotaItemList, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceQuotaLimitsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPreparer(ctx, location) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.ResourceQuotaLimitsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.ResourceQuotaLimitsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.ResourceQuotaLimitsClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ResourceQuotaLimitsClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/quotaLimits", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ResourceQuotaLimitsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ResourceQuotaLimitsClient) ListResponder(resp *http.Response) (result SubscriptionQuotaItemList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/snapshotpolicies.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/snapshotpolicies.go new file mode 100755 index 000000000000..365057c6955f --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/snapshotpolicies.go @@ -0,0 +1,569 @@ +package netapp + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// SnapshotPoliciesClient is the microsoft NetApp Files Azure Resource Provider specification +type SnapshotPoliciesClient struct { + BaseClient +} + +// NewSnapshotPoliciesClient creates an instance of the SnapshotPoliciesClient client. +func NewSnapshotPoliciesClient(subscriptionID string) SnapshotPoliciesClient { + return NewSnapshotPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSnapshotPoliciesClientWithBaseURI creates an instance of the SnapshotPoliciesClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewSnapshotPoliciesClientWithBaseURI(baseURI string, subscriptionID string) SnapshotPoliciesClient { + return SnapshotPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create create a snapshot policy +// Parameters: +// body - snapshot policy object supplied in the body of the operation. +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// snapshotPolicyName - the name of the snapshot policy +func (client SnapshotPoliciesClient) Create(ctx context.Context, body SnapshotPolicy, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPolicy, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: body, + Constraints: []validation.Constraint{{Target: "body.Location", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "body.SnapshotPolicyProperties", Name: validation.Null, Rule: true, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.SnapshotPoliciesClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, body, resourceGroupName, accountName, snapshotPolicyName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "Create", resp, "Failure responding to request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client SnapshotPoliciesClient) CreatePreparer(ctx context.Context, body SnapshotPolicy, resourceGroupName string, accountName string, snapshotPolicyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "snapshotPolicyName": autorest.Encode("path", snapshotPolicyName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + body.ID = nil + body.Name = nil + body.Etag = nil + body.Type = nil + body.SystemData = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client SnapshotPoliciesClient) CreateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client SnapshotPoliciesClient) CreateResponder(resp *http.Response) (result SnapshotPolicy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete snapshot policy +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// snapshotPolicyName - the name of the snapshot policy +func (client SnapshotPoliciesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPoliciesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.SnapshotPoliciesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, snapshotPolicyName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client SnapshotPoliciesClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "snapshotPolicyName": autorest.Encode("path", snapshotPolicyName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client SnapshotPoliciesClient) DeleteSender(req *http.Request) (future SnapshotPoliciesDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client SnapshotPoliciesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get a snapshot Policy +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// snapshotPolicyName - the name of the snapshot policy +func (client SnapshotPoliciesClient) Get(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPolicy, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.SnapshotPoliciesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, accountName, snapshotPolicyName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client SnapshotPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "snapshotPolicyName": autorest.Encode("path", snapshotPolicyName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SnapshotPoliciesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SnapshotPoliciesClient) GetResponder(resp *http.Response) (result SnapshotPolicy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list snapshot policy +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +func (client SnapshotPoliciesClient) List(ctx context.Context, resourceGroupName string, accountName string) (result SnapshotPoliciesList, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.SnapshotPoliciesClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client SnapshotPoliciesClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client SnapshotPoliciesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client SnapshotPoliciesClient) ListResponder(resp *http.Response) (result SnapshotPoliciesList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListVolumes get volumes associated with snapshot policy +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// snapshotPolicyName - the name of the snapshot policy +func (client SnapshotPoliciesClient) ListVolumes(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPolicyVolumeList, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.ListVolumes") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.SnapshotPoliciesClient", "ListVolumes", err.Error()) + } + + req, err := client.ListVolumesPreparer(ctx, resourceGroupName, accountName, snapshotPolicyName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "ListVolumes", nil, "Failure preparing request") + return + } + + resp, err := client.ListVolumesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "ListVolumes", resp, "Failure sending request") + return + } + + result, err = client.ListVolumesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "ListVolumes", resp, "Failure responding to request") + return + } + + return +} + +// ListVolumesPreparer prepares the ListVolumes request. +func (client SnapshotPoliciesClient) ListVolumesPreparer(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "snapshotPolicyName": autorest.Encode("path", snapshotPolicyName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}/volumes", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListVolumesSender sends the ListVolumes request. The method will close the +// http.Response Body if it receives an error. +func (client SnapshotPoliciesClient) ListVolumesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListVolumesResponder handles the response to the ListVolumes request. The method always +// closes the http.Response Body. +func (client SnapshotPoliciesClient) ListVolumesResponder(resp *http.Response) (result SnapshotPolicyVolumeList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update patch a snapshot policy +// Parameters: +// body - snapshot policy object supplied in the body of the operation. +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// snapshotPolicyName - the name of the snapshot policy +func (client SnapshotPoliciesClient) Update(ctx context.Context, body SnapshotPolicyPatch, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPoliciesUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.SnapshotPoliciesClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, body, resourceGroupName, accountName, snapshotPolicyName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client SnapshotPoliciesClient) UpdatePreparer(ctx context.Context, body SnapshotPolicyPatch, resourceGroupName string, accountName string, snapshotPolicyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "snapshotPolicyName": autorest.Encode("path", snapshotPolicyName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + body.ID = nil + body.Name = nil + body.Type = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client SnapshotPoliciesClient) UpdateSender(req *http.Request) (future SnapshotPoliciesUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client SnapshotPoliciesClient) UpdateResponder(resp *http.Response) (result SnapshotPolicy, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/snapshots.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/snapshots.go new file mode 100755 index 000000000000..d225f05633bc --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/snapshots.go @@ -0,0 +1,654 @@ +package netapp + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// SnapshotsClient is the microsoft NetApp Files Azure Resource Provider specification +type SnapshotsClient struct { + BaseClient +} + +// NewSnapshotsClient creates an instance of the SnapshotsClient client. +func NewSnapshotsClient(subscriptionID string) SnapshotsClient { + return NewSnapshotsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSnapshotsClientWithBaseURI creates an instance of the SnapshotsClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewSnapshotsClientWithBaseURI(baseURI string, subscriptionID string) SnapshotsClient { + return SnapshotsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create create the specified snapshot within the given volume +// Parameters: +// body - snapshot object supplied in the body of the operation. +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +// volumeName - the name of the volume +// snapshotName - the name of the snapshot +func (client SnapshotsClient) Create(ctx context.Context, body Snapshot, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: body, + Constraints: []validation.Constraint{{Target: "body.Location", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "body.SnapshotProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "body.SnapshotProperties.SnapshotID", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "body.SnapshotProperties.SnapshotID", Name: validation.MaxLength, Rule: 36, Chain: nil}, + {Target: "body.SnapshotProperties.SnapshotID", Name: validation.MinLength, Rule: 36, Chain: nil}, + {Target: "body.SnapshotProperties.SnapshotID", Name: validation.Pattern, Rule: `^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$`, Chain: nil}, + }}, + }}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: poolName, + Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, + {TargetValue: volumeName, + Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.SnapshotsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, body, resourceGroupName, accountName, poolName, volumeName, snapshotName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client SnapshotsClient) CreatePreparer(ctx context.Context, body Snapshot, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "snapshotName": autorest.Encode("path", snapshotName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "volumeName": autorest.Encode("path", volumeName), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + body.ID = nil + body.Name = nil + body.Type = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client SnapshotsClient) CreateSender(req *http.Request) (future SnapshotsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client SnapshotsClient) CreateResponder(resp *http.Response) (result Snapshot, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete snapshot +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +// volumeName - the name of the volume +// snapshotName - the name of the snapshot +func (client SnapshotsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: poolName, + Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, + {TargetValue: volumeName, + Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.SnapshotsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, poolName, volumeName, snapshotName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client SnapshotsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "snapshotName": autorest.Encode("path", snapshotName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "volumeName": autorest.Encode("path", volumeName), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client SnapshotsClient) DeleteSender(req *http.Request) (future SnapshotsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client SnapshotsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get details of the specified snapshot +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +// volumeName - the name of the volume +// snapshotName - the name of the snapshot +func (client SnapshotsClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result Snapshot, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: poolName, + Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, + {TargetValue: volumeName, + Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.SnapshotsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, accountName, poolName, volumeName, snapshotName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client SnapshotsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "snapshotName": autorest.Encode("path", snapshotName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "volumeName": autorest.Encode("path", volumeName), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SnapshotsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SnapshotsClient) GetResponder(resp *http.Response) (result Snapshot, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list all snapshots associated with the volume +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +// volumeName - the name of the volume +func (client SnapshotsClient) List(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result SnapshotsList, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: poolName, + Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, + {TargetValue: volumeName, + Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.SnapshotsClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, resourceGroupName, accountName, poolName, volumeName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client SnapshotsClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "volumeName": autorest.Encode("path", volumeName), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client SnapshotsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client SnapshotsClient) ListResponder(resp *http.Response) (result SnapshotsList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RestoreFiles restore the specified files from the specified snapshot to the active filesystem +// Parameters: +// body - restore payload supplied in the body of the operation. +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +// volumeName - the name of the volume +// snapshotName - the name of the snapshot +func (client SnapshotsClient) RestoreFiles(ctx context.Context, body SnapshotRestoreFiles, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsRestoreFilesFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.RestoreFiles") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: body, + Constraints: []validation.Constraint{{Target: "body.FilePaths", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "body.FilePaths", Name: validation.MaxItems, Rule: 10, Chain: nil}, + {Target: "body.FilePaths", Name: validation.MinItems, Rule: 1, Chain: nil}, + }}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: poolName, + Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, + {TargetValue: volumeName, + Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.SnapshotsClient", "RestoreFiles", err.Error()) + } + + req, err := client.RestoreFilesPreparer(ctx, body, resourceGroupName, accountName, poolName, volumeName, snapshotName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "RestoreFiles", nil, "Failure preparing request") + return + } + + result, err = client.RestoreFilesSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "RestoreFiles", result.Response(), "Failure sending request") + return + } + + return +} + +// RestoreFilesPreparer prepares the RestoreFiles request. +func (client SnapshotsClient) RestoreFilesPreparer(ctx context.Context, body SnapshotRestoreFiles, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "snapshotName": autorest.Encode("path", snapshotName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "volumeName": autorest.Encode("path", volumeName), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}/restoreFiles", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RestoreFilesSender sends the RestoreFiles request. The method will close the +// http.Response Body if it receives an error. +func (client SnapshotsClient) RestoreFilesSender(req *http.Request) (future SnapshotsRestoreFilesFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RestoreFilesResponder handles the response to the RestoreFiles request. The method always +// closes the http.Response Body. +func (client SnapshotsClient) RestoreFilesResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update patch a snapshot +// Parameters: +// body - snapshot object supplied in the body of the operation. +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +// volumeName - the name of the volume +// snapshotName - the name of the snapshot +func (client SnapshotsClient) Update(ctx context.Context, body interface{}, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: poolName, + Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, + {TargetValue: volumeName, + Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.SnapshotsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, body, resourceGroupName, accountName, poolName, volumeName, snapshotName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client SnapshotsClient) UpdatePreparer(ctx context.Context, body interface{}, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "snapshotName": autorest.Encode("path", snapshotName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "volumeName": autorest.Encode("path", volumeName), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client SnapshotsClient) UpdateSender(req *http.Request) (future SnapshotsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client SnapshotsClient) UpdateResponder(resp *http.Response) (result Snapshot, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/subvolumes.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/subvolumes.go new file mode 100755 index 000000000000..54cec7e712e5 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/subvolumes.go @@ -0,0 +1,698 @@ +package netapp + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// SubvolumesClient is the microsoft NetApp Files Azure Resource Provider specification +type SubvolumesClient struct { + BaseClient +} + +// NewSubvolumesClient creates an instance of the SubvolumesClient client. +func NewSubvolumesClient(subscriptionID string) SubvolumesClient { + return NewSubvolumesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSubvolumesClientWithBaseURI creates an instance of the SubvolumesClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewSubvolumesClientWithBaseURI(baseURI string, subscriptionID string) SubvolumesClient { + return SubvolumesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creates a subvolume in the path or clones the subvolume mentioned in the parentPath +// Parameters: +// body - subvolume object supplied in the body of the operation. +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +// volumeName - the name of the volume +// subvolumeName - the name of the subvolume. +func (client SubvolumesClient) Create(ctx context.Context, body SubvolumeInfo, resourceGroupName string, accountName string, poolName string, volumeName string, subvolumeName string) (result SubvolumesCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubvolumesClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: poolName, + Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, + {TargetValue: volumeName, + Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, + {TargetValue: subvolumeName, + Constraints: []validation.Constraint{{Target: "subvolumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "subvolumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "subvolumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.SubvolumesClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, body, resourceGroupName, accountName, poolName, volumeName, subvolumeName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SubvolumesClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SubvolumesClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client SubvolumesClient) CreatePreparer(ctx context.Context, body SubvolumeInfo, resourceGroupName string, accountName string, poolName string, volumeName string, subvolumeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "subvolumeName": autorest.Encode("path", subvolumeName), + "volumeName": autorest.Encode("path", volumeName), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + body.SystemData = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client SubvolumesClient) CreateSender(req *http.Request) (future SubvolumesCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client SubvolumesClient) CreateResponder(resp *http.Response) (result SubvolumeInfo, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete subvolume +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +// volumeName - the name of the volume +// subvolumeName - the name of the subvolume. +func (client SubvolumesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, subvolumeName string) (result SubvolumesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubvolumesClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: poolName, + Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, + {TargetValue: volumeName, + Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, + {TargetValue: subvolumeName, + Constraints: []validation.Constraint{{Target: "subvolumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "subvolumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "subvolumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.SubvolumesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, poolName, volumeName, subvolumeName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SubvolumesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SubvolumesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client SubvolumesClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, subvolumeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "subvolumeName": autorest.Encode("path", subvolumeName), + "volumeName": autorest.Encode("path", volumeName), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client SubvolumesClient) DeleteSender(req *http.Request) (future SubvolumesDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client SubvolumesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get returns the path associated with the subvolumeName provided +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +// volumeName - the name of the volume +// subvolumeName - the name of the subvolume. +func (client SubvolumesClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, subvolumeName string) (result SubvolumeInfo, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubvolumesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: poolName, + Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, + {TargetValue: volumeName, + Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, + {TargetValue: subvolumeName, + Constraints: []validation.Constraint{{Target: "subvolumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "subvolumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "subvolumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.SubvolumesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, accountName, poolName, volumeName, subvolumeName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SubvolumesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.SubvolumesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SubvolumesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client SubvolumesClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, subvolumeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "subvolumeName": autorest.Encode("path", subvolumeName), + "volumeName": autorest.Encode("path", volumeName), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SubvolumesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SubvolumesClient) GetResponder(resp *http.Response) (result SubvolumeInfo, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetMetadata get details of the specified subvolume +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +// volumeName - the name of the volume +// subvolumeName - the name of the subvolume. +func (client SubvolumesClient) GetMetadata(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, subvolumeName string) (result SubvolumesGetMetadataFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubvolumesClient.GetMetadata") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: poolName, + Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, + {TargetValue: volumeName, + Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, + {TargetValue: subvolumeName, + Constraints: []validation.Constraint{{Target: "subvolumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "subvolumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "subvolumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.SubvolumesClient", "GetMetadata", err.Error()) + } + + req, err := client.GetMetadataPreparer(ctx, resourceGroupName, accountName, poolName, volumeName, subvolumeName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SubvolumesClient", "GetMetadata", nil, "Failure preparing request") + return + } + + result, err = client.GetMetadataSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SubvolumesClient", "GetMetadata", result.Response(), "Failure sending request") + return + } + + return +} + +// GetMetadataPreparer prepares the GetMetadata request. +func (client SubvolumesClient) GetMetadataPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, subvolumeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "subvolumeName": autorest.Encode("path", subvolumeName), + "volumeName": autorest.Encode("path", volumeName), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}/getMetadata", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetMetadataSender sends the GetMetadata request. The method will close the +// http.Response Body if it receives an error. +func (client SubvolumesClient) GetMetadataSender(req *http.Request) (future SubvolumesGetMetadataFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// GetMetadataResponder handles the response to the GetMetadata request. The method always +// closes the http.Response Body. +func (client SubvolumesClient) GetMetadataResponder(resp *http.Response) (result SubvolumeModel, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByVolume returns a list of the subvolumes in the volume +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +// volumeName - the name of the volume +func (client SubvolumesClient) ListByVolume(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result SubvolumesListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubvolumesClient.ListByVolume") + defer func() { + sc := -1 + if result.sl.Response.Response != nil { + sc = result.sl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: poolName, + Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, + {TargetValue: volumeName, + Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.SubvolumesClient", "ListByVolume", err.Error()) + } + + result.fn = client.listByVolumeNextResults + req, err := client.ListByVolumePreparer(ctx, resourceGroupName, accountName, poolName, volumeName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SubvolumesClient", "ListByVolume", nil, "Failure preparing request") + return + } + + resp, err := client.ListByVolumeSender(req) + if err != nil { + result.sl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.SubvolumesClient", "ListByVolume", resp, "Failure sending request") + return + } + + result.sl, err = client.ListByVolumeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SubvolumesClient", "ListByVolume", resp, "Failure responding to request") + return + } + if result.sl.hasNextLink() && result.sl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByVolumePreparer prepares the ListByVolume request. +func (client SubvolumesClient) ListByVolumePreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "volumeName": autorest.Encode("path", volumeName), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByVolumeSender sends the ListByVolume request. The method will close the +// http.Response Body if it receives an error. +func (client SubvolumesClient) ListByVolumeSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByVolumeResponder handles the response to the ListByVolume request. The method always +// closes the http.Response Body. +func (client SubvolumesClient) ListByVolumeResponder(resp *http.Response) (result SubvolumesList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByVolumeNextResults retrieves the next set of results, if any. +func (client SubvolumesClient) listByVolumeNextResults(ctx context.Context, lastResults SubvolumesList) (result SubvolumesList, err error) { + req, err := lastResults.subvolumesListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "netapp.SubvolumesClient", "listByVolumeNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByVolumeSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "netapp.SubvolumesClient", "listByVolumeNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByVolumeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SubvolumesClient", "listByVolumeNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByVolumeComplete enumerates all values, automatically crossing page boundaries as required. +func (client SubvolumesClient) ListByVolumeComplete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result SubvolumesListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubvolumesClient.ListByVolume") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByVolume(ctx, resourceGroupName, accountName, poolName, volumeName) + return +} + +// Update patch a subvolume +// Parameters: +// body - subvolume object supplied in the body of the operation. +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +// volumeName - the name of the volume +// subvolumeName - the name of the subvolume. +func (client SubvolumesClient) Update(ctx context.Context, body SubvolumePatchRequest, resourceGroupName string, accountName string, poolName string, volumeName string, subvolumeName string) (result SubvolumesUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubvolumesClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: poolName, + Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, + {TargetValue: volumeName, + Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, + {TargetValue: subvolumeName, + Constraints: []validation.Constraint{{Target: "subvolumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "subvolumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "subvolumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.SubvolumesClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, body, resourceGroupName, accountName, poolName, volumeName, subvolumeName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SubvolumesClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.SubvolumesClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client SubvolumesClient) UpdatePreparer(ctx context.Context, body SubvolumePatchRequest, resourceGroupName string, accountName string, poolName string, volumeName string, subvolumeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "subvolumeName": autorest.Encode("path", subvolumeName), + "volumeName": autorest.Encode("path", volumeName), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client SubvolumesClient) UpdateSender(req *http.Request) (future SubvolumesUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client SubvolumesClient) UpdateResponder(resp *http.Response) (result SubvolumeInfo, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/vaults.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/vaults.go new file mode 100755 index 000000000000..ee3222d17445 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/vaults.go @@ -0,0 +1,116 @@ +package netapp + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// VaultsClient is the microsoft NetApp Files Azure Resource Provider specification +type VaultsClient struct { + BaseClient +} + +// NewVaultsClient creates an instance of the VaultsClient client. +func NewVaultsClient(subscriptionID string) VaultsClient { + return NewVaultsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewVaultsClientWithBaseURI creates an instance of the VaultsClient client using a custom endpoint. Use this when +// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewVaultsClientWithBaseURI(baseURI string, subscriptionID string) VaultsClient { + return VaultsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List list vaults for a Netapp Account +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +func (client VaultsClient) List(ctx context.Context, resourceGroupName string, accountName string) (result VaultList, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VaultsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.VaultsClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VaultsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.VaultsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VaultsClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client VaultsClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/vaults", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client VaultsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client VaultsClient) ListResponder(resp *http.Response) (result VaultList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/version.go new file mode 100755 index 000000000000..d254f8bece8a --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/version.go @@ -0,0 +1,19 @@ +package netapp + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + Version() + " netapp/2021-10-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/volumegroups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/volumegroups.go new file mode 100755 index 000000000000..65bc0539bda9 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/volumegroups.go @@ -0,0 +1,397 @@ +package netapp + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// VolumeGroupsClient is the microsoft NetApp Files Azure Resource Provider specification +type VolumeGroupsClient struct { + BaseClient +} + +// NewVolumeGroupsClient creates an instance of the VolumeGroupsClient client. +func NewVolumeGroupsClient(subscriptionID string) VolumeGroupsClient { + return NewVolumeGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewVolumeGroupsClientWithBaseURI creates an instance of the VolumeGroupsClient client using a custom endpoint. Use +// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewVolumeGroupsClientWithBaseURI(baseURI string, subscriptionID string) VolumeGroupsClient { + return VolumeGroupsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create create a volume group along with specified volumes +// Parameters: +// body - volume Group object supplied in the body of the operation. +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// volumeGroupName - the name of the volumeGroup +func (client VolumeGroupsClient) Create(ctx context.Context, body VolumeGroupDetails, resourceGroupName string, accountName string, volumeGroupName string) (result VolumeGroupsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VolumeGroupsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: volumeGroupName, + Constraints: []validation.Constraint{{Target: "volumeGroupName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "volumeGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "volumeGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.VolumeGroupsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, body, resourceGroupName, accountName, volumeGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumeGroupsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumeGroupsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client VolumeGroupsClient) CreatePreparer(ctx context.Context, body VolumeGroupDetails, resourceGroupName string, accountName string, volumeGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "volumeGroupName": autorest.Encode("path", volumeGroupName), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + body.ID = nil + body.Name = nil + body.Type = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/volumeGroups/{volumeGroupName}", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client VolumeGroupsClient) CreateSender(req *http.Request) (future VolumeGroupsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client VolumeGroupsClient) CreateResponder(resp *http.Response) (result VolumeGroupDetails, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the specified volume group only if there are no volumes under volume group. +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// volumeGroupName - the name of the volumeGroup +func (client VolumeGroupsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, volumeGroupName string) (result VolumeGroupsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VolumeGroupsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: volumeGroupName, + Constraints: []validation.Constraint{{Target: "volumeGroupName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "volumeGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "volumeGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.VolumeGroupsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, volumeGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumeGroupsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumeGroupsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client VolumeGroupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, volumeGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "volumeGroupName": autorest.Encode("path", volumeGroupName), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/volumeGroups/{volumeGroupName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client VolumeGroupsClient) DeleteSender(req *http.Request) (future VolumeGroupsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client VolumeGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get details of the specified volume group +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// volumeGroupName - the name of the volumeGroup +func (client VolumeGroupsClient) Get(ctx context.Context, resourceGroupName string, accountName string, volumeGroupName string) (result VolumeGroupDetails, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VolumeGroupsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: volumeGroupName, + Constraints: []validation.Constraint{{Target: "volumeGroupName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "volumeGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "volumeGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.VolumeGroupsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, accountName, volumeGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumeGroupsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.VolumeGroupsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumeGroupsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client VolumeGroupsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, volumeGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "volumeGroupName": autorest.Encode("path", volumeGroupName), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/volumeGroups/{volumeGroupName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client VolumeGroupsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client VolumeGroupsClient) GetResponder(resp *http.Response) (result VolumeGroupDetails, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByNetAppAccount list all volume groups for given account +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +func (client VolumeGroupsClient) ListByNetAppAccount(ctx context.Context, resourceGroupName string, accountName string) (result VolumeGroupList, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VolumeGroupsClient.ListByNetAppAccount") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.VolumeGroupsClient", "ListByNetAppAccount", err.Error()) + } + + req, err := client.ListByNetAppAccountPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumeGroupsClient", "ListByNetAppAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByNetAppAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.VolumeGroupsClient", "ListByNetAppAccount", resp, "Failure sending request") + return + } + + result, err = client.ListByNetAppAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumeGroupsClient", "ListByNetAppAccount", resp, "Failure responding to request") + return + } + + return +} + +// ListByNetAppAccountPreparer prepares the ListByNetAppAccount request. +func (client VolumeGroupsClient) ListByNetAppAccountPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/volumeGroups", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByNetAppAccountSender sends the ListByNetAppAccount request. The method will close the +// http.Response Body if it receives an error. +func (client VolumeGroupsClient) ListByNetAppAccountSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByNetAppAccountResponder handles the response to the ListByNetAppAccount request. The method always +// closes the http.Response Body. +func (client VolumeGroupsClient) ListByNetAppAccountResponder(resp *http.Response) (result VolumeGroupList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/volumes.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/volumes.go new file mode 100755 index 000000000000..11016cd3a95a --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/volumes.go @@ -0,0 +1,1422 @@ +package netapp + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// VolumesClient is the microsoft NetApp Files Azure Resource Provider specification +type VolumesClient struct { + BaseClient +} + +// NewVolumesClient creates an instance of the VolumesClient client. +func NewVolumesClient(subscriptionID string) VolumesClient { + return NewVolumesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewVolumesClientWithBaseURI creates an instance of the VolumesClient client using a custom endpoint. Use this when +// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewVolumesClientWithBaseURI(baseURI string, subscriptionID string) VolumesClient { + return VolumesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// AuthorizeReplication authorize the replication connection on the source volume +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +// volumeName - the name of the volume +// body - authorize request object supplied in the body of the operation. +func (client VolumesClient) AuthorizeReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body AuthorizeRequest) (result VolumesAuthorizeReplicationFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.AuthorizeReplication") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: poolName, + Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, + {TargetValue: volumeName, + Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.VolumesClient", "AuthorizeReplication", err.Error()) + } + + req, err := client.AuthorizeReplicationPreparer(ctx, resourceGroupName, accountName, poolName, volumeName, body) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "AuthorizeReplication", nil, "Failure preparing request") + return + } + + result, err = client.AuthorizeReplicationSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "AuthorizeReplication", result.Response(), "Failure sending request") + return + } + + return +} + +// AuthorizeReplicationPreparer prepares the AuthorizeReplication request. +func (client VolumesClient) AuthorizeReplicationPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body AuthorizeRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "volumeName": autorest.Encode("path", volumeName), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/authorizeReplication", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AuthorizeReplicationSender sends the AuthorizeReplication request. The method will close the +// http.Response Body if it receives an error. +func (client VolumesClient) AuthorizeReplicationSender(req *http.Request) (future VolumesAuthorizeReplicationFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// AuthorizeReplicationResponder handles the response to the AuthorizeReplication request. The method always +// closes the http.Response Body. +func (client VolumesClient) AuthorizeReplicationResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// BreakReplication break the replication connection on the destination volume +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +// volumeName - the name of the volume +// body - optional body to force break the replication. +func (client VolumesClient) BreakReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body *BreakReplicationRequest) (result VolumesBreakReplicationFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.BreakReplication") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: poolName, + Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, + {TargetValue: volumeName, + Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.VolumesClient", "BreakReplication", err.Error()) + } + + req, err := client.BreakReplicationPreparer(ctx, resourceGroupName, accountName, poolName, volumeName, body) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "BreakReplication", nil, "Failure preparing request") + return + } + + result, err = client.BreakReplicationSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "BreakReplication", result.Response(), "Failure sending request") + return + } + + return +} + +// BreakReplicationPreparer prepares the BreakReplication request. +func (client VolumesClient) BreakReplicationPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body *BreakReplicationRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "volumeName": autorest.Encode("path", volumeName), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/breakReplication", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if body != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(body)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// BreakReplicationSender sends the BreakReplication request. The method will close the +// http.Response Body if it receives an error. +func (client VolumesClient) BreakReplicationSender(req *http.Request) (future VolumesBreakReplicationFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// BreakReplicationResponder handles the response to the BreakReplication request. The method always +// closes the http.Response Body. +func (client VolumesClient) BreakReplicationResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// CreateOrUpdate create or update the specified volume within the capacity pool +// Parameters: +// body - volume object supplied in the body of the operation. +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +// volumeName - the name of the volume +func (client VolumesClient) CreateOrUpdate(ctx context.Context, body Volume, resourceGroupName string, accountName string, poolName string, volumeName string) (result VolumesCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: body, + Constraints: []validation.Constraint{{Target: "body.Location", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "body.VolumeProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "body.VolumeProperties.FileSystemID", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "body.VolumeProperties.FileSystemID", Name: validation.MaxLength, Rule: 36, Chain: nil}, + {Target: "body.VolumeProperties.FileSystemID", Name: validation.MinLength, Rule: 36, Chain: nil}, + {Target: "body.VolumeProperties.FileSystemID", Name: validation.Pattern, Rule: `^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$`, Chain: nil}, + }}, + {Target: "body.VolumeProperties.CreationToken", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "body.VolumeProperties.CreationToken", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "body.VolumeProperties.CreationToken", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "body.VolumeProperties.CreationToken", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-]{0,79}$`, Chain: nil}, + }}, + {Target: "body.VolumeProperties.UsageThreshold", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "body.VolumeProperties.UsageThreshold", Name: validation.InclusiveMaximum, Rule: int64(109951162777600), Chain: nil}, + {Target: "body.VolumeProperties.UsageThreshold", Name: validation.InclusiveMinimum, Rule: int64(107374182400), Chain: nil}, + }}, + {Target: "body.VolumeProperties.SnapshotID", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "body.VolumeProperties.SnapshotID", Name: validation.MaxLength, Rule: 36, Chain: nil}, + {Target: "body.VolumeProperties.SnapshotID", Name: validation.MinLength, Rule: 36, Chain: nil}, + {Target: "body.VolumeProperties.SnapshotID", Name: validation.Pattern, Rule: `^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}|(\\?([^\/]*[\/])*)([^\/]+)$`, Chain: nil}, + }}, + {Target: "body.VolumeProperties.BackupID", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "body.VolumeProperties.BackupID", Name: validation.MaxLength, Rule: 36, Chain: nil}, + {Target: "body.VolumeProperties.BackupID", Name: validation.MinLength, Rule: 36, Chain: nil}, + {Target: "body.VolumeProperties.BackupID", Name: validation.Pattern, Rule: `^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}|(\\?([^\/]*[\/])*)([^\/]+)$`, Chain: nil}, + }}, + {Target: "body.VolumeProperties.SubnetID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "body.VolumeProperties.NetworkSiblingSetID", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "body.VolumeProperties.NetworkSiblingSetID", Name: validation.MaxLength, Rule: 36, Chain: nil}, + {Target: "body.VolumeProperties.NetworkSiblingSetID", Name: validation.MinLength, Rule: 36, Chain: nil}, + {Target: "body.VolumeProperties.NetworkSiblingSetID", Name: validation.Pattern, Rule: `^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$`, Chain: nil}, + }}, + {Target: "body.VolumeProperties.DataProtection", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "body.VolumeProperties.DataProtection.Replication", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "body.VolumeProperties.DataProtection.Replication.RemoteVolumeResourceID", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + {Target: "body.VolumeProperties.CoolnessPeriod", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "body.VolumeProperties.CoolnessPeriod", Name: validation.InclusiveMaximum, Rule: int64(63), Chain: nil}, + {Target: "body.VolumeProperties.CoolnessPeriod", Name: validation.InclusiveMinimum, Rule: int64(7), Chain: nil}, + }}, + {Target: "body.VolumeProperties.UnixPermissions", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "body.VolumeProperties.UnixPermissions", Name: validation.MaxLength, Rule: 4, Chain: nil}, + {Target: "body.VolumeProperties.UnixPermissions", Name: validation.MinLength, Rule: 4, Chain: nil}, + }}, + }}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: poolName, + Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, + {TargetValue: volumeName, + Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.VolumesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, body, resourceGroupName, accountName, poolName, volumeName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client VolumesClient) CreateOrUpdatePreparer(ctx context.Context, body Volume, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "volumeName": autorest.Encode("path", volumeName), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + body.ID = nil + body.Name = nil + body.Etag = nil + body.Type = nil + body.SystemData = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client VolumesClient) CreateOrUpdateSender(req *http.Request) (future VolumesCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client VolumesClient) CreateOrUpdateResponder(resp *http.Response) (result Volume, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the specified volume +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +// volumeName - the name of the volume +// forceDelete - an option to force delete the volume. Will cleanup resources connected to the particular +// volume +func (client VolumesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, forceDelete *bool) (result VolumesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: poolName, + Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, + {TargetValue: volumeName, + Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.VolumesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, poolName, volumeName, forceDelete) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client VolumesClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, forceDelete *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "volumeName": autorest.Encode("path", volumeName), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if forceDelete != nil { + queryParameters["forceDelete"] = autorest.Encode("query", *forceDelete) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client VolumesClient) DeleteSender(req *http.Request) (future VolumesDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client VolumesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteReplication delete the replication connection on the destination volume, and send release to the source +// replication +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +// volumeName - the name of the volume +func (client VolumesClient) DeleteReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result VolumesDeleteReplicationFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.DeleteReplication") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: poolName, + Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, + {TargetValue: volumeName, + Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.VolumesClient", "DeleteReplication", err.Error()) + } + + req, err := client.DeleteReplicationPreparer(ctx, resourceGroupName, accountName, poolName, volumeName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "DeleteReplication", nil, "Failure preparing request") + return + } + + result, err = client.DeleteReplicationSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "DeleteReplication", result.Response(), "Failure sending request") + return + } + + return +} + +// DeleteReplicationPreparer prepares the DeleteReplication request. +func (client VolumesClient) DeleteReplicationPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "volumeName": autorest.Encode("path", volumeName), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/deleteReplication", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteReplicationSender sends the DeleteReplication request. The method will close the +// http.Response Body if it receives an error. +func (client VolumesClient) DeleteReplicationSender(req *http.Request) (future VolumesDeleteReplicationFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteReplicationResponder handles the response to the DeleteReplication request. The method always +// closes the http.Response Body. +func (client VolumesClient) DeleteReplicationResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get the details of the specified volume +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +// volumeName - the name of the volume +func (client VolumesClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result Volume, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: poolName, + Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, + {TargetValue: volumeName, + Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.VolumesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, accountName, poolName, volumeName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client VolumesClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "volumeName": autorest.Encode("path", volumeName), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client VolumesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client VolumesClient) GetResponder(resp *http.Response) (result Volume, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list all volumes within the capacity pool +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +func (client VolumesClient) List(ctx context.Context, resourceGroupName string, accountName string, poolName string) (result VolumeListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.List") + defer func() { + sc := -1 + if result.vl.Response.Response != nil { + sc = result.vl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: poolName, + Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.VolumesClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, accountName, poolName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.vl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "List", resp, "Failure sending request") + return + } + + result.vl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "List", resp, "Failure responding to request") + return + } + if result.vl.hasNextLink() && result.vl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client VolumesClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client VolumesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client VolumesClient) ListResponder(resp *http.Response) (result VolumeList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client VolumesClient) listNextResults(ctx context.Context, lastResults VolumeList) (result VolumeList, err error) { + req, err := lastResults.volumeListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "netapp.VolumesClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "netapp.VolumesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client VolumesClient) ListComplete(ctx context.Context, resourceGroupName string, accountName string, poolName string) (result VolumeListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName, accountName, poolName) + return +} + +// PoolChange moves volume to another pool +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +// volumeName - the name of the volume +// body - move volume to the pool supplied in the body of the operation. +func (client VolumesClient) PoolChange(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body PoolChangeRequest) (result VolumesPoolChangeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.PoolChange") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: poolName, + Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, + {TargetValue: volumeName, + Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, + {TargetValue: body, + Constraints: []validation.Constraint{{Target: "body.NewPoolResourceID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.VolumesClient", "PoolChange", err.Error()) + } + + req, err := client.PoolChangePreparer(ctx, resourceGroupName, accountName, poolName, volumeName, body) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "PoolChange", nil, "Failure preparing request") + return + } + + result, err = client.PoolChangeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "PoolChange", result.Response(), "Failure sending request") + return + } + + return +} + +// PoolChangePreparer prepares the PoolChange request. +func (client VolumesClient) PoolChangePreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body PoolChangeRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "volumeName": autorest.Encode("path", volumeName), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/poolChange", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PoolChangeSender sends the PoolChange request. The method will close the +// http.Response Body if it receives an error. +func (client VolumesClient) PoolChangeSender(req *http.Request) (future VolumesPoolChangeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PoolChangeResponder handles the response to the PoolChange request. The method always +// closes the http.Response Body. +func (client VolumesClient) PoolChangeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// ReInitializeReplication re-Initializes the replication connection on the destination volume +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +// volumeName - the name of the volume +func (client VolumesClient) ReInitializeReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result VolumesReInitializeReplicationFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.ReInitializeReplication") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: poolName, + Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, + {TargetValue: volumeName, + Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.VolumesClient", "ReInitializeReplication", err.Error()) + } + + req, err := client.ReInitializeReplicationPreparer(ctx, resourceGroupName, accountName, poolName, volumeName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ReInitializeReplication", nil, "Failure preparing request") + return + } + + result, err = client.ReInitializeReplicationSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ReInitializeReplication", result.Response(), "Failure sending request") + return + } + + return +} + +// ReInitializeReplicationPreparer prepares the ReInitializeReplication request. +func (client VolumesClient) ReInitializeReplicationPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "volumeName": autorest.Encode("path", volumeName), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/reinitializeReplication", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReInitializeReplicationSender sends the ReInitializeReplication request. The method will close the +// http.Response Body if it receives an error. +func (client VolumesClient) ReInitializeReplicationSender(req *http.Request) (future VolumesReInitializeReplicationFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ReInitializeReplicationResponder handles the response to the ReInitializeReplication request. The method always +// closes the http.Response Body. +func (client VolumesClient) ReInitializeReplicationResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// ReplicationStatusMethod get the status of the replication +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +// volumeName - the name of the volume +func (client VolumesClient) ReplicationStatusMethod(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result ReplicationStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.ReplicationStatusMethod") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: poolName, + Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, + {TargetValue: volumeName, + Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.VolumesClient", "ReplicationStatusMethod", err.Error()) + } + + req, err := client.ReplicationStatusMethodPreparer(ctx, resourceGroupName, accountName, poolName, volumeName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ReplicationStatusMethod", nil, "Failure preparing request") + return + } + + resp, err := client.ReplicationStatusMethodSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ReplicationStatusMethod", resp, "Failure sending request") + return + } + + result, err = client.ReplicationStatusMethodResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ReplicationStatusMethod", resp, "Failure responding to request") + return + } + + return +} + +// ReplicationStatusMethodPreparer prepares the ReplicationStatusMethod request. +func (client VolumesClient) ReplicationStatusMethodPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "volumeName": autorest.Encode("path", volumeName), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/replicationStatus", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReplicationStatusMethodSender sends the ReplicationStatusMethod request. The method will close the +// http.Response Body if it receives an error. +func (client VolumesClient) ReplicationStatusMethodSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ReplicationStatusMethodResponder handles the response to the ReplicationStatusMethod request. The method always +// closes the http.Response Body. +func (client VolumesClient) ReplicationStatusMethodResponder(resp *http.Response) (result ReplicationStatus, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ResyncReplication resync the connection on the destination volume. If the operation is ran on the source volume it +// will reverse-resync the connection and sync from destination to source. +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +// volumeName - the name of the volume +func (client VolumesClient) ResyncReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result VolumesResyncReplicationFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.ResyncReplication") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: poolName, + Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, + {TargetValue: volumeName, + Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.VolumesClient", "ResyncReplication", err.Error()) + } + + req, err := client.ResyncReplicationPreparer(ctx, resourceGroupName, accountName, poolName, volumeName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ResyncReplication", nil, "Failure preparing request") + return + } + + result, err = client.ResyncReplicationSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ResyncReplication", result.Response(), "Failure sending request") + return + } + + return +} + +// ResyncReplicationPreparer prepares the ResyncReplication request. +func (client VolumesClient) ResyncReplicationPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "volumeName": autorest.Encode("path", volumeName), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/resyncReplication", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResyncReplicationSender sends the ResyncReplication request. The method will close the +// http.Response Body if it receives an error. +func (client VolumesClient) ResyncReplicationSender(req *http.Request) (future VolumesResyncReplicationFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ResyncReplicationResponder handles the response to the ResyncReplication request. The method always +// closes the http.Response Body. +func (client VolumesClient) ResyncReplicationResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Revert revert a volume to the snapshot specified in the body +// Parameters: +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +// volumeName - the name of the volume +// body - object for snapshot to revert supplied in the body of the operation. +func (client VolumesClient) Revert(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body VolumeRevert) (result VolumesRevertFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.Revert") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: poolName, + Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, + {TargetValue: volumeName, + Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.VolumesClient", "Revert", err.Error()) + } + + req, err := client.RevertPreparer(ctx, resourceGroupName, accountName, poolName, volumeName, body) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Revert", nil, "Failure preparing request") + return + } + + result, err = client.RevertSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Revert", result.Response(), "Failure sending request") + return + } + + return +} + +// RevertPreparer prepares the Revert request. +func (client VolumesClient) RevertPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body VolumeRevert) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "volumeName": autorest.Encode("path", volumeName), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/revert", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RevertSender sends the Revert request. The method will close the +// http.Response Body if it receives an error. +func (client VolumesClient) RevertSender(req *http.Request) (future VolumesRevertFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RevertResponder handles the response to the Revert request. The method always +// closes the http.Response Body. +func (client VolumesClient) RevertResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update patch the specified volume +// Parameters: +// body - volume object supplied in the body of the operation. +// resourceGroupName - the name of the resource group. +// accountName - the name of the NetApp account +// poolName - the name of the capacity pool +// volumeName - the name of the volume +func (client VolumesClient) Update(ctx context.Context, body VolumePatch, resourceGroupName string, accountName string, poolName string, volumeName string) (result VolumesUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: poolName, + Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, + {TargetValue: volumeName, + Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("netapp.VolumesClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, body, resourceGroupName, accountName, poolName, volumeName) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client VolumesClient) UpdatePreparer(ctx context.Context, body VolumePatch, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "poolName": autorest.Encode("path", poolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "volumeName": autorest.Encode("path", volumeName), + } + + const APIVersion = "2021-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + body.ID = nil + body.Name = nil + body.Type = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client VolumesClient) UpdateSender(req *http.Request) (future VolumesUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client VolumesClient) UpdateResponder(resp *http.Response) (result Volume, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} From dd1476434f4ebda1a8c11364ad242438916e7be8 Mon Sep 17 00:00:00 2001 From: Paulo Date: Tue, 31 May 2022 16:38:24 -0700 Subject: [PATCH 05/12] fixing gencheck --- .../mgmt/2021-06-01/netapp/CHANGELOG.md | 56 - .../netapp/mgmt/2021-06-01/netapp/_meta.json | 11 - .../mgmt/2021-06-01/netapp/accountbackups.go | 290 -- .../netapp/mgmt/2021-06-01/netapp/accounts.go | 629 --- .../mgmt/2021-06-01/netapp/backuppolicies.go | 484 -- .../netapp/mgmt/2021-06-01/netapp/backups.go | 741 --- .../netapp/mgmt/2021-06-01/netapp/client.go | 41 - .../netapp/mgmt/2021-06-01/netapp/enums.go | 318 -- .../netapp/mgmt/2021-06-01/netapp/models.go | 4538 ----------------- .../mgmt/2021-06-01/netapp/operations.go | 98 - .../netapp/mgmt/2021-06-01/netapp/pools.go | 552 -- .../netapp/mgmt/2021-06-01/netapp/resource.go | 284 -- .../2021-06-01/netapp/resourcequotalimits.go | 182 - .../2021-06-01/netapp/snapshotpolicies.go | 568 --- .../mgmt/2021-06-01/netapp/snapshots.go | 546 -- .../netapp/mgmt/2021-06-01/netapp/vaults.go | 116 - .../netapp/mgmt/2021-06-01/netapp/version.go | 19 - .../netapp/mgmt/2021-06-01/netapp/volumes.go | 1420 ------ .../mgmt/2021-10-01/netapp/CHANGELOG.md | 0 .../netapp/mgmt/2021-10-01/netapp/_meta.json | 0 .../mgmt/2021-10-01/netapp/accountbackups.go | 0 .../netapp/mgmt/2021-10-01/netapp/accounts.go | 0 .../mgmt/2021-10-01/netapp/backuppolicies.go | 0 .../netapp/mgmt/2021-10-01/netapp/backups.go | 0 .../netapp/mgmt/2021-10-01/netapp/client.go | 0 .../netapp/mgmt/2021-10-01/netapp/enums.go | 0 .../netapp/mgmt/2021-10-01/netapp/models.go | 0 .../mgmt/2021-10-01/netapp/operations.go | 0 .../netapp/mgmt/2021-10-01/netapp/pools.go | 0 .../netapp/mgmt/2021-10-01/netapp/resource.go | 0 .../2021-10-01/netapp/resourcequotalimits.go | 0 .../2021-10-01/netapp/snapshotpolicies.go | 0 .../mgmt/2021-10-01/netapp/snapshots.go | 0 .../mgmt/2021-10-01/netapp/subvolumes.go | 0 .../netapp/mgmt/2021-10-01/netapp/vaults.go | 0 .../netapp/mgmt/2021-10-01/netapp/version.go | 0 .../mgmt/2021-10-01/netapp/volumegroups.go | 0 .../netapp/mgmt/2021-10-01/netapp/volumes.go | 0 vendor/modules.txt | 2 +- 39 files changed, 1 insertion(+), 10894 deletions(-) delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/CHANGELOG.md delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/_meta.json delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/accountbackups.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/accounts.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/backuppolicies.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/backups.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/enums.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/models.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/operations.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/pools.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/resource.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/resourcequotalimits.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/snapshotpolicies.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/snapshots.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/vaults.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/version.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/volumes.go mode change 100755 => 100644 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/CHANGELOG.md mode change 100755 => 100644 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/_meta.json mode change 100755 => 100644 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/accountbackups.go mode change 100755 => 100644 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/accounts.go mode change 100755 => 100644 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/backuppolicies.go mode change 100755 => 100644 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/backups.go mode change 100755 => 100644 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/client.go mode change 100755 => 100644 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/enums.go mode change 100755 => 100644 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/models.go mode change 100755 => 100644 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/operations.go mode change 100755 => 100644 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/pools.go mode change 100755 => 100644 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/resource.go mode change 100755 => 100644 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/resourcequotalimits.go mode change 100755 => 100644 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/snapshotpolicies.go mode change 100755 => 100644 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/snapshots.go mode change 100755 => 100644 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/subvolumes.go mode change 100755 => 100644 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/vaults.go mode change 100755 => 100644 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/version.go mode change 100755 => 100644 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/volumegroups.go mode change 100755 => 100644 vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/volumes.go diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/CHANGELOG.md deleted file mode 100644 index fc0d66e3e9f8..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/CHANGELOG.md +++ /dev/null @@ -1,56 +0,0 @@ -# Change History - -## Additive Changes - -### New Constants - -1. NetworkFeatures.NetworkFeaturesBasic -1. NetworkFeatures.NetworkFeaturesStandard -1. VolumeStorageToNetworkProximity.VolumeStorageToNetworkProximityDefault -1. VolumeStorageToNetworkProximity.VolumeStorageToNetworkProximityT1 -1. VolumeStorageToNetworkProximity.VolumeStorageToNetworkProximityT2 - -### New Funcs - -1. *SubscriptionQuotaItem.UnmarshalJSON([]byte) error -1. AzureEntityResource.MarshalJSON() ([]byte, error) -1. NewResourceQuotaLimitsClient(string) ResourceQuotaLimitsClient -1. NewResourceQuotaLimitsClientWithBaseURI(string, string) ResourceQuotaLimitsClient -1. PossibleNetworkFeaturesValues() []NetworkFeatures -1. PossibleVolumeStorageToNetworkProximityValues() []VolumeStorageToNetworkProximity -1. ProxyResource.MarshalJSON() ([]byte, error) -1. Resource.MarshalJSON() ([]byte, error) -1. ResourceQuotaLimitsClient.Get(context.Context, string, string) (SubscriptionQuotaItem, error) -1. ResourceQuotaLimitsClient.GetPreparer(context.Context, string, string) (*http.Request, error) -1. ResourceQuotaLimitsClient.GetResponder(*http.Response) (SubscriptionQuotaItem, error) -1. ResourceQuotaLimitsClient.GetSender(*http.Request) (*http.Response, error) -1. ResourceQuotaLimitsClient.List(context.Context, string) (SubscriptionQuotaItemList, error) -1. ResourceQuotaLimitsClient.ListPreparer(context.Context, string) (*http.Request, error) -1. ResourceQuotaLimitsClient.ListResponder(*http.Response) (SubscriptionQuotaItemList, error) -1. ResourceQuotaLimitsClient.ListSender(*http.Request) (*http.Response, error) -1. SubscriptionQuotaItem.MarshalJSON() ([]byte, error) -1. SubscriptionQuotaItemProperties.MarshalJSON() ([]byte, error) -1. TrackedResource.MarshalJSON() ([]byte, error) - -### Struct Changes - -#### New Structs - -1. AzureEntityResource -1. LogSpecification -1. ProxyResource -1. Resource -1. ResourceQuotaLimitsClient -1. SubscriptionQuotaItem -1. SubscriptionQuotaItemList -1. SubscriptionQuotaItemProperties -1. TrackedResource - -#### New Struct Fields - -1. MetricSpecification.EnableRegionalMdmAccount -1. MetricSpecification.IsInternal -1. ServiceSpecification.LogSpecifications -1. VolumeProperties.NetworkFeatures -1. VolumeProperties.NetworkSiblingSetID -1. VolumeProperties.StorageToNetworkProximity diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/_meta.json b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/_meta.json deleted file mode 100644 index e7cfc268a08b..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/_meta.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commit": "a95079cdd7a60c5af0417360b1ee56c8ae845cc4", - "readme": "/_/azure-rest-api-specs/specification/netapp/resource-manager/readme.md", - "tag": "package-netapp-2021-06-01", - "use": "@microsoft.azure/autorest.go@2.1.187", - "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-netapp-2021-06-01 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix /_/azure-rest-api-specs/specification/netapp/resource-manager/readme.md", - "additional_properties": { - "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix" - } -} \ No newline at end of file diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/accountbackups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/accountbackups.go deleted file mode 100644 index 600a025ad397..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/accountbackups.go +++ /dev/null @@ -1,290 +0,0 @@ -package netapp - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// AccountBackupsClient is the microsoft NetApp Files Azure Resource Provider specification -type AccountBackupsClient struct { - BaseClient -} - -// NewAccountBackupsClient creates an instance of the AccountBackupsClient client. -func NewAccountBackupsClient(subscriptionID string) AccountBackupsClient { - return NewAccountBackupsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewAccountBackupsClientWithBaseURI creates an instance of the AccountBackupsClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewAccountBackupsClientWithBaseURI(baseURI string, subscriptionID string) AccountBackupsClient { - return AccountBackupsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Delete delete the specified Backup for a Netapp Account -// Parameters: -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -// backupName - the name of the backup -func (client AccountBackupsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, backupName string) (result AccountBackupsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountBackupsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.AccountBackupsClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, backupName) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.AccountBackupsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.AccountBackupsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client AccountBackupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, backupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "backupName": autorest.Encode("path", backupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups/{backupName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client AccountBackupsClient) DeleteSender(req *http.Request) (future AccountBackupsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client AccountBackupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified backup for a Netapp Account -// Parameters: -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -// backupName - the name of the backup -func (client AccountBackupsClient) Get(ctx context.Context, resourceGroupName string, accountName string, backupName string) (result Backup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountBackupsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.AccountBackupsClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, accountName, backupName) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.AccountBackupsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "netapp.AccountBackupsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.AccountBackupsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client AccountBackupsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, backupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "backupName": autorest.Encode("path", backupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups/{backupName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client AccountBackupsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client AccountBackupsClient) GetResponder(resp *http.Response) (result Backup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List list all Backups for a Netapp Account -// Parameters: -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -func (client AccountBackupsClient) List(ctx context.Context, resourceGroupName string, accountName string) (result BackupsList, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountBackupsClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.AccountBackupsClient", "List", err.Error()) - } - - req, err := client.ListPreparer(ctx, resourceGroupName, accountName) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.AccountBackupsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "netapp.AccountBackupsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.AccountBackupsClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client AccountBackupsClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client AccountBackupsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client AccountBackupsClient) ListResponder(resp *http.Response) (result BackupsList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/accounts.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/accounts.go deleted file mode 100644 index e85f02ff9960..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/accounts.go +++ /dev/null @@ -1,629 +0,0 @@ -package netapp - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// AccountsClient is the microsoft NetApp Files Azure Resource Provider specification -type AccountsClient struct { - BaseClient -} - -// NewAccountsClient creates an instance of the AccountsClient client. -func NewAccountsClient(subscriptionID string) AccountsClient { - return NewAccountsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewAccountsClientWithBaseURI creates an instance of the AccountsClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewAccountsClientWithBaseURI(baseURI string, subscriptionID string) AccountsClient { - return AccountsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update the specified NetApp account within the resource group -// Parameters: -// body - netApp Account object supplied in the body of the operation. -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -func (client AccountsClient) CreateOrUpdate(ctx context.Context, body Account, resourceGroupName string, accountName string) (result AccountsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: body, - Constraints: []validation.Constraint{{Target: "body.Location", Name: validation.Null, Rule: true, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.AccountsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, body, resourceGroupName, accountName) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client AccountsClient) CreateOrUpdatePreparer(ctx context.Context, body Account, resourceGroupName string, accountName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - body.ID = nil - body.Name = nil - body.Etag = nil - body.Type = nil - body.SystemData = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}", pathParameters), - autorest.WithJSON(body), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client AccountsClient) CreateOrUpdateSender(req *http.Request) (future AccountsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client AccountsClient) CreateOrUpdateResponder(resp *http.Response) (result Account, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete the specified NetApp account -// Parameters: -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -func (client AccountsClient) Delete(ctx context.Context, resourceGroupName string, accountName string) (result AccountsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.AccountsClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, accountName) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client AccountsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client AccountsClient) DeleteSender(req *http.Request) (future AccountsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client AccountsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get get the NetApp account -// Parameters: -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -func (client AccountsClient) Get(ctx context.Context, resourceGroupName string, accountName string) (result Account, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.AccountsClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, accountName) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client AccountsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client AccountsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client AccountsClient) GetResponder(resp *http.Response) (result Account, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List list and describe all NetApp accounts in the resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client AccountsClient) List(ctx context.Context, resourceGroupName string) (result AccountListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.List") - defer func() { - sc := -1 - if result.al.Response.Response != nil { - sc = result.al.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.AccountsClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.al.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "List", resp, "Failure sending request") - return - } - - result.al, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "List", resp, "Failure responding to request") - return - } - if result.al.hasNextLink() && result.al.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client AccountsClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client AccountsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client AccountsClient) ListResponder(resp *http.Response) (result AccountList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client AccountsClient) listNextResults(ctx context.Context, lastResults AccountList) (result AccountList, err error) { - req, err := lastResults.accountListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "netapp.AccountsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "netapp.AccountsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client AccountsClient) ListComplete(ctx context.Context, resourceGroupName string) (result AccountListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListBySubscription list and describe all NetApp accounts in the subscription. -func (client AccountsClient) ListBySubscription(ctx context.Context) (result AccountListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.ListBySubscription") - defer func() { - sc := -1 - if result.al.Response.Response != nil { - sc = result.al.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listBySubscriptionNextResults - req, err := client.ListBySubscriptionPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "ListBySubscription", nil, "Failure preparing request") - return - } - - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.al.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "ListBySubscription", resp, "Failure sending request") - return - } - - result.al, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "ListBySubscription", resp, "Failure responding to request") - return - } - if result.al.hasNextLink() && result.al.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client AccountsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/netAppAccounts", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListBySubscriptionSender sends the ListBySubscription request. The method will close the -// http.Response Body if it receives an error. -func (client AccountsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always -// closes the http.Response Body. -func (client AccountsClient) ListBySubscriptionResponder(resp *http.Response) (result AccountList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listBySubscriptionNextResults retrieves the next set of results, if any. -func (client AccountsClient) listBySubscriptionNextResults(ctx context.Context, lastResults AccountList) (result AccountList, err error) { - req, err := lastResults.accountListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "netapp.AccountsClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "netapp.AccountsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") - } - result, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client AccountsClient) ListBySubscriptionComplete(ctx context.Context) (result AccountListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.ListBySubscription") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListBySubscription(ctx) - return -} - -// Update patch the specified NetApp account -// Parameters: -// body - netApp Account object supplied in the body of the operation. -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -func (client AccountsClient) Update(ctx context.Context, body AccountPatch, resourceGroupName string, accountName string) (result AccountsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.AccountsClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, body, resourceGroupName, accountName) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client AccountsClient) UpdatePreparer(ctx context.Context, body AccountPatch, resourceGroupName string, accountName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - body.ID = nil - body.Name = nil - body.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}", pathParameters), - autorest.WithJSON(body), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client AccountsClient) UpdateSender(req *http.Request) (future AccountsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client AccountsClient) UpdateResponder(resp *http.Response) (result Account, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/backuppolicies.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/backuppolicies.go deleted file mode 100644 index c541e91de007..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/backuppolicies.go +++ /dev/null @@ -1,484 +0,0 @@ -package netapp - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// BackupPoliciesClient is the microsoft NetApp Files Azure Resource Provider specification -type BackupPoliciesClient struct { - BaseClient -} - -// NewBackupPoliciesClient creates an instance of the BackupPoliciesClient client. -func NewBackupPoliciesClient(subscriptionID string) BackupPoliciesClient { - return NewBackupPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewBackupPoliciesClientWithBaseURI creates an instance of the BackupPoliciesClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewBackupPoliciesClientWithBaseURI(baseURI string, subscriptionID string) BackupPoliciesClient { - return BackupPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Create create a backup policy for Netapp Account -// Parameters: -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -// backupPolicyName - backup policy Name which uniquely identify backup policy. -// body - backup policy object supplied in the body of the operation. -func (client BackupPoliciesClient) Create(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string, body BackupPolicy) (result BackupPoliciesCreateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BackupPoliciesClient.Create") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: body, - Constraints: []validation.Constraint{{Target: "body.Location", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "body.BackupPolicyProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.BackupPoliciesClient", "Create", err.Error()) - } - - req, err := client.CreatePreparer(ctx, resourceGroupName, accountName, backupPolicyName, body) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "Create", nil, "Failure preparing request") - return - } - - result, err = client.CreateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "Create", result.Response(), "Failure sending request") - return - } - - return -} - -// CreatePreparer prepares the Create request. -func (client BackupPoliciesClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string, body BackupPolicy) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "backupPolicyName": autorest.Encode("path", backupPolicyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - body.ID = nil - body.Name = nil - body.Etag = nil - body.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}", pathParameters), - autorest.WithJSON(body), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateSender sends the Create request. The method will close the -// http.Response Body if it receives an error. -func (client BackupPoliciesClient) CreateSender(req *http.Request) (future BackupPoliciesCreateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateResponder handles the response to the Create request. The method always -// closes the http.Response Body. -func (client BackupPoliciesClient) CreateResponder(resp *http.Response) (result BackupPolicy, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete backup policy -// Parameters: -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -// backupPolicyName - backup policy Name which uniquely identify backup policy. -func (client BackupPoliciesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string) (result BackupPoliciesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BackupPoliciesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.BackupPoliciesClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, backupPolicyName) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client BackupPoliciesClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "backupPolicyName": autorest.Encode("path", backupPolicyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client BackupPoliciesClient) DeleteSender(req *http.Request) (future BackupPoliciesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client BackupPoliciesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get get a particular backup Policy -// Parameters: -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -// backupPolicyName - backup policy Name which uniquely identify backup policy. -func (client BackupPoliciesClient) Get(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string) (result BackupPolicy, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BackupPoliciesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.BackupPoliciesClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, accountName, backupPolicyName) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client BackupPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "backupPolicyName": autorest.Encode("path", backupPolicyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client BackupPoliciesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client BackupPoliciesClient) GetResponder(resp *http.Response) (result BackupPolicy, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List list backup policies for Netapp Account -// Parameters: -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -func (client BackupPoliciesClient) List(ctx context.Context, resourceGroupName string, accountName string) (result BackupPoliciesList, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BackupPoliciesClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.BackupPoliciesClient", "List", err.Error()) - } - - req, err := client.ListPreparer(ctx, resourceGroupName, accountName) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client BackupPoliciesClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client BackupPoliciesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client BackupPoliciesClient) ListResponder(resp *http.Response) (result BackupPoliciesList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Update patch a backup policy for Netapp Account -// Parameters: -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -// backupPolicyName - backup policy Name which uniquely identify backup policy. -// body - backup policy object supplied in the body of the operation. -func (client BackupPoliciesClient) Update(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string, body BackupPolicyPatch) (result BackupPoliciesUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BackupPoliciesClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.BackupPoliciesClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, resourceGroupName, accountName, backupPolicyName, body) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client BackupPoliciesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string, body BackupPolicyPatch) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "backupPolicyName": autorest.Encode("path", backupPolicyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - body.ID = nil - body.Name = nil - body.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}", pathParameters), - autorest.WithJSON(body), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client BackupPoliciesClient) UpdateSender(req *http.Request) (future BackupPoliciesUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client BackupPoliciesClient) UpdateResponder(resp *http.Response) (result BackupPolicy, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/backups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/backups.go deleted file mode 100644 index 4adc51d81657..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/backups.go +++ /dev/null @@ -1,741 +0,0 @@ -package netapp - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// BackupsClient is the microsoft NetApp Files Azure Resource Provider specification -type BackupsClient struct { - BaseClient -} - -// NewBackupsClient creates an instance of the BackupsClient client. -func NewBackupsClient(subscriptionID string) BackupsClient { - return NewBackupsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewBackupsClientWithBaseURI creates an instance of the BackupsClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewBackupsClientWithBaseURI(baseURI string, subscriptionID string) BackupsClient { - return BackupsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Create create a backup for the volume -// Parameters: -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -// poolName - the name of the capacity pool -// volumeName - the name of the volume -// backupName - the name of the backup -// body - backup object supplied in the body of the operation. -func (client BackupsClient) Create(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string, body Backup) (result BackupsCreateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BackupsClient.Create") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: poolName, - Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, - {TargetValue: volumeName, - Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, - {TargetValue: body, - Constraints: []validation.Constraint{{Target: "body.Location", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "body.BackupProperties", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "body.BackupProperties.BackupID", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "body.BackupProperties.BackupID", Name: validation.MaxLength, Rule: 36, Chain: nil}, - {Target: "body.BackupProperties.BackupID", Name: validation.MinLength, Rule: 36, Chain: nil}, - {Target: "body.BackupProperties.BackupID", Name: validation.Pattern, Rule: `^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$`, Chain: nil}, - }}, - }}}}}); err != nil { - return result, validation.NewError("netapp.BackupsClient", "Create", err.Error()) - } - - req, err := client.CreatePreparer(ctx, resourceGroupName, accountName, poolName, volumeName, backupName, body) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "Create", nil, "Failure preparing request") - return - } - - result, err = client.CreateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "Create", result.Response(), "Failure sending request") - return - } - - return -} - -// CreatePreparer prepares the Create request. -func (client BackupsClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string, body Backup) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "backupName": autorest.Encode("path", backupName), - "poolName": autorest.Encode("path", poolName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "volumeName": autorest.Encode("path", volumeName), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - body.ID = nil - body.Name = nil - body.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}", pathParameters), - autorest.WithJSON(body), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateSender sends the Create request. The method will close the -// http.Response Body if it receives an error. -func (client BackupsClient) CreateSender(req *http.Request) (future BackupsCreateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateResponder handles the response to the Create request. The method always -// closes the http.Response Body. -func (client BackupsClient) CreateResponder(resp *http.Response) (result Backup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete a backup of the volume -// Parameters: -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -// poolName - the name of the capacity pool -// volumeName - the name of the volume -// backupName - the name of the backup -func (client BackupsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string) (result BackupsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BackupsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: poolName, - Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, - {TargetValue: volumeName, - Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.BackupsClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, poolName, volumeName, backupName) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client BackupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "backupName": autorest.Encode("path", backupName), - "poolName": autorest.Encode("path", poolName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "volumeName": autorest.Encode("path", volumeName), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client BackupsClient) DeleteSender(req *http.Request) (future BackupsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client BackupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified backup of the volume -// Parameters: -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -// poolName - the name of the capacity pool -// volumeName - the name of the volume -// backupName - the name of the backup -func (client BackupsClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string) (result Backup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BackupsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: poolName, - Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, - {TargetValue: volumeName, - Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.BackupsClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, accountName, poolName, volumeName, backupName) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client BackupsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "backupName": autorest.Encode("path", backupName), - "poolName": autorest.Encode("path", poolName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "volumeName": autorest.Encode("path", volumeName), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client BackupsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client BackupsClient) GetResponder(resp *http.Response) (result Backup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetStatus get the status of the backup for a volume -// Parameters: -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -// poolName - the name of the capacity pool -// volumeName - the name of the volume -func (client BackupsClient) GetStatus(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result BackupStatus, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BackupsClient.GetStatus") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: poolName, - Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, - {TargetValue: volumeName, - Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.BackupsClient", "GetStatus", err.Error()) - } - - req, err := client.GetStatusPreparer(ctx, resourceGroupName, accountName, poolName, volumeName) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "GetStatus", nil, "Failure preparing request") - return - } - - resp, err := client.GetStatusSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "GetStatus", resp, "Failure sending request") - return - } - - result, err = client.GetStatusResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "GetStatus", resp, "Failure responding to request") - return - } - - return -} - -// GetStatusPreparer prepares the GetStatus request. -func (client BackupsClient) GetStatusPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "poolName": autorest.Encode("path", poolName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "volumeName": autorest.Encode("path", volumeName), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backupStatus", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetStatusSender sends the GetStatus request. The method will close the -// http.Response Body if it receives an error. -func (client BackupsClient) GetStatusSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetStatusResponder handles the response to the GetStatus request. The method always -// closes the http.Response Body. -func (client BackupsClient) GetStatusResponder(resp *http.Response) (result BackupStatus, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetVolumeRestoreStatus get the status of the restore for a volume -// Parameters: -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -// poolName - the name of the capacity pool -// volumeName - the name of the volume -func (client BackupsClient) GetVolumeRestoreStatus(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result RestoreStatus, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BackupsClient.GetVolumeRestoreStatus") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: poolName, - Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, - {TargetValue: volumeName, - Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.BackupsClient", "GetVolumeRestoreStatus", err.Error()) - } - - req, err := client.GetVolumeRestoreStatusPreparer(ctx, resourceGroupName, accountName, poolName, volumeName) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "GetVolumeRestoreStatus", nil, "Failure preparing request") - return - } - - resp, err := client.GetVolumeRestoreStatusSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "GetVolumeRestoreStatus", resp, "Failure sending request") - return - } - - result, err = client.GetVolumeRestoreStatusResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "GetVolumeRestoreStatus", resp, "Failure responding to request") - return - } - - return -} - -// GetVolumeRestoreStatusPreparer prepares the GetVolumeRestoreStatus request. -func (client BackupsClient) GetVolumeRestoreStatusPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "poolName": autorest.Encode("path", poolName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "volumeName": autorest.Encode("path", volumeName), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/restoreStatus", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetVolumeRestoreStatusSender sends the GetVolumeRestoreStatus request. The method will close the -// http.Response Body if it receives an error. -func (client BackupsClient) GetVolumeRestoreStatusSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetVolumeRestoreStatusResponder handles the response to the GetVolumeRestoreStatus request. The method always -// closes the http.Response Body. -func (client BackupsClient) GetVolumeRestoreStatusResponder(resp *http.Response) (result RestoreStatus, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List list all backups for a volume -// Parameters: -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -// poolName - the name of the capacity pool -// volumeName - the name of the volume -func (client BackupsClient) List(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result BackupsList, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BackupsClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: poolName, - Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, - {TargetValue: volumeName, - Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.BackupsClient", "List", err.Error()) - } - - req, err := client.ListPreparer(ctx, resourceGroupName, accountName, poolName, volumeName) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client BackupsClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "poolName": autorest.Encode("path", poolName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "volumeName": autorest.Encode("path", volumeName), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client BackupsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client BackupsClient) ListResponder(resp *http.Response) (result BackupsList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Update patch a backup for the volume -// Parameters: -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -// poolName - the name of the capacity pool -// volumeName - the name of the volume -// backupName - the name of the backup -// body - backup object supplied in the body of the operation. -func (client BackupsClient) Update(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string, body *BackupPatch) (result BackupsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BackupsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: poolName, - Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, - {TargetValue: volumeName, - Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.BackupsClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, resourceGroupName, accountName, poolName, volumeName, backupName, body) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client BackupsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string, body *BackupPatch) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "backupName": autorest.Encode("path", backupName), - "poolName": autorest.Encode("path", poolName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "volumeName": autorest.Encode("path", volumeName), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if body != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(body)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client BackupsClient) UpdateSender(req *http.Request) (future BackupsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client BackupsClient) UpdateResponder(resp *http.Response) (result Backup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/client.go deleted file mode 100644 index 0a9c729f12ff..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/client.go +++ /dev/null @@ -1,41 +0,0 @@ -// Package netapp implements the Azure ARM Netapp service API version 2021-06-01. -// -// Microsoft NetApp Files Azure Resource Provider specification -package netapp - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "github.com/Azure/go-autorest/autorest" -) - -const ( - // DefaultBaseURI is the default URI used for the service Netapp - DefaultBaseURI = "https://management.azure.com" -) - -// BaseClient is the base client for Netapp. -type BaseClient struct { - autorest.Client - BaseURI string - SubscriptionID string -} - -// New creates an instance of the BaseClient client. -func New(subscriptionID string) BaseClient { - return NewWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with -// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { - return BaseClient{ - Client: autorest.NewClientWithUserAgent(UserAgent()), - BaseURI: baseURI, - SubscriptionID: subscriptionID, - } -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/enums.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/enums.go deleted file mode 100644 index e1f13080ad73..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/enums.go +++ /dev/null @@ -1,318 +0,0 @@ -package netapp - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -// ActiveDirectoryStatus enumerates the values for active directory status. -type ActiveDirectoryStatus string - -const ( - // ActiveDirectoryStatusCreated Active Directory created but not in use - ActiveDirectoryStatusCreated ActiveDirectoryStatus = "Created" - // ActiveDirectoryStatusDeleted Active Directory Deleted - ActiveDirectoryStatusDeleted ActiveDirectoryStatus = "Deleted" - // ActiveDirectoryStatusError Error with the Active Directory - ActiveDirectoryStatusError ActiveDirectoryStatus = "Error" - // ActiveDirectoryStatusInUse Active Directory in use by SMB Volume - ActiveDirectoryStatusInUse ActiveDirectoryStatus = "InUse" - // ActiveDirectoryStatusUpdating Active Directory Updating - ActiveDirectoryStatusUpdating ActiveDirectoryStatus = "Updating" -) - -// PossibleActiveDirectoryStatusValues returns an array of possible values for the ActiveDirectoryStatus const type. -func PossibleActiveDirectoryStatusValues() []ActiveDirectoryStatus { - return []ActiveDirectoryStatus{ActiveDirectoryStatusCreated, ActiveDirectoryStatusDeleted, ActiveDirectoryStatusError, ActiveDirectoryStatusInUse, ActiveDirectoryStatusUpdating} -} - -// AvsDataStore enumerates the values for avs data store. -type AvsDataStore string - -const ( - // AvsDataStoreDisabled avsDataStore is disabled - AvsDataStoreDisabled AvsDataStore = "Disabled" - // AvsDataStoreEnabled avsDataStore is enabled - AvsDataStoreEnabled AvsDataStore = "Enabled" -) - -// PossibleAvsDataStoreValues returns an array of possible values for the AvsDataStore const type. -func PossibleAvsDataStoreValues() []AvsDataStore { - return []AvsDataStore{AvsDataStoreDisabled, AvsDataStoreEnabled} -} - -// BackupType enumerates the values for backup type. -type BackupType string - -const ( - // BackupTypeManual Manual backup - BackupTypeManual BackupType = "Manual" - // BackupTypeScheduled Scheduled backup - BackupTypeScheduled BackupType = "Scheduled" -) - -// PossibleBackupTypeValues returns an array of possible values for the BackupType const type. -func PossibleBackupTypeValues() []BackupType { - return []BackupType{BackupTypeManual, BackupTypeScheduled} -} - -// CheckNameResourceTypes enumerates the values for check name resource types. -type CheckNameResourceTypes string - -const ( - // CheckNameResourceTypesMicrosoftNetAppnetAppAccounts ... - CheckNameResourceTypesMicrosoftNetAppnetAppAccounts CheckNameResourceTypes = "Microsoft.NetApp/netAppAccounts" - // CheckNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPools ... - CheckNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPools CheckNameResourceTypes = "Microsoft.NetApp/netAppAccounts/capacityPools" - // CheckNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumes ... - CheckNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumes CheckNameResourceTypes = "Microsoft.NetApp/netAppAccounts/capacityPools/volumes" - // CheckNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumessnapshots ... - CheckNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumessnapshots CheckNameResourceTypes = "Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots" -) - -// PossibleCheckNameResourceTypesValues returns an array of possible values for the CheckNameResourceTypes const type. -func PossibleCheckNameResourceTypesValues() []CheckNameResourceTypes { - return []CheckNameResourceTypes{CheckNameResourceTypesMicrosoftNetAppnetAppAccounts, CheckNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPools, CheckNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumes, CheckNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumessnapshots} -} - -// CheckQuotaNameResourceTypes enumerates the values for check quota name resource types. -type CheckQuotaNameResourceTypes string - -const ( - // CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccounts ... - CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccounts CheckQuotaNameResourceTypes = "Microsoft.NetApp/netAppAccounts" - // CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPools ... - CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPools CheckQuotaNameResourceTypes = "Microsoft.NetApp/netAppAccounts/capacityPools" - // CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumes ... - CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumes CheckQuotaNameResourceTypes = "Microsoft.NetApp/netAppAccounts/capacityPools/volumes" - // CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumessnapshots ... - CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumessnapshots CheckQuotaNameResourceTypes = "Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots" -) - -// PossibleCheckQuotaNameResourceTypesValues returns an array of possible values for the CheckQuotaNameResourceTypes const type. -func PossibleCheckQuotaNameResourceTypesValues() []CheckQuotaNameResourceTypes { - return []CheckQuotaNameResourceTypes{CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccounts, CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPools, CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumes, CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumessnapshots} -} - -// ChownMode enumerates the values for chown mode. -type ChownMode string - -const ( - // ChownModeRestricted ... - ChownModeRestricted ChownMode = "Restricted" - // ChownModeUnrestricted ... - ChownModeUnrestricted ChownMode = "Unrestricted" -) - -// PossibleChownModeValues returns an array of possible values for the ChownMode const type. -func PossibleChownModeValues() []ChownMode { - return []ChownMode{ChownModeRestricted, ChownModeUnrestricted} -} - -// CreatedByType enumerates the values for created by type. -type CreatedByType string - -const ( - // CreatedByTypeApplication ... - CreatedByTypeApplication CreatedByType = "Application" - // CreatedByTypeKey ... - CreatedByTypeKey CreatedByType = "Key" - // CreatedByTypeManagedIdentity ... - CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" - // CreatedByTypeUser ... - CreatedByTypeUser CreatedByType = "User" -) - -// PossibleCreatedByTypeValues returns an array of possible values for the CreatedByType const type. -func PossibleCreatedByTypeValues() []CreatedByType { - return []CreatedByType{CreatedByTypeApplication, CreatedByTypeKey, CreatedByTypeManagedIdentity, CreatedByTypeUser} -} - -// EncryptionType enumerates the values for encryption type. -type EncryptionType string - -const ( - // EncryptionTypeDouble EncryptionType Double, volumes will use double encryption at rest - EncryptionTypeDouble EncryptionType = "Double" - // EncryptionTypeSingle EncryptionType Single, volumes will use single encryption at rest - EncryptionTypeSingle EncryptionType = "Single" -) - -// PossibleEncryptionTypeValues returns an array of possible values for the EncryptionType const type. -func PossibleEncryptionTypeValues() []EncryptionType { - return []EncryptionType{EncryptionTypeDouble, EncryptionTypeSingle} -} - -// EndpointType enumerates the values for endpoint type. -type EndpointType string - -const ( - // EndpointTypeDst ... - EndpointTypeDst EndpointType = "dst" - // EndpointTypeSrc ... - EndpointTypeSrc EndpointType = "src" -) - -// PossibleEndpointTypeValues returns an array of possible values for the EndpointType const type. -func PossibleEndpointTypeValues() []EndpointType { - return []EndpointType{EndpointTypeDst, EndpointTypeSrc} -} - -// InAvailabilityReasonType enumerates the values for in availability reason type. -type InAvailabilityReasonType string - -const ( - // InAvailabilityReasonTypeAlreadyExists ... - InAvailabilityReasonTypeAlreadyExists InAvailabilityReasonType = "AlreadyExists" - // InAvailabilityReasonTypeInvalid ... - InAvailabilityReasonTypeInvalid InAvailabilityReasonType = "Invalid" -) - -// PossibleInAvailabilityReasonTypeValues returns an array of possible values for the InAvailabilityReasonType const type. -func PossibleInAvailabilityReasonTypeValues() []InAvailabilityReasonType { - return []InAvailabilityReasonType{InAvailabilityReasonTypeAlreadyExists, InAvailabilityReasonTypeInvalid} -} - -// MetricAggregationType enumerates the values for metric aggregation type. -type MetricAggregationType string - -const ( - // MetricAggregationTypeAverage ... - MetricAggregationTypeAverage MetricAggregationType = "Average" -) - -// PossibleMetricAggregationTypeValues returns an array of possible values for the MetricAggregationType const type. -func PossibleMetricAggregationTypeValues() []MetricAggregationType { - return []MetricAggregationType{MetricAggregationTypeAverage} -} - -// MirrorState enumerates the values for mirror state. -type MirrorState string - -const ( - // MirrorStateBroken ... - MirrorStateBroken MirrorState = "Broken" - // MirrorStateMirrored ... - MirrorStateMirrored MirrorState = "Mirrored" - // MirrorStateUninitialized ... - MirrorStateUninitialized MirrorState = "Uninitialized" -) - -// PossibleMirrorStateValues returns an array of possible values for the MirrorState const type. -func PossibleMirrorStateValues() []MirrorState { - return []MirrorState{MirrorStateBroken, MirrorStateMirrored, MirrorStateUninitialized} -} - -// NetworkFeatures enumerates the values for network features. -type NetworkFeatures string - -const ( - // NetworkFeaturesBasic Basic network feature. - NetworkFeaturesBasic NetworkFeatures = "Basic" - // NetworkFeaturesStandard Standard network feature. - NetworkFeaturesStandard NetworkFeatures = "Standard" -) - -// PossibleNetworkFeaturesValues returns an array of possible values for the NetworkFeatures const type. -func PossibleNetworkFeaturesValues() []NetworkFeatures { - return []NetworkFeatures{NetworkFeaturesBasic, NetworkFeaturesStandard} -} - -// QosType enumerates the values for qos type. -type QosType string - -const ( - // QosTypeAuto qos type Auto - QosTypeAuto QosType = "Auto" - // QosTypeManual qos type Manual - QosTypeManual QosType = "Manual" -) - -// PossibleQosTypeValues returns an array of possible values for the QosType const type. -func PossibleQosTypeValues() []QosType { - return []QosType{QosTypeAuto, QosTypeManual} -} - -// RelationshipStatus enumerates the values for relationship status. -type RelationshipStatus string - -const ( - // RelationshipStatusIdle ... - RelationshipStatusIdle RelationshipStatus = "Idle" - // RelationshipStatusTransferring ... - RelationshipStatusTransferring RelationshipStatus = "Transferring" -) - -// PossibleRelationshipStatusValues returns an array of possible values for the RelationshipStatus const type. -func PossibleRelationshipStatusValues() []RelationshipStatus { - return []RelationshipStatus{RelationshipStatusIdle, RelationshipStatusTransferring} -} - -// ReplicationSchedule enumerates the values for replication schedule. -type ReplicationSchedule string - -const ( - // ReplicationSchedule10minutely ... - ReplicationSchedule10minutely ReplicationSchedule = "_10minutely" - // ReplicationScheduleDaily ... - ReplicationScheduleDaily ReplicationSchedule = "daily" - // ReplicationScheduleHourly ... - ReplicationScheduleHourly ReplicationSchedule = "hourly" -) - -// PossibleReplicationScheduleValues returns an array of possible values for the ReplicationSchedule const type. -func PossibleReplicationScheduleValues() []ReplicationSchedule { - return []ReplicationSchedule{ReplicationSchedule10minutely, ReplicationScheduleDaily, ReplicationScheduleHourly} -} - -// SecurityStyle enumerates the values for security style. -type SecurityStyle string - -const ( - // SecurityStyleNtfs ... - SecurityStyleNtfs SecurityStyle = "ntfs" - // SecurityStyleUnix ... - SecurityStyleUnix SecurityStyle = "unix" -) - -// PossibleSecurityStyleValues returns an array of possible values for the SecurityStyle const type. -func PossibleSecurityStyleValues() []SecurityStyle { - return []SecurityStyle{SecurityStyleNtfs, SecurityStyleUnix} -} - -// ServiceLevel enumerates the values for service level. -type ServiceLevel string - -const ( - // ServiceLevelPremium Premium service level - ServiceLevelPremium ServiceLevel = "Premium" - // ServiceLevelStandard Standard service level - ServiceLevelStandard ServiceLevel = "Standard" - // ServiceLevelStandardZRS Zone redundant storage service level - ServiceLevelStandardZRS ServiceLevel = "StandardZRS" - // ServiceLevelUltra Ultra service level - ServiceLevelUltra ServiceLevel = "Ultra" -) - -// PossibleServiceLevelValues returns an array of possible values for the ServiceLevel const type. -func PossibleServiceLevelValues() []ServiceLevel { - return []ServiceLevel{ServiceLevelPremium, ServiceLevelStandard, ServiceLevelStandardZRS, ServiceLevelUltra} -} - -// VolumeStorageToNetworkProximity enumerates the values for volume storage to network proximity. -type VolumeStorageToNetworkProximity string - -const ( - // VolumeStorageToNetworkProximityDefault Basic storage to network connectivity. - VolumeStorageToNetworkProximityDefault VolumeStorageToNetworkProximity = "Default" - // VolumeStorageToNetworkProximityT1 Standard T1 storage to network connectivity. - VolumeStorageToNetworkProximityT1 VolumeStorageToNetworkProximity = "T1" - // VolumeStorageToNetworkProximityT2 Standard T2 storage to network connectivity. - VolumeStorageToNetworkProximityT2 VolumeStorageToNetworkProximity = "T2" -) - -// PossibleVolumeStorageToNetworkProximityValues returns an array of possible values for the VolumeStorageToNetworkProximity const type. -func PossibleVolumeStorageToNetworkProximityValues() []VolumeStorageToNetworkProximity { - return []VolumeStorageToNetworkProximity{VolumeStorageToNetworkProximityDefault, VolumeStorageToNetworkProximityT1, VolumeStorageToNetworkProximityT2} -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/models.go deleted file mode 100644 index 39fac048638a..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/models.go +++ /dev/null @@ -1,4538 +0,0 @@ -package netapp - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "encoding/json" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/date" - "github.com/Azure/go-autorest/autorest/to" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// The package's fully qualified name. -const fqdn = "github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp" - -// Account netApp account resource -type Account struct { - autorest.Response `json:"-"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` - // AccountProperties - NetApp Account properties - *AccountProperties `json:"properties,omitempty"` - // SystemData - READ-ONLY; The system meta data relating to this resource. - SystemData *SystemData `json:"systemData,omitempty"` -} - -// MarshalJSON is the custom marshaler for Account. -func (a Account) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if a.Location != nil { - objectMap["location"] = a.Location - } - if a.Tags != nil { - objectMap["tags"] = a.Tags - } - if a.AccountProperties != nil { - objectMap["properties"] = a.AccountProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Account struct. -func (a *Account) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - a.Location = &location - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - a.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - a.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - a.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - a.Type = &typeVar - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - a.Tags = tags - } - case "properties": - if v != nil { - var accountProperties AccountProperties - err = json.Unmarshal(*v, &accountProperties) - if err != nil { - return err - } - a.AccountProperties = &accountProperties - } - case "systemData": - if v != nil { - var systemData SystemData - err = json.Unmarshal(*v, &systemData) - if err != nil { - return err - } - a.SystemData = &systemData - } - } - } - - return nil -} - -// AccountBackupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type AccountBackupsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(AccountBackupsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *AccountBackupsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for AccountBackupsDeleteFuture.Result. -func (future *AccountBackupsDeleteFuture) result(client AccountBackupsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.AccountBackupsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("netapp.AccountBackupsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// AccountEncryption encryption settings -type AccountEncryption struct { - // KeySource - Encryption Key Source. Possible values are: 'Microsoft.NetApp'. - KeySource *string `json:"keySource,omitempty"` -} - -// AccountList list of NetApp account resources -type AccountList struct { - autorest.Response `json:"-"` - // Value - Multiple NetApp accounts - Value *[]Account `json:"value,omitempty"` - // NextLink - URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// AccountListIterator provides access to a complete listing of Account values. -type AccountListIterator struct { - i int - page AccountListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *AccountListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *AccountListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter AccountListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter AccountListIterator) Response() AccountList { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter AccountListIterator) Value() Account { - if !iter.page.NotDone() { - return Account{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the AccountListIterator type. -func NewAccountListIterator(page AccountListPage) AccountListIterator { - return AccountListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (al AccountList) IsEmpty() bool { - return al.Value == nil || len(*al.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (al AccountList) hasNextLink() bool { - return al.NextLink != nil && len(*al.NextLink) != 0 -} - -// accountListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (al AccountList) accountListPreparer(ctx context.Context) (*http.Request, error) { - if !al.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(al.NextLink))) -} - -// AccountListPage contains a page of Account values. -type AccountListPage struct { - fn func(context.Context, AccountList) (AccountList, error) - al AccountList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *AccountListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AccountListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.al) - if err != nil { - return err - } - page.al = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *AccountListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page AccountListPage) NotDone() bool { - return !page.al.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page AccountListPage) Response() AccountList { - return page.al -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page AccountListPage) Values() []Account { - if page.al.IsEmpty() { - return nil - } - return *page.al.Value -} - -// Creates a new instance of the AccountListPage type. -func NewAccountListPage(cur AccountList, getNextPage func(context.Context, AccountList) (AccountList, error)) AccountListPage { - return AccountListPage{ - fn: getNextPage, - al: cur, - } -} - -// AccountPatch netApp account patch resource -type AccountPatch struct { - // Location - Resource location - Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` - // AccountProperties - NetApp Account properties - *AccountProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for AccountPatch. -func (ap AccountPatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ap.Location != nil { - objectMap["location"] = ap.Location - } - if ap.Tags != nil { - objectMap["tags"] = ap.Tags - } - if ap.AccountProperties != nil { - objectMap["properties"] = ap.AccountProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for AccountPatch struct. -func (ap *AccountPatch) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - ap.Location = &location - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ap.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ap.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ap.Type = &typeVar - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - ap.Tags = tags - } - case "properties": - if v != nil { - var accountProperties AccountProperties - err = json.Unmarshal(*v, &accountProperties) - if err != nil { - return err - } - ap.AccountProperties = &accountProperties - } - } - } - - return nil -} - -// AccountProperties netApp account properties -type AccountProperties struct { - // ProvisioningState - READ-ONLY; Azure lifecycle management - ProvisioningState *string `json:"provisioningState,omitempty"` - // ActiveDirectories - Active Directories - ActiveDirectories *[]ActiveDirectory `json:"activeDirectories,omitempty"` - // Encryption - Encryption settings - Encryption *AccountEncryption `json:"encryption,omitempty"` -} - -// MarshalJSON is the custom marshaler for AccountProperties. -func (ap AccountProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ap.ActiveDirectories != nil { - objectMap["activeDirectories"] = ap.ActiveDirectories - } - if ap.Encryption != nil { - objectMap["encryption"] = ap.Encryption - } - return json.Marshal(objectMap) -} - -// AccountsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type AccountsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(AccountsClient) (Account, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *AccountsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for AccountsCreateOrUpdateFuture.Result. -func (future *AccountsCreateOrUpdateFuture) result(client AccountsClient) (a Account, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.AccountsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - a.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("netapp.AccountsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if a.Response.Response, err = future.GetResult(sender); err == nil && a.Response.Response.StatusCode != http.StatusNoContent { - a, err = client.CreateOrUpdateResponder(a.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.AccountsCreateOrUpdateFuture", "Result", a.Response.Response, "Failure responding to request") - } - } - return -} - -// AccountsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type AccountsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(AccountsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *AccountsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for AccountsDeleteFuture.Result. -func (future *AccountsDeleteFuture) result(client AccountsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.AccountsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("netapp.AccountsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// AccountsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type AccountsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(AccountsClient) (Account, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *AccountsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for AccountsUpdateFuture.Result. -func (future *AccountsUpdateFuture) result(client AccountsClient) (a Account, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.AccountsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - a.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("netapp.AccountsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if a.Response.Response, err = future.GetResult(sender); err == nil && a.Response.Response.StatusCode != http.StatusNoContent { - a, err = client.UpdateResponder(a.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.AccountsUpdateFuture", "Result", a.Response.Response, "Failure responding to request") - } - } - return -} - -// ActiveDirectory active Directory -type ActiveDirectory struct { - // ActiveDirectoryID - Id of the Active Directory - ActiveDirectoryID *string `json:"activeDirectoryId,omitempty"` - // Username - Username of Active Directory domain administrator - Username *string `json:"username,omitempty"` - // Password - Plain text password of Active Directory domain administrator, value is masked in the response - Password *string `json:"password,omitempty"` - // Domain - Name of the Active Directory domain - Domain *string `json:"domain,omitempty"` - // DNS - Comma separated list of DNS server IP addresses (IPv4 only) for the Active Directory domain - DNS *string `json:"dns,omitempty"` - // Status - READ-ONLY; Status of the Active Directory. Possible values include: 'ActiveDirectoryStatusCreated', 'ActiveDirectoryStatusInUse', 'ActiveDirectoryStatusDeleted', 'ActiveDirectoryStatusError', 'ActiveDirectoryStatusUpdating' - Status ActiveDirectoryStatus `json:"status,omitempty"` - // StatusDetails - READ-ONLY; Any details in regards to the Status of the Active Directory - StatusDetails *string `json:"statusDetails,omitempty"` - // SmbServerName - NetBIOS name of the SMB server. This name will be registered as a computer account in the AD and used to mount volumes - SmbServerName *string `json:"smbServerName,omitempty"` - // OrganizationalUnit - The Organizational Unit (OU) within the Windows Active Directory - OrganizationalUnit *string `json:"organizationalUnit,omitempty"` - // Site - The Active Directory site the service will limit Domain Controller discovery to - Site *string `json:"site,omitempty"` - // BackupOperators - Users to be added to the Built-in Backup Operator active directory group. A list of unique usernames without domain specifier - BackupOperators *[]string `json:"backupOperators,omitempty"` - // Administrators - Users to be added to the Built-in Administrators active directory group. A list of unique usernames without domain specifier - Administrators *[]string `json:"administrators,omitempty"` - // KdcIP - kdc server IP addresses for the active directory machine. This optional parameter is used only while creating kerberos volume. - KdcIP *string `json:"kdcIP,omitempty"` - // AdName - Name of the active directory machine. This optional parameter is used only while creating kerberos volume - AdName *string `json:"adName,omitempty"` - // ServerRootCACertificate - When LDAP over SSL/TLS is enabled, the LDAP client is required to have base64 encoded Active Directory Certificate Service's self-signed root CA certificate, this optional parameter is used only for dual protocol with LDAP user-mapping volumes. - ServerRootCACertificate *string `json:"serverRootCACertificate,omitempty"` - // AesEncryption - If enabled, AES encryption will be enabled for SMB communication. - AesEncryption *bool `json:"aesEncryption,omitempty"` - // LdapSigning - Specifies whether or not the LDAP traffic needs to be signed. - LdapSigning *bool `json:"ldapSigning,omitempty"` - // SecurityOperators - Domain Users in the Active directory to be given SeSecurityPrivilege privilege (Needed for SMB Continuously available shares for SQL). A list of unique usernames without domain specifier - SecurityOperators *[]string `json:"securityOperators,omitempty"` - // LdapOverTLS - Specifies whether or not the LDAP traffic needs to be secured via TLS. - LdapOverTLS *bool `json:"ldapOverTLS,omitempty"` - // AllowLocalNfsUsersWithLdap - If enabled, NFS client local users can also (in addition to LDAP users) access the NFS volumes. - AllowLocalNfsUsersWithLdap *bool `json:"allowLocalNfsUsersWithLdap,omitempty"` -} - -// MarshalJSON is the custom marshaler for ActiveDirectory. -func (ad ActiveDirectory) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ad.ActiveDirectoryID != nil { - objectMap["activeDirectoryId"] = ad.ActiveDirectoryID - } - if ad.Username != nil { - objectMap["username"] = ad.Username - } - if ad.Password != nil { - objectMap["password"] = ad.Password - } - if ad.Domain != nil { - objectMap["domain"] = ad.Domain - } - if ad.DNS != nil { - objectMap["dns"] = ad.DNS - } - if ad.SmbServerName != nil { - objectMap["smbServerName"] = ad.SmbServerName - } - if ad.OrganizationalUnit != nil { - objectMap["organizationalUnit"] = ad.OrganizationalUnit - } - if ad.Site != nil { - objectMap["site"] = ad.Site - } - if ad.BackupOperators != nil { - objectMap["backupOperators"] = ad.BackupOperators - } - if ad.Administrators != nil { - objectMap["administrators"] = ad.Administrators - } - if ad.KdcIP != nil { - objectMap["kdcIP"] = ad.KdcIP - } - if ad.AdName != nil { - objectMap["adName"] = ad.AdName - } - if ad.ServerRootCACertificate != nil { - objectMap["serverRootCACertificate"] = ad.ServerRootCACertificate - } - if ad.AesEncryption != nil { - objectMap["aesEncryption"] = ad.AesEncryption - } - if ad.LdapSigning != nil { - objectMap["ldapSigning"] = ad.LdapSigning - } - if ad.SecurityOperators != nil { - objectMap["securityOperators"] = ad.SecurityOperators - } - if ad.LdapOverTLS != nil { - objectMap["ldapOverTLS"] = ad.LdapOverTLS - } - if ad.AllowLocalNfsUsersWithLdap != nil { - objectMap["allowLocalNfsUsersWithLdap"] = ad.AllowLocalNfsUsersWithLdap - } - return json.Marshal(objectMap) -} - -// AuthorizeRequest authorize request -type AuthorizeRequest struct { - // RemoteVolumeResourceID - Resource id of the remote volume - RemoteVolumeResourceID *string `json:"remoteVolumeResourceId,omitempty"` -} - -// AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag. -type AzureEntityResource struct { - // Etag - READ-ONLY; Resource Etag. - Etag *string `json:"etag,omitempty"` - // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureEntityResource. -func (aer AzureEntityResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// Backup backup of a Volume -type Backup struct { - autorest.Response `json:"-"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // BackupProperties - Backup Properties - *BackupProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for Backup. -func (b Backup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if b.Location != nil { - objectMap["location"] = b.Location - } - if b.BackupProperties != nil { - objectMap["properties"] = b.BackupProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Backup struct. -func (b *Backup) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - b.Location = &location - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - b.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - b.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - b.Type = &typeVar - } - case "properties": - if v != nil { - var backupProperties BackupProperties - err = json.Unmarshal(*v, &backupProperties) - if err != nil { - return err - } - b.BackupProperties = &backupProperties - } - } - } - - return nil -} - -// BackupPatch backup patch -type BackupPatch struct { - // Tags - Resource tags - Tags map[string]*string `json:"tags"` - // BackupProperties - Backup Properties - *BackupProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for BackupPatch. -func (bp BackupPatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if bp.Tags != nil { - objectMap["tags"] = bp.Tags - } - if bp.BackupProperties != nil { - objectMap["properties"] = bp.BackupProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for BackupPatch struct. -func (bp *BackupPatch) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - bp.Tags = tags - } - case "properties": - if v != nil { - var backupProperties BackupProperties - err = json.Unmarshal(*v, &backupProperties) - if err != nil { - return err - } - bp.BackupProperties = &backupProperties - } - } - } - - return nil -} - -// BackupPoliciesCreateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type BackupPoliciesCreateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(BackupPoliciesClient) (BackupPolicy, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *BackupPoliciesCreateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for BackupPoliciesCreateFuture.Result. -func (future *BackupPoliciesCreateFuture) result(client BackupPoliciesClient) (bp BackupPolicy, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesCreateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - bp.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("netapp.BackupPoliciesCreateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if bp.Response.Response, err = future.GetResult(sender); err == nil && bp.Response.Response.StatusCode != http.StatusNoContent { - bp, err = client.CreateResponder(bp.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesCreateFuture", "Result", bp.Response.Response, "Failure responding to request") - } - } - return -} - -// BackupPoliciesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type BackupPoliciesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(BackupPoliciesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *BackupPoliciesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for BackupPoliciesDeleteFuture.Result. -func (future *BackupPoliciesDeleteFuture) result(client BackupPoliciesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("netapp.BackupPoliciesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// BackupPoliciesList list of Backup Policies -type BackupPoliciesList struct { - autorest.Response `json:"-"` - // Value - A list of backup policies - Value *[]BackupPolicy `json:"value,omitempty"` -} - -// BackupPoliciesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type BackupPoliciesUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(BackupPoliciesClient) (BackupPolicy, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *BackupPoliciesUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for BackupPoliciesUpdateFuture.Result. -func (future *BackupPoliciesUpdateFuture) result(client BackupPoliciesClient) (bp BackupPolicy, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - bp.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("netapp.BackupPoliciesUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if bp.Response.Response, err = future.GetResult(sender); err == nil && bp.Response.Response.StatusCode != http.StatusNoContent { - bp, err = client.UpdateResponder(bp.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesUpdateFuture", "Result", bp.Response.Response, "Failure responding to request") - } - } - return -} - -// BackupPolicy backup policy information -type BackupPolicy struct { - autorest.Response `json:"-"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` - // BackupPolicyProperties - Backup policy Properties - *BackupPolicyProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for BackupPolicy. -func (bp BackupPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if bp.Location != nil { - objectMap["location"] = bp.Location - } - if bp.Tags != nil { - objectMap["tags"] = bp.Tags - } - if bp.BackupPolicyProperties != nil { - objectMap["properties"] = bp.BackupPolicyProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for BackupPolicy struct. -func (bp *BackupPolicy) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - bp.Location = &location - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - bp.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - bp.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - bp.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - bp.Type = &typeVar - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - bp.Tags = tags - } - case "properties": - if v != nil { - var backupPolicyProperties BackupPolicyProperties - err = json.Unmarshal(*v, &backupPolicyProperties) - if err != nil { - return err - } - bp.BackupPolicyProperties = &backupPolicyProperties - } - } - } - - return nil -} - -// BackupPolicyDetails backup policy properties -type BackupPolicyDetails struct { - // Location - Resource location - Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` - // BackupPolicyProperties - Backup policy Properties - *BackupPolicyProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for BackupPolicyDetails. -func (bpd BackupPolicyDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if bpd.Location != nil { - objectMap["location"] = bpd.Location - } - if bpd.Tags != nil { - objectMap["tags"] = bpd.Tags - } - if bpd.BackupPolicyProperties != nil { - objectMap["properties"] = bpd.BackupPolicyProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for BackupPolicyDetails struct. -func (bpd *BackupPolicyDetails) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - bpd.Location = &location - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - bpd.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - bpd.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - bpd.Type = &typeVar - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - bpd.Tags = tags - } - case "properties": - if v != nil { - var backupPolicyProperties BackupPolicyProperties - err = json.Unmarshal(*v, &backupPolicyProperties) - if err != nil { - return err - } - bpd.BackupPolicyProperties = &backupPolicyProperties - } - } - } - - return nil -} - -// BackupPolicyPatch backup policy Details for create and update -type BackupPolicyPatch struct { - // Location - Resource location - Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` - // BackupPolicyProperties - Backup policy Properties - *BackupPolicyProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for BackupPolicyPatch. -func (bpp BackupPolicyPatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if bpp.Location != nil { - objectMap["location"] = bpp.Location - } - if bpp.Tags != nil { - objectMap["tags"] = bpp.Tags - } - if bpp.BackupPolicyProperties != nil { - objectMap["properties"] = bpp.BackupPolicyProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for BackupPolicyPatch struct. -func (bpp *BackupPolicyPatch) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - bpp.Location = &location - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - bpp.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - bpp.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - bpp.Type = &typeVar - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - bpp.Tags = tags - } - case "properties": - if v != nil { - var backupPolicyProperties BackupPolicyProperties - err = json.Unmarshal(*v, &backupPolicyProperties) - if err != nil { - return err - } - bpp.BackupPolicyProperties = &backupPolicyProperties - } - } - } - - return nil -} - -// BackupPolicyProperties backup policy properties -type BackupPolicyProperties struct { - // Name - READ-ONLY; Name of backup policy - Name *string `json:"name,omitempty"` - // BackupPolicyID - READ-ONLY; Backup Policy Resource ID - BackupPolicyID *string `json:"backupPolicyId,omitempty"` - // ProvisioningState - READ-ONLY; Azure lifecycle management - ProvisioningState *string `json:"provisioningState,omitempty"` - // DailyBackupsToKeep - Daily backups count to keep - DailyBackupsToKeep *int32 `json:"dailyBackupsToKeep,omitempty"` - // WeeklyBackupsToKeep - Weekly backups count to keep - WeeklyBackupsToKeep *int32 `json:"weeklyBackupsToKeep,omitempty"` - // MonthlyBackupsToKeep - Monthly backups count to keep - MonthlyBackupsToKeep *int32 `json:"monthlyBackupsToKeep,omitempty"` - // VolumesAssigned - READ-ONLY; Volumes using current backup policy - VolumesAssigned *int32 `json:"volumesAssigned,omitempty"` - // Enabled - The property to decide policy is enabled or not - Enabled *bool `json:"enabled,omitempty"` - // VolumeBackups - READ-ONLY; A list of volumes assigned to this policy - VolumeBackups *[]VolumeBackups `json:"volumeBackups,omitempty"` -} - -// MarshalJSON is the custom marshaler for BackupPolicyProperties. -func (bpp BackupPolicyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if bpp.DailyBackupsToKeep != nil { - objectMap["dailyBackupsToKeep"] = bpp.DailyBackupsToKeep - } - if bpp.WeeklyBackupsToKeep != nil { - objectMap["weeklyBackupsToKeep"] = bpp.WeeklyBackupsToKeep - } - if bpp.MonthlyBackupsToKeep != nil { - objectMap["monthlyBackupsToKeep"] = bpp.MonthlyBackupsToKeep - } - if bpp.Enabled != nil { - objectMap["enabled"] = bpp.Enabled - } - return json.Marshal(objectMap) -} - -// BackupProperties backup properties -type BackupProperties struct { - // BackupID - READ-ONLY; UUID v4 used to identify the Backup - BackupID *string `json:"backupId,omitempty"` - // CreationDate - READ-ONLY; The creation date of the backup - CreationDate *date.Time `json:"creationDate,omitempty"` - // ProvisioningState - READ-ONLY; Azure lifecycle management - ProvisioningState *string `json:"provisioningState,omitempty"` - // Size - READ-ONLY; Size of backup - Size *int64 `json:"size,omitempty"` - // Label - Label for backup - Label *string `json:"label,omitempty"` - // BackupType - READ-ONLY; Type of backup Manual or Scheduled. Possible values include: 'BackupTypeManual', 'BackupTypeScheduled' - BackupType BackupType `json:"backupType,omitempty"` - // FailureReason - READ-ONLY; Failure reason - FailureReason *string `json:"failureReason,omitempty"` - // VolumeName - READ-ONLY; Volume name - VolumeName *string `json:"volumeName,omitempty"` - // UseExistingSnapshot - Manual backup an already existing snapshot. This will always be false for scheduled backups and true/false for manual backups - UseExistingSnapshot *bool `json:"useExistingSnapshot,omitempty"` -} - -// MarshalJSON is the custom marshaler for BackupProperties. -func (bp BackupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if bp.Label != nil { - objectMap["label"] = bp.Label - } - if bp.UseExistingSnapshot != nil { - objectMap["useExistingSnapshot"] = bp.UseExistingSnapshot - } - return json.Marshal(objectMap) -} - -// BackupsCreateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type BackupsCreateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(BackupsClient) (Backup, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *BackupsCreateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for BackupsCreateFuture.Result. -func (future *BackupsCreateFuture) result(client BackupsClient) (b Backup, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.BackupsCreateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - b.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("netapp.BackupsCreateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if b.Response.Response, err = future.GetResult(sender); err == nil && b.Response.Response.StatusCode != http.StatusNoContent { - b, err = client.CreateResponder(b.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.BackupsCreateFuture", "Result", b.Response.Response, "Failure responding to request") - } - } - return -} - -// BackupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type BackupsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(BackupsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *BackupsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for BackupsDeleteFuture.Result. -func (future *BackupsDeleteFuture) result(client BackupsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.BackupsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("netapp.BackupsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// BackupsList list of Backups -type BackupsList struct { - autorest.Response `json:"-"` - // Value - A list of Backups - Value *[]Backup `json:"value,omitempty"` -} - -// BackupStatus backup status -type BackupStatus struct { - autorest.Response `json:"-"` - // Healthy - READ-ONLY; Backup health status - Healthy *bool `json:"healthy,omitempty"` - // RelationshipStatus - READ-ONLY; Status of the backup mirror relationship. Possible values include: 'RelationshipStatusIdle', 'RelationshipStatusTransferring' - RelationshipStatus RelationshipStatus `json:"relationshipStatus,omitempty"` - // MirrorState - READ-ONLY; The status of the backup. Possible values include: 'MirrorStateUninitialized', 'MirrorStateMirrored', 'MirrorStateBroken' - MirrorState MirrorState `json:"mirrorState,omitempty"` - // UnhealthyReason - READ-ONLY; Reason for the unhealthy backup relationship - UnhealthyReason *string `json:"unhealthyReason,omitempty"` - // ErrorMessage - READ-ONLY; Displays error message if the backup is in an error state - ErrorMessage *string `json:"errorMessage,omitempty"` - // LastTransferSize - READ-ONLY; Displays the last transfer size - LastTransferSize *int64 `json:"lastTransferSize,omitempty"` - // LastTransferType - READ-ONLY; Displays the last transfer type - LastTransferType *string `json:"lastTransferType,omitempty"` - // TotalTransferBytes - READ-ONLY; Displays the total bytes transferred - TotalTransferBytes *int64 `json:"totalTransferBytes,omitempty"` -} - -// MarshalJSON is the custom marshaler for BackupStatus. -func (bs BackupStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// BackupsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type BackupsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(BackupsClient) (Backup, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *BackupsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for BackupsUpdateFuture.Result. -func (future *BackupsUpdateFuture) result(client BackupsClient) (b Backup, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.BackupsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - b.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("netapp.BackupsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if b.Response.Response, err = future.GetResult(sender); err == nil && b.Response.Response.StatusCode != http.StatusNoContent { - b, err = client.UpdateResponder(b.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.BackupsUpdateFuture", "Result", b.Response.Response, "Failure responding to request") - } - } - return -} - -// BreakReplicationRequest break replication request -type BreakReplicationRequest struct { - // ForceBreakReplication - If replication is in status transferring and you want to force break the replication, set to true - ForceBreakReplication *bool `json:"forceBreakReplication,omitempty"` -} - -// CapacityPool capacity pool resource -type CapacityPool struct { - autorest.Response `json:"-"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` - // PoolProperties - Capacity pool properties - *PoolProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for CapacityPool. -func (cp CapacityPool) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cp.Location != nil { - objectMap["location"] = cp.Location - } - if cp.Tags != nil { - objectMap["tags"] = cp.Tags - } - if cp.PoolProperties != nil { - objectMap["properties"] = cp.PoolProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for CapacityPool struct. -func (cp *CapacityPool) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - cp.Location = &location - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - cp.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - cp.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - cp.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - cp.Type = &typeVar - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - cp.Tags = tags - } - case "properties": - if v != nil { - var poolProperties PoolProperties - err = json.Unmarshal(*v, &poolProperties) - if err != nil { - return err - } - cp.PoolProperties = &poolProperties - } - } - } - - return nil -} - -// CapacityPoolList list of capacity pool resources -type CapacityPoolList struct { - autorest.Response `json:"-"` - // Value - List of Capacity pools - Value *[]CapacityPool `json:"value,omitempty"` - // NextLink - URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// CapacityPoolListIterator provides access to a complete listing of CapacityPool values. -type CapacityPoolListIterator struct { - i int - page CapacityPoolListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *CapacityPoolListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CapacityPoolListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *CapacityPoolListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CapacityPoolListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter CapacityPoolListIterator) Response() CapacityPoolList { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter CapacityPoolListIterator) Value() CapacityPool { - if !iter.page.NotDone() { - return CapacityPool{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the CapacityPoolListIterator type. -func NewCapacityPoolListIterator(page CapacityPoolListPage) CapacityPoolListIterator { - return CapacityPoolListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (cpl CapacityPoolList) IsEmpty() bool { - return cpl.Value == nil || len(*cpl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (cpl CapacityPoolList) hasNextLink() bool { - return cpl.NextLink != nil && len(*cpl.NextLink) != 0 -} - -// capacityPoolListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cpl CapacityPoolList) capacityPoolListPreparer(ctx context.Context) (*http.Request, error) { - if !cpl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cpl.NextLink))) -} - -// CapacityPoolListPage contains a page of CapacityPool values. -type CapacityPoolListPage struct { - fn func(context.Context, CapacityPoolList) (CapacityPoolList, error) - cpl CapacityPoolList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *CapacityPoolListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CapacityPoolListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.cpl) - if err != nil { - return err - } - page.cpl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *CapacityPoolListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CapacityPoolListPage) NotDone() bool { - return !page.cpl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CapacityPoolListPage) Response() CapacityPoolList { - return page.cpl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CapacityPoolListPage) Values() []CapacityPool { - if page.cpl.IsEmpty() { - return nil - } - return *page.cpl.Value -} - -// Creates a new instance of the CapacityPoolListPage type. -func NewCapacityPoolListPage(cur CapacityPoolList, getNextPage func(context.Context, CapacityPoolList) (CapacityPoolList, error)) CapacityPoolListPage { - return CapacityPoolListPage{ - fn: getNextPage, - cpl: cur, - } -} - -// CapacityPoolPatch capacity pool patch resource -type CapacityPoolPatch struct { - // Location - Resource location - Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` - // PoolPatchProperties - Capacity pool properties - *PoolPatchProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for CapacityPoolPatch. -func (cpp CapacityPoolPatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cpp.Location != nil { - objectMap["location"] = cpp.Location - } - if cpp.Tags != nil { - objectMap["tags"] = cpp.Tags - } - if cpp.PoolPatchProperties != nil { - objectMap["properties"] = cpp.PoolPatchProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for CapacityPoolPatch struct. -func (cpp *CapacityPoolPatch) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - cpp.Location = &location - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - cpp.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - cpp.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - cpp.Type = &typeVar - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - cpp.Tags = tags - } - case "properties": - if v != nil { - var poolPatchProperties PoolPatchProperties - err = json.Unmarshal(*v, &poolPatchProperties) - if err != nil { - return err - } - cpp.PoolPatchProperties = &poolPatchProperties - } - } - } - - return nil -} - -// CheckAvailabilityResponse information regarding availability of a resource. -type CheckAvailabilityResponse struct { - autorest.Response `json:"-"` - // IsAvailable - true indicates name is valid and available. false indicates the name is invalid, unavailable, or both. - IsAvailable *bool `json:"isAvailable,omitempty"` - // Reason - Invalid indicates the name provided does not match Azure App Service naming requirements. AlreadyExists indicates that the name is already in use and is therefore unavailable. Possible values include: 'InAvailabilityReasonTypeInvalid', 'InAvailabilityReasonTypeAlreadyExists' - Reason InAvailabilityReasonType `json:"reason,omitempty"` - // Message - If reason == invalid, provide the user with the reason why the given name is invalid, and provide the resource naming requirements so that the user can select a valid name. If reason == AlreadyExists, explain that resource name is already in use, and direct them to select a different name. - Message *string `json:"message,omitempty"` -} - -// CloudError an error response from the service. -type CloudError struct { - // Error - Cloud error body. - Error *CloudErrorBody `json:"error,omitempty"` -} - -// CloudErrorBody an error response from the service. -type CloudErrorBody struct { - // Code - An identifier for the error. Codes are invariant and are intended to be consumed programmatically. - Code *string `json:"code,omitempty"` - // Message - A message describing the error, intended to be suitable for display in a user interface. - Message *string `json:"message,omitempty"` -} - -// DailySchedule daily Schedule properties -type DailySchedule struct { - // SnapshotsToKeep - Daily snapshot count to keep - SnapshotsToKeep *int32 `json:"snapshotsToKeep,omitempty"` - // Hour - Indicates which hour in UTC timezone a snapshot should be taken - Hour *int32 `json:"hour,omitempty"` - // Minute - Indicates which minute snapshot should be taken - Minute *int32 `json:"minute,omitempty"` - // UsedBytes - Resource size in bytes, current storage usage for the volume in bytes - UsedBytes *int64 `json:"usedBytes,omitempty"` -} - -// Dimension dimension of blobs, possibly be blob type or access tier. -type Dimension struct { - // Name - Display name of dimension. - Name *string `json:"name,omitempty"` - // DisplayName - Display name of dimension. - DisplayName *string `json:"displayName,omitempty"` -} - -// ExportPolicyRule volume Export Policy Rule -type ExportPolicyRule struct { - // RuleIndex - Order index - RuleIndex *int32 `json:"ruleIndex,omitempty"` - // UnixReadOnly - Read only access - UnixReadOnly *bool `json:"unixReadOnly,omitempty"` - // UnixReadWrite - Read and write access - UnixReadWrite *bool `json:"unixReadWrite,omitempty"` - // Kerberos5ReadOnly - Kerberos5 Read only access. To be use with swagger version 2020-05-01 or later - Kerberos5ReadOnly *bool `json:"kerberos5ReadOnly,omitempty"` - // Kerberos5ReadWrite - Kerberos5 Read and write access. To be use with swagger version 2020-05-01 or later - Kerberos5ReadWrite *bool `json:"kerberos5ReadWrite,omitempty"` - // Kerberos5iReadOnly - Kerberos5i Read only access. To be use with swagger version 2020-05-01 or later - Kerberos5iReadOnly *bool `json:"kerberos5iReadOnly,omitempty"` - // Kerberos5iReadWrite - Kerberos5i Read and write access. To be use with swagger version 2020-05-01 or later - Kerberos5iReadWrite *bool `json:"kerberos5iReadWrite,omitempty"` - // Kerberos5pReadOnly - Kerberos5p Read only access. To be use with swagger version 2020-05-01 or later - Kerberos5pReadOnly *bool `json:"kerberos5pReadOnly,omitempty"` - // Kerberos5pReadWrite - Kerberos5p Read and write access. To be use with swagger version 2020-05-01 or later - Kerberos5pReadWrite *bool `json:"kerberos5pReadWrite,omitempty"` - // Cifs - Allows CIFS protocol - Cifs *bool `json:"cifs,omitempty"` - // Nfsv3 - Allows NFSv3 protocol. Enable only for NFSv3 type volumes - Nfsv3 *bool `json:"nfsv3,omitempty"` - // Nfsv41 - Allows NFSv4.1 protocol. Enable only for NFSv4.1 type volumes - Nfsv41 *bool `json:"nfsv41,omitempty"` - // AllowedClients - Client ingress specification as comma separated string with IPv4 CIDRs, IPv4 host addresses and host names - AllowedClients *string `json:"allowedClients,omitempty"` - // HasRootAccess - Has root access to volume - HasRootAccess *bool `json:"hasRootAccess,omitempty"` - // ChownMode - This parameter specifies who is authorized to change the ownership of a file. restricted - Only root user can change the ownership of the file. unrestricted - Non-root users can change ownership of files that they own. Possible values include: 'ChownModeRestricted', 'ChownModeUnrestricted' - ChownMode ChownMode `json:"chownMode,omitempty"` -} - -// FilePathAvailabilityRequest file path availability request content - availability is based on the name -// and the subnetId. -type FilePathAvailabilityRequest struct { - // Name - File path to verify. - Name *string `json:"name,omitempty"` - // SubnetID - The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes - SubnetID *string `json:"subnetId,omitempty"` -} - -// HourlySchedule hourly Schedule properties -type HourlySchedule struct { - // SnapshotsToKeep - Hourly snapshot count to keep - SnapshotsToKeep *int32 `json:"snapshotsToKeep,omitempty"` - // Minute - Indicates which minute snapshot should be taken - Minute *int32 `json:"minute,omitempty"` - // UsedBytes - Resource size in bytes, current storage usage for the volume in bytes - UsedBytes *int64 `json:"usedBytes,omitempty"` -} - -// LogSpecification log Definition of a single resource metric. -type LogSpecification struct { - Name *string `json:"name,omitempty"` - DisplayName *string `json:"displayName,omitempty"` -} - -// MetricSpecification metric specification of operation. -type MetricSpecification struct { - // Name - Name of metric specification. - Name *string `json:"name,omitempty"` - // DisplayName - Display name of metric specification. - DisplayName *string `json:"displayName,omitempty"` - // DisplayDescription - Display description of metric specification. - DisplayDescription *string `json:"displayDescription,omitempty"` - // Unit - Unit could be Bytes or Count. - Unit *string `json:"unit,omitempty"` - // SupportedAggregationTypes - Support metric aggregation type. - SupportedAggregationTypes *[]MetricAggregationType `json:"supportedAggregationTypes,omitempty"` - // SupportedTimeGrainTypes - The supported time grain types for the metrics. - SupportedTimeGrainTypes *[]string `json:"supportedTimeGrainTypes,omitempty"` - // InternalMetricName - The internal metric name. - InternalMetricName *string `json:"internalMetricName,omitempty"` - // EnableRegionalMdmAccount - Whether or not the service is using regional MDM accounts. - EnableRegionalMdmAccount *bool `json:"enableRegionalMdmAccount,omitempty"` - // SourceMdmAccount - The source MDM account. - SourceMdmAccount *string `json:"sourceMdmAccount,omitempty"` - // SourceMdmNamespace - The source MDM namespace. - SourceMdmNamespace *string `json:"sourceMdmNamespace,omitempty"` - // Dimensions - Dimensions of blobs, including blob type and access tier. - Dimensions *[]Dimension `json:"dimensions,omitempty"` - // AggregationType - Aggregation type could be Average. - AggregationType *string `json:"aggregationType,omitempty"` - // FillGapWithZero - The property to decide fill gap with zero or not. - FillGapWithZero *bool `json:"fillGapWithZero,omitempty"` - // Category - The category this metric specification belong to, could be Capacity. - Category *string `json:"category,omitempty"` - // ResourceIDDimensionNameOverride - Account Resource Id. - ResourceIDDimensionNameOverride *string `json:"resourceIdDimensionNameOverride,omitempty"` - // IsInternal - Whether the metric is internal. - IsInternal *bool `json:"isInternal,omitempty"` -} - -// MonthlySchedule monthly Schedule properties -type MonthlySchedule struct { - // SnapshotsToKeep - Monthly snapshot count to keep - SnapshotsToKeep *int32 `json:"snapshotsToKeep,omitempty"` - // DaysOfMonth - Indicates which days of the month snapshot should be taken. A comma delimited string. - DaysOfMonth *string `json:"daysOfMonth,omitempty"` - // Hour - Indicates which hour in UTC timezone a snapshot should be taken - Hour *int32 `json:"hour,omitempty"` - // Minute - Indicates which minute snapshot should be taken - Minute *int32 `json:"minute,omitempty"` - // UsedBytes - Resource size in bytes, current storage usage for the volume in bytes - UsedBytes *int64 `json:"usedBytes,omitempty"` -} - -// MountTarget mount Target -type MountTarget struct { - // Location - Resource location - Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` - // MountTargetProperties - Mount Target Properties - *MountTargetProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for MountTarget. -func (mt MountTarget) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if mt.Location != nil { - objectMap["location"] = mt.Location - } - if mt.Tags != nil { - objectMap["tags"] = mt.Tags - } - if mt.MountTargetProperties != nil { - objectMap["properties"] = mt.MountTargetProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for MountTarget struct. -func (mt *MountTarget) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - mt.Location = &location - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - mt.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - mt.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - mt.Type = &typeVar - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - mt.Tags = tags - } - case "properties": - if v != nil { - var mountTargetProperties MountTargetProperties - err = json.Unmarshal(*v, &mountTargetProperties) - if err != nil { - return err - } - mt.MountTargetProperties = &mountTargetProperties - } - } - } - - return nil -} - -// MountTargetProperties mount target properties -type MountTargetProperties struct { - // MountTargetID - READ-ONLY; UUID v4 used to identify the MountTarget - MountTargetID *string `json:"mountTargetId,omitempty"` - // FileSystemID - UUID v4 used to identify the MountTarget - FileSystemID *string `json:"fileSystemId,omitempty"` - // IPAddress - READ-ONLY; The mount target's IPv4 address - IPAddress *string `json:"ipAddress,omitempty"` - // SmbServerFqdn - The SMB server's Fully Qualified Domain Name, FQDN - SmbServerFqdn *string `json:"smbServerFqdn,omitempty"` -} - -// MarshalJSON is the custom marshaler for MountTargetProperties. -func (mtp MountTargetProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if mtp.FileSystemID != nil { - objectMap["fileSystemId"] = mtp.FileSystemID - } - if mtp.SmbServerFqdn != nil { - objectMap["smbServerFqdn"] = mtp.SmbServerFqdn - } - return json.Marshal(objectMap) -} - -// Operation microsoft.NetApp REST API operation definition. -type Operation struct { - // Name - Operation name: {provider}/{resource}/{operation} - Name *string `json:"name,omitempty"` - // Display - Display metadata associated with the operation. - Display *OperationDisplay `json:"display,omitempty"` - // Origin - The origin of operations. - Origin *string `json:"origin,omitempty"` - // OperationProperties - Properties of operation, include metric specifications. - *OperationProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for Operation. -func (o Operation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if o.Name != nil { - objectMap["name"] = o.Name - } - if o.Display != nil { - objectMap["display"] = o.Display - } - if o.Origin != nil { - objectMap["origin"] = o.Origin - } - if o.OperationProperties != nil { - objectMap["properties"] = o.OperationProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Operation struct. -func (o *Operation) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - o.Name = &name - } - case "display": - if v != nil { - var display OperationDisplay - err = json.Unmarshal(*v, &display) - if err != nil { - return err - } - o.Display = &display - } - case "origin": - if v != nil { - var origin string - err = json.Unmarshal(*v, &origin) - if err != nil { - return err - } - o.Origin = &origin - } - case "properties": - if v != nil { - var operationProperties OperationProperties - err = json.Unmarshal(*v, &operationProperties) - if err != nil { - return err - } - o.OperationProperties = &operationProperties - } - } - } - - return nil -} - -// OperationDisplay display metadata associated with the operation. -type OperationDisplay struct { - // Provider - Service provider: Microsoft NetApp. - Provider *string `json:"provider,omitempty"` - // Resource - Resource on which the operation is performed etc. - Resource *string `json:"resource,omitempty"` - // Operation - Type of operation: get, read, delete, etc. - Operation *string `json:"operation,omitempty"` - // Description - Operation description. - Description *string `json:"description,omitempty"` -} - -// OperationListResult result of the request to list Cloud Volume operations. It contains a list of -// operations and a URL link to get the next set of results. -type OperationListResult struct { - autorest.Response `json:"-"` - // Value - List of Storage operations supported by the Storage resource provider. - Value *[]Operation `json:"value,omitempty"` -} - -// OperationProperties properties of operation, include metric specifications. -type OperationProperties struct { - // ServiceSpecification - One property of operation, include metric specifications. - ServiceSpecification *ServiceSpecification `json:"serviceSpecification,omitempty"` -} - -// PoolChangeRequest pool change request -type PoolChangeRequest struct { - // NewPoolResourceID - Resource id of the pool to move volume to - NewPoolResourceID *string `json:"newPoolResourceId,omitempty"` -} - -// PoolPatchProperties patchable pool properties -type PoolPatchProperties struct { - // Size - Provisioned size of the pool (in bytes). Allowed values are in 4TiB chunks (value must be multiply of 4398046511104). - Size *int64 `json:"size,omitempty"` - // QosType - The qos type of the pool. Possible values include: 'QosTypeAuto', 'QosTypeManual' - QosType QosType `json:"qosType,omitempty"` -} - -// PoolProperties pool properties -type PoolProperties struct { - // PoolID - READ-ONLY; UUID v4 used to identify the Pool - PoolID *string `json:"poolId,omitempty"` - // Size - Provisioned size of the pool (in bytes). Allowed values are in 4TiB chunks (value must be multiply of 4398046511104). - Size *int64 `json:"size,omitempty"` - // ServiceLevel - Possible values include: 'ServiceLevelStandard', 'ServiceLevelPremium', 'ServiceLevelUltra', 'ServiceLevelStandardZRS' - ServiceLevel ServiceLevel `json:"serviceLevel,omitempty"` - // ProvisioningState - READ-ONLY; Azure lifecycle management - ProvisioningState *string `json:"provisioningState,omitempty"` - // TotalThroughputMibps - READ-ONLY; Total throughput of pool in Mibps - TotalThroughputMibps *float64 `json:"totalThroughputMibps,omitempty"` - // UtilizedThroughputMibps - READ-ONLY; Utilized throughput of pool in Mibps - UtilizedThroughputMibps *float64 `json:"utilizedThroughputMibps,omitempty"` - // QosType - The qos type of the pool. Possible values include: 'QosTypeAuto', 'QosTypeManual' - QosType QosType `json:"qosType,omitempty"` - // CoolAccess - If enabled (true) the pool can contain cool Access enabled volumes. - CoolAccess *bool `json:"coolAccess,omitempty"` - // EncryptionType - Encryption type of the capacity pool, set encryption type for data at rest for this pool and all volumes in it. This value can only be set when creating new pool. Possible values include: 'EncryptionTypeSingle', 'EncryptionTypeDouble' - EncryptionType EncryptionType `json:"encryptionType,omitempty"` -} - -// MarshalJSON is the custom marshaler for PoolProperties. -func (pp PoolProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pp.Size != nil { - objectMap["size"] = pp.Size - } - if pp.ServiceLevel != "" { - objectMap["serviceLevel"] = pp.ServiceLevel - } - if pp.QosType != "" { - objectMap["qosType"] = pp.QosType - } - if pp.CoolAccess != nil { - objectMap["coolAccess"] = pp.CoolAccess - } - if pp.EncryptionType != "" { - objectMap["encryptionType"] = pp.EncryptionType - } - return json.Marshal(objectMap) -} - -// PoolsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type PoolsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PoolsClient) (CapacityPool, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PoolsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PoolsCreateOrUpdateFuture.Result. -func (future *PoolsCreateOrUpdateFuture) result(client PoolsClient) (cp CapacityPool, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.PoolsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - cp.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("netapp.PoolsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if cp.Response.Response, err = future.GetResult(sender); err == nil && cp.Response.Response.StatusCode != http.StatusNoContent { - cp, err = client.CreateOrUpdateResponder(cp.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.PoolsCreateOrUpdateFuture", "Result", cp.Response.Response, "Failure responding to request") - } - } - return -} - -// PoolsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. -type PoolsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PoolsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PoolsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PoolsDeleteFuture.Result. -func (future *PoolsDeleteFuture) result(client PoolsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.PoolsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("netapp.PoolsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// PoolsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. -type PoolsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PoolsClient) (CapacityPool, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PoolsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PoolsUpdateFuture.Result. -func (future *PoolsUpdateFuture) result(client PoolsClient) (cp CapacityPool, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.PoolsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - cp.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("netapp.PoolsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if cp.Response.Response, err = future.GetResult(sender); err == nil && cp.Response.Response.StatusCode != http.StatusNoContent { - cp, err = client.UpdateResponder(cp.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.PoolsUpdateFuture", "Result", cp.Response.Response, "Failure responding to request") - } - } - return -} - -// ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not -// have tags and a location -type ProxyResource struct { - // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for ProxyResource. -func (pr ProxyResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// QuotaAvailabilityRequest quota availability request content. -type QuotaAvailabilityRequest struct { - // Name - Name of the resource to verify. - Name *string `json:"name,omitempty"` - // Type - Resource type used for verification. Possible values include: 'CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccounts', 'CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPools', 'CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumes', 'CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumessnapshots' - Type CheckQuotaNameResourceTypes `json:"type,omitempty"` - // ResourceGroup - Resource group name. - ResourceGroup *string `json:"resourceGroup,omitempty"` -} - -// ReplicationObject replication properties -type ReplicationObject struct { - // ReplicationID - Id - ReplicationID *string `json:"replicationId,omitempty"` - // EndpointType - Indicates whether the local volume is the source or destination for the Volume Replication. Possible values include: 'EndpointTypeSrc', 'EndpointTypeDst' - EndpointType EndpointType `json:"endpointType,omitempty"` - // ReplicationSchedule - Schedule. Possible values include: 'ReplicationSchedule10minutely', 'ReplicationScheduleHourly', 'ReplicationScheduleDaily' - ReplicationSchedule ReplicationSchedule `json:"replicationSchedule,omitempty"` - // RemoteVolumeResourceID - The resource ID of the remote volume. - RemoteVolumeResourceID *string `json:"remoteVolumeResourceId,omitempty"` - // RemoteVolumeRegion - The remote region for the other end of the Volume Replication. - RemoteVolumeRegion *string `json:"remoteVolumeRegion,omitempty"` -} - -// ReplicationStatus replication status -type ReplicationStatus struct { - autorest.Response `json:"-"` - // Healthy - Replication health check - Healthy *bool `json:"healthy,omitempty"` - // RelationshipStatus - Status of the mirror relationship. Possible values include: 'RelationshipStatusIdle', 'RelationshipStatusTransferring' - RelationshipStatus RelationshipStatus `json:"relationshipStatus,omitempty"` - // MirrorState - The status of the replication. Possible values include: 'MirrorStateUninitialized', 'MirrorStateMirrored', 'MirrorStateBroken' - MirrorState MirrorState `json:"mirrorState,omitempty"` - // TotalProgress - The progress of the replication - TotalProgress *string `json:"totalProgress,omitempty"` - // ErrorMessage - Displays error message if the replication is in an error state - ErrorMessage *string `json:"errorMessage,omitempty"` -} - -// Resource common fields that are returned in the response for all Azure Resource Manager resources -type Resource struct { - // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for Resource. -func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ResourceIdentity identity for the resource. -type ResourceIdentity struct { - // PrincipalID - READ-ONLY; Object id of the identity resource - PrincipalID *string `json:"principalId,omitempty"` - // TenantID - READ-ONLY; The tenant id of the resource - TenantID *string `json:"tenantId,omitempty"` - // Type - Type of Identity. Supported values are: 'None', 'SystemAssigned' - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceIdentity. -func (ri ResourceIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ri.Type != nil { - objectMap["type"] = ri.Type - } - return json.Marshal(objectMap) -} - -// ResourceNameAvailabilityRequest resource name availability request content. -type ResourceNameAvailabilityRequest struct { - // Name - Resource name to verify. - Name *string `json:"name,omitempty"` - // Type - Resource type used for verification. Possible values include: 'CheckNameResourceTypesMicrosoftNetAppnetAppAccounts', 'CheckNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPools', 'CheckNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumes', 'CheckNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumessnapshots' - Type CheckNameResourceTypes `json:"type,omitempty"` - // ResourceGroup - Resource group name. - ResourceGroup *string `json:"resourceGroup,omitempty"` -} - -// RestoreStatus restore status -type RestoreStatus struct { - autorest.Response `json:"-"` - // Healthy - READ-ONLY; Restore health status - Healthy *bool `json:"healthy,omitempty"` - // RelationshipStatus - READ-ONLY; Status of the restore SnapMirror relationship. Possible values include: 'RelationshipStatusIdle', 'RelationshipStatusTransferring' - RelationshipStatus RelationshipStatus `json:"relationshipStatus,omitempty"` - // MirrorState - READ-ONLY; The status of the restore. Possible values include: 'MirrorStateUninitialized', 'MirrorStateMirrored', 'MirrorStateBroken' - MirrorState MirrorState `json:"mirrorState,omitempty"` - // UnhealthyReason - READ-ONLY; Reason for the unhealthy restore relationship - UnhealthyReason *string `json:"unhealthyReason,omitempty"` - // ErrorMessage - READ-ONLY; Displays error message if the restore is in an error state - ErrorMessage *string `json:"errorMessage,omitempty"` - // TotalTransferBytes - READ-ONLY; Displays the total bytes transferred - TotalTransferBytes *int64 `json:"totalTransferBytes,omitempty"` -} - -// MarshalJSON is the custom marshaler for RestoreStatus. -func (rs RestoreStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ServiceSpecification one property of operation, include metric specifications. -type ServiceSpecification struct { - // MetricSpecifications - Metric specifications of operation. - MetricSpecifications *[]MetricSpecification `json:"metricSpecifications,omitempty"` - LogSpecifications *[]LogSpecification `json:"logSpecifications,omitempty"` -} - -// Snapshot snapshot of a Volume -type Snapshot struct { - autorest.Response `json:"-"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // SnapshotProperties - Snapshot Properties - *SnapshotProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for Snapshot. -func (s Snapshot) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if s.Location != nil { - objectMap["location"] = s.Location - } - if s.SnapshotProperties != nil { - objectMap["properties"] = s.SnapshotProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Snapshot struct. -func (s *Snapshot) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - s.Location = &location - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - s.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - s.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - s.Type = &typeVar - } - case "properties": - if v != nil { - var snapshotProperties SnapshotProperties - err = json.Unmarshal(*v, &snapshotProperties) - if err != nil { - return err - } - s.SnapshotProperties = &snapshotProperties - } - } - } - - return nil -} - -// SnapshotPoliciesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type SnapshotPoliciesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(SnapshotPoliciesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SnapshotPoliciesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for SnapshotPoliciesDeleteFuture.Result. -func (future *SnapshotPoliciesDeleteFuture) result(client SnapshotPoliciesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("netapp.SnapshotPoliciesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// SnapshotPoliciesList list of Snapshot Policies -type SnapshotPoliciesList struct { - autorest.Response `json:"-"` - // Value - A list of snapshot policies - Value *[]SnapshotPolicy `json:"value,omitempty"` -} - -// SnapshotPoliciesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type SnapshotPoliciesUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(SnapshotPoliciesClient) (SnapshotPolicy, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SnapshotPoliciesUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for SnapshotPoliciesUpdateFuture.Result. -func (future *SnapshotPoliciesUpdateFuture) result(client SnapshotPoliciesClient) (sp SnapshotPolicy, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - sp.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("netapp.SnapshotPoliciesUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if sp.Response.Response, err = future.GetResult(sender); err == nil && sp.Response.Response.StatusCode != http.StatusNoContent { - sp, err = client.UpdateResponder(sp.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesUpdateFuture", "Result", sp.Response.Response, "Failure responding to request") - } - } - return -} - -// SnapshotPolicy snapshot policy information -type SnapshotPolicy struct { - autorest.Response `json:"-"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` - // SnapshotPolicyProperties - Snapshot policy Properties - *SnapshotPolicyProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for SnapshotPolicy. -func (sp SnapshotPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sp.Location != nil { - objectMap["location"] = sp.Location - } - if sp.Tags != nil { - objectMap["tags"] = sp.Tags - } - if sp.SnapshotPolicyProperties != nil { - objectMap["properties"] = sp.SnapshotPolicyProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for SnapshotPolicy struct. -func (sp *SnapshotPolicy) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - sp.Location = &location - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - sp.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - sp.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - sp.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - sp.Type = &typeVar - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - sp.Tags = tags - } - case "properties": - if v != nil { - var snapshotPolicyProperties SnapshotPolicyProperties - err = json.Unmarshal(*v, &snapshotPolicyProperties) - if err != nil { - return err - } - sp.SnapshotPolicyProperties = &snapshotPolicyProperties - } - } - } - - return nil -} - -// SnapshotPolicyDetails snapshot policy properties -type SnapshotPolicyDetails struct { - // Location - Resource location - Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` - // SnapshotPolicyProperties - Snapshot policy Properties - *SnapshotPolicyProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for SnapshotPolicyDetails. -func (spd SnapshotPolicyDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if spd.Location != nil { - objectMap["location"] = spd.Location - } - if spd.Tags != nil { - objectMap["tags"] = spd.Tags - } - if spd.SnapshotPolicyProperties != nil { - objectMap["properties"] = spd.SnapshotPolicyProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for SnapshotPolicyDetails struct. -func (spd *SnapshotPolicyDetails) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - spd.Location = &location - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - spd.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - spd.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - spd.Type = &typeVar - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - spd.Tags = tags - } - case "properties": - if v != nil { - var snapshotPolicyProperties SnapshotPolicyProperties - err = json.Unmarshal(*v, &snapshotPolicyProperties) - if err != nil { - return err - } - spd.SnapshotPolicyProperties = &snapshotPolicyProperties - } - } - } - - return nil -} - -// SnapshotPolicyPatch snapshot policy Details for create and update -type SnapshotPolicyPatch struct { - // Location - Resource location - Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` - // SnapshotPolicyProperties - Snapshot Policy properties - *SnapshotPolicyProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for SnapshotPolicyPatch. -func (spp SnapshotPolicyPatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if spp.Location != nil { - objectMap["location"] = spp.Location - } - if spp.Tags != nil { - objectMap["tags"] = spp.Tags - } - if spp.SnapshotPolicyProperties != nil { - objectMap["properties"] = spp.SnapshotPolicyProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for SnapshotPolicyPatch struct. -func (spp *SnapshotPolicyPatch) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - spp.Location = &location - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - spp.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - spp.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - spp.Type = &typeVar - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - spp.Tags = tags - } - case "properties": - if v != nil { - var snapshotPolicyProperties SnapshotPolicyProperties - err = json.Unmarshal(*v, &snapshotPolicyProperties) - if err != nil { - return err - } - spp.SnapshotPolicyProperties = &snapshotPolicyProperties - } - } - } - - return nil -} - -// SnapshotPolicyProperties snapshot policy properties -type SnapshotPolicyProperties struct { - // HourlySchedule - Schedule for hourly snapshots - HourlySchedule *HourlySchedule `json:"hourlySchedule,omitempty"` - // DailySchedule - Schedule for daily snapshots - DailySchedule *DailySchedule `json:"dailySchedule,omitempty"` - // WeeklySchedule - Schedule for weekly snapshots - WeeklySchedule *WeeklySchedule `json:"weeklySchedule,omitempty"` - // MonthlySchedule - Schedule for monthly snapshots - MonthlySchedule *MonthlySchedule `json:"monthlySchedule,omitempty"` - // Enabled - The property to decide policy is enabled or not - Enabled *bool `json:"enabled,omitempty"` - // ProvisioningState - READ-ONLY; Azure lifecycle management - ProvisioningState *string `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for SnapshotPolicyProperties. -func (spp SnapshotPolicyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if spp.HourlySchedule != nil { - objectMap["hourlySchedule"] = spp.HourlySchedule - } - if spp.DailySchedule != nil { - objectMap["dailySchedule"] = spp.DailySchedule - } - if spp.WeeklySchedule != nil { - objectMap["weeklySchedule"] = spp.WeeklySchedule - } - if spp.MonthlySchedule != nil { - objectMap["monthlySchedule"] = spp.MonthlySchedule - } - if spp.Enabled != nil { - objectMap["enabled"] = spp.Enabled - } - return json.Marshal(objectMap) -} - -// SnapshotPolicyVolumeList volumes associated with snapshot policy -type SnapshotPolicyVolumeList struct { - autorest.Response `json:"-"` - // Value - List of volumes - Value *[]interface{} `json:"value,omitempty"` -} - -// SnapshotProperties snapshot properties -type SnapshotProperties struct { - // SnapshotID - READ-ONLY; UUID v4 used to identify the Snapshot - SnapshotID *string `json:"snapshotId,omitempty"` - // Created - READ-ONLY; The creation date of the snapshot - Created *date.Time `json:"created,omitempty"` - // ProvisioningState - READ-ONLY; Azure lifecycle management - ProvisioningState *string `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for SnapshotProperties. -func (sp SnapshotProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// SnapshotsCreateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type SnapshotsCreateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(SnapshotsClient) (Snapshot, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SnapshotsCreateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for SnapshotsCreateFuture.Result. -func (future *SnapshotsCreateFuture) result(client SnapshotsClient) (s Snapshot, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.SnapshotsCreateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - s.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("netapp.SnapshotsCreateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { - s, err = client.CreateResponder(s.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.SnapshotsCreateFuture", "Result", s.Response.Response, "Failure responding to request") - } - } - return -} - -// SnapshotsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type SnapshotsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(SnapshotsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SnapshotsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for SnapshotsDeleteFuture.Result. -func (future *SnapshotsDeleteFuture) result(client SnapshotsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.SnapshotsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("netapp.SnapshotsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// SnapshotsList list of Snapshots -type SnapshotsList struct { - autorest.Response `json:"-"` - // Value - A list of Snapshots - Value *[]Snapshot `json:"value,omitempty"` -} - -// SnapshotsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type SnapshotsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(SnapshotsClient) (Snapshot, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SnapshotsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for SnapshotsUpdateFuture.Result. -func (future *SnapshotsUpdateFuture) result(client SnapshotsClient) (s Snapshot, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.SnapshotsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - s.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("netapp.SnapshotsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { - s, err = client.UpdateResponder(s.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.SnapshotsUpdateFuture", "Result", s.Response.Response, "Failure responding to request") - } - } - return -} - -// SubscriptionQuotaItem information regarding Subscription Quota Item. -type SubscriptionQuotaItem struct { - autorest.Response `json:"-"` - // SubscriptionQuotaItemProperties - SubscriptionQuotaItem properties - *SubscriptionQuotaItemProperties `json:"properties,omitempty"` - // SystemData - READ-ONLY; The system meta data relating to this resource. - SystemData *SystemData `json:"systemData,omitempty"` - // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for SubscriptionQuotaItem. -func (sqi SubscriptionQuotaItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sqi.SubscriptionQuotaItemProperties != nil { - objectMap["properties"] = sqi.SubscriptionQuotaItemProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for SubscriptionQuotaItem struct. -func (sqi *SubscriptionQuotaItem) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var subscriptionQuotaItemProperties SubscriptionQuotaItemProperties - err = json.Unmarshal(*v, &subscriptionQuotaItemProperties) - if err != nil { - return err - } - sqi.SubscriptionQuotaItemProperties = &subscriptionQuotaItemProperties - } - case "systemData": - if v != nil { - var systemData SystemData - err = json.Unmarshal(*v, &systemData) - if err != nil { - return err - } - sqi.SystemData = &systemData - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - sqi.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - sqi.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - sqi.Type = &typeVar - } - } - } - - return nil -} - -// SubscriptionQuotaItemList list of Subscription Quota Items -type SubscriptionQuotaItemList struct { - autorest.Response `json:"-"` - // Value - A list of SubscriptionQuotaItems - Value *[]SubscriptionQuotaItem `json:"value,omitempty"` -} - -// SubscriptionQuotaItemProperties subscriptionQuotaItem Properties -type SubscriptionQuotaItemProperties struct { - // Name - READ-ONLY; Quota Item name - Name *string `json:"name,omitempty"` - // Current - READ-ONLY; The current quota value. - Current *int32 `json:"current,omitempty"` - // Default - READ-ONLY; The default quota value. - Default *int32 `json:"default,omitempty"` -} - -// MarshalJSON is the custom marshaler for SubscriptionQuotaItemProperties. -func (sqip SubscriptionQuotaItemProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// SystemData metadata pertaining to creation and last modification of the resource. -type SystemData struct { - // CreatedBy - The identity that created the resource. - CreatedBy *string `json:"createdBy,omitempty"` - // CreatedByType - The type of identity that created the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey' - CreatedByType CreatedByType `json:"createdByType,omitempty"` - // CreatedAt - The timestamp of resource creation (UTC). - CreatedAt *date.Time `json:"createdAt,omitempty"` - // LastModifiedBy - The identity that last modified the resource. - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` - // LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey' - LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"` - // LastModifiedAt - The timestamp of resource last modification (UTC) - LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"` -} - -// TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource -// which has 'tags' and a 'location' -type TrackedResource struct { - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // Location - The geo-location where the resource lives - Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for TrackedResource. -func (tr TrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if tr.Tags != nil { - objectMap["tags"] = tr.Tags - } - if tr.Location != nil { - objectMap["location"] = tr.Location - } - return json.Marshal(objectMap) -} - -// Vault vault information -type Vault struct { - // Location - Resource location - Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // VaultProperties - Vault Properties - *VaultProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for Vault. -func (vVar Vault) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vVar.Location != nil { - objectMap["location"] = vVar.Location - } - if vVar.VaultProperties != nil { - objectMap["properties"] = vVar.VaultProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Vault struct. -func (vVar *Vault) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - vVar.Location = &location - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vVar.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vVar.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vVar.Type = &typeVar - } - case "properties": - if v != nil { - var vaultProperties VaultProperties - err = json.Unmarshal(*v, &vaultProperties) - if err != nil { - return err - } - vVar.VaultProperties = &vaultProperties - } - } - } - - return nil -} - -// VaultList list of Vaults -type VaultList struct { - autorest.Response `json:"-"` - // Value - A list of vaults - Value *[]Vault `json:"value,omitempty"` -} - -// VaultProperties vault properties -type VaultProperties struct { - // VaultName - Vault Name - VaultName *string `json:"vaultName,omitempty"` -} - -// Volume volume resource -type Volume struct { - autorest.Response `json:"-"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` - // VolumeProperties - Volume properties - *VolumeProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for Volume. -func (vVar Volume) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vVar.Location != nil { - objectMap["location"] = vVar.Location - } - if vVar.Tags != nil { - objectMap["tags"] = vVar.Tags - } - if vVar.VolumeProperties != nil { - objectMap["properties"] = vVar.VolumeProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Volume struct. -func (vVar *Volume) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - vVar.Location = &location - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vVar.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vVar.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vVar.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vVar.Type = &typeVar - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vVar.Tags = tags - } - case "properties": - if v != nil { - var volumeProperties VolumeProperties - err = json.Unmarshal(*v, &volumeProperties) - if err != nil { - return err - } - vVar.VolumeProperties = &volumeProperties - } - } - } - - return nil -} - -// VolumeBackupProperties volume Backup Properties -type VolumeBackupProperties struct { - // BackupPolicyID - Backup Policy Resource ID - BackupPolicyID *string `json:"backupPolicyId,omitempty"` - // PolicyEnforced - Policy Enforced - PolicyEnforced *bool `json:"policyEnforced,omitempty"` - // VaultID - Vault Resource ID - VaultID *string `json:"vaultId,omitempty"` - // BackupEnabled - Backup Enabled - BackupEnabled *bool `json:"backupEnabled,omitempty"` -} - -// VolumeBackups volume details using the backup policy -type VolumeBackups struct { - // VolumeName - Volume name - VolumeName *string `json:"volumeName,omitempty"` - // BackupsCount - Total count of backups for volume - BackupsCount *int32 `json:"backupsCount,omitempty"` - // PolicyEnabled - Policy enabled - PolicyEnabled *bool `json:"policyEnabled,omitempty"` -} - -// VolumeList list of volume resources -type VolumeList struct { - autorest.Response `json:"-"` - // Value - List of volumes - Value *[]Volume `json:"value,omitempty"` - // NextLink - URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// VolumeListIterator provides access to a complete listing of Volume values. -type VolumeListIterator struct { - i int - page VolumeListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VolumeListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VolumeListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VolumeListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VolumeListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VolumeListIterator) Response() VolumeList { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VolumeListIterator) Value() Volume { - if !iter.page.NotDone() { - return Volume{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VolumeListIterator type. -func NewVolumeListIterator(page VolumeListPage) VolumeListIterator { - return VolumeListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vl VolumeList) IsEmpty() bool { - return vl.Value == nil || len(*vl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vl VolumeList) hasNextLink() bool { - return vl.NextLink != nil && len(*vl.NextLink) != 0 -} - -// volumeListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vl VolumeList) volumeListPreparer(ctx context.Context) (*http.Request, error) { - if !vl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vl.NextLink))) -} - -// VolumeListPage contains a page of Volume values. -type VolumeListPage struct { - fn func(context.Context, VolumeList) (VolumeList, error) - vl VolumeList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VolumeListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VolumeListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vl) - if err != nil { - return err - } - page.vl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VolumeListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VolumeListPage) NotDone() bool { - return !page.vl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VolumeListPage) Response() VolumeList { - return page.vl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VolumeListPage) Values() []Volume { - if page.vl.IsEmpty() { - return nil - } - return *page.vl.Value -} - -// Creates a new instance of the VolumeListPage type. -func NewVolumeListPage(cur VolumeList, getNextPage func(context.Context, VolumeList) (VolumeList, error)) VolumeListPage { - return VolumeListPage{ - fn: getNextPage, - vl: cur, - } -} - -// VolumePatch volume patch resource -type VolumePatch struct { - // Location - Resource location - Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` - // VolumePatchProperties - Patchable volume properties - *VolumePatchProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for VolumePatch. -func (vp VolumePatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vp.Location != nil { - objectMap["location"] = vp.Location - } - if vp.Tags != nil { - objectMap["tags"] = vp.Tags - } - if vp.VolumePatchProperties != nil { - objectMap["properties"] = vp.VolumePatchProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VolumePatch struct. -func (vp *VolumePatch) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - vp.Location = &location - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vp.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vp.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vp.Type = &typeVar - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vp.Tags = tags - } - case "properties": - if v != nil { - var volumePatchProperties VolumePatchProperties - err = json.Unmarshal(*v, &volumePatchProperties) - if err != nil { - return err - } - vp.VolumePatchProperties = &volumePatchProperties - } - } - } - - return nil -} - -// VolumePatchProperties patchable volume properties -type VolumePatchProperties struct { - // ServiceLevel - Possible values include: 'ServiceLevelStandard', 'ServiceLevelPremium', 'ServiceLevelUltra', 'ServiceLevelStandardZRS' - ServiceLevel ServiceLevel `json:"serviceLevel,omitempty"` - // UsageThreshold - Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. Minimum size is 100 GiB. Upper limit is 100TiB. Specified in bytes. - UsageThreshold *int64 `json:"usageThreshold,omitempty"` - // ExportPolicy - Set of export policy rules - ExportPolicy *VolumePatchPropertiesExportPolicy `json:"exportPolicy,omitempty"` - ThroughputMibps *float64 `json:"throughputMibps,omitempty"` - // DataProtection - DataProtection type volumes include an object containing details of the replication - DataProtection *VolumePatchPropertiesDataProtection `json:"dataProtection,omitempty"` - // IsDefaultQuotaEnabled - Specifies if default quota is enabled for the volume. - IsDefaultQuotaEnabled *bool `json:"isDefaultQuotaEnabled,omitempty"` - // DefaultUserQuotaInKiBs - Default user quota for volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies . - DefaultUserQuotaInKiBs *int64 `json:"defaultUserQuotaInKiBs,omitempty"` - // DefaultGroupQuotaInKiBs - Default group quota for volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies. - DefaultGroupQuotaInKiBs *int64 `json:"defaultGroupQuotaInKiBs,omitempty"` -} - -// VolumePatchPropertiesDataProtection dataProtection type volumes include an object containing details of -// the replication -type VolumePatchPropertiesDataProtection struct { - // Backup - Backup Properties - Backup *VolumeBackupProperties `json:"backup,omitempty"` - // Snapshot - Snapshot properties. - Snapshot *VolumeSnapshotProperties `json:"snapshot,omitempty"` -} - -// VolumePatchPropertiesExportPolicy set of export policy rules -type VolumePatchPropertiesExportPolicy struct { - // Rules - Export policy rule - Rules *[]ExportPolicyRule `json:"rules,omitempty"` -} - -// VolumeProperties volume properties -type VolumeProperties struct { - // FileSystemID - READ-ONLY; Unique FileSystem Identifier. - FileSystemID *string `json:"fileSystemId,omitempty"` - // CreationToken - A unique file path for the volume. Used when creating mount targets - CreationToken *string `json:"creationToken,omitempty"` - // ServiceLevel - Possible values include: 'ServiceLevelStandard', 'ServiceLevelPremium', 'ServiceLevelUltra', 'ServiceLevelStandardZRS' - ServiceLevel ServiceLevel `json:"serviceLevel,omitempty"` - // UsageThreshold - Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. Minimum size is 100 GiB. Upper limit is 100TiB. Specified in bytes. - UsageThreshold *int64 `json:"usageThreshold,omitempty"` - // ExportPolicy - Set of export policy rules - ExportPolicy *VolumePropertiesExportPolicy `json:"exportPolicy,omitempty"` - // ProtocolTypes - Set of protocol types, default NFSv3, CIFS for SMB protocol - ProtocolTypes *[]string `json:"protocolTypes,omitempty"` - // ProvisioningState - READ-ONLY; Azure lifecycle management - ProvisioningState *string `json:"provisioningState,omitempty"` - // SnapshotID - UUID v4 or resource identifier used to identify the Snapshot. - SnapshotID *string `json:"snapshotId,omitempty"` - // BackupID - UUID v4 or resource identifier used to identify the Backup. - BackupID *string `json:"backupId,omitempty"` - // BaremetalTenantID - READ-ONLY; Unique Baremetal Tenant Identifier. - BaremetalTenantID *string `json:"baremetalTenantId,omitempty"` - // SubnetID - The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes - SubnetID *string `json:"subnetId,omitempty"` - // NetworkFeatures - Basic network, or Standard features available to the volume. Possible values include: 'NetworkFeaturesBasic', 'NetworkFeaturesStandard' - NetworkFeatures NetworkFeatures `json:"networkFeatures,omitempty"` - // NetworkSiblingSetID - READ-ONLY; Network Sibling Set ID for the the group of volumes sharing networking resources. - NetworkSiblingSetID *string `json:"networkSiblingSetId,omitempty"` - // StorageToNetworkProximity - READ-ONLY; Provides storage to network proximity information for the volume. Possible values include: 'VolumeStorageToNetworkProximityDefault', 'VolumeStorageToNetworkProximityT1', 'VolumeStorageToNetworkProximityT2' - StorageToNetworkProximity VolumeStorageToNetworkProximity `json:"storageToNetworkProximity,omitempty"` - // MountTargets - READ-ONLY; List of mount targets - MountTargets *[]MountTargetProperties `json:"mountTargets,omitempty"` - // VolumeType - What type of volume is this. For destination volumes in Cross Region Replication, set type to DataProtection - VolumeType *string `json:"volumeType,omitempty"` - // DataProtection - DataProtection type volumes include an object containing details of the replication - DataProtection *VolumePropertiesDataProtection `json:"dataProtection,omitempty"` - // IsRestoring - Restoring - IsRestoring *bool `json:"isRestoring,omitempty"` - // SnapshotDirectoryVisible - If enabled (true) the volume will contain a read-only snapshot directory which provides access to each of the volume's snapshots (default to true). - SnapshotDirectoryVisible *bool `json:"snapshotDirectoryVisible,omitempty"` - // KerberosEnabled - Describe if a volume is KerberosEnabled. To be use with swagger version 2020-05-01 or later - KerberosEnabled *bool `json:"kerberosEnabled,omitempty"` - // SecurityStyle - The security style of volume, default unix, defaults to ntfs for dual protocol or CIFS protocol. Possible values include: 'SecurityStyleNtfs', 'SecurityStyleUnix' - SecurityStyle SecurityStyle `json:"securityStyle,omitempty"` - // SmbEncryption - Enables encryption for in-flight smb3 data. Only applicable for SMB/DualProtocol volume. To be used with swagger version 2020-08-01 or later - SmbEncryption *bool `json:"smbEncryption,omitempty"` - // SmbContinuouslyAvailable - Enables continuously available share property for smb volume. Only applicable for SMB volume - SmbContinuouslyAvailable *bool `json:"smbContinuouslyAvailable,omitempty"` - ThroughputMibps *float64 `json:"throughputMibps,omitempty"` - // EncryptionKeySource - Encryption Key Source. Possible values are: 'Microsoft.NetApp' - EncryptionKeySource *string `json:"encryptionKeySource,omitempty"` - // LdapEnabled - Specifies whether LDAP is enabled or not for a given NFS volume. - LdapEnabled *bool `json:"ldapEnabled,omitempty"` - // CoolAccess - Specifies whether Cool Access(tiering) is enabled for the volume. - CoolAccess *bool `json:"coolAccess,omitempty"` - // CoolnessPeriod - Specifies the number of days after which data that is not accessed by clients will be tiered. - CoolnessPeriod *int32 `json:"coolnessPeriod,omitempty"` - // UnixPermissions - UNIX permissions for NFS volume accepted in octal 4 digit format. First digit selects the set user ID(4), set group ID (2) and sticky (1) attributes. Second digit selects permission for the owner of the file: read (4), write (2) and execute (1). Third selects permissions for other users in the same group. the fourth for other users not in the group. 0755 - gives read/write/execute permissions to owner and read/execute to group and other users. - UnixPermissions *string `json:"unixPermissions,omitempty"` - // CloneProgress - READ-ONLY; When a volume is being restored from another volume's snapshot, will show the percentage completion of this cloning process. When this value is empty/null there is no cloning process currently happening on this volume. This value will update every 5 minutes during cloning. - CloneProgress *int32 `json:"cloneProgress,omitempty"` - // AvsDataStore - Specifies whether the volume is enabled for Azure VMware Solution (AVS) datastore purpose. Possible values include: 'AvsDataStoreEnabled', 'AvsDataStoreDisabled' - AvsDataStore AvsDataStore `json:"avsDataStore,omitempty"` - // IsDefaultQuotaEnabled - Specifies if default quota is enabled for the volume. - IsDefaultQuotaEnabled *bool `json:"isDefaultQuotaEnabled,omitempty"` - // DefaultUserQuotaInKiBs - Default user quota for volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies . - DefaultUserQuotaInKiBs *int64 `json:"defaultUserQuotaInKiBs,omitempty"` - // DefaultGroupQuotaInKiBs - Default group quota for volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies. - DefaultGroupQuotaInKiBs *int64 `json:"defaultGroupQuotaInKiBs,omitempty"` -} - -// MarshalJSON is the custom marshaler for VolumeProperties. -func (vp VolumeProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vp.CreationToken != nil { - objectMap["creationToken"] = vp.CreationToken - } - if vp.ServiceLevel != "" { - objectMap["serviceLevel"] = vp.ServiceLevel - } - if vp.UsageThreshold != nil { - objectMap["usageThreshold"] = vp.UsageThreshold - } - if vp.ExportPolicy != nil { - objectMap["exportPolicy"] = vp.ExportPolicy - } - if vp.ProtocolTypes != nil { - objectMap["protocolTypes"] = vp.ProtocolTypes - } - if vp.SnapshotID != nil { - objectMap["snapshotId"] = vp.SnapshotID - } - if vp.BackupID != nil { - objectMap["backupId"] = vp.BackupID - } - if vp.SubnetID != nil { - objectMap["subnetId"] = vp.SubnetID - } - if vp.NetworkFeatures != "" { - objectMap["networkFeatures"] = vp.NetworkFeatures - } - if vp.VolumeType != nil { - objectMap["volumeType"] = vp.VolumeType - } - if vp.DataProtection != nil { - objectMap["dataProtection"] = vp.DataProtection - } - if vp.IsRestoring != nil { - objectMap["isRestoring"] = vp.IsRestoring - } - if vp.SnapshotDirectoryVisible != nil { - objectMap["snapshotDirectoryVisible"] = vp.SnapshotDirectoryVisible - } - if vp.KerberosEnabled != nil { - objectMap["kerberosEnabled"] = vp.KerberosEnabled - } - if vp.SecurityStyle != "" { - objectMap["securityStyle"] = vp.SecurityStyle - } - if vp.SmbEncryption != nil { - objectMap["smbEncryption"] = vp.SmbEncryption - } - if vp.SmbContinuouslyAvailable != nil { - objectMap["smbContinuouslyAvailable"] = vp.SmbContinuouslyAvailable - } - if vp.ThroughputMibps != nil { - objectMap["throughputMibps"] = vp.ThroughputMibps - } - if vp.EncryptionKeySource != nil { - objectMap["encryptionKeySource"] = vp.EncryptionKeySource - } - if vp.LdapEnabled != nil { - objectMap["ldapEnabled"] = vp.LdapEnabled - } - if vp.CoolAccess != nil { - objectMap["coolAccess"] = vp.CoolAccess - } - if vp.CoolnessPeriod != nil { - objectMap["coolnessPeriod"] = vp.CoolnessPeriod - } - if vp.UnixPermissions != nil { - objectMap["unixPermissions"] = vp.UnixPermissions - } - if vp.AvsDataStore != "" { - objectMap["avsDataStore"] = vp.AvsDataStore - } - if vp.IsDefaultQuotaEnabled != nil { - objectMap["isDefaultQuotaEnabled"] = vp.IsDefaultQuotaEnabled - } - if vp.DefaultUserQuotaInKiBs != nil { - objectMap["defaultUserQuotaInKiBs"] = vp.DefaultUserQuotaInKiBs - } - if vp.DefaultGroupQuotaInKiBs != nil { - objectMap["defaultGroupQuotaInKiBs"] = vp.DefaultGroupQuotaInKiBs - } - return json.Marshal(objectMap) -} - -// VolumePropertiesDataProtection dataProtection type volumes include an object containing details of the -// replication -type VolumePropertiesDataProtection struct { - // Backup - Backup Properties - Backup *VolumeBackupProperties `json:"backup,omitempty"` - // Replication - Replication properties - Replication *ReplicationObject `json:"replication,omitempty"` - // Snapshot - Snapshot properties. - Snapshot *VolumeSnapshotProperties `json:"snapshot,omitempty"` -} - -// VolumePropertiesExportPolicy set of export policy rules -type VolumePropertiesExportPolicy struct { - // Rules - Export policy rule - Rules *[]ExportPolicyRule `json:"rules,omitempty"` -} - -// VolumeRevert revert a volume to the snapshot -type VolumeRevert struct { - // SnapshotID - Resource id of the snapshot - SnapshotID *string `json:"snapshotId,omitempty"` -} - -// VolumesAuthorizeReplicationFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VolumesAuthorizeReplicationFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VolumesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VolumesAuthorizeReplicationFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VolumesAuthorizeReplicationFuture.Result. -func (future *VolumesAuthorizeReplicationFuture) result(client VolumesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.VolumesAuthorizeReplicationFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("netapp.VolumesAuthorizeReplicationFuture") - return - } - ar.Response = future.Response() - return -} - -// VolumesBreakReplicationFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VolumesBreakReplicationFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VolumesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VolumesBreakReplicationFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VolumesBreakReplicationFuture.Result. -func (future *VolumesBreakReplicationFuture) result(client VolumesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.VolumesBreakReplicationFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("netapp.VolumesBreakReplicationFuture") - return - } - ar.Response = future.Response() - return -} - -// VolumesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VolumesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VolumesClient) (Volume, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VolumesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VolumesCreateOrUpdateFuture.Result. -func (future *VolumesCreateOrUpdateFuture) result(client VolumesClient) (vVar Volume, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.VolumesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vVar.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("netapp.VolumesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vVar.Response.Response, err = future.GetResult(sender); err == nil && vVar.Response.Response.StatusCode != http.StatusNoContent { - vVar, err = client.CreateOrUpdateResponder(vVar.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.VolumesCreateOrUpdateFuture", "Result", vVar.Response.Response, "Failure responding to request") - } - } - return -} - -// VolumesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VolumesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VolumesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VolumesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VolumesDeleteFuture.Result. -func (future *VolumesDeleteFuture) result(client VolumesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.VolumesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("netapp.VolumesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VolumesDeleteReplicationFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VolumesDeleteReplicationFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VolumesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VolumesDeleteReplicationFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VolumesDeleteReplicationFuture.Result. -func (future *VolumesDeleteReplicationFuture) result(client VolumesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.VolumesDeleteReplicationFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("netapp.VolumesDeleteReplicationFuture") - return - } - ar.Response = future.Response() - return -} - -// VolumeSnapshotProperties volume Snapshot Properties -type VolumeSnapshotProperties struct { - // SnapshotPolicyID - Snapshot Policy ResourceId - SnapshotPolicyID *string `json:"snapshotPolicyId,omitempty"` -} - -// VolumesPoolChangeFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VolumesPoolChangeFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VolumesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VolumesPoolChangeFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VolumesPoolChangeFuture.Result. -func (future *VolumesPoolChangeFuture) result(client VolumesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.VolumesPoolChangeFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("netapp.VolumesPoolChangeFuture") - return - } - ar.Response = future.Response() - return -} - -// VolumesReInitializeReplicationFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VolumesReInitializeReplicationFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VolumesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VolumesReInitializeReplicationFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VolumesReInitializeReplicationFuture.Result. -func (future *VolumesReInitializeReplicationFuture) result(client VolumesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.VolumesReInitializeReplicationFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("netapp.VolumesReInitializeReplicationFuture") - return - } - ar.Response = future.Response() - return -} - -// VolumesResyncReplicationFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VolumesResyncReplicationFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VolumesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VolumesResyncReplicationFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VolumesResyncReplicationFuture.Result. -func (future *VolumesResyncReplicationFuture) result(client VolumesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.VolumesResyncReplicationFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("netapp.VolumesResyncReplicationFuture") - return - } - ar.Response = future.Response() - return -} - -// VolumesRevertFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VolumesRevertFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VolumesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VolumesRevertFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VolumesRevertFuture.Result. -func (future *VolumesRevertFuture) result(client VolumesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.VolumesRevertFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("netapp.VolumesRevertFuture") - return - } - ar.Response = future.Response() - return -} - -// VolumesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VolumesUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VolumesClient) (Volume, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VolumesUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VolumesUpdateFuture.Result. -func (future *VolumesUpdateFuture) result(client VolumesClient) (vVar Volume, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.VolumesUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vVar.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("netapp.VolumesUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vVar.Response.Response, err = future.GetResult(sender); err == nil && vVar.Response.Response.StatusCode != http.StatusNoContent { - vVar, err = client.UpdateResponder(vVar.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.VolumesUpdateFuture", "Result", vVar.Response.Response, "Failure responding to request") - } - } - return -} - -// WeeklySchedule weekly Schedule properties, make a snapshot every week at a specific day or days -type WeeklySchedule struct { - // SnapshotsToKeep - Weekly snapshot count to keep - SnapshotsToKeep *int32 `json:"snapshotsToKeep,omitempty"` - // Day - Indicates which weekdays snapshot should be taken, accepts a comma separated list of week day names in english - Day *string `json:"day,omitempty"` - // Hour - Indicates which hour in UTC timezone a snapshot should be taken - Hour *int32 `json:"hour,omitempty"` - // Minute - Indicates which minute snapshot should be taken - Minute *int32 `json:"minute,omitempty"` - // UsedBytes - Resource size in bytes, current storage usage for the volume in bytes - UsedBytes *int64 `json:"usedBytes,omitempty"` -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/operations.go deleted file mode 100644 index ec80a3510106..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/operations.go +++ /dev/null @@ -1,98 +0,0 @@ -package netapp - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// OperationsClient is the microsoft NetApp Files Azure Resource Provider specification -type OperationsClient struct { - BaseClient -} - -// NewOperationsClient creates an instance of the OperationsClient client. -func NewOperationsClient(subscriptionID string) OperationsClient { - return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { - return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List lists all of the available Microsoft.NetApp Rest API operations -func (client OperationsClient) List(ctx context.Context) (result OperationListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.OperationsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "netapp.OperationsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.OperationsClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/providers/Microsoft.NetApp/operations"), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/pools.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/pools.go deleted file mode 100644 index 75a84624cec1..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/pools.go +++ /dev/null @@ -1,552 +0,0 @@ -package netapp - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// PoolsClient is the microsoft NetApp Files Azure Resource Provider specification -type PoolsClient struct { - BaseClient -} - -// NewPoolsClient creates an instance of the PoolsClient client. -func NewPoolsClient(subscriptionID string) PoolsClient { - return NewPoolsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewPoolsClientWithBaseURI creates an instance of the PoolsClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewPoolsClientWithBaseURI(baseURI string, subscriptionID string) PoolsClient { - return PoolsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or Update a capacity pool -// Parameters: -// body - capacity pool object supplied in the body of the operation. -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -// poolName - the name of the capacity pool -func (client PoolsClient) CreateOrUpdate(ctx context.Context, body CapacityPool, resourceGroupName string, accountName string, poolName string) (result PoolsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PoolsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: body, - Constraints: []validation.Constraint{{Target: "body.Location", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "body.PoolProperties", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "body.PoolProperties.PoolID", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "body.PoolProperties.PoolID", Name: validation.MaxLength, Rule: 36, Chain: nil}, - {Target: "body.PoolProperties.PoolID", Name: validation.MinLength, Rule: 36, Chain: nil}, - {Target: "body.PoolProperties.PoolID", Name: validation.Pattern, Rule: `^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$`, Chain: nil}, - }}, - {Target: "body.PoolProperties.Size", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "body.PoolProperties.Size", Name: validation.InclusiveMaximum, Rule: int64(549755813888000), Chain: nil}, - {Target: "body.PoolProperties.Size", Name: validation.InclusiveMinimum, Rule: int64(4398046511104), Chain: nil}, - }}, - }}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: poolName, - Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.PoolsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, body, resourceGroupName, accountName, poolName) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client PoolsClient) CreateOrUpdatePreparer(ctx context.Context, body CapacityPool, resourceGroupName string, accountName string, poolName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "poolName": autorest.Encode("path", poolName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - body.ID = nil - body.Name = nil - body.Etag = nil - body.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}", pathParameters), - autorest.WithJSON(body), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client PoolsClient) CreateOrUpdateSender(req *http.Request) (future PoolsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client PoolsClient) CreateOrUpdateResponder(resp *http.Response) (result CapacityPool, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete the specified capacity pool -// Parameters: -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -// poolName - the name of the capacity pool -func (client PoolsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string) (result PoolsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PoolsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: poolName, - Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.PoolsClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, poolName) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client PoolsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "poolName": autorest.Encode("path", poolName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client PoolsClient) DeleteSender(req *http.Request) (future PoolsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client PoolsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get get details of the specified capacity pool -// Parameters: -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -// poolName - the name of the capacity pool -func (client PoolsClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string) (result CapacityPool, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PoolsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: poolName, - Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.PoolsClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, accountName, poolName) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client PoolsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "poolName": autorest.Encode("path", poolName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client PoolsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client PoolsClient) GetResponder(resp *http.Response) (result CapacityPool, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List list all capacity pools in the NetApp Account -// Parameters: -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -func (client PoolsClient) List(ctx context.Context, resourceGroupName string, accountName string) (result CapacityPoolListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PoolsClient.List") - defer func() { - sc := -1 - if result.cpl.Response.Response != nil { - sc = result.cpl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.PoolsClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, accountName) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.cpl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "List", resp, "Failure sending request") - return - } - - result.cpl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "List", resp, "Failure responding to request") - return - } - if result.cpl.hasNextLink() && result.cpl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client PoolsClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client PoolsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client PoolsClient) ListResponder(resp *http.Response) (result CapacityPoolList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client PoolsClient) listNextResults(ctx context.Context, lastResults CapacityPoolList) (result CapacityPoolList, err error) { - req, err := lastResults.capacityPoolListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "netapp.PoolsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "netapp.PoolsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client PoolsClient) ListComplete(ctx context.Context, resourceGroupName string, accountName string) (result CapacityPoolListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PoolsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, accountName) - return -} - -// Update patch the specified capacity pool -// Parameters: -// body - capacity pool object supplied in the body of the operation. -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -// poolName - the name of the capacity pool -func (client PoolsClient) Update(ctx context.Context, body CapacityPoolPatch, resourceGroupName string, accountName string, poolName string) (result PoolsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PoolsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: poolName, - Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.PoolsClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, body, resourceGroupName, accountName, poolName) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client PoolsClient) UpdatePreparer(ctx context.Context, body CapacityPoolPatch, resourceGroupName string, accountName string, poolName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "poolName": autorest.Encode("path", poolName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - body.ID = nil - body.Name = nil - body.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}", pathParameters), - autorest.WithJSON(body), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client PoolsClient) UpdateSender(req *http.Request) (future PoolsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client PoolsClient) UpdateResponder(resp *http.Response) (result CapacityPool, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/resource.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/resource.go deleted file mode 100644 index 84f69bd20fad..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/resource.go +++ /dev/null @@ -1,284 +0,0 @@ -package netapp - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ResourceClient is the microsoft NetApp Files Azure Resource Provider specification -type ResourceClient struct { - BaseClient -} - -// NewResourceClient creates an instance of the ResourceClient client. -func NewResourceClient(subscriptionID string) ResourceClient { - return NewResourceClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewResourceClientWithBaseURI creates an instance of the ResourceClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewResourceClientWithBaseURI(baseURI string, subscriptionID string) ResourceClient { - return ResourceClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CheckFilePathAvailability check if a file path is available. -// Parameters: -// body - file path availability request. -// location - the location -func (client ResourceClient) CheckFilePathAvailability(ctx context.Context, body FilePathAvailabilityRequest, location string) (result CheckAvailabilityResponse, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceClient.CheckFilePathAvailability") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: body, - Constraints: []validation.Constraint{{Target: "body.Name", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "body.SubnetID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.ResourceClient", "CheckFilePathAvailability", err.Error()) - } - - req, err := client.CheckFilePathAvailabilityPreparer(ctx, body, location) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.ResourceClient", "CheckFilePathAvailability", nil, "Failure preparing request") - return - } - - resp, err := client.CheckFilePathAvailabilitySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "netapp.ResourceClient", "CheckFilePathAvailability", resp, "Failure sending request") - return - } - - result, err = client.CheckFilePathAvailabilityResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.ResourceClient", "CheckFilePathAvailability", resp, "Failure responding to request") - return - } - - return -} - -// CheckFilePathAvailabilityPreparer prepares the CheckFilePathAvailability request. -func (client ResourceClient) CheckFilePathAvailabilityPreparer(ctx context.Context, body FilePathAvailabilityRequest, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/checkFilePathAvailability", pathParameters), - autorest.WithJSON(body), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CheckFilePathAvailabilitySender sends the CheckFilePathAvailability request. The method will close the -// http.Response Body if it receives an error. -func (client ResourceClient) CheckFilePathAvailabilitySender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CheckFilePathAvailabilityResponder handles the response to the CheckFilePathAvailability request. The method always -// closes the http.Response Body. -func (client ResourceClient) CheckFilePathAvailabilityResponder(resp *http.Response) (result CheckAvailabilityResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// CheckNameAvailability check if a resource name is available. -// Parameters: -// body - name availability request. -// location - the location -func (client ResourceClient) CheckNameAvailability(ctx context.Context, body ResourceNameAvailabilityRequest, location string) (result CheckAvailabilityResponse, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceClient.CheckNameAvailability") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: body, - Constraints: []validation.Constraint{{Target: "body.Name", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "body.ResourceGroup", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.ResourceClient", "CheckNameAvailability", err.Error()) - } - - req, err := client.CheckNameAvailabilityPreparer(ctx, body, location) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.ResourceClient", "CheckNameAvailability", nil, "Failure preparing request") - return - } - - resp, err := client.CheckNameAvailabilitySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "netapp.ResourceClient", "CheckNameAvailability", resp, "Failure sending request") - return - } - - result, err = client.CheckNameAvailabilityResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.ResourceClient", "CheckNameAvailability", resp, "Failure responding to request") - return - } - - return -} - -// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request. -func (client ResourceClient) CheckNameAvailabilityPreparer(ctx context.Context, body ResourceNameAvailabilityRequest, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/checkNameAvailability", pathParameters), - autorest.WithJSON(body), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CheckNameAvailabilitySender sends the CheckNameAvailability request. The method will close the -// http.Response Body if it receives an error. -func (client ResourceClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CheckNameAvailabilityResponder handles the response to the CheckNameAvailability request. The method always -// closes the http.Response Body. -func (client ResourceClient) CheckNameAvailabilityResponder(resp *http.Response) (result CheckAvailabilityResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// CheckQuotaAvailability check if a quota is available. -// Parameters: -// body - quota availability request. -// location - the location -func (client ResourceClient) CheckQuotaAvailability(ctx context.Context, body QuotaAvailabilityRequest, location string) (result CheckAvailabilityResponse, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceClient.CheckQuotaAvailability") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: body, - Constraints: []validation.Constraint{{Target: "body.Name", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "body.ResourceGroup", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.ResourceClient", "CheckQuotaAvailability", err.Error()) - } - - req, err := client.CheckQuotaAvailabilityPreparer(ctx, body, location) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.ResourceClient", "CheckQuotaAvailability", nil, "Failure preparing request") - return - } - - resp, err := client.CheckQuotaAvailabilitySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "netapp.ResourceClient", "CheckQuotaAvailability", resp, "Failure sending request") - return - } - - result, err = client.CheckQuotaAvailabilityResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.ResourceClient", "CheckQuotaAvailability", resp, "Failure responding to request") - return - } - - return -} - -// CheckQuotaAvailabilityPreparer prepares the CheckQuotaAvailability request. -func (client ResourceClient) CheckQuotaAvailabilityPreparer(ctx context.Context, body QuotaAvailabilityRequest, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/checkQuotaAvailability", pathParameters), - autorest.WithJSON(body), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CheckQuotaAvailabilitySender sends the CheckQuotaAvailability request. The method will close the -// http.Response Body if it receives an error. -func (client ResourceClient) CheckQuotaAvailabilitySender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CheckQuotaAvailabilityResponder handles the response to the CheckQuotaAvailability request. The method always -// closes the http.Response Body. -func (client ResourceClient) CheckQuotaAvailabilityResponder(resp *http.Response) (result CheckAvailabilityResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/resourcequotalimits.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/resourcequotalimits.go deleted file mode 100644 index 202dac096ab5..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/resourcequotalimits.go +++ /dev/null @@ -1,182 +0,0 @@ -package netapp - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ResourceQuotaLimitsClient is the microsoft NetApp Files Azure Resource Provider specification -type ResourceQuotaLimitsClient struct { - BaseClient -} - -// NewResourceQuotaLimitsClient creates an instance of the ResourceQuotaLimitsClient client. -func NewResourceQuotaLimitsClient(subscriptionID string) ResourceQuotaLimitsClient { - return NewResourceQuotaLimitsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewResourceQuotaLimitsClientWithBaseURI creates an instance of the ResourceQuotaLimitsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewResourceQuotaLimitsClientWithBaseURI(baseURI string, subscriptionID string) ResourceQuotaLimitsClient { - return ResourceQuotaLimitsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get get the default and current subscription quota limit -// Parameters: -// location - the location -// quotaLimitName - the name of the Quota Limit -func (client ResourceQuotaLimitsClient) Get(ctx context.Context, location string, quotaLimitName string) (result SubscriptionQuotaItem, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceQuotaLimitsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, location, quotaLimitName) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.ResourceQuotaLimitsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "netapp.ResourceQuotaLimitsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.ResourceQuotaLimitsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ResourceQuotaLimitsClient) GetPreparer(ctx context.Context, location string, quotaLimitName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "quotaLimitName": autorest.Encode("path", quotaLimitName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/quotaLimits/{quotaLimitName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ResourceQuotaLimitsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ResourceQuotaLimitsClient) GetResponder(resp *http.Response) (result SubscriptionQuotaItem, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List get the default and current limits for quotas -// Parameters: -// location - the location -func (client ResourceQuotaLimitsClient) List(ctx context.Context, location string) (result SubscriptionQuotaItemList, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceQuotaLimitsClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.ResourceQuotaLimitsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "netapp.ResourceQuotaLimitsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.ResourceQuotaLimitsClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ResourceQuotaLimitsClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/quotaLimits", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ResourceQuotaLimitsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ResourceQuotaLimitsClient) ListResponder(resp *http.Response) (result SubscriptionQuotaItemList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/snapshotpolicies.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/snapshotpolicies.go deleted file mode 100644 index 3b25ffb3692e..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/snapshotpolicies.go +++ /dev/null @@ -1,568 +0,0 @@ -package netapp - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// SnapshotPoliciesClient is the microsoft NetApp Files Azure Resource Provider specification -type SnapshotPoliciesClient struct { - BaseClient -} - -// NewSnapshotPoliciesClient creates an instance of the SnapshotPoliciesClient client. -func NewSnapshotPoliciesClient(subscriptionID string) SnapshotPoliciesClient { - return NewSnapshotPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewSnapshotPoliciesClientWithBaseURI creates an instance of the SnapshotPoliciesClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewSnapshotPoliciesClientWithBaseURI(baseURI string, subscriptionID string) SnapshotPoliciesClient { - return SnapshotPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Create create a snapshot policy -// Parameters: -// body - snapshot policy object supplied in the body of the operation. -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -// snapshotPolicyName - the name of the snapshot policy -func (client SnapshotPoliciesClient) Create(ctx context.Context, body SnapshotPolicy, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPolicy, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Create") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: body, - Constraints: []validation.Constraint{{Target: "body.Location", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "body.SnapshotPolicyProperties", Name: validation.Null, Rule: true, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.SnapshotPoliciesClient", "Create", err.Error()) - } - - req, err := client.CreatePreparer(ctx, body, resourceGroupName, accountName, snapshotPolicyName) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "Create", nil, "Failure preparing request") - return - } - - resp, err := client.CreateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "Create", resp, "Failure sending request") - return - } - - result, err = client.CreateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "Create", resp, "Failure responding to request") - return - } - - return -} - -// CreatePreparer prepares the Create request. -func (client SnapshotPoliciesClient) CreatePreparer(ctx context.Context, body SnapshotPolicy, resourceGroupName string, accountName string, snapshotPolicyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "snapshotPolicyName": autorest.Encode("path", snapshotPolicyName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - body.ID = nil - body.Name = nil - body.Etag = nil - body.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}", pathParameters), - autorest.WithJSON(body), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateSender sends the Create request. The method will close the -// http.Response Body if it receives an error. -func (client SnapshotPoliciesClient) CreateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateResponder handles the response to the Create request. The method always -// closes the http.Response Body. -func (client SnapshotPoliciesClient) CreateResponder(resp *http.Response) (result SnapshotPolicy, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete snapshot policy -// Parameters: -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -// snapshotPolicyName - the name of the snapshot policy -func (client SnapshotPoliciesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPoliciesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.SnapshotPoliciesClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, snapshotPolicyName) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client SnapshotPoliciesClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "snapshotPolicyName": autorest.Encode("path", snapshotPolicyName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client SnapshotPoliciesClient) DeleteSender(req *http.Request) (future SnapshotPoliciesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client SnapshotPoliciesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get get a snapshot Policy -// Parameters: -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -// snapshotPolicyName - the name of the snapshot policy -func (client SnapshotPoliciesClient) Get(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPolicy, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.SnapshotPoliciesClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, accountName, snapshotPolicyName) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client SnapshotPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "snapshotPolicyName": autorest.Encode("path", snapshotPolicyName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client SnapshotPoliciesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client SnapshotPoliciesClient) GetResponder(resp *http.Response) (result SnapshotPolicy, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List list snapshot policy -// Parameters: -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -func (client SnapshotPoliciesClient) List(ctx context.Context, resourceGroupName string, accountName string) (result SnapshotPoliciesList, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.SnapshotPoliciesClient", "List", err.Error()) - } - - req, err := client.ListPreparer(ctx, resourceGroupName, accountName) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client SnapshotPoliciesClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client SnapshotPoliciesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client SnapshotPoliciesClient) ListResponder(resp *http.Response) (result SnapshotPoliciesList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListVolumes get volumes associated with snapshot policy -// Parameters: -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -// snapshotPolicyName - the name of the snapshot policy -func (client SnapshotPoliciesClient) ListVolumes(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPolicyVolumeList, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.ListVolumes") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.SnapshotPoliciesClient", "ListVolumes", err.Error()) - } - - req, err := client.ListVolumesPreparer(ctx, resourceGroupName, accountName, snapshotPolicyName) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "ListVolumes", nil, "Failure preparing request") - return - } - - resp, err := client.ListVolumesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "ListVolumes", resp, "Failure sending request") - return - } - - result, err = client.ListVolumesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "ListVolumes", resp, "Failure responding to request") - return - } - - return -} - -// ListVolumesPreparer prepares the ListVolumes request. -func (client SnapshotPoliciesClient) ListVolumesPreparer(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "snapshotPolicyName": autorest.Encode("path", snapshotPolicyName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}/volumes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListVolumesSender sends the ListVolumes request. The method will close the -// http.Response Body if it receives an error. -func (client SnapshotPoliciesClient) ListVolumesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListVolumesResponder handles the response to the ListVolumes request. The method always -// closes the http.Response Body. -func (client SnapshotPoliciesClient) ListVolumesResponder(resp *http.Response) (result SnapshotPolicyVolumeList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Update patch a snapshot policy -// Parameters: -// body - snapshot policy object supplied in the body of the operation. -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -// snapshotPolicyName - the name of the snapshot policy -func (client SnapshotPoliciesClient) Update(ctx context.Context, body SnapshotPolicyPatch, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPoliciesUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.SnapshotPoliciesClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, body, resourceGroupName, accountName, snapshotPolicyName) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client SnapshotPoliciesClient) UpdatePreparer(ctx context.Context, body SnapshotPolicyPatch, resourceGroupName string, accountName string, snapshotPolicyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "snapshotPolicyName": autorest.Encode("path", snapshotPolicyName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - body.ID = nil - body.Name = nil - body.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}", pathParameters), - autorest.WithJSON(body), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client SnapshotPoliciesClient) UpdateSender(req *http.Request) (future SnapshotPoliciesUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client SnapshotPoliciesClient) UpdateResponder(resp *http.Response) (result SnapshotPolicy, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/snapshots.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/snapshots.go deleted file mode 100644 index 78f4f0d304e3..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/snapshots.go +++ /dev/null @@ -1,546 +0,0 @@ -package netapp - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// SnapshotsClient is the microsoft NetApp Files Azure Resource Provider specification -type SnapshotsClient struct { - BaseClient -} - -// NewSnapshotsClient creates an instance of the SnapshotsClient client. -func NewSnapshotsClient(subscriptionID string) SnapshotsClient { - return NewSnapshotsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewSnapshotsClientWithBaseURI creates an instance of the SnapshotsClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewSnapshotsClientWithBaseURI(baseURI string, subscriptionID string) SnapshotsClient { - return SnapshotsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Create create the specified snapshot within the given volume -// Parameters: -// body - snapshot object supplied in the body of the operation. -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -// poolName - the name of the capacity pool -// volumeName - the name of the volume -// snapshotName - the name of the snapshot -func (client SnapshotsClient) Create(ctx context.Context, body Snapshot, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsCreateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Create") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: body, - Constraints: []validation.Constraint{{Target: "body.Location", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "body.SnapshotProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "body.SnapshotProperties.SnapshotID", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "body.SnapshotProperties.SnapshotID", Name: validation.MaxLength, Rule: 36, Chain: nil}, - {Target: "body.SnapshotProperties.SnapshotID", Name: validation.MinLength, Rule: 36, Chain: nil}, - {Target: "body.SnapshotProperties.SnapshotID", Name: validation.Pattern, Rule: `^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$`, Chain: nil}, - }}, - }}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: poolName, - Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, - {TargetValue: volumeName, - Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.SnapshotsClient", "Create", err.Error()) - } - - req, err := client.CreatePreparer(ctx, body, resourceGroupName, accountName, poolName, volumeName, snapshotName) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Create", nil, "Failure preparing request") - return - } - - result, err = client.CreateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Create", result.Response(), "Failure sending request") - return - } - - return -} - -// CreatePreparer prepares the Create request. -func (client SnapshotsClient) CreatePreparer(ctx context.Context, body Snapshot, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "poolName": autorest.Encode("path", poolName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "snapshotName": autorest.Encode("path", snapshotName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "volumeName": autorest.Encode("path", volumeName), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - body.ID = nil - body.Name = nil - body.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}", pathParameters), - autorest.WithJSON(body), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateSender sends the Create request. The method will close the -// http.Response Body if it receives an error. -func (client SnapshotsClient) CreateSender(req *http.Request) (future SnapshotsCreateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateResponder handles the response to the Create request. The method always -// closes the http.Response Body. -func (client SnapshotsClient) CreateResponder(resp *http.Response) (result Snapshot, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete snapshot -// Parameters: -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -// poolName - the name of the capacity pool -// volumeName - the name of the volume -// snapshotName - the name of the snapshot -func (client SnapshotsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: poolName, - Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, - {TargetValue: volumeName, - Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.SnapshotsClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, poolName, volumeName, snapshotName) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client SnapshotsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "poolName": autorest.Encode("path", poolName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "snapshotName": autorest.Encode("path", snapshotName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "volumeName": autorest.Encode("path", volumeName), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client SnapshotsClient) DeleteSender(req *http.Request) (future SnapshotsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client SnapshotsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get get details of the specified snapshot -// Parameters: -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -// poolName - the name of the capacity pool -// volumeName - the name of the volume -// snapshotName - the name of the snapshot -func (client SnapshotsClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result Snapshot, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: poolName, - Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, - {TargetValue: volumeName, - Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.SnapshotsClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, accountName, poolName, volumeName, snapshotName) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client SnapshotsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "poolName": autorest.Encode("path", poolName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "snapshotName": autorest.Encode("path", snapshotName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "volumeName": autorest.Encode("path", volumeName), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client SnapshotsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client SnapshotsClient) GetResponder(resp *http.Response) (result Snapshot, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List list all snapshots associated with the volume -// Parameters: -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -// poolName - the name of the capacity pool -// volumeName - the name of the volume -func (client SnapshotsClient) List(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result SnapshotsList, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: poolName, - Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, - {TargetValue: volumeName, - Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.SnapshotsClient", "List", err.Error()) - } - - req, err := client.ListPreparer(ctx, resourceGroupName, accountName, poolName, volumeName) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client SnapshotsClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "poolName": autorest.Encode("path", poolName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "volumeName": autorest.Encode("path", volumeName), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client SnapshotsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client SnapshotsClient) ListResponder(resp *http.Response) (result SnapshotsList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Update patch a snapshot -// Parameters: -// body - snapshot object supplied in the body of the operation. -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -// poolName - the name of the capacity pool -// volumeName - the name of the volume -// snapshotName - the name of the snapshot -func (client SnapshotsClient) Update(ctx context.Context, body interface{}, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: poolName, - Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, - {TargetValue: volumeName, - Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.SnapshotsClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, body, resourceGroupName, accountName, poolName, volumeName, snapshotName) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client SnapshotsClient) UpdatePreparer(ctx context.Context, body interface{}, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "poolName": autorest.Encode("path", poolName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "snapshotName": autorest.Encode("path", snapshotName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "volumeName": autorest.Encode("path", volumeName), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}", pathParameters), - autorest.WithJSON(body), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client SnapshotsClient) UpdateSender(req *http.Request) (future SnapshotsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client SnapshotsClient) UpdateResponder(resp *http.Response) (result Snapshot, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/vaults.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/vaults.go deleted file mode 100644 index 3dece6a95fcd..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/vaults.go +++ /dev/null @@ -1,116 +0,0 @@ -package netapp - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VaultsClient is the microsoft NetApp Files Azure Resource Provider specification -type VaultsClient struct { - BaseClient -} - -// NewVaultsClient creates an instance of the VaultsClient client. -func NewVaultsClient(subscriptionID string) VaultsClient { - return NewVaultsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVaultsClientWithBaseURI creates an instance of the VaultsClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewVaultsClientWithBaseURI(baseURI string, subscriptionID string) VaultsClient { - return VaultsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List list vaults for a Netapp Account -// Parameters: -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -func (client VaultsClient) List(ctx context.Context, resourceGroupName string, accountName string) (result VaultList, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VaultsClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.VaultsClient", "List", err.Error()) - } - - req, err := client.ListPreparer(ctx, resourceGroupName, accountName) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.VaultsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "netapp.VaultsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.VaultsClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VaultsClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/vaults", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VaultsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VaultsClient) ListResponder(resp *http.Response) (result VaultList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/version.go deleted file mode 100644 index 0ede4076aaa4..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/version.go +++ /dev/null @@ -1,19 +0,0 @@ -package netapp - -import "github.com/Azure/azure-sdk-for-go/version" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -// UserAgent returns the UserAgent string to use when sending http.Requests. -func UserAgent() string { - return "Azure-SDK-For-Go/" + Version() + " netapp/2021-06-01" -} - -// Version returns the semantic version (see http://semver.org) of the client. -func Version() string { - return version.Number -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/volumes.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/volumes.go deleted file mode 100644 index aaf8f13212f5..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp/volumes.go +++ /dev/null @@ -1,1420 +0,0 @@ -package netapp - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VolumesClient is the microsoft NetApp Files Azure Resource Provider specification -type VolumesClient struct { - BaseClient -} - -// NewVolumesClient creates an instance of the VolumesClient client. -func NewVolumesClient(subscriptionID string) VolumesClient { - return NewVolumesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVolumesClientWithBaseURI creates an instance of the VolumesClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewVolumesClientWithBaseURI(baseURI string, subscriptionID string) VolumesClient { - return VolumesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// AuthorizeReplication authorize the replication connection on the source volume -// Parameters: -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -// poolName - the name of the capacity pool -// volumeName - the name of the volume -// body - authorize request object supplied in the body of the operation. -func (client VolumesClient) AuthorizeReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body AuthorizeRequest) (result VolumesAuthorizeReplicationFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.AuthorizeReplication") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: poolName, - Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, - {TargetValue: volumeName, - Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.VolumesClient", "AuthorizeReplication", err.Error()) - } - - req, err := client.AuthorizeReplicationPreparer(ctx, resourceGroupName, accountName, poolName, volumeName, body) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "AuthorizeReplication", nil, "Failure preparing request") - return - } - - result, err = client.AuthorizeReplicationSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "AuthorizeReplication", result.Response(), "Failure sending request") - return - } - - return -} - -// AuthorizeReplicationPreparer prepares the AuthorizeReplication request. -func (client VolumesClient) AuthorizeReplicationPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body AuthorizeRequest) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "poolName": autorest.Encode("path", poolName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "volumeName": autorest.Encode("path", volumeName), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/authorizeReplication", pathParameters), - autorest.WithJSON(body), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// AuthorizeReplicationSender sends the AuthorizeReplication request. The method will close the -// http.Response Body if it receives an error. -func (client VolumesClient) AuthorizeReplicationSender(req *http.Request) (future VolumesAuthorizeReplicationFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// AuthorizeReplicationResponder handles the response to the AuthorizeReplication request. The method always -// closes the http.Response Body. -func (client VolumesClient) AuthorizeReplicationResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// BreakReplication break the replication connection on the destination volume -// Parameters: -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -// poolName - the name of the capacity pool -// volumeName - the name of the volume -// body - optional body to force break the replication. -func (client VolumesClient) BreakReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body *BreakReplicationRequest) (result VolumesBreakReplicationFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.BreakReplication") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: poolName, - Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, - {TargetValue: volumeName, - Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.VolumesClient", "BreakReplication", err.Error()) - } - - req, err := client.BreakReplicationPreparer(ctx, resourceGroupName, accountName, poolName, volumeName, body) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "BreakReplication", nil, "Failure preparing request") - return - } - - result, err = client.BreakReplicationSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "BreakReplication", result.Response(), "Failure sending request") - return - } - - return -} - -// BreakReplicationPreparer prepares the BreakReplication request. -func (client VolumesClient) BreakReplicationPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body *BreakReplicationRequest) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "poolName": autorest.Encode("path", poolName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "volumeName": autorest.Encode("path", volumeName), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/breakReplication", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if body != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(body)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// BreakReplicationSender sends the BreakReplication request. The method will close the -// http.Response Body if it receives an error. -func (client VolumesClient) BreakReplicationSender(req *http.Request) (future VolumesBreakReplicationFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// BreakReplicationResponder handles the response to the BreakReplication request. The method always -// closes the http.Response Body. -func (client VolumesClient) BreakReplicationResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// CreateOrUpdate create or update the specified volume within the capacity pool -// Parameters: -// body - volume object supplied in the body of the operation. -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -// poolName - the name of the capacity pool -// volumeName - the name of the volume -func (client VolumesClient) CreateOrUpdate(ctx context.Context, body Volume, resourceGroupName string, accountName string, poolName string, volumeName string) (result VolumesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: body, - Constraints: []validation.Constraint{{Target: "body.Location", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "body.VolumeProperties", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "body.VolumeProperties.FileSystemID", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "body.VolumeProperties.FileSystemID", Name: validation.MaxLength, Rule: 36, Chain: nil}, - {Target: "body.VolumeProperties.FileSystemID", Name: validation.MinLength, Rule: 36, Chain: nil}, - {Target: "body.VolumeProperties.FileSystemID", Name: validation.Pattern, Rule: `^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$`, Chain: nil}, - }}, - {Target: "body.VolumeProperties.CreationToken", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "body.VolumeProperties.CreationToken", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "body.VolumeProperties.CreationToken", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "body.VolumeProperties.CreationToken", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-]{0,79}$`, Chain: nil}, - }}, - {Target: "body.VolumeProperties.UsageThreshold", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "body.VolumeProperties.UsageThreshold", Name: validation.InclusiveMaximum, Rule: int64(109951162777600), Chain: nil}, - {Target: "body.VolumeProperties.UsageThreshold", Name: validation.InclusiveMinimum, Rule: int64(107374182400), Chain: nil}, - }}, - {Target: "body.VolumeProperties.SnapshotID", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "body.VolumeProperties.SnapshotID", Name: validation.MaxLength, Rule: 36, Chain: nil}, - {Target: "body.VolumeProperties.SnapshotID", Name: validation.MinLength, Rule: 36, Chain: nil}, - {Target: "body.VolumeProperties.SnapshotID", Name: validation.Pattern, Rule: `^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}|(\\?([^\/]*[\/])*)([^\/]+)$`, Chain: nil}, - }}, - {Target: "body.VolumeProperties.BackupID", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "body.VolumeProperties.BackupID", Name: validation.MaxLength, Rule: 36, Chain: nil}, - {Target: "body.VolumeProperties.BackupID", Name: validation.MinLength, Rule: 36, Chain: nil}, - {Target: "body.VolumeProperties.BackupID", Name: validation.Pattern, Rule: `^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}|(\\?([^\/]*[\/])*)([^\/]+)$`, Chain: nil}, - }}, - {Target: "body.VolumeProperties.SubnetID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "body.VolumeProperties.NetworkSiblingSetID", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "body.VolumeProperties.NetworkSiblingSetID", Name: validation.MaxLength, Rule: 36, Chain: nil}, - {Target: "body.VolumeProperties.NetworkSiblingSetID", Name: validation.MinLength, Rule: 36, Chain: nil}, - {Target: "body.VolumeProperties.NetworkSiblingSetID", Name: validation.Pattern, Rule: `^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$`, Chain: nil}, - }}, - {Target: "body.VolumeProperties.DataProtection", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "body.VolumeProperties.DataProtection.Replication", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "body.VolumeProperties.DataProtection.Replication.RemoteVolumeResourceID", Name: validation.Null, Rule: true, Chain: nil}}}, - }}, - {Target: "body.VolumeProperties.ThroughputMibps", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "body.VolumeProperties.ThroughputMibps", Name: validation.InclusiveMaximum, Rule: float64(4500), Chain: nil}, - {Target: "body.VolumeProperties.ThroughputMibps", Name: validation.InclusiveMinimum, Rule: float64(0), Chain: nil}, - }}, - {Target: "body.VolumeProperties.CoolnessPeriod", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "body.VolumeProperties.CoolnessPeriod", Name: validation.InclusiveMaximum, Rule: int64(63), Chain: nil}, - {Target: "body.VolumeProperties.CoolnessPeriod", Name: validation.InclusiveMinimum, Rule: int64(7), Chain: nil}, - }}, - {Target: "body.VolumeProperties.UnixPermissions", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "body.VolumeProperties.UnixPermissions", Name: validation.MaxLength, Rule: 4, Chain: nil}, - {Target: "body.VolumeProperties.UnixPermissions", Name: validation.MinLength, Rule: 4, Chain: nil}, - }}, - }}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: poolName, - Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, - {TargetValue: volumeName, - Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.VolumesClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, body, resourceGroupName, accountName, poolName, volumeName) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VolumesClient) CreateOrUpdatePreparer(ctx context.Context, body Volume, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "poolName": autorest.Encode("path", poolName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "volumeName": autorest.Encode("path", volumeName), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - body.ID = nil - body.Name = nil - body.Etag = nil - body.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}", pathParameters), - autorest.WithJSON(body), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VolumesClient) CreateOrUpdateSender(req *http.Request) (future VolumesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VolumesClient) CreateOrUpdateResponder(resp *http.Response) (result Volume, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete the specified volume -// Parameters: -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -// poolName - the name of the capacity pool -// volumeName - the name of the volume -func (client VolumesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result VolumesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: poolName, - Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, - {TargetValue: volumeName, - Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.VolumesClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, poolName, volumeName) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VolumesClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "poolName": autorest.Encode("path", poolName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "volumeName": autorest.Encode("path", volumeName), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VolumesClient) DeleteSender(req *http.Request) (future VolumesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VolumesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// DeleteReplication delete the replication connection on the destination volume, and send release to the source -// replication -// Parameters: -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -// poolName - the name of the capacity pool -// volumeName - the name of the volume -func (client VolumesClient) DeleteReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result VolumesDeleteReplicationFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.DeleteReplication") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: poolName, - Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, - {TargetValue: volumeName, - Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.VolumesClient", "DeleteReplication", err.Error()) - } - - req, err := client.DeleteReplicationPreparer(ctx, resourceGroupName, accountName, poolName, volumeName) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "DeleteReplication", nil, "Failure preparing request") - return - } - - result, err = client.DeleteReplicationSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "DeleteReplication", result.Response(), "Failure sending request") - return - } - - return -} - -// DeleteReplicationPreparer prepares the DeleteReplication request. -func (client VolumesClient) DeleteReplicationPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "poolName": autorest.Encode("path", poolName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "volumeName": autorest.Encode("path", volumeName), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/deleteReplication", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteReplicationSender sends the DeleteReplication request. The method will close the -// http.Response Body if it receives an error. -func (client VolumesClient) DeleteReplicationSender(req *http.Request) (future VolumesDeleteReplicationFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteReplicationResponder handles the response to the DeleteReplication request. The method always -// closes the http.Response Body. -func (client VolumesClient) DeleteReplicationResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get get the details of the specified volume -// Parameters: -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -// poolName - the name of the capacity pool -// volumeName - the name of the volume -func (client VolumesClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result Volume, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: poolName, - Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, - {TargetValue: volumeName, - Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.VolumesClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, accountName, poolName, volumeName) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VolumesClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "poolName": autorest.Encode("path", poolName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "volumeName": autorest.Encode("path", volumeName), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VolumesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VolumesClient) GetResponder(resp *http.Response) (result Volume, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List list all volumes within the capacity pool -// Parameters: -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -// poolName - the name of the capacity pool -func (client VolumesClient) List(ctx context.Context, resourceGroupName string, accountName string, poolName string) (result VolumeListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.List") - defer func() { - sc := -1 - if result.vl.Response.Response != nil { - sc = result.vl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: poolName, - Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.VolumesClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, accountName, poolName) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.vl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "List", resp, "Failure sending request") - return - } - - result.vl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "List", resp, "Failure responding to request") - return - } - if result.vl.hasNextLink() && result.vl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VolumesClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "poolName": autorest.Encode("path", poolName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VolumesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VolumesClient) ListResponder(resp *http.Response) (result VolumeList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client VolumesClient) listNextResults(ctx context.Context, lastResults VolumeList) (result VolumeList, err error) { - req, err := lastResults.volumeListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "netapp.VolumesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "netapp.VolumesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VolumesClient) ListComplete(ctx context.Context, resourceGroupName string, accountName string, poolName string) (result VolumeListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, accountName, poolName) - return -} - -// PoolChange moves volume to another pool -// Parameters: -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -// poolName - the name of the capacity pool -// volumeName - the name of the volume -// body - move volume to the pool supplied in the body of the operation. -func (client VolumesClient) PoolChange(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body PoolChangeRequest) (result VolumesPoolChangeFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.PoolChange") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: poolName, - Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, - {TargetValue: volumeName, - Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, - {TargetValue: body, - Constraints: []validation.Constraint{{Target: "body.NewPoolResourceID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.VolumesClient", "PoolChange", err.Error()) - } - - req, err := client.PoolChangePreparer(ctx, resourceGroupName, accountName, poolName, volumeName, body) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "PoolChange", nil, "Failure preparing request") - return - } - - result, err = client.PoolChangeSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "PoolChange", result.Response(), "Failure sending request") - return - } - - return -} - -// PoolChangePreparer prepares the PoolChange request. -func (client VolumesClient) PoolChangePreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body PoolChangeRequest) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "poolName": autorest.Encode("path", poolName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "volumeName": autorest.Encode("path", volumeName), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/poolChange", pathParameters), - autorest.WithJSON(body), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PoolChangeSender sends the PoolChange request. The method will close the -// http.Response Body if it receives an error. -func (client VolumesClient) PoolChangeSender(req *http.Request) (future VolumesPoolChangeFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// PoolChangeResponder handles the response to the PoolChange request. The method always -// closes the http.Response Body. -func (client VolumesClient) PoolChangeResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// ReInitializeReplication re-Initializes the replication connection on the destination volume -// Parameters: -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -// poolName - the name of the capacity pool -// volumeName - the name of the volume -func (client VolumesClient) ReInitializeReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result VolumesReInitializeReplicationFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.ReInitializeReplication") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: poolName, - Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, - {TargetValue: volumeName, - Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.VolumesClient", "ReInitializeReplication", err.Error()) - } - - req, err := client.ReInitializeReplicationPreparer(ctx, resourceGroupName, accountName, poolName, volumeName) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ReInitializeReplication", nil, "Failure preparing request") - return - } - - result, err = client.ReInitializeReplicationSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ReInitializeReplication", result.Response(), "Failure sending request") - return - } - - return -} - -// ReInitializeReplicationPreparer prepares the ReInitializeReplication request. -func (client VolumesClient) ReInitializeReplicationPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "poolName": autorest.Encode("path", poolName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "volumeName": autorest.Encode("path", volumeName), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/reinitializeReplication", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ReInitializeReplicationSender sends the ReInitializeReplication request. The method will close the -// http.Response Body if it receives an error. -func (client VolumesClient) ReInitializeReplicationSender(req *http.Request) (future VolumesReInitializeReplicationFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ReInitializeReplicationResponder handles the response to the ReInitializeReplication request. The method always -// closes the http.Response Body. -func (client VolumesClient) ReInitializeReplicationResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// ReplicationStatusMethod get the status of the replication -// Parameters: -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -// poolName - the name of the capacity pool -// volumeName - the name of the volume -func (client VolumesClient) ReplicationStatusMethod(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result ReplicationStatus, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.ReplicationStatusMethod") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: poolName, - Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, - {TargetValue: volumeName, - Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.VolumesClient", "ReplicationStatusMethod", err.Error()) - } - - req, err := client.ReplicationStatusMethodPreparer(ctx, resourceGroupName, accountName, poolName, volumeName) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ReplicationStatusMethod", nil, "Failure preparing request") - return - } - - resp, err := client.ReplicationStatusMethodSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ReplicationStatusMethod", resp, "Failure sending request") - return - } - - result, err = client.ReplicationStatusMethodResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ReplicationStatusMethod", resp, "Failure responding to request") - return - } - - return -} - -// ReplicationStatusMethodPreparer prepares the ReplicationStatusMethod request. -func (client VolumesClient) ReplicationStatusMethodPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "poolName": autorest.Encode("path", poolName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "volumeName": autorest.Encode("path", volumeName), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/replicationStatus", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ReplicationStatusMethodSender sends the ReplicationStatusMethod request. The method will close the -// http.Response Body if it receives an error. -func (client VolumesClient) ReplicationStatusMethodSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ReplicationStatusMethodResponder handles the response to the ReplicationStatusMethod request. The method always -// closes the http.Response Body. -func (client VolumesClient) ReplicationStatusMethodResponder(resp *http.Response) (result ReplicationStatus, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ResyncReplication resync the connection on the destination volume. If the operation is ran on the source volume it -// will reverse-resync the connection and sync from destination to source. -// Parameters: -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -// poolName - the name of the capacity pool -// volumeName - the name of the volume -func (client VolumesClient) ResyncReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result VolumesResyncReplicationFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.ResyncReplication") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: poolName, - Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, - {TargetValue: volumeName, - Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.VolumesClient", "ResyncReplication", err.Error()) - } - - req, err := client.ResyncReplicationPreparer(ctx, resourceGroupName, accountName, poolName, volumeName) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ResyncReplication", nil, "Failure preparing request") - return - } - - result, err = client.ResyncReplicationSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ResyncReplication", result.Response(), "Failure sending request") - return - } - - return -} - -// ResyncReplicationPreparer prepares the ResyncReplication request. -func (client VolumesClient) ResyncReplicationPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "poolName": autorest.Encode("path", poolName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "volumeName": autorest.Encode("path", volumeName), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/resyncReplication", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ResyncReplicationSender sends the ResyncReplication request. The method will close the -// http.Response Body if it receives an error. -func (client VolumesClient) ResyncReplicationSender(req *http.Request) (future VolumesResyncReplicationFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ResyncReplicationResponder handles the response to the ResyncReplication request. The method always -// closes the http.Response Body. -func (client VolumesClient) ResyncReplicationResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Revert revert a volume to the snapshot specified in the body -// Parameters: -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -// poolName - the name of the capacity pool -// volumeName - the name of the volume -// body - object for snapshot to revert supplied in the body of the operation. -func (client VolumesClient) Revert(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body VolumeRevert) (result VolumesRevertFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.Revert") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: poolName, - Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, - {TargetValue: volumeName, - Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.VolumesClient", "Revert", err.Error()) - } - - req, err := client.RevertPreparer(ctx, resourceGroupName, accountName, poolName, volumeName, body) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Revert", nil, "Failure preparing request") - return - } - - result, err = client.RevertSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Revert", result.Response(), "Failure sending request") - return - } - - return -} - -// RevertPreparer prepares the Revert request. -func (client VolumesClient) RevertPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body VolumeRevert) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "poolName": autorest.Encode("path", poolName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "volumeName": autorest.Encode("path", volumeName), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/revert", pathParameters), - autorest.WithJSON(body), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RevertSender sends the Revert request. The method will close the -// http.Response Body if it receives an error. -func (client VolumesClient) RevertSender(req *http.Request) (future VolumesRevertFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RevertResponder handles the response to the Revert request. The method always -// closes the http.Response Body. -func (client VolumesClient) RevertResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Update patch the specified volume -// Parameters: -// body - volume object supplied in the body of the operation. -// resourceGroupName - the name of the resource group. -// accountName - the name of the NetApp account -// poolName - the name of the capacity pool -// volumeName - the name of the volume -func (client VolumesClient) Update(ctx context.Context, body VolumePatch, resourceGroupName string, accountName string, poolName string, volumeName string) (result VolumesUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: poolName, - Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, - {TargetValue: volumeName, - Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("netapp.VolumesClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, body, resourceGroupName, accountName, poolName, volumeName) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client VolumesClient) UpdatePreparer(ctx context.Context, body VolumePatch, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "accountName": autorest.Encode("path", accountName), - "poolName": autorest.Encode("path", poolName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "volumeName": autorest.Encode("path", volumeName), - } - - const APIVersion = "2021-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - body.ID = nil - body.Name = nil - body.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}", pathParameters), - autorest.WithJSON(body), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client VolumesClient) UpdateSender(req *http.Request) (future VolumesUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client VolumesClient) UpdateResponder(resp *http.Response) (result Volume, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/CHANGELOG.md old mode 100755 new mode 100644 diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/_meta.json b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/_meta.json old mode 100755 new mode 100644 diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/accountbackups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/accountbackups.go old mode 100755 new mode 100644 diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/accounts.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/accounts.go old mode 100755 new mode 100644 diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/backuppolicies.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/backuppolicies.go old mode 100755 new mode 100644 diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/backups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/backups.go old mode 100755 new mode 100644 diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/client.go old mode 100755 new mode 100644 diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/enums.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/enums.go old mode 100755 new mode 100644 diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/models.go old mode 100755 new mode 100644 diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/operations.go old mode 100755 new mode 100644 diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/pools.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/pools.go old mode 100755 new mode 100644 diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/resource.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/resource.go old mode 100755 new mode 100644 diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/resourcequotalimits.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/resourcequotalimits.go old mode 100755 new mode 100644 diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/snapshotpolicies.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/snapshotpolicies.go old mode 100755 new mode 100644 diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/snapshots.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/snapshots.go old mode 100755 new mode 100644 diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/subvolumes.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/subvolumes.go old mode 100755 new mode 100644 diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/vaults.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/vaults.go old mode 100755 new mode 100644 diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/version.go old mode 100755 new mode 100644 diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/volumegroups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/volumegroups.go old mode 100755 new mode 100644 diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/volumes.go b/vendor/github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp/volumes.go old mode 100755 new mode 100644 diff --git a/vendor/modules.txt b/vendor/modules.txt index c646fef3412a..3847404addba 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -50,7 +50,7 @@ github.com/Azure/azure-sdk-for-go/services/mixedreality/mgmt/2021-01-01/mixedrea github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2020-10-01/insights github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2020-01-01/mysql github.com/Azure/azure-sdk-for-go/services/mysql/mgmt/2021-05-01/mysqlflexibleservers -github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-06-01/netapp +github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-05-01/network github.com/Azure/azure-sdk-for-go/services/notificationhubs/mgmt/2017-04-01/notificationhubs github.com/Azure/azure-sdk-for-go/services/operationalinsights/mgmt/2020-08-01/operationalinsights From a23fbe4bc9c555c58c8c0a7e5f6e2a9c4dd5c1bd Mon Sep 17 00:00:00 2001 From: Paulo Date: Tue, 31 May 2022 17:28:44 -0700 Subject: [PATCH 06/12] Fixing linting issues --- go.mod | 21 ++- go.sum | 160 ++++++++++++++++++ .../netapp/netapp_volume_data_source_test.go | 2 +- .../netapp/netapp_volume_resource_test.go | 18 +- 4 files changed, 190 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index 8ffe60fd0943..3d2d2f93e600 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/hashicorp/go-azure-helpers v0.31.1 github.com/hashicorp/go-multierror v1.1.1 github.com/hashicorp/go-uuid v1.0.2 - github.com/hashicorp/go-version v1.3.0 + github.com/hashicorp/go-version v1.4.0 github.com/hashicorp/terraform-plugin-sdk/v2 v2.10.1 github.com/magodo/terraform-provider-azurerm-example-gen v0.0.0-20220407025246-3a3ee0ab24a8 github.com/manicminer/hamilton v0.44.0 @@ -36,15 +36,18 @@ require ( 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 + github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 // indirect github.com/apparentlymart/go-cidr v1.1.0 // indirect github.com/apparentlymart/go-textseg v1.0.0 // indirect github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect github.com/aws/aws-sdk-go v1.38.69 // indirect github.com/dimchansky/utfbom v1.1.1 // indirect github.com/fatih/color v1.12.0 // indirect + github.com/fsnotify/fsnotify v1.4.9 // indirect github.com/golang-jwt/jwt/v4 v4.4.1 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.2 // indirect + github.com/gookit/color v1.2.6 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-checkpoint v0.5.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect @@ -54,6 +57,7 @@ require ( github.com/hashicorp/go-plugin v1.4.2 // indirect github.com/hashicorp/go-retryablehttp v0.7.0 // indirect github.com/hashicorp/hc-install v0.3.1 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect github.com/hashicorp/hcl/v2 v2.10.0 // indirect github.com/hashicorp/hcl2 v0.0.0-20191002203319-fb75b3253c80 // indirect github.com/hashicorp/logutils v1.0.0 // indirect @@ -64,7 +68,11 @@ require ( github.com/hashicorp/terraform-registry-address v0.0.0-20210412075316-9b2996cce896 // indirect github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 // indirect github.com/hashicorp/yamux v0.0.0-20210316155119-a95892c5f864 // indirect + github.com/inconshreveable/mousetrap v1.0.0 // indirect + github.com/katbyte/terrafmt v0.4.0 // indirect github.com/klauspost/compress v1.13.1 // indirect + github.com/konsorten/go-windows-terminal-sequences v1.0.3 // indirect + github.com/magiconair/properties v1.8.1 // indirect github.com/manicminer/hamilton-autorest v0.2.0 // indirect github.com/mattn/go-colorable v0.1.8 // indirect github.com/mattn/go-isatty v0.0.13 // indirect @@ -74,7 +82,16 @@ require ( github.com/mitchellh/go-wordwrap v1.0.1 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/oklog/run v1.1.0 // indirect + github.com/pelletier/go-toml v1.8.0 // indirect github.com/rickb777/plural v1.2.0 // indirect + github.com/sirupsen/logrus v1.6.0 // indirect + github.com/spf13/afero v1.4.1 // indirect + github.com/spf13/cast v1.3.1 // indirect + github.com/spf13/cobra v1.0.0 // indirect + github.com/spf13/jwalterweatherman v1.1.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/spf13/viper v1.7.0 // indirect + github.com/subosito/gotenv v1.2.0 // indirect github.com/ulikunitz/xz v0.5.10 // indirect github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect github.com/zclconf/go-cty v1.9.1 // indirect @@ -89,6 +106,8 @@ require ( google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 // indirect google.golang.org/grpc v1.39.0 // indirect google.golang.org/protobuf v1.27.1 // indirect + gopkg.in/ini.v1 v1.57.0 // indirect + gopkg.in/yaml.v2 v2.3.0 // indirect ) go 1.18 diff --git a/go.sum b/go.sum index ea334e4ef831..090c247f7cc4 100644 --- a/go.sum +++ b/go.sum @@ -30,6 +30,7 @@ cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4g cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= @@ -87,6 +88,7 @@ github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuN github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/Microsoft/go-winio v0.4.16 h1:FtSW/jqD+l4ba5iPBj9CODVtgfYAD8w2wS923g/cFDk= github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 h1:YoJbenK9C67SkzkDfmQuVln04ygHj3vjZfd9FL+GmQQ= github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo= github.com/acomagu/bufpipe v1.0.3 h1:fxAGrHZTgQ9w5QqVItgzwj235/uYZYgbXitB+dLupOk= @@ -95,6 +97,10 @@ github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo= github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= +github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/andybalholm/crlf v0.0.0-20171020200849-670099aa064f/go.mod h1:k8feO4+kXDxro6ErPXBRTJ/ro2mf0SsFG8s7doP9kJE= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= @@ -109,19 +115,26 @@ github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/ github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw= github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= +github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= github.com/aws/aws-sdk-go v1.25.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.38.69 h1:V489lmrdkIQSfF6OAGZZ1Cavcm7eczCm2JcGvX+yHRg= github.com/aws/aws-sdk-go v1.38.69/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/bsm/go-vlq v0.0.0-20150828105119-ec6e8d4f5f4e/go.mod h1:N+BjUcTjSxc2mtRGSCPsat1kze3CUtvJN3/jTXlp29k= github.com/btubbs/datetime v0.1.0 h1:183iHRjmNAokYM5D8V3wbEOOEe/HYEYpm7E2oom3vhM= github.com/btubbs/datetime v0.1.0/go.mod h1:n2BZ/2ltnRzNiz27aE3wUb2onNttQdC+WFxAoks5jJM= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= @@ -131,11 +144,20 @@ github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGX github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= +github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8= github.com/dimchansky/utfbom v1.1.1 h1:vV6w1AhK4VMnhBno/TPVCoK9U/LP0PkLCS9tbxHdi/U= github.com/dimchansky/utfbom v1.1.1/go.mod h1:SxdoEBH5qIqFocHMyGOXVAybYJdr71b1Q/j0mACtrfE= @@ -156,6 +178,8 @@ github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= @@ -169,15 +193,22 @@ github.com/go-git/go-git/v5 v5.4.2/go.mod h1:gQ1kArt6d+n+BGd+/B/I74HwRTLhth2+zti github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= 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/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 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= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -250,7 +281,17 @@ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/gookit/color v1.2.6 h1:f6/ehoHPXwi2tuntjpBRhpBhFLL9YjrnB2m6RWsbCRg= +github.com/gookit/color v1.2.6/go.mod h1:AhIE+pS6D4Ql0SQWbBeXPHw7gY0/sjHoA4s/n1KB7xg= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= +github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v0.0.0-20180715044906-d6c0cd880357/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= @@ -274,6 +315,8 @@ github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrj github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-hclog v0.16.1 h1:IVQwpTGNRRIHafnTs2dQLIk4ENtneRIEEJWOVDqz99o= github.com/hashicorp/go-hclog v0.16.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v0.0.0-20180717150148-3d5d8f294aa0/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= @@ -284,19 +327,28 @@ github.com/hashicorp/go-plugin v1.4.2 h1:yFvG3ufXXpqiMiZx9HLcaK3XbIqQ1WJFR/F1a2C github.com/hashicorp/go-plugin v1.4.2/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ38b18Udy6vYQ= github.com/hashicorp/go-retryablehttp v0.7.0 h1:eu1EI/mbirUgP5C8hVsTNaGZreBDlYiwC1FZWkvQPQ4= github.com/hashicorp/go-retryablehttp v0.7.0/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= +github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= +github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.3.0 h1:McDWVJIU/y+u1BRV06dPaLfLCaT7fUTJLp5r04x7iNw= github.com/hashicorp/go-version v1.3.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.4.0 h1:aAQzgqIrRKRa7w75CKpbBxYsmUoPjzVm1W59ca1L0J4= +github.com/hashicorp/go-version v1.4.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hc-install v0.3.1 h1:VIjllE6KyAI1A244G8kTaHXy+TL5/XYzvrtFi8po/Yk= github.com/hashicorp/hc-install v0.3.1/go.mod h1:3LCdWcCDS1gaHC9mhHCGbkYfoY6vdsKohGjugbZdZak= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl/v2 v2.3.0/go.mod h1:d+FwDBbOLvpAM3Z6J7gPj/VoAGkNe/gm352ZhjJ/Zv8= github.com/hashicorp/hcl/v2 v2.10.0 h1:1S1UnuhDGlv3gRFV4+0EdwB+znNP5HmcGbIqwnSCByg= github.com/hashicorp/hcl/v2 v2.10.0/go.mod h1:FwWsfWEjyV/CMj8s/gqAuiviY72rJ1/oayI9WftqcKg= @@ -304,6 +356,9 @@ github.com/hashicorp/hcl2 v0.0.0-20191002203319-fb75b3253c80 h1:PFfGModn55JA0oBs github.com/hashicorp/hcl2 v0.0.0-20191002203319-fb75b3253c80/go.mod h1:Cxv+IJLuBiEhQ7pBYGEuORa0nr4U994pE8mYLuFd7v0= github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hashicorp/terraform-exec v0.15.0 h1:cqjh4d8HYNQrDoEmlSGelHmg2DYDh5yayckvJ5bV18E= github.com/hashicorp/terraform-exec v0.15.0/go.mod h1:H4IG8ZxanU+NW0ZpDRNsvh9f0ul7C0nHP+rUR/CHs7I= github.com/hashicorp/terraform-json v0.13.0 h1:Li9L+lKD1FO5RVFRM1mMMIBDoUHslOniyEi5CM+FWGY= @@ -329,6 +384,8 @@ github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1: github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= 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/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= 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= @@ -340,16 +397,27 @@ github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1 h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/katbyte/terrafmt v0.4.0 h1:jC6KfIdkjKRHA44SYM3e+SomG8se4p7/AgclV0gfZjg= +github.com/katbyte/terrafmt v0.4.0/go.mod h1:Pp5wvGuCufOBz+pAPjXNNmhUAj8EEpIO9+uxbecx0Iw= github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 h1:DowS9hvgyYSX4TO5NpyC606/Z4SxnNYbT+WX27or6Ck= github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.11.2/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.13.1 h1:wXr2uRxZTJXHLly6qhJabee5JqIhTRoLBhDOA74hDEQ= github.com/klauspost/compress v1.13.1/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= 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= @@ -360,6 +428,9 @@ 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/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= +github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= 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/manicminer/hamilton v0.43.0/go.mod h1:lbVyngC+/nCWuDp8UhC6Bw+bh7jcP/E+YwqzHTmzemk= @@ -381,6 +452,9 @@ github.com/mattn/go-isatty v0.0.13 h1:qdl+GuBjcsKKDco5BsxPJlId98mSWNKqYA+Co0SC1y github.com/mattn/go-isatty v0.0.13/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/cli v1.1.2/go.mod h1:6iaV0fGdElS6dPBx0EApTxHrcWvmJphyh2n8YBLPPZ4= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= @@ -396,33 +470,59 @@ github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZX github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= +github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= +github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nsf/jsondiff v0.0.0-20200515183724-f29ed568f4ce h1:RPclfga2SEJmgMmz2k+Mg7cowZ8yv4Trqw9UsJby758= github.com/nsf/jsondiff v0.0.0-20200515183724-f29ed568f4ce/go.mod h1:uFMI8w+ref4v2r9jz+c9i1IfIttS/OkmLfrk1jne5hs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= +github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pelletier/go-toml v1.8.0 h1:Keo9qb7iRJs2voHvunFtuuYFsbWeOBh8/P9v/kVMFtw= +github.com/pelletier/go-toml v1.8.0/go.mod h1:D6yutnOGMveHEPV7VQOuvI/gXY61bv+9bAOTRnLElKs= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 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/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= 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/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rickb777/date v1.12.5-0.20200422084442-6300e543c4d9 h1:czJCcoUR3FMpHnRQow2E84H/0CPrX1fMAGn9HugzyI4= github.com/rickb777/date v1.12.5-0.20200422084442-6300e543c4d9/go.mod h1:L8WrssTzvgYw34/Ppa0JpJfI7KKXZ2cVGI6Djt0brUU= github.com/rickb777/plural v1.2.0 h1:5tvEc7UBCZ7l8h/2UeybSkt/uu1DQsZFOFdNevmUhlE= github.com/rickb777/plural v1.2.0/go.mod h1:UdpyWFCGbo3mvK3f/PfZOAOrkjzJlYN/sD46XNWJ+Es= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/sebdah/goldie v1.0.0/go.mod h1:jXP4hmWywNEwZzhMuv2ccnqTSFpuq8iyQhtQdkkZBH4= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= @@ -430,8 +530,33 @@ github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= +github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/afero v1.4.1 h1:asw9sl74539yqavKaglDM5hFpdJVK0Y5Dr/JOgQ89nQ= +github.com/spf13/afero v1.4.1/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= +github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= +github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v1.0.0 h1:6m/oheQuQ13N9ks4hubMG6BnvwOeaJrqSPLahSnczz8= +github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= +github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= +github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= +github.com/spf13/viper v1.7.0 h1:xVKxvI7ouOI5I+U9s2eeiUfMaWBVoXA3AWskkrqK0VM= +github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= @@ -441,8 +566,12 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= +github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tombuildsstuff/giovanni v0.20.0 h1:IM/I/iNWMXnPYwcSq8uxV7TKDlv7Nejq0bRK9i6O/C0= github.com/tombuildsstuff/giovanni v0.20.0/go.mod h1:66KVLYma2whJhEdxPSPL3GQHkulhK+C5CluKfHGfPF4= +github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/ulikunitz/xz v0.5.10 h1:t92gobL9l3HE202wg3rlk19F6X+JOxl9BBrCCMYEYd8= github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= @@ -453,6 +582,8 @@ github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+ 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/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -466,6 +597,7 @@ github.com/zclconf/go-cty v1.8.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUA github.com/zclconf/go-cty v1.9.1 h1:viqrgQwFl5UpSxc046qblj78wZXVDFnSOufaOTER+cc= github.com/zclconf/go-cty v1.9.1/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= +go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -475,11 +607,17 @@ go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -534,6 +672,10 @@ golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -541,6 +683,7 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190502183928-7f726cade0ab/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -599,13 +742,18 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -614,6 +762,7 @@ golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -666,12 +815,14 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= @@ -681,6 +832,7 @@ golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -810,6 +962,7 @@ google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151/go.mod h1:yiaVoXHp google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= @@ -848,6 +1001,7 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 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= @@ -857,14 +1011,20 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EV gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.57.0 h1:9unxIsFcTt4I55uWluz+UmL95q4kdJ0buvQ1ZIqVQww= +gopkg.in/ini.v1 v1.57.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= 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.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= 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= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0 h1:hjy8E9ON/egN1tAYqKb61G10WtihqetD4sz2H+8nIeA= diff --git a/internal/services/netapp/netapp_volume_data_source_test.go b/internal/services/netapp/netapp_volume_data_source_test.go index ee50c354b6bd..70b6ba47b9a9 100644 --- a/internal/services/netapp/netapp_volume_data_source_test.go +++ b/internal/services/netapp/netapp_volume_data_source_test.go @@ -38,7 +38,7 @@ provider "azurerm" { alias = "all" features { resource_group { - prevent_deletion_if_contains_resources = false + prevent_deletion_if_contains_resources = false } } } diff --git a/internal/services/netapp/netapp_volume_resource_test.go b/internal/services/netapp/netapp_volume_resource_test.go index dc23140d5ede..dcd65b6c3d3f 100644 --- a/internal/services/netapp/netapp_volume_resource_test.go +++ b/internal/services/netapp/netapp_volume_resource_test.go @@ -488,7 +488,7 @@ resource "azurerm_netapp_volume" "test" { protocols_enabled = ["NFSv3"] unix_read_only = false unix_read_write = true - }, + } tags = { "SkipASMAzSecPack" = "true" @@ -626,7 +626,7 @@ resource "azurerm_netapp_volume" "test" { } tags = { - "FoO" = "BaR", + "FoO" = "BaR", "SkipASMAzSecPack" = "true" } } @@ -675,7 +675,7 @@ resource "azurerm_netapp_volume" "test" { } tags = { - "FoO" = "BaR", + "FoO" = "BaR", "SkipASMAzSecPack" = "true" } } @@ -716,8 +716,8 @@ resource "azurerm_netapp_volume" "test" { } tags = { - "FoO" = "BaR", - "bAr" = "fOo", + "FoO" = "BaR", + "bAr" = "fOo", "SkipASMAzSecPack" = "true" } } @@ -801,7 +801,7 @@ resource "azurerm_netapp_volume" "test" { } tags = { - "FoO" = "BaR", + "FoO" = "BaR", "SkipASMAzSecPack" = "true" } } @@ -939,7 +939,7 @@ provider "azurerm" { alias = "all2" features { resource_group { - prevent_deletion_if_contains_resources = false + prevent_deletion_if_contains_resources = false } } } @@ -947,7 +947,7 @@ provider "azurerm" { resource "azurerm_resource_group" "test" { name = "acctestRG-netapp-%d" location = "%s" - + tags = { "SkipASMAzSecPack" = "true" } @@ -959,7 +959,7 @@ resource "azurerm_network_security_group" "test" { resource_group_name = azurerm_resource_group.test.name tags = { - environment = "Production", + environment = "Production", "SkipASMAzSecPack" = "true" } } From b1b11e775d3703deffb6b3a996de9b25fadebda3 Mon Sep 17 00:00:00 2001 From: Paulo Date: Tue, 31 May 2022 17:32:39 -0700 Subject: [PATCH 07/12] Fixing vendor folder again --- .../hashicorp/go-version/CHANGELOG.md | 7 ++ .../hashicorp/go-version/constraint.go | 108 ++++++++++++++++-- .../hashicorp/go-version/version.go | 6 +- vendor/modules.txt | 40 ++++++- 4 files changed, 145 insertions(+), 16 deletions(-) diff --git a/vendor/github.com/hashicorp/go-version/CHANGELOG.md b/vendor/github.com/hashicorp/go-version/CHANGELOG.md index dbae7f7be9c7..2020c4727432 100644 --- a/vendor/github.com/hashicorp/go-version/CHANGELOG.md +++ b/vendor/github.com/hashicorp/go-version/CHANGELOG.md @@ -1,3 +1,10 @@ +# 1.4.0 (January 5, 2021) + +FEATURES: + + - Introduce `MustConstraints()` ([#87](https://github.com/hashicorp/go-version/pull/87)) + - `Constraints`: Introduce `Equals()` and `sort.Interface` methods ([#88](https://github.com/hashicorp/go-version/pull/88)) + # 1.3.0 (March 31, 2021) Please note that CHANGELOG.md does not exist in the source code prior to this release. diff --git a/vendor/github.com/hashicorp/go-version/constraint.go b/vendor/github.com/hashicorp/go-version/constraint.go index d055759611c8..1d8809028109 100644 --- a/vendor/github.com/hashicorp/go-version/constraint.go +++ b/vendor/github.com/hashicorp/go-version/constraint.go @@ -4,6 +4,7 @@ import ( "fmt" "reflect" "regexp" + "sort" "strings" ) @@ -11,30 +12,40 @@ import ( // ">= 1.0". type Constraint struct { f constraintFunc + op operator check *Version original string } +func (c *Constraint) Equals(con *Constraint) bool { + return c.op == con.op && c.check.Equal(con.check) +} + // Constraints is a slice of constraints. We make a custom type so that // we can add methods to it. type Constraints []*Constraint type constraintFunc func(v, c *Version) bool -var constraintOperators map[string]constraintFunc +var constraintOperators map[string]constraintOperation + +type constraintOperation struct { + op operator + f constraintFunc +} var constraintRegexp *regexp.Regexp func init() { - constraintOperators = map[string]constraintFunc{ - "": constraintEqual, - "=": constraintEqual, - "!=": constraintNotEqual, - ">": constraintGreaterThan, - "<": constraintLessThan, - ">=": constraintGreaterThanEqual, - "<=": constraintLessThanEqual, - "~>": constraintPessimistic, + constraintOperators = map[string]constraintOperation{ + "": {op: equal, f: constraintEqual}, + "=": {op: equal, f: constraintEqual}, + "!=": {op: notEqual, f: constraintNotEqual}, + ">": {op: greaterThan, f: constraintGreaterThan}, + "<": {op: lessThan, f: constraintLessThan}, + ">=": {op: greaterThanEqual, f: constraintGreaterThanEqual}, + "<=": {op: lessThanEqual, f: constraintLessThanEqual}, + "~>": {op: pessimistic, f: constraintPessimistic}, } ops := make([]string, 0, len(constraintOperators)) @@ -66,6 +77,16 @@ func NewConstraint(v string) (Constraints, error) { return Constraints(result), nil } +// MustConstraints is a helper that wraps a call to a function +// returning (Constraints, error) and panics if error is non-nil. +func MustConstraints(c Constraints, err error) Constraints { + if err != nil { + panic(err) + } + + return c +} + // Check tests if a version satisfies all the constraints. func (cs Constraints) Check(v *Version) bool { for _, c := range cs { @@ -77,6 +98,56 @@ func (cs Constraints) Check(v *Version) bool { return true } +// Equals compares Constraints with other Constraints +// for equality. This may not represent logical equivalence +// of compared constraints. +// e.g. even though '>0.1,>0.2' is logically equivalent +// to '>0.2' it is *NOT* treated as equal. +// +// Missing operator is treated as equal to '=', whitespaces +// are ignored and constraints are sorted before comaparison. +func (cs Constraints) Equals(c Constraints) bool { + if len(cs) != len(c) { + return false + } + + // make copies to retain order of the original slices + left := make(Constraints, len(cs)) + copy(left, cs) + sort.Stable(left) + right := make(Constraints, len(c)) + copy(right, c) + sort.Stable(right) + + // compare sorted slices + for i, con := range left { + if !con.Equals(right[i]) { + return false + } + } + + return true +} + +func (cs Constraints) Len() int { + return len(cs) +} + +func (cs Constraints) Less(i, j int) bool { + if cs[i].op < cs[j].op { + return true + } + if cs[i].op > cs[j].op { + return false + } + + return cs[i].check.LessThan(cs[j].check) +} + +func (cs Constraints) Swap(i, j int) { + cs[i], cs[j] = cs[j], cs[i] +} + // Returns the string format of the constraints func (cs Constraints) String() string { csStr := make([]string, len(cs)) @@ -107,8 +178,11 @@ func parseSingle(v string) (*Constraint, error) { return nil, err } + cop := constraintOperators[matches[1]] + return &Constraint{ - f: constraintOperators[matches[1]], + f: cop.f, + op: cop.op, check: check, original: v, }, nil @@ -138,6 +212,18 @@ func prereleaseCheck(v, c *Version) bool { // Constraint functions //------------------------------------------------------------------- +type operator rune + +const ( + equal operator = '=' + notEqual operator = '≠' + greaterThan operator = '>' + lessThan operator = '<' + greaterThanEqual operator = '≥' + lessThanEqual operator = '≤' + pessimistic operator = '~' +) + func constraintEqual(v, c *Version) bool { return v.Equal(c) } diff --git a/vendor/github.com/hashicorp/go-version/version.go b/vendor/github.com/hashicorp/go-version/version.go index 8068834ec843..116a74466db4 100644 --- a/vendor/github.com/hashicorp/go-version/version.go +++ b/vendor/github.com/hashicorp/go-version/version.go @@ -64,7 +64,6 @@ func newVersion(v string, pattern *regexp.Regexp) (*Version, error) { } segmentsStr := strings.Split(matches[1], ".") segments := make([]int64, len(segmentsStr)) - si := 0 for i, str := range segmentsStr { val, err := strconv.ParseInt(str, 10, 64) if err != nil { @@ -72,8 +71,7 @@ func newVersion(v string, pattern *regexp.Regexp) (*Version, error) { "Error parsing version: %s", err) } - segments[i] = int64(val) - si++ + segments[i] = val } // Even though we could support more than three segments, if we @@ -92,7 +90,7 @@ func newVersion(v string, pattern *regexp.Regexp) (*Version, error) { metadata: matches[10], pre: pre, segments: segments, - si: si, + si: len(segmentsStr), original: v, }, nil } diff --git a/vendor/modules.txt b/vendor/modules.txt index 31a7424a93e9..2969fcf249b9 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -140,6 +140,8 @@ github.com/Azure/go-autorest/tracing # github.com/agext/levenshtein v1.2.3 ## explicit github.com/agext/levenshtein +# github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 +## explicit # github.com/apparentlymart/go-cidr v1.1.0 ## explicit github.com/apparentlymart/go-cidr/cidr @@ -163,6 +165,8 @@ github.com/dimchansky/utfbom # github.com/fatih/color v1.12.0 ## explicit; go 1.13 github.com/fatih/color +# github.com/fsnotify/fsnotify v1.4.9 +## explicit; go 1.13 # github.com/gofrs/uuid v4.0.0+incompatible ## explicit github.com/gofrs/uuid @@ -190,6 +194,8 @@ github.com/google/go-cmp/cmp/internal/value # github.com/google/uuid v1.1.2 ## explicit github.com/google/uuid +# github.com/gookit/color v1.2.6 +## explicit; go 1.11 # github.com/hashicorp/errwrap v1.1.0 ## explicit github.com/hashicorp/errwrap @@ -244,7 +250,7 @@ github.com/hashicorp/go-retryablehttp # github.com/hashicorp/go-uuid v1.0.2 ## explicit github.com/hashicorp/go-uuid -# github.com/hashicorp/go-version v1.3.0 +# github.com/hashicorp/go-version v1.4.0 ## explicit github.com/hashicorp/go-version # github.com/hashicorp/hc-install v0.3.1 @@ -263,6 +269,8 @@ github.com/hashicorp/hc-install/internal/version github.com/hashicorp/hc-install/product github.com/hashicorp/hc-install/releases github.com/hashicorp/hc-install/src +# github.com/hashicorp/hcl v1.0.0 +## explicit # github.com/hashicorp/hcl/v2 v2.10.0 ## explicit; go 1.12 github.com/hashicorp/hcl/v2 @@ -331,8 +339,16 @@ github.com/hashicorp/terraform-svchost # github.com/hashicorp/yamux v0.0.0-20210316155119-a95892c5f864 ## explicit; go 1.15 github.com/hashicorp/yamux +# github.com/inconshreveable/mousetrap v1.0.0 +## explicit +# github.com/katbyte/terrafmt v0.4.0 +## explicit; go 1.18 # github.com/klauspost/compress v1.13.1 ## explicit; go 1.13 +# github.com/konsorten/go-windows-terminal-sequences v1.0.3 +## explicit +# github.com/magiconair/properties v1.8.1 +## explicit # github.com/magodo/terraform-provider-azurerm-example-gen v0.0.0-20220407025246-3a3ee0ab24a8 ## explicit; go 1.16 github.com/magodo/terraform-provider-azurerm-example-gen/examplegen @@ -375,6 +391,8 @@ github.com/mitchellh/reflectwalk # github.com/oklog/run v1.1.0 ## explicit; go 1.13 github.com/oklog/run +# github.com/pelletier/go-toml v1.8.0 +## explicit; go 1.12 # github.com/rickb777/date v1.12.5-0.20200422084442-6300e543c4d9 ## explicit; go 1.13 github.com/rickb777/date/period @@ -387,6 +405,22 @@ github.com/sergi/go-diff/diffmatchpatch # github.com/shopspring/decimal v1.2.0 ## explicit; go 1.13 github.com/shopspring/decimal +# github.com/sirupsen/logrus v1.6.0 +## explicit; go 1.13 +# github.com/spf13/afero v1.4.1 +## explicit; go 1.13 +# github.com/spf13/cast v1.3.1 +## explicit +# github.com/spf13/cobra v1.0.0 +## explicit; go 1.12 +# github.com/spf13/jwalterweatherman v1.1.0 +## explicit +# github.com/spf13/pflag v1.0.5 +## explicit; go 1.12 +# github.com/spf13/viper v1.7.0 +## explicit; go 1.12 +# github.com/subosito/gotenv v1.2.0 +## explicit # github.com/tombuildsstuff/giovanni v0.20.0 ## explicit; go 1.13 github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts @@ -595,6 +629,10 @@ google.golang.org/protobuf/types/known/anypb google.golang.org/protobuf/types/known/durationpb google.golang.org/protobuf/types/known/emptypb google.golang.org/protobuf/types/known/timestamppb +# gopkg.in/ini.v1 v1.57.0 +## explicit +# gopkg.in/yaml.v2 v2.3.0 +## explicit # gopkg.in/yaml.v3 v3.0.0 ## explicit gopkg.in/yaml.v3 From 8e0e6c66844962348701920d7f87aa383d9c4b1a Mon Sep 17 00:00:00 2001 From: Paulo Date: Tue, 31 May 2022 17:37:52 -0700 Subject: [PATCH 08/12] Executing go mod tidy --- go.mod | 19 ------- go.sum | 159 --------------------------------------------------------- 2 files changed, 178 deletions(-) diff --git a/go.mod b/go.mod index 3d2d2f93e600..6296471fa127 100644 --- a/go.mod +++ b/go.mod @@ -36,18 +36,15 @@ require ( 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 - github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 // indirect github.com/apparentlymart/go-cidr v1.1.0 // indirect github.com/apparentlymart/go-textseg v1.0.0 // indirect github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect github.com/aws/aws-sdk-go v1.38.69 // indirect github.com/dimchansky/utfbom v1.1.1 // indirect github.com/fatih/color v1.12.0 // indirect - github.com/fsnotify/fsnotify v1.4.9 // indirect github.com/golang-jwt/jwt/v4 v4.4.1 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.2 // indirect - github.com/gookit/color v1.2.6 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-checkpoint v0.5.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect @@ -57,7 +54,6 @@ require ( github.com/hashicorp/go-plugin v1.4.2 // indirect github.com/hashicorp/go-retryablehttp v0.7.0 // indirect github.com/hashicorp/hc-install v0.3.1 // indirect - github.com/hashicorp/hcl v1.0.0 // indirect github.com/hashicorp/hcl/v2 v2.10.0 // indirect github.com/hashicorp/hcl2 v0.0.0-20191002203319-fb75b3253c80 // indirect github.com/hashicorp/logutils v1.0.0 // indirect @@ -68,11 +64,7 @@ require ( github.com/hashicorp/terraform-registry-address v0.0.0-20210412075316-9b2996cce896 // indirect github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 // indirect github.com/hashicorp/yamux v0.0.0-20210316155119-a95892c5f864 // indirect - github.com/inconshreveable/mousetrap v1.0.0 // indirect - github.com/katbyte/terrafmt v0.4.0 // indirect github.com/klauspost/compress v1.13.1 // indirect - github.com/konsorten/go-windows-terminal-sequences v1.0.3 // indirect - github.com/magiconair/properties v1.8.1 // indirect github.com/manicminer/hamilton-autorest v0.2.0 // indirect github.com/mattn/go-colorable v0.1.8 // indirect github.com/mattn/go-isatty v0.0.13 // indirect @@ -82,16 +74,7 @@ require ( github.com/mitchellh/go-wordwrap v1.0.1 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/oklog/run v1.1.0 // indirect - github.com/pelletier/go-toml v1.8.0 // indirect github.com/rickb777/plural v1.2.0 // indirect - github.com/sirupsen/logrus v1.6.0 // indirect - github.com/spf13/afero v1.4.1 // indirect - github.com/spf13/cast v1.3.1 // indirect - github.com/spf13/cobra v1.0.0 // indirect - github.com/spf13/jwalterweatherman v1.1.0 // indirect - github.com/spf13/pflag v1.0.5 // indirect - github.com/spf13/viper v1.7.0 // indirect - github.com/subosito/gotenv v1.2.0 // indirect github.com/ulikunitz/xz v0.5.10 // indirect github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect github.com/zclconf/go-cty v1.9.1 // indirect @@ -106,8 +89,6 @@ require ( google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151 // indirect google.golang.org/grpc v1.39.0 // indirect google.golang.org/protobuf v1.27.1 // indirect - gopkg.in/ini.v1 v1.57.0 // indirect - gopkg.in/yaml.v2 v2.3.0 // indirect ) go 1.18 diff --git a/go.sum b/go.sum index 090c247f7cc4..32acc3ec31ab 100644 --- a/go.sum +++ b/go.sum @@ -30,7 +30,6 @@ cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4g cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= @@ -88,7 +87,6 @@ github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuN github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/Microsoft/go-winio v0.4.16 h1:FtSW/jqD+l4ba5iPBj9CODVtgfYAD8w2wS923g/cFDk= github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 h1:YoJbenK9C67SkzkDfmQuVln04ygHj3vjZfd9FL+GmQQ= github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo= github.com/acomagu/bufpipe v1.0.3 h1:fxAGrHZTgQ9w5QqVItgzwj235/uYZYgbXitB+dLupOk= @@ -97,10 +95,6 @@ github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo= github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= -github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/andybalholm/crlf v0.0.0-20171020200849-670099aa064f/go.mod h1:k8feO4+kXDxro6ErPXBRTJ/ro2mf0SsFG8s7doP9kJE= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= @@ -115,26 +109,19 @@ github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/ github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw= github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo= -github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= github.com/aws/aws-sdk-go v1.25.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.38.69 h1:V489lmrdkIQSfF6OAGZZ1Cavcm7eczCm2JcGvX+yHRg= github.com/aws/aws-sdk-go v1.38.69/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/bsm/go-vlq v0.0.0-20150828105119-ec6e8d4f5f4e/go.mod h1:N+BjUcTjSxc2mtRGSCPsat1kze3CUtvJN3/jTXlp29k= github.com/btubbs/datetime v0.1.0 h1:183iHRjmNAokYM5D8V3wbEOOEe/HYEYpm7E2oom3vhM= github.com/btubbs/datetime v0.1.0/go.mod h1:n2BZ/2ltnRzNiz27aE3wUb2onNttQdC+WFxAoks5jJM= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= @@ -144,20 +131,11 @@ github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGX github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8= github.com/dimchansky/utfbom v1.1.1 h1:vV6w1AhK4VMnhBno/TPVCoK9U/LP0PkLCS9tbxHdi/U= github.com/dimchansky/utfbom v1.1.1/go.mod h1:SxdoEBH5qIqFocHMyGOXVAybYJdr71b1Q/j0mACtrfE= @@ -178,8 +156,6 @@ github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= -github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= @@ -193,22 +169,15 @@ github.com/go-git/go-git/v5 v5.4.2/go.mod h1:gQ1kArt6d+n+BGd+/B/I74HwRTLhth2+zti github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= 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/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 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= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -281,17 +250,7 @@ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/gookit/color v1.2.6 h1:f6/ehoHPXwi2tuntjpBRhpBhFLL9YjrnB2m6RWsbCRg= -github.com/gookit/color v1.2.6/go.mod h1:AhIE+pS6D4Ql0SQWbBeXPHw7gY0/sjHoA4s/n1KB7xg= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= -github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v0.0.0-20180715044906-d6c0cd880357/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= @@ -315,8 +274,6 @@ github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrj github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-hclog v0.16.1 h1:IVQwpTGNRRIHafnTs2dQLIk4ENtneRIEEJWOVDqz99o= github.com/hashicorp/go-hclog v0.16.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v0.0.0-20180717150148-3d5d8f294aa0/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= @@ -327,28 +284,20 @@ github.com/hashicorp/go-plugin v1.4.2 h1:yFvG3ufXXpqiMiZx9HLcaK3XbIqQ1WJFR/F1a2C github.com/hashicorp/go-plugin v1.4.2/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ38b18Udy6vYQ= github.com/hashicorp/go-retryablehttp v0.7.0 h1:eu1EI/mbirUgP5C8hVsTNaGZreBDlYiwC1FZWkvQPQ4= github.com/hashicorp/go-retryablehttp v0.7.0/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= -github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= -github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go-version v1.3.0 h1:McDWVJIU/y+u1BRV06dPaLfLCaT7fUTJLp5r04x7iNw= github.com/hashicorp/go-version v1.3.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.4.0 h1:aAQzgqIrRKRa7w75CKpbBxYsmUoPjzVm1W59ca1L0J4= github.com/hashicorp/go-version v1.4.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hc-install v0.3.1 h1:VIjllE6KyAI1A244G8kTaHXy+TL5/XYzvrtFi8po/Yk= github.com/hashicorp/hc-install v0.3.1/go.mod h1:3LCdWcCDS1gaHC9mhHCGbkYfoY6vdsKohGjugbZdZak= -github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl/v2 v2.3.0/go.mod h1:d+FwDBbOLvpAM3Z6J7gPj/VoAGkNe/gm352ZhjJ/Zv8= github.com/hashicorp/hcl/v2 v2.10.0 h1:1S1UnuhDGlv3gRFV4+0EdwB+znNP5HmcGbIqwnSCByg= github.com/hashicorp/hcl/v2 v2.10.0/go.mod h1:FwWsfWEjyV/CMj8s/gqAuiviY72rJ1/oayI9WftqcKg= @@ -356,9 +305,6 @@ github.com/hashicorp/hcl2 v0.0.0-20191002203319-fb75b3253c80 h1:PFfGModn55JA0oBs github.com/hashicorp/hcl2 v0.0.0-20191002203319-fb75b3253c80/go.mod h1:Cxv+IJLuBiEhQ7pBYGEuORa0nr4U994pE8mYLuFd7v0= github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= -github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hashicorp/terraform-exec v0.15.0 h1:cqjh4d8HYNQrDoEmlSGelHmg2DYDh5yayckvJ5bV18E= github.com/hashicorp/terraform-exec v0.15.0/go.mod h1:H4IG8ZxanU+NW0ZpDRNsvh9f0ul7C0nHP+rUR/CHs7I= github.com/hashicorp/terraform-json v0.13.0 h1:Li9L+lKD1FO5RVFRM1mMMIBDoUHslOniyEi5CM+FWGY= @@ -384,8 +330,6 @@ github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1: github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= 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/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= 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= @@ -397,27 +341,16 @@ github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= -github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1 h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/katbyte/terrafmt v0.4.0 h1:jC6KfIdkjKRHA44SYM3e+SomG8se4p7/AgclV0gfZjg= -github.com/katbyte/terrafmt v0.4.0/go.mod h1:Pp5wvGuCufOBz+pAPjXNNmhUAj8EEpIO9+uxbecx0Iw= github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 h1:DowS9hvgyYSX4TO5NpyC606/Z4SxnNYbT+WX27or6Ck= github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.11.2/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.13.1 h1:wXr2uRxZTJXHLly6qhJabee5JqIhTRoLBhDOA74hDEQ= github.com/klauspost/compress v1.13.1/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= 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= @@ -428,9 +361,6 @@ 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/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= -github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= 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/manicminer/hamilton v0.43.0/go.mod h1:lbVyngC+/nCWuDp8UhC6Bw+bh7jcP/E+YwqzHTmzemk= @@ -452,9 +382,6 @@ github.com/mattn/go-isatty v0.0.13 h1:qdl+GuBjcsKKDco5BsxPJlId98mSWNKqYA+Co0SC1y github.com/mattn/go-isatty v0.0.13/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/cli v1.1.2/go.mod h1:6iaV0fGdElS6dPBx0EApTxHrcWvmJphyh2n8YBLPPZ4= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= @@ -470,59 +397,33 @@ github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZX github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= -github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= -github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= -github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nsf/jsondiff v0.0.0-20200515183724-f29ed568f4ce h1:RPclfga2SEJmgMmz2k+Mg7cowZ8yv4Trqw9UsJby758= github.com/nsf/jsondiff v0.0.0-20200515183724-f29ed568f4ce/go.mod h1:uFMI8w+ref4v2r9jz+c9i1IfIttS/OkmLfrk1jne5hs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml v1.8.0 h1:Keo9qb7iRJs2voHvunFtuuYFsbWeOBh8/P9v/kVMFtw= -github.com/pelletier/go-toml v1.8.0/go.mod h1:D6yutnOGMveHEPV7VQOuvI/gXY61bv+9bAOTRnLElKs= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 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/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= 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/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rickb777/date v1.12.5-0.20200422084442-6300e543c4d9 h1:czJCcoUR3FMpHnRQow2E84H/0CPrX1fMAGn9HugzyI4= github.com/rickb777/date v1.12.5-0.20200422084442-6300e543c4d9/go.mod h1:L8WrssTzvgYw34/Ppa0JpJfI7KKXZ2cVGI6Djt0brUU= github.com/rickb777/plural v1.2.0 h1:5tvEc7UBCZ7l8h/2UeybSkt/uu1DQsZFOFdNevmUhlE= github.com/rickb777/plural v1.2.0/go.mod h1:UdpyWFCGbo3mvK3f/PfZOAOrkjzJlYN/sD46XNWJ+Es= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/sebdah/goldie v1.0.0/go.mod h1:jXP4hmWywNEwZzhMuv2ccnqTSFpuq8iyQhtQdkkZBH4= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= @@ -530,33 +431,8 @@ github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= -github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.4.1 h1:asw9sl74539yqavKaglDM5hFpdJVK0Y5Dr/JOgQ89nQ= -github.com/spf13/afero v1.4.1/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= -github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v1.0.0 h1:6m/oheQuQ13N9ks4hubMG6BnvwOeaJrqSPLahSnczz8= -github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= -github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= -github.com/spf13/viper v1.7.0 h1:xVKxvI7ouOI5I+U9s2eeiUfMaWBVoXA3AWskkrqK0VM= -github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= @@ -566,12 +442,8 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= -github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tombuildsstuff/giovanni v0.20.0 h1:IM/I/iNWMXnPYwcSq8uxV7TKDlv7Nejq0bRK9i6O/C0= github.com/tombuildsstuff/giovanni v0.20.0/go.mod h1:66KVLYma2whJhEdxPSPL3GQHkulhK+C5CluKfHGfPF4= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/ulikunitz/xz v0.5.10 h1:t92gobL9l3HE202wg3rlk19F6X+JOxl9BBrCCMYEYd8= github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= @@ -582,8 +454,6 @@ github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+ 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/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -597,7 +467,6 @@ github.com/zclconf/go-cty v1.8.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUA github.com/zclconf/go-cty v1.9.1 h1:viqrgQwFl5UpSxc046qblj78wZXVDFnSOufaOTER+cc= github.com/zclconf/go-cty v1.9.1/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= -go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -607,17 +476,11 @@ go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -672,10 +535,6 @@ golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -683,7 +542,6 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190502183928-7f726cade0ab/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -742,18 +600,13 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -762,7 +615,6 @@ golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -815,14 +667,12 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= @@ -832,7 +682,6 @@ golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -962,7 +811,6 @@ google.golang.org/genproto v0.0.0-20210629200056-84d6f6074151/go.mod h1:yiaVoXHp google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= @@ -1001,7 +849,6 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 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= @@ -1011,20 +858,14 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EV gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.57.0 h1:9unxIsFcTt4I55uWluz+UmL95q4kdJ0buvQ1ZIqVQww= -gopkg.in/ini.v1 v1.57.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= 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.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= 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= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0 h1:hjy8E9ON/egN1tAYqKb61G10WtihqetD4sz2H+8nIeA= From 823cbcd7d205bc4889fc3c4bfa8b321714bcb73c Mon Sep 17 00:00:00 2001 From: Paulo Date: Tue, 31 May 2022 17:45:24 -0700 Subject: [PATCH 09/12] go mod vendor execution --- vendor/modules.txt | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/vendor/modules.txt b/vendor/modules.txt index 2969fcf249b9..1f9e11a994e8 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -140,8 +140,6 @@ github.com/Azure/go-autorest/tracing # github.com/agext/levenshtein v1.2.3 ## explicit github.com/agext/levenshtein -# github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 -## explicit # github.com/apparentlymart/go-cidr v1.1.0 ## explicit github.com/apparentlymart/go-cidr/cidr @@ -165,8 +163,6 @@ github.com/dimchansky/utfbom # github.com/fatih/color v1.12.0 ## explicit; go 1.13 github.com/fatih/color -# github.com/fsnotify/fsnotify v1.4.9 -## explicit; go 1.13 # github.com/gofrs/uuid v4.0.0+incompatible ## explicit github.com/gofrs/uuid @@ -194,8 +190,6 @@ github.com/google/go-cmp/cmp/internal/value # github.com/google/uuid v1.1.2 ## explicit github.com/google/uuid -# github.com/gookit/color v1.2.6 -## explicit; go 1.11 # github.com/hashicorp/errwrap v1.1.0 ## explicit github.com/hashicorp/errwrap @@ -269,8 +263,6 @@ github.com/hashicorp/hc-install/internal/version github.com/hashicorp/hc-install/product github.com/hashicorp/hc-install/releases github.com/hashicorp/hc-install/src -# github.com/hashicorp/hcl v1.0.0 -## explicit # github.com/hashicorp/hcl/v2 v2.10.0 ## explicit; go 1.12 github.com/hashicorp/hcl/v2 @@ -339,16 +331,8 @@ github.com/hashicorp/terraform-svchost # github.com/hashicorp/yamux v0.0.0-20210316155119-a95892c5f864 ## explicit; go 1.15 github.com/hashicorp/yamux -# github.com/inconshreveable/mousetrap v1.0.0 -## explicit -# github.com/katbyte/terrafmt v0.4.0 -## explicit; go 1.18 # github.com/klauspost/compress v1.13.1 ## explicit; go 1.13 -# github.com/konsorten/go-windows-terminal-sequences v1.0.3 -## explicit -# github.com/magiconair/properties v1.8.1 -## explicit # github.com/magodo/terraform-provider-azurerm-example-gen v0.0.0-20220407025246-3a3ee0ab24a8 ## explicit; go 1.16 github.com/magodo/terraform-provider-azurerm-example-gen/examplegen @@ -391,8 +375,6 @@ github.com/mitchellh/reflectwalk # github.com/oklog/run v1.1.0 ## explicit; go 1.13 github.com/oklog/run -# github.com/pelletier/go-toml v1.8.0 -## explicit; go 1.12 # github.com/rickb777/date v1.12.5-0.20200422084442-6300e543c4d9 ## explicit; go 1.13 github.com/rickb777/date/period @@ -405,22 +387,6 @@ github.com/sergi/go-diff/diffmatchpatch # github.com/shopspring/decimal v1.2.0 ## explicit; go 1.13 github.com/shopspring/decimal -# github.com/sirupsen/logrus v1.6.0 -## explicit; go 1.13 -# github.com/spf13/afero v1.4.1 -## explicit; go 1.13 -# github.com/spf13/cast v1.3.1 -## explicit -# github.com/spf13/cobra v1.0.0 -## explicit; go 1.12 -# github.com/spf13/jwalterweatherman v1.1.0 -## explicit -# github.com/spf13/pflag v1.0.5 -## explicit; go 1.12 -# github.com/spf13/viper v1.7.0 -## explicit; go 1.12 -# github.com/subosito/gotenv v1.2.0 -## explicit # github.com/tombuildsstuff/giovanni v0.20.0 ## explicit; go 1.13 github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/accounts @@ -629,10 +595,6 @@ google.golang.org/protobuf/types/known/anypb google.golang.org/protobuf/types/known/durationpb google.golang.org/protobuf/types/known/emptypb google.golang.org/protobuf/types/known/timestamppb -# gopkg.in/ini.v1 v1.57.0 -## explicit -# gopkg.in/yaml.v2 v2.3.0 -## explicit # gopkg.in/yaml.v3 v3.0.0 ## explicit gopkg.in/yaml.v3 From d0452c24acaf7b6fcd29392606f0d82235af0c03 Mon Sep 17 00:00:00 2001 From: Paulo Date: Wed, 1 Jun 2022 11:01:17 -0700 Subject: [PATCH 10/12] removing data source property set --- .../services/netapp/netapp_snapshot_policy_data_source_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/services/netapp/netapp_snapshot_policy_data_source_test.go b/internal/services/netapp/netapp_snapshot_policy_data_source_test.go index c86e8c1e2370..40b36d5c167e 100644 --- a/internal/services/netapp/netapp_snapshot_policy_data_source_test.go +++ b/internal/services/netapp/netapp_snapshot_policy_data_source_test.go @@ -35,7 +35,6 @@ data "azurerm_netapp_snapshot_policy" "test" { name = azurerm_netapp_snapshot_policy.test.name resource_group_name = azurerm_netapp_snapshot_policy.test.resource_group_name account_name = azurerm_netapp_snapshot_policy.test.account_name - enabled = azurerm_netapp_snapshot_policy.test.enabled } `, NetAppSnapshotPolicyResource{}.basic(data)) } From 111d89ab187073e0f568007056dea0dfb1c13327 Mon Sep 17 00:00:00 2001 From: Paulo Date: Wed, 1 Jun 2022 12:23:13 -0700 Subject: [PATCH 11/12] Changing CRR pair region --- internal/services/netapp/netapp_volume_resource_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/services/netapp/netapp_volume_resource_test.go b/internal/services/netapp/netapp_volume_resource_test.go index dcd65b6c3d3f..dd2ee3bb8c4d 100644 --- a/internal/services/netapp/netapp_volume_resource_test.go +++ b/internal/services/netapp/netapp_volume_resource_test.go @@ -461,7 +461,7 @@ resource "azurerm_netapp_volume" "test_secondary" { "SkipASMAzSecPack" = "true" } } -`, template, data.RandomInteger, "germanywestcentral") +`, template, data.RandomInteger, data.Locations.Secondary) } func (NetAppVolumeResource) nfsv3FromSnapshot(data acceptance.TestData) string { @@ -862,7 +862,7 @@ resource "azurerm_netapp_pool" "test_secondary" { "SkipASMAzSecPack" = "true" } } -`, r.template(data), data.RandomInteger, "germanywestcentral") +`, r.template(data), data.RandomInteger, data.Locations.Secondary) } func (NetAppVolumeResource) template(data acceptance.TestData) string { From a8d8f72bb621dafb02b9e3931284a6111e6bbb76 Mon Sep 17 00:00:00 2001 From: Paulo Date: Wed, 1 Jun 2022 16:45:25 -0700 Subject: [PATCH 12/12] Hardcoding regions to avoid CRR issues due to region peering sensitivity --- internal/services/netapp/netapp_volume_resource_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/services/netapp/netapp_volume_resource_test.go b/internal/services/netapp/netapp_volume_resource_test.go index dd2ee3bb8c4d..336a36cba8ba 100644 --- a/internal/services/netapp/netapp_volume_resource_test.go +++ b/internal/services/netapp/netapp_volume_resource_test.go @@ -461,7 +461,7 @@ resource "azurerm_netapp_volume" "test_secondary" { "SkipASMAzSecPack" = "true" } } -`, template, data.RandomInteger, data.Locations.Secondary) +`, template, data.RandomInteger, "eastus2") } func (NetAppVolumeResource) nfsv3FromSnapshot(data acceptance.TestData) string { @@ -862,7 +862,7 @@ resource "azurerm_netapp_pool" "test_secondary" { "SkipASMAzSecPack" = "true" } } -`, r.template(data), data.RandomInteger, data.Locations.Secondary) +`, r.template(data), data.RandomInteger, "eastus2") } func (NetAppVolumeResource) template(data acceptance.TestData) string { @@ -930,7 +930,7 @@ resource "azurerm_netapp_pool" "test" { "SkipASMAzSecPack" = "true" } } -`, data.RandomInteger, data.Locations.Ternary, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger) +`, data.RandomInteger, "westus2", data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger) } func (NetAppVolumeResource) templatePoolQosManual(data acceptance.TestData) string { @@ -1014,5 +1014,5 @@ resource "azurerm_netapp_pool" "test" { "SkipASMAzSecPack" = "true" } } -`, data.RandomInteger, data.Locations.Ternary, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger) +`, data.RandomInteger, "westus2", data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger) }