From fe840f7bc7abfbe74d824d3d38f45341b8b87511 Mon Sep 17 00:00:00 2001 From: elena Date: Tue, 4 Apr 2023 14:13:07 +0800 Subject: [PATCH] update code --- .../storage_mover_agent_resource.go | 2 + .../storage_mover_source_endpoint_resource.go | 231 ------------------ ...age_mover_source_endpoint_resource_test.go | 171 ------------- .../storage_mover_target_endpoint_resource.go | 225 ----------------- ...age_mover_target_endpoint_resource_test.go | 171 ------------- .../2023-03-01/endpoints/README.md | 107 -------- .../2023-03-01/endpoints/client.go | 26 -- .../2023-03-01/endpoints/constants.go | 90 ------- .../2023-03-01/endpoints/id_endpoint.go | 140 ----------- .../2023-03-01/endpoints/id_storagemover.go | 127 ---------- .../endpoints/method_createorupdate.go | 55 ----- .../2023-03-01/endpoints/method_delete.go | 71 ------ .../2023-03-01/endpoints/method_get.go | 51 ---- .../2023-03-01/endpoints/method_list.go | 89 ------- .../2023-03-01/endpoints/method_update.go | 55 ----- ...estorageblobcontainerendpointproperties.go | 44 ---- .../2023-03-01/endpoints/model_endpoint.go | 48 ---- .../endpoints/model_endpointbaseproperties.go | 56 ----- .../model_endpointbaseupdateparameters.go | 8 - .../model_endpointbaseupdateproperties.go | 8 - .../model_nfsmountendpointproperties.go | 45 ---- .../2023-03-01/endpoints/predicates.go | 27 -- .../2023-03-01/endpoints/version.go | 12 - vendor/modules.txt | 1 - 24 files changed, 2 insertions(+), 1858 deletions(-) delete mode 100644 internal/services/storagemover/storage_mover_source_endpoint_resource.go delete mode 100644 internal/services/storagemover/storage_mover_source_endpoint_resource_test.go delete mode 100644 internal/services/storagemover/storage_mover_target_endpoint_resource.go delete mode 100644 internal/services/storagemover/storage_mover_target_endpoint_resource_test.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/README.md delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/client.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/constants.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/id_endpoint.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/id_storagemover.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/method_createorupdate.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/method_delete.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/method_get.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/method_list.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/method_update.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/model_azurestorageblobcontainerendpointproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/model_endpoint.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/model_endpointbaseproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/model_endpointbaseupdateparameters.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/model_endpointbaseupdateproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/model_nfsmountendpointproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/predicates.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/version.go diff --git a/internal/services/storagemover/storage_mover_agent_resource.go b/internal/services/storagemover/storage_mover_agent_resource.go index 74b4a7f1fa8cd..7d380cef0fb11 100644 --- a/internal/services/storagemover/storage_mover_agent_resource.go +++ b/internal/services/storagemover/storage_mover_agent_resource.go @@ -199,6 +199,8 @@ func (r StorageMoverAgentResource) Read() sdk.ResourceFunc { state.ArcVmUuid = properties.ArcVMUuid + state.ArcResourceId = properties.ArcResourceId + des := "" if properties.Description != nil { des = *properties.Description diff --git a/internal/services/storagemover/storage_mover_source_endpoint_resource.go b/internal/services/storagemover/storage_mover_source_endpoint_resource.go deleted file mode 100644 index 35f2d9524378b..0000000000000 --- a/internal/services/storagemover/storage_mover_source_endpoint_resource.go +++ /dev/null @@ -1,231 +0,0 @@ -package storagemover - -import ( - "context" - "fmt" - "time" - - "github.com/hashicorp/terraform-provider-azurerm/utils" - - "github.com/hashicorp/go-azure-helpers/lang/response" - "github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints" - "github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/storagemovers" - "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" - "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" - "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" -) - -type StorageMoverSourceEndpointResourceModel struct { - Name string `tfschema:"name"` - StorageMoverId string `tfschema:"storage_mover_id"` - Host string `tfschema:"host"` - Export string `tfschema:"export"` - NfsVersion endpoints.NfsVersion `tfschema:"nfs_version"` - Description string `tfschema:"description"` -} - -type StorageMoverSourceEndpointResource struct{} - -var _ sdk.ResourceWithUpdate = StorageMoverSourceEndpointResourceModel{} - -func (r StorageMoverSourceEndpointResourceModel) ResourceType() string { - return "azurerm_storagemover_endpoint" -} - -func (r StorageMoverSourceEndpointResourceModel) ModelObject() interface{} { - return &StorageMoverSourceEndpointResourceModel{} -} - -func (r StorageMoverSourceEndpointResourceModel) IDValidationFunc() pluginsdk.SchemaValidateFunc { - return endpoints.ValidateEndpointID -} - -func (r StorageMoverSourceEndpointResourceModel) Arguments() map[string]*pluginsdk.Schema { - return map[string]*pluginsdk.Schema{ - "name": { - Type: pluginsdk.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validation.StringIsNotEmpty, - }, - - "storage_mover_id": { - Type: pluginsdk.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: storagemovers.ValidateStorageMoverID, - }, - - "host": { - Type: pluginsdk.TypeString, - Required: true, - ValidateFunc: validation.StringIsNotEmpty, - }, - - "export": { - Type: pluginsdk.TypeString, - Required: true, - ValidateFunc: validation.StringIsNotEmpty, - }, - - "nfs_version": { - Type: pluginsdk.TypeString, - Required: true, - ValidateFunc: validation.StringIsNotEmpty, - }, - - "description": { - Type: pluginsdk.TypeString, - Optional: true, - ValidateFunc: validation.StringIsNotEmpty, - }, - } -} - -func (r StorageMoverSourceEndpointResourceModel) Attributes() map[string]*pluginsdk.Schema { - return map[string]*pluginsdk.Schema{} -} - -func (r StorageMoverSourceEndpointResourceModel) Create() sdk.ResourceFunc { - return sdk.ResourceFunc{ - Timeout: 30 * time.Minute, - Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { - var model StorageMoverSourceEndpointResourceModel - if err := metadata.Decode(&model); err != nil { - return fmt.Errorf("decoding: %+v", err) - } - - client := metadata.Client.StorageMover.EndpointsClient - storageMoverId, err := storagemovers.ParseStorageMoverID(model.StorageMoverId) - if err != nil { - return err - } - - id := endpoints.NewEndpointID(storageMoverId.SubscriptionId, storageMoverId.ResourceGroupName, storageMoverId.StorageMoverName, model.Name) - existing, err := client.Get(ctx, id) - if err != nil && !response.WasNotFound(existing.HttpResponse) { - return fmt.Errorf("checking for existing %s: %+v", id, err) - } - - if !response.WasNotFound(existing.HttpResponse) { - return metadata.ResourceRequiresImport(r.ResourceType(), id) - } - - properties := endpoints.Endpoint{ - Name: utils.String(model.Name), - Type: utils.String(string(endpoints.EndpointTypeNfsMount)), - Properties: endpoints.NfsMountEndpointProperties{ - Export: model.Export, - Host: model.Host, - NfsVersion: &model.NfsVersion, - Description: &model.Description, - }, - } - - if _, err := client.CreateOrUpdate(ctx, id, properties); err != nil { - return fmt.Errorf("creating %s: %+v", id, err) - } - - metadata.SetID(id) - return nil - }, - } -} - -func (r StorageMoverSourceEndpointResourceModel) Update() sdk.ResourceFunc { - return sdk.ResourceFunc{ - Timeout: 30 * time.Minute, - Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { - client := metadata.Client.StorageMover.EndpointsClient - - id, err := endpoints.ParseEndpointID(metadata.ResourceData.Id()) - if err != nil { - return err - } - - var model StorageMoverSourceEndpointResourceModel - if err := metadata.Decode(&model); err != nil { - return fmt.Errorf("decoding: %+v", err) - } - - resp, err := client.Get(ctx, *id) - if err != nil { - return fmt.Errorf("retrieving %s: %+v", *id, err) - } - - properties := resp.Model - if properties == nil { - return fmt.Errorf("retrieving %s: model was nil", *id) - } - - if _, err := client.CreateOrUpdate(ctx, *id, *properties); err != nil { - return fmt.Errorf("updating %s: %+v", *id, err) - } - - return nil - }, - } -} - -func (r StorageMoverSourceEndpointResourceModel) Read() sdk.ResourceFunc { - return sdk.ResourceFunc{ - Timeout: 5 * time.Minute, - Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { - client := metadata.Client.StorageMover.EndpointsClient - - id, err := endpoints.ParseEndpointID(metadata.ResourceData.Id()) - if err != nil { - return err - } - - resp, err := client.Get(ctx, *id) - if err != nil { - if response.WasNotFound(resp.HttpResponse) { - return metadata.MarkAsGone(id) - } - - return fmt.Errorf("retrieving %s: %+v", *id, err) - } - - model := resp.Model - if model == nil { - return fmt.Errorf("retrieving %s: model was nil", *id) - } - - state := StorageMoverSourceEndpointResourceModel{ - Name: id.EndpointName, - StorageMoverId: storagemovers.NewStorageMoverID(id.SubscriptionId, id.ResourceGroupName, id.StorageMoverName).ID(), - } - - properties := endpoints.NfsMountEndpointProperties{} - properties = model.Properties - if properties != nil { - state.Description = *properties.Description - } - - state.EndpointType = properties.EndpointType - - return metadata.Encode(&state) - }, - } -} - -func (r StorageMoverSourceEndpointResourceModel) Delete() sdk.ResourceFunc { - return sdk.ResourceFunc{ - Timeout: 30 * time.Minute, - Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { - client := metadata.Client.StorageMover.EndpointsClient - - id, err := endpoints.ParseEndpointID(metadata.ResourceData.Id()) - if err != nil { - return err - } - - if err := client.DeleteThenPoll(ctx, *id); err != nil { - return fmt.Errorf("deleting %s: %+v", *id, err) - } - - return nil - }, - } -} diff --git a/internal/services/storagemover/storage_mover_source_endpoint_resource_test.go b/internal/services/storagemover/storage_mover_source_endpoint_resource_test.go deleted file mode 100644 index 9b0fecee424f9..0000000000000 --- a/internal/services/storagemover/storage_mover_source_endpoint_resource_test.go +++ /dev/null @@ -1,171 +0,0 @@ -package storagemover_test - -import ( - "context" - "fmt" - "testing" - - "github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints" - - "github.com/hashicorp/go-azure-helpers/lang/response" - "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" - "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" - "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" - "github.com/hashicorp/terraform-provider-azurerm/utils" -) - -type StorageMoverSourceEndpointTestResource struct{} - -func TestAccstoragemoverEndpoint_basic(t *testing.T) { - data := acceptance.BuildTestData(t, "azurerm_storagemover_endpoint", "test") - r := StorageMoverSourceEndpointTestResource{} - data.ResourceTest(t, r, []acceptance.TestStep{ - { - Config: r.basic(data), - Check: acceptance.ComposeTestCheckFunc( - check.That(data.ResourceName).ExistsInAzure(r), - ), - }, - data.ImportStep(), - }) -} - -func TestAccstoragemoverEndpoint_requiresImport(t *testing.T) { - data := acceptance.BuildTestData(t, "azurerm_storagemover_endpoint", "test") - r := StorageMoverSourceEndpointTestResource{} - data.ResourceTest(t, r, []acceptance.TestStep{ - { - Config: r.basic(data), - Check: acceptance.ComposeTestCheckFunc( - check.That(data.ResourceName).ExistsInAzure(r), - ), - }, - data.RequiresImportErrorStep(r.requiresImport), - }) -} - -func TestAccstoragemoverEndpoint_complete(t *testing.T) { - data := acceptance.BuildTestData(t, "azurerm_storagemover_endpoint", "test") - r := StorageMoverSourceEndpointTestResource{} - data.ResourceTest(t, r, []acceptance.TestStep{ - { - Config: r.complete(data), - Check: acceptance.ComposeTestCheckFunc( - check.That(data.ResourceName).ExistsInAzure(r), - ), - }, - data.ImportStep(), - }) -} - -func TestAccstoragemoverEndpoint_update(t *testing.T) { - data := acceptance.BuildTestData(t, "azurerm_storagemover_endpoint", "test") - r := StorageMoverSourceEndpointTestResource{} - data.ResourceTest(t, r, []acceptance.TestStep{ - { - Config: r.complete(data), - Check: acceptance.ComposeTestCheckFunc( - check.That(data.ResourceName).ExistsInAzure(r), - ), - }, - data.ImportStep(), - { - Config: r.update(data), - Check: acceptance.ComposeTestCheckFunc( - check.That(data.ResourceName).ExistsInAzure(r), - ), - }, - data.ImportStep(), - }) -} - -func (r StorageMoverSourceEndpointTestResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { - id, err := endpoints.ParseEndpointID(state.ID) - if err != nil { - return nil, err - } - - client := clients.storagemover.EndpointsClient - resp, err := client.Get(ctx, *id) - if err != nil { - if response.WasNotFound(resp.HttpResponse) { - return utils.Bool(false), nil - } - return nil, fmt.Errorf("retrieving %s: %+v", id, err) - } - return utils.Bool(resp.Model != nil), nil -} - -func (r StorageMoverSourceEndpointTestResource) template(data acceptance.TestData) string { - return fmt.Sprintf(` -provider "azurerm" { - features {} -} - -resource "azurerm_resource_group" "test" { - name = "acctest-rg-%d" - location = "%s" -} -resource "azurerm_storagemover_storage_mover" "test" { - name = "acctest-ssm-%d" - resource_group_name = azurerm_resource_group.test.name -} -`, data.RandomInteger, data.Locations.Primary, data.RandomInteger) -} - -func (r StorageMoverSourceEndpointTestResource) basic(data acceptance.TestData) string { - template := r.template(data) - return fmt.Sprintf(` - %s - -resource "azurerm_storagemover_endpoint" "test" { - name = "acctest-se-%d" - StorageMoverId = azurerm_storagemover_storage_mover.test.id - endpoint_type = "" -} -`, template, data.RandomInteger) -} - -func (r StorageMoverSourceEndpointTestResource) requiresImport(data acceptance.TestData) string { - config := r.basic(data) - return fmt.Sprintf(` - %s - -resource "azurerm_storagemover_endpoint" "import" { - name = azurerm_storagemover_endpoint.test.name - StorageMoverId = azurerm_storagemover_storage_mover.test.id - endpoint_type = "" -} -`, config) -} - -func (r StorageMoverSourceEndpointTestResource) complete(data acceptance.TestData) string { - template := r.template(data) - return fmt.Sprintf(` - %s - -resource "azurerm_storagemover_endpoint" "test" { - name = "acctest-se-%d" - StorageMoverId = azurerm_storagemover_storage_mover.test.id - description = "" - endpoint_type = "" - -} -`, template, data.RandomInteger) -} - -func (r StorageMoverSourceEndpointTestResource) update(data acceptance.TestData) string { - template := r.template(data) - return fmt.Sprintf(` - %s - -resource "azurerm_storagemover_endpoint" "test" { - name = "acctest-se-%d" - StorageMoverId = azurerm_storagemover_storage_mover.test.id - description = "" - endpoint_type = "" - -} -`, template, data.RandomInteger) -} diff --git a/internal/services/storagemover/storage_mover_target_endpoint_resource.go b/internal/services/storagemover/storage_mover_target_endpoint_resource.go deleted file mode 100644 index 712ba0249cd36..0000000000000 --- a/internal/services/storagemover/storage_mover_target_endpoint_resource.go +++ /dev/null @@ -1,225 +0,0 @@ -package storagemover - -import ( - "context" - "fmt" - "time" - - "github.com/hashicorp/terraform-provider-azurerm/utils" - - "github.com/hashicorp/go-azure-helpers/lang/response" - "github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints" - "github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/storagemovers" - "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" - "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" - "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" -) - -type StorageMoverTargetEndpointResourceModel struct { - Name string `tfschema:"name"` - StorageMoverId string `tfschema:"storage_mover_id"` - EndpointType endpoints.EndpointType `tfschema:"endpoint_type"` - Description string `tfschema:"description"` - BlobContainerName string `tfschema:"blob_container_name"` - StorageAccountId string `tfschema:"storage_account_id"` - Host string `tfschema:"host"` - Export string `tfschema:"export"` - NfsVersion string `tfschema:"nfs_version"` -} - -type StorageMoverTargetEndpointResource struct{} - -var _ sdk.ResourceWithUpdate = StorageMoverTargetEndpointResource{} - -func (r StorageMoverTargetEndpointResource) ResourceType() string { - return "azurerm_storagemover_endpoint" -} - -func (r StorageMoverTargetEndpointResource) ModelObject() interface{} { - return &StorageMoverTargetEndpointResourceModel{} -} - -func (r StorageMoverTargetEndpointResource) IDValidationFunc() pluginsdk.SchemaValidateFunc { - return endpoints.ValidateEndpointID -} - -func (r StorageMoverTargetEndpointResource) Arguments() map[string]*pluginsdk.Schema { - return map[string]*pluginsdk.Schema{ - "name": { - Type: pluginsdk.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validation.StringIsNotEmpty, - }, - - "endpoint_type": { - Type: pluginsdk.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validation.StringInSlice([]string{ - string(endpoints.EndpointTypeAzureStorageBlobContainer), - string(endpoints.EndpointTypeNfsMount), - }, false), - }, - - "storage_mover_id": { - Type: pluginsdk.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: storagemovers.ValidateStorageMoverID, - }, - - "description": { - Type: pluginsdk.TypeString, - Optional: true, - ValidateFunc: validation.StringIsNotEmpty, - }, - } -} - -func (r StorageMoverTargetEndpointResource) Attributes() map[string]*pluginsdk.Schema { - return map[string]*pluginsdk.Schema{} -} - -func (r StorageMoverTargetEndpointResource) Create() sdk.ResourceFunc { - return sdk.ResourceFunc{ - Timeout: 30 * time.Minute, - Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { - var model StorageMoverTargetEndpointResourceModel - if err := metadata.Decode(&model); err != nil { - return fmt.Errorf("decoding: %+v", err) - } - - client := metadata.Client.StorageMover.EndpointsClient - storageMoverId, err := storagemovers.ParseStorageMoverID(model.StorageMoverId) - if err != nil { - return err - } - - id := endpoints.NewEndpointID(storageMoverId.SubscriptionId, storageMoverId.ResourceGroupName, storageMoverId.StorageMoverName, model.Name) - existing, err := client.Get(ctx, id) - if err != nil && !response.WasNotFound(existing.HttpResponse) { - return fmt.Errorf("checking for existing %s: %+v", id, err) - } - - if !response.WasNotFound(existing.HttpResponse) { - return metadata.ResourceRequiresImport(r.ResourceType(), id) - } - - properties := endpoints.Endpoint{ - Name: utils.String(model.Name), - Type: utils.String(string(model.EndpointType)), - } - - if model.EndpointType == endpoints.EndpointTypeAzureStorageBlobContainer { - properties.Properties = endpoints.AzureStorageBlobContainerEndpointProperties{} - } else if model.EndpointType == endpoints.EndpointTypeNfsMount { - properties.Properties = endpoints.NfsMountEndpointProperties{} - } - - if _, err := client.CreateOrUpdate(ctx, id, properties); err != nil { - return fmt.Errorf("creating %s: %+v", id, err) - } - - metadata.SetID(id) - return nil - }, - } -} - -func (r StorageMoverTargetEndpointResource) Update() sdk.ResourceFunc { - return sdk.ResourceFunc{ - Timeout: 30 * time.Minute, - Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { - client := metadata.Client.StorageMover.EndpointsClient - - id, err := endpoints.ParseEndpointID(metadata.ResourceData.Id()) - if err != nil { - return err - } - - var model StorageMoverTargetEndpointResourceModel - if err := metadata.Decode(&model); err != nil { - return fmt.Errorf("decoding: %+v", err) - } - - resp, err := client.Get(ctx, *id) - if err != nil { - return fmt.Errorf("retrieving %s: %+v", *id, err) - } - - properties := resp.Model - if properties == nil { - return fmt.Errorf("retrieving %s: model was nil", *id) - } - - if _, err := client.CreateOrUpdate(ctx, *id, *properties); err != nil { - return fmt.Errorf("updating %s: %+v", *id, err) - } - - return nil - }, - } -} - -func (r StorageMoverTargetEndpointResource) Read() sdk.ResourceFunc { - return sdk.ResourceFunc{ - Timeout: 5 * time.Minute, - Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { - client := metadata.Client.StorageMover.EndpointsClient - - id, err := endpoints.ParseEndpointID(metadata.ResourceData.Id()) - if err != nil { - return err - } - - resp, err := client.Get(ctx, *id) - if err != nil { - if response.WasNotFound(resp.HttpResponse) { - return metadata.MarkAsGone(id) - } - - return fmt.Errorf("retrieving %s: %+v", *id, err) - } - - model := resp.Model - if model == nil { - return fmt.Errorf("retrieving %s: model was nil", *id) - } - - state := StorageMoverTargetEndpointResourceModel{ - Name: id.EndpointName, - StorageMoverId: storagemovers.NewStorageMoverID(id.SubscriptionId, id.ResourceGroupName, id.StorageMoverName).ID(), - } - - properties := &model.Properties - if properties.Description != nil { - state.Description = *properties.Description - } - - state.EndpointType = properties.EndpointType - - return metadata.Encode(&state) - }, - } -} - -func (r StorageMoverTargetEndpointResource) Delete() sdk.ResourceFunc { - return sdk.ResourceFunc{ - Timeout: 30 * time.Minute, - Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { - client := metadata.Client.StorageMover.EndpointsClient - - id, err := endpoints.ParseEndpointID(metadata.ResourceData.Id()) - if err != nil { - return err - } - - if err := client.DeleteThenPoll(ctx, *id); err != nil { - return fmt.Errorf("deleting %s: %+v", *id, err) - } - - return nil - }, - } -} diff --git a/internal/services/storagemover/storage_mover_target_endpoint_resource_test.go b/internal/services/storagemover/storage_mover_target_endpoint_resource_test.go deleted file mode 100644 index ab4186effaa4f..0000000000000 --- a/internal/services/storagemover/storage_mover_target_endpoint_resource_test.go +++ /dev/null @@ -1,171 +0,0 @@ -package storagemover_test - -import ( - "context" - "fmt" - "testing" - - "github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints" - - "github.com/hashicorp/go-azure-helpers/lang/response" - "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" - "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" - "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" - "github.com/hashicorp/terraform-provider-azurerm/utils" -) - -type StorageMoverTargetEndpointTestResource struct{} - -func TestAccstoragemoverEndpoint_basic(t *testing.T) { - data := acceptance.BuildTestData(t, "azurerm_storagemover_endpoint", "test") - r := StorageMoverTargetEndpointTestResource{} - data.ResourceTest(t, r, []acceptance.TestStep{ - { - Config: r.basic(data), - Check: acceptance.ComposeTestCheckFunc( - check.That(data.ResourceName).ExistsInAzure(r), - ), - }, - data.ImportStep(), - }) -} - -func TestAccstoragemoverEndpoint_requiresImport(t *testing.T) { - data := acceptance.BuildTestData(t, "azurerm_storagemover_endpoint", "test") - r := StorageMoverTargetEndpointTestResource{} - data.ResourceTest(t, r, []acceptance.TestStep{ - { - Config: r.basic(data), - Check: acceptance.ComposeTestCheckFunc( - check.That(data.ResourceName).ExistsInAzure(r), - ), - }, - data.RequiresImportErrorStep(r.requiresImport), - }) -} - -func TestAccstoragemoverEndpoint_complete(t *testing.T) { - data := acceptance.BuildTestData(t, "azurerm_storagemover_endpoint", "test") - r := StorageMoverTargetEndpointTestResource{} - data.ResourceTest(t, r, []acceptance.TestStep{ - { - Config: r.complete(data), - Check: acceptance.ComposeTestCheckFunc( - check.That(data.ResourceName).ExistsInAzure(r), - ), - }, - data.ImportStep(), - }) -} - -func TestAccstoragemoverEndpoint_update(t *testing.T) { - data := acceptance.BuildTestData(t, "azurerm_storagemover_endpoint", "test") - r := StorageMoverTargetEndpointTestResource{} - data.ResourceTest(t, r, []acceptance.TestStep{ - { - Config: r.complete(data), - Check: acceptance.ComposeTestCheckFunc( - check.That(data.ResourceName).ExistsInAzure(r), - ), - }, - data.ImportStep(), - { - Config: r.update(data), - Check: acceptance.ComposeTestCheckFunc( - check.That(data.ResourceName).ExistsInAzure(r), - ), - }, - data.ImportStep(), - }) -} - -func (r StorageMoverTargetEndpointTestResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { - id, err := endpoints.ParseEndpointID(state.ID) - if err != nil { - return nil, err - } - - client := clients.storagemover.EndpointsClient - resp, err := client.Get(ctx, *id) - if err != nil { - if response.WasNotFound(resp.HttpResponse) { - return utils.Bool(false), nil - } - return nil, fmt.Errorf("retrieving %s: %+v", id, err) - } - return utils.Bool(resp.Model != nil), nil -} - -func (r StorageMoverTargetEndpointTestResource) template(data acceptance.TestData) string { - return fmt.Sprintf(` -provider "azurerm" { - features {} -} - -resource "azurerm_resource_group" "test" { - name = "acctest-rg-%d" - location = "%s" -} -resource "azurerm_storagemover_storage_mover" "test" { - name = "acctest-ssm-%d" - resource_group_name = azurerm_resource_group.test.name -} -`, data.RandomInteger, data.Locations.Primary, data.RandomInteger) -} - -func (r StorageMoverTargetEndpointTestResource) basic(data acceptance.TestData) string { - template := r.template(data) - return fmt.Sprintf(` - %s - -resource "azurerm_storagemover_endpoint" "test" { - name = "acctest-se-%d" - StorageMoverId = azurerm_storagemover_storage_mover.test.id - endpoint_type = "" -} -`, template, data.RandomInteger) -} - -func (r StorageMoverTargetEndpointTestResource) requiresImport(data acceptance.TestData) string { - config := r.basic(data) - return fmt.Sprintf(` - %s - -resource "azurerm_storagemover_endpoint" "import" { - name = azurerm_storagemover_endpoint.test.name - StorageMoverId = azurerm_storagemover_storage_mover.test.id - endpoint_type = "" -} -`, config) -} - -func (r StorageMoverTargetEndpointTestResource) complete(data acceptance.TestData) string { - template := r.template(data) - return fmt.Sprintf(` - %s - -resource "azurerm_storagemover_endpoint" "test" { - name = "acctest-se-%d" - StorageMoverId = azurerm_storagemover_storage_mover.test.id - description = "" - endpoint_type = "" - -} -`, template, data.RandomInteger) -} - -func (r StorageMoverTargetEndpointTestResource) update(data acceptance.TestData) string { - template := r.template(data) - return fmt.Sprintf(` - %s - -resource "azurerm_storagemover_endpoint" "test" { - name = "acctest-se-%d" - StorageMoverId = azurerm_storagemover_storage_mover.test.id - description = "" - endpoint_type = "" - -} -`, template, data.RandomInteger) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/README.md deleted file mode 100644 index 50f43b91e98a2..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/README.md +++ /dev/null @@ -1,107 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints` Documentation - -The `endpoints` SDK allows for interaction with the Azure Resource Manager Service `storagemover` (API Version `2023-03-01`). - -This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). - -### Import Path - -```go -import "github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints" -``` - - -### Client Initialization - -```go -client := endpoints.NewEndpointsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `EndpointsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := endpoints.NewEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageMoverValue", "endpointValue") - -payload := endpoints.Endpoint{ - // ... -} - - -read, err := client.CreateOrUpdate(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `EndpointsClient.Delete` - -```go -ctx := context.TODO() -id := endpoints.NewEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageMoverValue", "endpointValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `EndpointsClient.Get` - -```go -ctx := context.TODO() -id := endpoints.NewEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageMoverValue", "endpointValue") - -read, err := client.Get(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `EndpointsClient.List` - -```go -ctx := context.TODO() -id := endpoints.NewStorageMoverID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageMoverValue") - -// alternatively `client.List(ctx, id)` can be used to do batched pagination -items, err := client.ListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `EndpointsClient.Update` - -```go -ctx := context.TODO() -id := endpoints.NewEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageMoverValue", "endpointValue") - -payload := endpoints.EndpointBaseUpdateParameters{ - // ... -} - - -read, err := client.Update(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/client.go deleted file mode 100644 index d5d5f4782570c..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package endpoints - -import ( - "fmt" - - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EndpointsClient struct { - Client *resourcemanager.Client -} - -func NewEndpointsClientWithBaseURI(api environments.Api) (*EndpointsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(api, "endpoints", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating EndpointsClient: %+v", err) - } - - return &EndpointsClient{ - Client: client, - }, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/constants.go deleted file mode 100644 index 416284d706798..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/constants.go +++ /dev/null @@ -1,90 +0,0 @@ -package endpoints - -import "strings" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EndpointType string - -const ( - EndpointTypeAzureStorageBlobContainer EndpointType = "AzureStorageBlobContainer" - EndpointTypeNfsMount EndpointType = "NfsMount" -) - -func PossibleValuesForEndpointType() []string { - return []string{ - string(EndpointTypeAzureStorageBlobContainer), - string(EndpointTypeNfsMount), - } -} - -func parseEndpointType(input string) (*EndpointType, error) { - vals := map[string]EndpointType{ - "azurestorageblobcontainer": EndpointTypeAzureStorageBlobContainer, - "nfsmount": EndpointTypeNfsMount, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EndpointType(input) - return &out, nil -} - -type NfsVersion string - -const ( - NfsVersionNFSauto NfsVersion = "NFSauto" - NfsVersionNFSvFour NfsVersion = "NFSv4" - NfsVersionNFSvThree NfsVersion = "NFSv3" -) - -func PossibleValuesForNfsVersion() []string { - return []string{ - string(NfsVersionNFSauto), - string(NfsVersionNFSvFour), - string(NfsVersionNFSvThree), - } -} - -func parseNfsVersion(input string) (*NfsVersion, error) { - vals := map[string]NfsVersion{ - "nfsauto": NfsVersionNFSauto, - "nfsv4": NfsVersionNFSvFour, - "nfsv3": NfsVersionNFSvThree, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NfsVersion(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateSucceeded ProvisioningState = "Succeeded" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateSucceeded), - } -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "succeeded": ProvisioningStateSucceeded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/id_endpoint.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/id_endpoint.go deleted file mode 100644 index 1476ea711d5e5..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/id_endpoint.go +++ /dev/null @@ -1,140 +0,0 @@ -package endpoints - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ resourceids.ResourceId = EndpointId{} - -// EndpointId is a struct representing the Resource ID for a Endpoint -type EndpointId struct { - SubscriptionId string - ResourceGroupName string - StorageMoverName string - EndpointName string -} - -// NewEndpointID returns a new EndpointId struct -func NewEndpointID(subscriptionId string, resourceGroupName string, storageMoverName string, endpointName string) EndpointId { - return EndpointId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - StorageMoverName: storageMoverName, - EndpointName: endpointName, - } -} - -// ParseEndpointID parses 'input' into a EndpointId -func ParseEndpointID(input string) (*EndpointId, error) { - parser := resourceids.NewParserFromResourceIdType(EndpointId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := EndpointId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.StorageMoverName, ok = parsed.Parsed["storageMoverName"]; !ok { - return nil, fmt.Errorf("the segment 'storageMoverName' was not found in the resource id %q", input) - } - - if id.EndpointName, ok = parsed.Parsed["endpointName"]; !ok { - return nil, fmt.Errorf("the segment 'endpointName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ParseEndpointIDInsensitively parses 'input' case-insensitively into a EndpointId -// note: this method should only be used for API response data and not user input -func ParseEndpointIDInsensitively(input string) (*EndpointId, error) { - parser := resourceids.NewParserFromResourceIdType(EndpointId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := EndpointId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.StorageMoverName, ok = parsed.Parsed["storageMoverName"]; !ok { - return nil, fmt.Errorf("the segment 'storageMoverName' was not found in the resource id %q", input) - } - - if id.EndpointName, ok = parsed.Parsed["endpointName"]; !ok { - return nil, fmt.Errorf("the segment 'endpointName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ValidateEndpointID checks that 'input' can be parsed as a Endpoint ID -func ValidateEndpointID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := ParseEndpointID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Endpoint ID -func (id EndpointId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.StorageMover/storageMovers/%s/endpoints/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.StorageMoverName, id.EndpointName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Endpoint ID -func (id EndpointId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftStorageMover", "Microsoft.StorageMover", "Microsoft.StorageMover"), - resourceids.StaticSegment("staticStorageMovers", "storageMovers", "storageMovers"), - resourceids.UserSpecifiedSegment("storageMoverName", "storageMoverValue"), - resourceids.StaticSegment("staticEndpoints", "endpoints", "endpoints"), - resourceids.UserSpecifiedSegment("endpointName", "endpointValue"), - } -} - -// String returns a human-readable description of this Endpoint ID -func (id EndpointId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Storage Mover Name: %q", id.StorageMoverName), - fmt.Sprintf("Endpoint Name: %q", id.EndpointName), - } - return fmt.Sprintf("Endpoint (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/id_storagemover.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/id_storagemover.go deleted file mode 100644 index 3631ab09348a2..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/id_storagemover.go +++ /dev/null @@ -1,127 +0,0 @@ -package endpoints - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ resourceids.ResourceId = StorageMoverId{} - -// StorageMoverId is a struct representing the Resource ID for a Storage Mover -type StorageMoverId struct { - SubscriptionId string - ResourceGroupName string - StorageMoverName string -} - -// NewStorageMoverID returns a new StorageMoverId struct -func NewStorageMoverID(subscriptionId string, resourceGroupName string, storageMoverName string) StorageMoverId { - return StorageMoverId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - StorageMoverName: storageMoverName, - } -} - -// ParseStorageMoverID parses 'input' into a StorageMoverId -func ParseStorageMoverID(input string) (*StorageMoverId, error) { - parser := resourceids.NewParserFromResourceIdType(StorageMoverId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := StorageMoverId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.StorageMoverName, ok = parsed.Parsed["storageMoverName"]; !ok { - return nil, fmt.Errorf("the segment 'storageMoverName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ParseStorageMoverIDInsensitively parses 'input' case-insensitively into a StorageMoverId -// note: this method should only be used for API response data and not user input -func ParseStorageMoverIDInsensitively(input string) (*StorageMoverId, error) { - parser := resourceids.NewParserFromResourceIdType(StorageMoverId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := StorageMoverId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) - } - - if id.StorageMoverName, ok = parsed.Parsed["storageMoverName"]; !ok { - return nil, fmt.Errorf("the segment 'storageMoverName' was not found in the resource id %q", input) - } - - return &id, nil -} - -// ValidateStorageMoverID checks that 'input' can be parsed as a Storage Mover ID -func ValidateStorageMoverID(input interface{}, key string) (warnings []string, errors []error) { - v, ok := input.(string) - if !ok { - errors = append(errors, fmt.Errorf("expected %q to be a string", key)) - return - } - - if _, err := ParseStorageMoverID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Storage Mover ID -func (id StorageMoverId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.StorageMover/storageMovers/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.StorageMoverName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Storage Mover ID -func (id StorageMoverId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftStorageMover", "Microsoft.StorageMover", "Microsoft.StorageMover"), - resourceids.StaticSegment("staticStorageMovers", "storageMovers", "storageMovers"), - resourceids.UserSpecifiedSegment("storageMoverName", "storageMoverValue"), - } -} - -// String returns a human-readable description of this Storage Mover ID -func (id StorageMoverId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Storage Mover Name: %q", id.StorageMoverName), - } - return fmt.Sprintf("Storage Mover (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/method_createorupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/method_createorupdate.go deleted file mode 100644 index 0cbd9602bee28..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/method_createorupdate.go +++ /dev/null @@ -1,55 +0,0 @@ -package endpoints - -import ( - "context" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CreateOrUpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *Endpoint -} - -// CreateOrUpdate ... -func (c EndpointsClient) CreateOrUpdate(ctx context.Context, id EndpointId, input Endpoint) (result CreateOrUpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPut, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - if err = req.Marshal(input); err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - if err = resp.Unmarshal(&result.Model); err != nil { - return - } - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/method_delete.go deleted file mode 100644 index 2733aa7217278..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package endpoints - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Delete ... -func (c EndpointsClient) Delete(ctx context.Context, id EndpointId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusNoContent, - http.StatusOK, - }, - HttpMethod: http.MethodDelete, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// DeleteThenPoll performs Delete then polls until it's completed -func (c EndpointsClient) DeleteThenPoll(ctx context.Context, id EndpointId) error { - result, err := c.Delete(ctx, id) - if err != nil { - return fmt.Errorf("performing Delete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Delete: %+v", err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/method_get.go deleted file mode 100644 index c93ee983f3b19..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/method_get.go +++ /dev/null @@ -1,51 +0,0 @@ -package endpoints - -import ( - "context" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *Endpoint -} - -// Get ... -func (c EndpointsClient) Get(ctx context.Context, id EndpointId) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - if err = resp.Unmarshal(&result.Model); err != nil { - return - } - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/method_list.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/method_list.go deleted file mode 100644 index 9f3661189e98f..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/method_list.go +++ /dev/null @@ -1,89 +0,0 @@ -package endpoints - -import ( - "context" - "fmt" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]Endpoint -} - -type ListCompleteResult struct { - Items []Endpoint -} - -// List ... -func (c EndpointsClient) List(ctx context.Context, id StorageMoverId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/endpoints", id.ID()), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - var resp *client.Response - resp, err = req.ExecutePaged(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var values struct { - Values *[]Endpoint `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListComplete retrieves all the results into a single object -func (c EndpointsClient) ListComplete(ctx context.Context, id StorageMoverId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, EndpointOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c EndpointsClient) ListCompleteMatchingPredicate(ctx context.Context, id StorageMoverId, predicate EndpointOperationPredicate) (result ListCompleteResult, err error) { - items := make([]Endpoint, 0) - - resp, err := c.List(ctx, id) - if err != nil { - err = fmt.Errorf("loading results: %+v", err) - return - } - if resp.Model != nil { - for _, v := range *resp.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - result = ListCompleteResult{ - Items: items, - } - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/method_update.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/method_update.go deleted file mode 100644 index 9f7177e4a9c1b..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/method_update.go +++ /dev/null @@ -1,55 +0,0 @@ -package endpoints - -import ( - "context" - "net/http" - - "github.com/hashicorp/go-azure-sdk/sdk/client" - "github.com/hashicorp/go-azure-sdk/sdk/odata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *Endpoint -} - -// Update ... -func (c EndpointsClient) Update(ctx context.Context, id EndpointId, input EndpointBaseUpdateParameters) (result UpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPatch, - Path: id.ID(), - } - - req, err := c.Client.NewRequest(ctx, opts) - if err != nil { - return - } - - if err = req.Marshal(input); err != nil { - return - } - - var resp *client.Response - resp, err = req.Execute(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - if err = resp.Unmarshal(&result.Model); err != nil { - return - } - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/model_azurestorageblobcontainerendpointproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/model_azurestorageblobcontainerendpointproperties.go deleted file mode 100644 index 3a655d2725d9f..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/model_azurestorageblobcontainerendpointproperties.go +++ /dev/null @@ -1,44 +0,0 @@ -package endpoints - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ EndpointBaseProperties = AzureStorageBlobContainerEndpointProperties{} - -type AzureStorageBlobContainerEndpointProperties struct { - BlobContainerName string `json:"blobContainerName"` - StorageAccountResourceId string `json:"storageAccountResourceId"` - - // Fields inherited from EndpointBaseProperties - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} - -var _ json.Marshaler = AzureStorageBlobContainerEndpointProperties{} - -func (s AzureStorageBlobContainerEndpointProperties) MarshalJSON() ([]byte, error) { - type wrapper AzureStorageBlobContainerEndpointProperties - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AzureStorageBlobContainerEndpointProperties: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AzureStorageBlobContainerEndpointProperties: %+v", err) - } - decoded["endpointType"] = "AzureStorageBlobContainer" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AzureStorageBlobContainerEndpointProperties: %+v", err) - } - - return encoded, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/model_endpoint.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/model_endpoint.go deleted file mode 100644 index 5f30fb5dd5396..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/model_endpoint.go +++ /dev/null @@ -1,48 +0,0 @@ -package endpoints - -import ( - "encoding/json" - "fmt" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Endpoint struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties EndpointBaseProperties `json:"properties"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Unmarshaler = &Endpoint{} - -func (s *Endpoint) UnmarshalJSON(bytes []byte) error { - type alias Endpoint - var decoded alias - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling into Endpoint: %+v", err) - } - - s.Id = decoded.Id - s.Name = decoded.Name - s.SystemData = decoded.SystemData - s.Type = decoded.Type - - var temp map[string]json.RawMessage - if err := json.Unmarshal(bytes, &temp); err != nil { - return fmt.Errorf("unmarshaling Endpoint into map[string]json.RawMessage: %+v", err) - } - - if v, ok := temp["properties"]; ok { - impl, err := unmarshalEndpointBasePropertiesImplementation(v) - if err != nil { - return fmt.Errorf("unmarshaling field 'Properties' for 'Endpoint': %+v", err) - } - s.Properties = impl - } - return nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/model_endpointbaseproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/model_endpointbaseproperties.go deleted file mode 100644 index b84fee4359458..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/model_endpointbaseproperties.go +++ /dev/null @@ -1,56 +0,0 @@ -package endpoints - -import ( - "encoding/json" - "fmt" - "strings" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EndpointBaseProperties interface { -} - -func unmarshalEndpointBasePropertiesImplementation(input []byte) (EndpointBaseProperties, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling EndpointBaseProperties into map[string]interface: %+v", err) - } - - value, ok := temp["endpointType"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "AzureStorageBlobContainer") { - var out AzureStorageBlobContainerEndpointProperties - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AzureStorageBlobContainerEndpointProperties: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "NfsMount") { - var out NfsMountEndpointProperties - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into NfsMountEndpointProperties: %+v", err) - } - return out, nil - } - - type RawEndpointBasePropertiesImpl struct { - Type string `json:"-"` - Values map[string]interface{} `json:"-"` - } - out := RawEndpointBasePropertiesImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/model_endpointbaseupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/model_endpointbaseupdateparameters.go deleted file mode 100644 index 142c929182aff..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/model_endpointbaseupdateparameters.go +++ /dev/null @@ -1,8 +0,0 @@ -package endpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EndpointBaseUpdateParameters struct { - Properties *EndpointBaseUpdateProperties `json:"properties,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/model_endpointbaseupdateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/model_endpointbaseupdateproperties.go deleted file mode 100644 index 9d88fb22a32f1..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/model_endpointbaseupdateproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package endpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EndpointBaseUpdateProperties struct { - Description *string `json:"description,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/model_nfsmountendpointproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/model_nfsmountendpointproperties.go deleted file mode 100644 index d8631f3caf2d4..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/model_nfsmountendpointproperties.go +++ /dev/null @@ -1,45 +0,0 @@ -package endpoints - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ EndpointBaseProperties = NfsMountEndpointProperties{} - -type NfsMountEndpointProperties struct { - Export string `json:"export"` - Host string `json:"host"` - NfsVersion *NfsVersion `json:"nfsVersion,omitempty"` - - // Fields inherited from EndpointBaseProperties - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} - -var _ json.Marshaler = NfsMountEndpointProperties{} - -func (s NfsMountEndpointProperties) MarshalJSON() ([]byte, error) { - type wrapper NfsMountEndpointProperties - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling NfsMountEndpointProperties: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling NfsMountEndpointProperties: %+v", err) - } - decoded["endpointType"] = "NfsMount" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling NfsMountEndpointProperties: %+v", err) - } - - return encoded, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/predicates.go deleted file mode 100644 index 968958292ac64..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package endpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EndpointOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p EndpointOperationPredicate) Matches(input Endpoint) bool { - - if p.Id != nil && (input.Id == nil && *p.Id != *input.Id) { - return false - } - - if p.Name != nil && (input.Name == nil && *p.Name != *input.Name) { - return false - } - - if p.Type != nil && (input.Type == nil && *p.Type != *input.Type) { - return false - } - - return true -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/version.go deleted file mode 100644 index 4a86d747ef80c..0000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package endpoints - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-03-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/endpoints/%s", defaultApiVersion) -} diff --git a/vendor/modules.txt b/vendor/modules.txt index 5b326a4297e38..c09cc19e0c5d8 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -537,7 +537,6 @@ github.com/hashicorp/go-azure-sdk/resource-manager/storage/2022-05-01/storageacc github.com/hashicorp/go-azure-sdk/resource-manager/storage/2022-05-01/tableservice github.com/hashicorp/go-azure-sdk/resource-manager/storage/2022-05-01/tableserviceproperties github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/agents -github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/endpoints github.com/hashicorp/go-azure-sdk/resource-manager/storagemover/2023-03-01/storagemovers github.com/hashicorp/go-azure-sdk/resource-manager/storagepool/2021-08-01/diskpools github.com/hashicorp/go-azure-sdk/resource-manager/storagepool/2021-08-01/iscsitargets