diff --git a/azurerm/internal/services/storage/client/client.go b/azurerm/internal/services/storage/client/client.go index 803bde85e0b1..e6eda24e52f2 100644 --- a/azurerm/internal/services/storage/client/client.go +++ b/azurerm/internal/services/storage/client/client.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage" - "github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2019-11-01/storagecache" + "github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2020-03-01/storagecache" "github.com/Azure/azure-sdk-for-go/services/storagesync/mgmt/2020-03-01/storagesync" "github.com/Azure/go-autorest/autorest" az "github.com/Azure/go-autorest/autorest/azure" diff --git a/azurerm/internal/services/storage/resource_arm_hpc_cache.go b/azurerm/internal/services/storage/resource_arm_hpc_cache.go index 4b417dd3a2d0..a7bdb533c41a 100644 --- a/azurerm/internal/services/storage/resource_arm_hpc_cache.go +++ b/azurerm/internal/services/storage/resource_arm_hpc_cache.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2019-11-01/storagecache" + "github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2020-03-01/storagecache" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" @@ -19,12 +19,14 @@ import ( func resourceArmHPCCache() *schema.Resource { return &schema.Resource{ - Create: resourceArmHPCCacheCreate, + Create: resourceArmHPCCacheCreateOrUpdate, + Update: resourceArmHPCCacheCreateOrUpdate, Read: resourceArmHPCCacheRead, Delete: resourceArmHPCCacheDelete, Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(30 * time.Minute), + Update: schema.DefaultTimeout(30 * time.Minute), Read: schema.DefaultTimeout(5 * time.Minute), Delete: schema.DefaultTimeout(30 * time.Minute), }, @@ -76,6 +78,23 @@ func resourceArmHPCCache() *schema.Resource { }, false), }, + "mtu": { + Type: schema.TypeInt, + Optional: true, + Default: 1500, + ValidateFunc: validation.IntBetween(576, 1500), + }, + + "root_squash_enabled": { + Type: schema.TypeBool, + Optional: true, + // TODO 3.0: remove "Computed: true" and add "Default: true" + // The old resource has no consistent default for the rootSquash setting. In order not to + // break users, we intentionally mark this property as Computed. + // https://docs.microsoft.com/en-us/azure/hpc-cache/configuration#configure-root-squash. + Computed: true, + }, + "mount_addresses": { Type: schema.TypeList, Computed: true, @@ -85,7 +104,7 @@ func resourceArmHPCCache() *schema.Resource { } } -func resourceArmHPCCacheCreate(d *schema.ResourceData, meta interface{}) error { +func resourceArmHPCCacheCreateOrUpdate(d *schema.ResourceData, meta interface{}) error { client := meta.(*clients.Client).Storage.CachesClient ctx, cancel := timeouts.ForCreate(meta.(*clients.Client).StopContext, d) defer cancel() @@ -111,6 +130,8 @@ func resourceArmHPCCacheCreate(d *schema.ResourceData, meta interface{}) error { cacheSize := d.Get("cache_size_in_gb").(int) subnet := d.Get("subnet_id").(string) skuName := d.Get("sku_name").(string) + rootSquash := d.Get("root_squash_enabled").(bool) + mtu := d.Get("mtu").(int) cache := &storagecache.Cache{ Name: utils.String(name), @@ -118,6 +139,12 @@ func resourceArmHPCCacheCreate(d *schema.ResourceData, meta interface{}) error { CacheProperties: &storagecache.CacheProperties{ CacheSizeGB: utils.Int32(int32(cacheSize)), Subnet: utils.String(subnet), + NetworkSettings: &storagecache.CacheNetworkSettings{ + Mtu: utils.Int32(int32(mtu)), + }, + SecuritySettings: &storagecache.CacheSecuritySettings{ + RootSquash: &rootSquash, + }, }, Sku: &storagecache.CacheSku{ Name: utils.String(skuName), @@ -174,6 +201,12 @@ func resourceArmHPCCacheRead(d *schema.ResourceData, meta interface{}) error { d.Set("cache_size_in_gb", props.CacheSizeGB) d.Set("subnet_id", props.Subnet) d.Set("mount_addresses", utils.FlattenStringSlice(props.MountAddresses)) + if props.NetworkSettings != nil { + d.Set("mtu", props.NetworkSettings.Mtu) + } + if props.SecuritySettings != nil { + d.Set("root_squash_enabled", props.SecuritySettings.RootSquash) + } } if sku := resp.Sku; sku != nil { diff --git a/azurerm/internal/services/storage/resource_arm_hpc_cache_blob_target.go b/azurerm/internal/services/storage/resource_arm_hpc_cache_blob_target.go index 36d100959928..68dfda40aa34 100644 --- a/azurerm/internal/services/storage/resource_arm_hpc_cache_blob_target.go +++ b/azurerm/internal/services/storage/resource_arm_hpc_cache_blob_target.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2019-11-01/storagecache" + "github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2020-03-01/storagecache" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" @@ -104,9 +104,9 @@ func resourceArmHPCCacheBlobTargetCreateOrUpdate(d *schema.ResourceData, meta in }, } param := &storagecache.StorageTarget{ - StorageTargetProperties: &storagecache.StorageTargetProperties{ + BasicStorageTargetProperties: &storagecache.ClfsTargetProperties{ Junctions: &namespaceJunction, - TargetType: storagecache.StorageTargetTypeClfs, + TargetType: storagecache.TargetTypeClfs, Clfs: &storagecache.ClfsTarget{ Target: utils.String(containerId), }, @@ -161,7 +161,12 @@ func resourceArmHPCCacheBlobTargetRead(d *schema.ResourceData, meta interface{}) d.Set("resource_group_name", id.ResourceGroup) d.Set("cache_name", id.Cache) - if props := resp.StorageTargetProperties; props != nil { + if props := resp.BasicStorageTargetProperties; props != nil { + props, ok := props.AsClfsTargetProperties() + if !ok { + return fmt.Errorf("The type of this HPC Cache Target %q (Resource Group %q, Cahe %q) is not a Blob Target", id.Name, id.ResourceGroup, id.Cache) + } + storageContainerId := "" if props.Clfs != nil && props.Clfs.Target != nil { storageContainerId = *props.Clfs.Target diff --git a/azurerm/internal/services/storage/resource_arm_hpc_cache_nfs_target.go b/azurerm/internal/services/storage/resource_arm_hpc_cache_nfs_target.go index ef1b555aec46..d462c4d36802 100644 --- a/azurerm/internal/services/storage/resource_arm_hpc_cache_nfs_target.go +++ b/azurerm/internal/services/storage/resource_arm_hpc_cache_nfs_target.go @@ -7,7 +7,7 @@ import ( azSchema "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tf/schema" - "github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2019-11-01/storagecache" + "github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2020-03-01/storagecache" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" @@ -129,9 +129,9 @@ func resourceArmHPCCacheNFSTargetCreateOrUpdate(d *schema.ResourceData, meta int // Construct parameters param := &storagecache.StorageTarget{ - StorageTargetProperties: &storagecache.StorageTargetProperties{ + BasicStorageTargetProperties: &storagecache.Nfs3TargetProperties{ Junctions: expandNamespaceJunctions(d.Get("namespace_junction").(*schema.Set).List()), - TargetType: storagecache.StorageTargetTypeNfs3, + TargetType: storagecache.TargetTypeNfs3, Nfs3: &storagecache.Nfs3Target{ Target: utils.String(d.Get("target_host_name").(string)), UsageModel: utils.String(d.Get("usage_model").(string)), @@ -186,7 +186,11 @@ func resourceArmHPCCacheNFSTargetRead(d *schema.ResourceData, meta interface{}) d.Set("resource_group_name", id.ResourceGroup) d.Set("cache_name", id.Cache) - if props := resp.StorageTargetProperties; props != nil { + if props := resp.BasicStorageTargetProperties; props != nil { + props, ok := props.AsNfs3TargetProperties() + if !ok { + return fmt.Errorf("The type of this HPC Cache Target %q (Resource Group %q, Cahe %q) is not a NFS Target", id.Name, id.ResourceGroup, id.Cache) + } if nfs3 := props.Nfs3; nfs3 != nil { d.Set("target_host_name", nfs3.Target) d.Set("usage_model", nfs3.UsageModel) diff --git a/azurerm/internal/services/storage/tests/resource_arm_hpc_cache_test.go b/azurerm/internal/services/storage/tests/resource_arm_hpc_cache_test.go index 1ea780e2641f..a9ab3556a642 100644 --- a/azurerm/internal/services/storage/tests/resource_arm_hpc_cache_test.go +++ b/azurerm/internal/services/storage/tests/resource_arm_hpc_cache_test.go @@ -31,6 +31,78 @@ func TestAccAzureRMHPCCache_basic(t *testing.T) { }) } +func TestAccAzureRMHPCCache_mtu(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_hpc_cache", "test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMHPCCacheDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAzureRMHPCCache_mtu(data, 1000), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMHPCCacheExists(data.ResourceName), + resource.TestCheckResourceAttrSet(data.ResourceName, "mount_addresses.#"), + ), + }, + data.ImportStep(), + { + Config: testAccAzureRMHPCCache_mtu(data, 1500), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMHPCCacheExists(data.ResourceName), + resource.TestCheckResourceAttrSet(data.ResourceName, "mount_addresses.#"), + ), + }, + data.ImportStep(), + { + Config: testAccAzureRMHPCCache_mtu(data, 1000), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMHPCCacheExists(data.ResourceName), + resource.TestCheckResourceAttrSet(data.ResourceName, "mount_addresses.#"), + ), + }, + data.ImportStep(), + }, + }) +} + +func TestAccAzureRMHPCCache_rootSquash(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_hpc_cache", "test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMHPCCacheDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAzureRMHPCCache_rootSquash(data, false), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMHPCCacheExists(data.ResourceName), + resource.TestCheckResourceAttrSet(data.ResourceName, "mount_addresses.#"), + ), + }, + data.ImportStep(), + { + Config: testAccAzureRMHPCCache_rootSquash(data, true), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMHPCCacheExists(data.ResourceName), + resource.TestCheckResourceAttrSet(data.ResourceName, "mount_addresses.#"), + ), + }, + data.ImportStep(), + { + Config: testAccAzureRMHPCCache_rootSquash(data, true), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMHPCCacheExists(data.ResourceName), + resource.TestCheckResourceAttrSet(data.ResourceName, "mount_addresses.#"), + ), + }, + data.ImportStep(), + }, + }) +} + func TestAccAzureRMHPCCache_requiresImport(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_hpc_cache", "test") resource.ParallelTest(t, resource.TestCase{ @@ -101,29 +173,9 @@ func testCheckAzureRMHPCCacheDestroy(s *terraform.State) error { } func testAccAzureRMHPCCache_basic(data acceptance.TestData) string { + template := testAccAzureRMHPCCache_template(data) return fmt.Sprintf(` -provider "azurerm" { - features {} -} - -resource "azurerm_resource_group" "test" { - name = "acctestRG-storage-%d" - location = "%s" -} - -resource "azurerm_virtual_network" "test" { - name = "acctest-VN-%d" - address_space = ["10.0.0.0/16"] - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name -} - -resource "azurerm_subnet" "test" { - name = "acctestsub-%d" - resource_group_name = azurerm_resource_group.test.name - virtual_network_name = azurerm_virtual_network.test.name - address_prefix = "10.0.2.0/24" -} +%s resource "azurerm_hpc_cache" "test" { name = "acctest-HPCC-%d" @@ -133,7 +185,7 @@ resource "azurerm_hpc_cache" "test" { subnet_id = azurerm_subnet.test.id sku_name = "Standard_2G" } -`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger, data.RandomInteger) +`, template, data.RandomInteger) } func testAccAzureRMHPCCahce_requiresImport(data acceptance.TestData) string { @@ -151,3 +203,64 @@ resource "azurerm_hpc_cache" "import" { } `, template) } + +func testAccAzureRMHPCCache_mtu(data acceptance.TestData, mtu int) string { + template := testAccAzureRMHPCCache_template(data) + return fmt.Sprintf(` +%s + +resource "azurerm_hpc_cache" "test" { + name = "acctest-HPCC-%d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + cache_size_in_gb = 3072 + subnet_id = azurerm_subnet.test.id + sku_name = "Standard_2G" + mtu = %d +} +`, template, data.RandomInteger, mtu) +} + +func testAccAzureRMHPCCache_rootSquash(data acceptance.TestData, enable bool) string { + template := testAccAzureRMHPCCache_template(data) + return fmt.Sprintf(` +%s + +resource "azurerm_hpc_cache" "test" { + name = "acctest-HPCC-%d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + cache_size_in_gb = 3072 + subnet_id = azurerm_subnet.test.id + sku_name = "Standard_2G" + root_squash_enabled = %t +} +`, template, data.RandomInteger, enable) +} + +func testAccAzureRMHPCCache_template(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-storage-%d" + location = "%s" +} + +resource "azurerm_virtual_network" "test" { + name = "acctest-VN-%d" + address_space = ["10.0.0.0/16"] + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name +} + +resource "azurerm_subnet" "test" { + name = "acctestsub-%d" + resource_group_name = azurerm_resource_group.test.name + virtual_network_name = azurerm_virtual_network.test.name + address_prefix = "10.0.2.0/24" +} +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger) +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2020-03-01/storagecache/ascoperations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2020-03-01/storagecache/ascoperations.go new file mode 100644 index 000000000000..e40670c20942 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2020-03-01/storagecache/ascoperations.go @@ -0,0 +1,119 @@ +package storagecache + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// AscOperationsClient is the a Storage Cache provides scalable caching service for NAS clients, serving data from +// either NFSv3 or Blob at-rest storage (referred to as "Storage Targets"). These operations allow you to manage +// Caches. +type AscOperationsClient struct { + BaseClient +} + +// NewAscOperationsClient creates an instance of the AscOperationsClient client. +func NewAscOperationsClient(subscriptionID string) AscOperationsClient { + return NewAscOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAscOperationsClientWithBaseURI creates an instance of the AscOperationsClient 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 NewAscOperationsClientWithBaseURI(baseURI string, subscriptionID string) AscOperationsClient { + return AscOperationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets the status of an asynchronous operation for the Azure HPC cache +// Parameters: +// location - the region name which the operation will lookup into. +// operationID - the operation id which uniquely identifies the asynchronous operation. +func (client AscOperationsClient) Get(ctx context.Context, location string, operationID string) (result AscOperation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AscOperationsClient.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, operationID) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.AscOperationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storagecache.AscOperationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.AscOperationsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client AscOperationsClient) GetPreparer(ctx context.Context, location string, operationID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "operationId": autorest.Encode("path", operationID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.StorageCache/locations/{location}/ascOperations/{operationId}", 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 AscOperationsClient) 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 AscOperationsClient) GetResponder(resp *http.Response) (result AscOperation, 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/storagecache/mgmt/2019-11-01/storagecache/caches.go b/vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2020-03-01/storagecache/caches.go similarity index 92% rename from vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2019-11-01/storagecache/caches.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2020-03-01/storagecache/caches.go index ecbffeedc269..85b58d8935ca 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2019-11-01/storagecache/caches.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2020-03-01/storagecache/caches.go @@ -46,7 +46,8 @@ func NewCachesClientWithBaseURI(baseURI string, subscriptionID string) CachesCli // CreateOrUpdate create or update a Cache. // Parameters: // resourceGroupName - target resource group. -// cacheName - name of Cache. +// cacheName - name of Cache. Length of name must be not greater than 80 and chars must be in list of +// [-0-9a-zA-Z_] char class. // cache - object containing the user-selectable properties of the new Cache. If read-only properties are // included, they must match the existing values of those properties. func (client CachesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, cacheName string, cache *Cache) (result CachesCreateOrUpdateFuture, err error) { @@ -62,7 +63,24 @@ func (client CachesClient) CreateOrUpdate(ctx context.Context, resourceGroupName } if err := validation.Validate([]validation.Validation{ {TargetValue: cacheName, - Constraints: []validation.Constraint{{Target: "cacheName", Name: validation.Pattern, Rule: `^[-0-9a-zA-Z_]{1,80}$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "cacheName", Name: validation.Pattern, Rule: `^[-0-9a-zA-Z_]{1,80}$`, Chain: nil}}}, + {TargetValue: cache, + Constraints: []validation.Constraint{{Target: "cache", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "cache.CacheProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "cache.CacheProperties.NetworkSettings", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "cache.CacheProperties.NetworkSettings.Mtu", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "cache.CacheProperties.NetworkSettings.Mtu", Name: validation.InclusiveMaximum, Rule: int64(1500), Chain: nil}, + {Target: "cache.CacheProperties.NetworkSettings.Mtu", Name: validation.InclusiveMinimum, Rule: int64(576), Chain: nil}, + }}, + }}, + {Target: "cache.CacheProperties.EncryptionSettings", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "cache.CacheProperties.EncryptionSettings.KeyEncryptionKey", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "cache.CacheProperties.EncryptionSettings.KeyEncryptionKey.KeyURL", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "cache.CacheProperties.EncryptionSettings.KeyEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + }}, + }}}}}); err != nil { return result, validation.NewError("storagecache.CachesClient", "CreateOrUpdate", err.Error()) } @@ -89,7 +107,7 @@ func (client CachesClient) CreateOrUpdatePreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-11-01" + const APIVersion = "2020-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -137,7 +155,8 @@ func (client CachesClient) CreateOrUpdateResponder(resp *http.Response) (result // Delete schedules a Cache for deletion. // Parameters: // resourceGroupName - target resource group. -// cacheName - name of Cache. +// cacheName - name of Cache. Length of name must be not greater than 80 and chars must be in list of +// [-0-9a-zA-Z_] char class. func (client CachesClient) Delete(ctx context.Context, resourceGroupName string, cacheName string) (result CachesDeleteFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/CachesClient.Delete") @@ -178,7 +197,7 @@ func (client CachesClient) DeletePreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-11-01" + const APIVersion = "2020-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -219,7 +238,8 @@ func (client CachesClient) DeleteResponder(resp *http.Response) (result SetObjec // returned until the flush is complete. // Parameters: // resourceGroupName - target resource group. -// cacheName - name of Cache. +// cacheName - name of Cache. Length of name must be not greater than 80 and chars must be in list of +// [-0-9a-zA-Z_] char class. func (client CachesClient) Flush(ctx context.Context, resourceGroupName string, cacheName string) (result CachesFlushFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/CachesClient.Flush") @@ -260,7 +280,7 @@ func (client CachesClient) FlushPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-11-01" + const APIVersion = "2020-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -300,7 +320,8 @@ func (client CachesClient) FlushResponder(resp *http.Response) (result SetObject // Get returns a Cache. // Parameters: // resourceGroupName - target resource group. -// cacheName - name of Cache. +// cacheName - name of Cache. Length of name must be not greater than 80 and chars must be in list of +// [-0-9a-zA-Z_] char class. func (client CachesClient) Get(ctx context.Context, resourceGroupName string, cacheName string) (result Cache, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/CachesClient.Get") @@ -347,7 +368,7 @@ func (client CachesClient) GetPreparer(ctx context.Context, resourceGroupName st "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-11-01" + const APIVersion = "2020-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -421,7 +442,7 @@ func (client CachesClient) ListPreparer(ctx context.Context) (*http.Request, err "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-11-01" + const APIVersion = "2020-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -535,7 +556,7 @@ func (client CachesClient) ListByResourceGroupPreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-11-01" + const APIVersion = "2020-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -606,7 +627,8 @@ func (client CachesClient) ListByResourceGroupComplete(ctx context.Context, reso // Start tells a Stopped state Cache to transition to Active state. // Parameters: // resourceGroupName - target resource group. -// cacheName - name of Cache. +// cacheName - name of Cache. Length of name must be not greater than 80 and chars must be in list of +// [-0-9a-zA-Z_] char class. func (client CachesClient) Start(ctx context.Context, resourceGroupName string, cacheName string) (result CachesStartFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/CachesClient.Start") @@ -647,7 +669,7 @@ func (client CachesClient) StartPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-11-01" + const APIVersion = "2020-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -687,7 +709,8 @@ func (client CachesClient) StartResponder(resp *http.Response) (result SetObject // Stop tells an Active Cache to transition to Stopped state. // Parameters: // resourceGroupName - target resource group. -// cacheName - name of Cache. +// cacheName - name of Cache. Length of name must be not greater than 80 and chars must be in list of +// [-0-9a-zA-Z_] char class. func (client CachesClient) Stop(ctx context.Context, resourceGroupName string, cacheName string) (result CachesStopFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/CachesClient.Stop") @@ -728,7 +751,7 @@ func (client CachesClient) StopPreparer(ctx context.Context, resourceGroupName s "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-11-01" + const APIVersion = "2020-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -768,7 +791,8 @@ func (client CachesClient) StopResponder(resp *http.Response) (result SetObject, // Update update a Cache instance. // Parameters: // resourceGroupName - target resource group. -// cacheName - name of Cache. +// cacheName - name of Cache. Length of name must be not greater than 80 and chars must be in list of +// [-0-9a-zA-Z_] char class. // cache - object containing the user-selectable properties of the Cache. If read-only properties are included, // they must match the existing values of those properties. func (client CachesClient) Update(ctx context.Context, resourceGroupName string, cacheName string, cache *Cache) (result Cache, err error) { @@ -817,7 +841,7 @@ func (client CachesClient) UpdatePreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-11-01" + const APIVersion = "2020-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -859,7 +883,8 @@ func (client CachesClient) UpdateResponder(resp *http.Response) (result Cache, e // UpgradeFirmware upgrade a Cache's firmware if a new version is available. Otherwise, this operation has no effect. // Parameters: // resourceGroupName - target resource group. -// cacheName - name of Cache. +// cacheName - name of Cache. Length of name must be not greater than 80 and chars must be in list of +// [-0-9a-zA-Z_] char class. func (client CachesClient) UpgradeFirmware(ctx context.Context, resourceGroupName string, cacheName string) (result CachesUpgradeFirmwareFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/CachesClient.UpgradeFirmware") @@ -900,7 +925,7 @@ func (client CachesClient) UpgradeFirmwarePreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-11-01" + const APIVersion = "2020-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2019-11-01/storagecache/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2020-03-01/storagecache/client.go similarity index 98% rename from vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2019-11-01/storagecache/client.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2020-03-01/storagecache/client.go index 875d0b7d8704..baa73a8fa62a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2019-11-01/storagecache/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2020-03-01/storagecache/client.go @@ -1,4 +1,4 @@ -// Package storagecache implements the Azure ARM Storagecache service API version 2019-11-01. +// Package storagecache implements the Azure ARM Storagecache service API version 2020-03-01. // // A Storage Cache provides scalable caching service for NAS clients, serving data from either NFSv3 or Blob at-rest // storage (referred to as "Storage Targets"). These operations allow you to manage Caches. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2019-11-01/storagecache/enums.go b/vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2020-03-01/storagecache/enums.go similarity index 75% rename from vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2019-11-01/storagecache/enums.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2020-03-01/storagecache/enums.go index 7bcabb595a75..363739be6da5 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2019-11-01/storagecache/enums.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2020-03-01/storagecache/enums.go @@ -17,6 +17,21 @@ package storagecache // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// CacheIdentityType enumerates the values for cache identity type. +type CacheIdentityType string + +const ( + // None ... + None CacheIdentityType = "None" + // SystemAssigned ... + SystemAssigned CacheIdentityType = "SystemAssigned" +) + +// PossibleCacheIdentityTypeValues returns an array of possible values for the CacheIdentityType const type. +func PossibleCacheIdentityTypeValues() []CacheIdentityType { + return []CacheIdentityType{None, SystemAssigned} +} + // FirmwareStatusType enumerates the values for firmware status type. type FirmwareStatusType string @@ -99,19 +114,21 @@ func PossibleReasonCodeValues() []ReasonCode { return []ReasonCode{NotAvailableForSubscription, QuotaID} } -// StorageTargetType enumerates the values for storage target type. -type StorageTargetType string +// TargetType enumerates the values for target type. +type TargetType string const ( - // StorageTargetTypeClfs ... - StorageTargetTypeClfs StorageTargetType = "clfs" - // StorageTargetTypeNfs3 ... - StorageTargetTypeNfs3 StorageTargetType = "nfs3" - // StorageTargetTypeUnknown ... - StorageTargetTypeUnknown StorageTargetType = "unknown" + // TargetTypeClfs ... + TargetTypeClfs TargetType = "clfs" + // TargetTypeNfs3 ... + TargetTypeNfs3 TargetType = "nfs3" + // TargetTypeStorageTargetProperties ... + TargetTypeStorageTargetProperties TargetType = "StorageTargetProperties" + // TargetTypeUnknown ... + TargetTypeUnknown TargetType = "unknown" ) -// PossibleStorageTargetTypeValues returns an array of possible values for the StorageTargetType const type. -func PossibleStorageTargetTypeValues() []StorageTargetType { - return []StorageTargetType{StorageTargetTypeClfs, StorageTargetTypeNfs3, StorageTargetTypeUnknown} +// PossibleTargetTypeValues returns an array of possible values for the TargetType const type. +func PossibleTargetTypeValues() []TargetType { + return []TargetType{TargetTypeClfs, TargetTypeNfs3, TargetTypeStorageTargetProperties, TargetTypeUnknown} } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2019-11-01/storagecache/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2020-03-01/storagecache/models.go similarity index 75% rename from vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2019-11-01/storagecache/models.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2020-03-01/storagecache/models.go index f71a38ac4d16..e994cb25aeb7 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2019-11-01/storagecache/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2020-03-01/storagecache/models.go @@ -29,7 +29,7 @@ import ( ) // The package's fully qualified name. -const fqdn = "github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2019-11-01/storagecache" +const fqdn = "github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2020-03-01/storagecache" // APIOperation REST API operation description: see // https://github.com/Azure/azure-rest-api-specs/blob/master/documentation/openapi-authoring-automated-guidelines.md#r3023-operationsapiimplementation @@ -207,6 +207,23 @@ func NewAPIOperationListResultPage(getNextPage func(context.Context, APIOperatio return APIOperationListResultPage{fn: getNextPage} } +// AscOperation the status of operation. +type AscOperation struct { + autorest.Response `json:"-"` + // ID - The operation Id. + ID *string `json:"id,omitempty"` + // Name - The operation name. + Name *string `json:"name,omitempty"` + // StartTime - The start time of the operation. + StartTime *string `json:"startTime,omitempty"` + // EndTime - The end time of the operation. + EndTime *string `json:"endTime,omitempty"` + // Status - The status of the operation. + Status *string `json:"status,omitempty"` + // Error - The error detail of the operation if any. + Error *ErrorResponse `json:"error,omitempty"` +} + // Cache a Cache instance. Follows Azure Resource Manager standards: // https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/resource-api-reference.md type Cache struct { @@ -221,6 +238,8 @@ type Cache struct { Name *string `json:"name,omitempty"` // Type - READ-ONLY; Type of the Cache; Microsoft.StorageCache/Cache Type *string `json:"type,omitempty"` + // Identity - The identity of the cache, if configured. + Identity *CacheIdentity `json:"identity,omitempty"` // CacheProperties - Properties of the Cache. *CacheProperties `json:"properties,omitempty"` // Sku - SKU for the Cache. @@ -236,6 +255,9 @@ func (c Cache) MarshalJSON() ([]byte, error) { if c.Location != nil { objectMap["location"] = c.Location } + if c.Identity != nil { + objectMap["identity"] = c.Identity + } if c.CacheProperties != nil { objectMap["properties"] = c.CacheProperties } @@ -299,6 +321,15 @@ func (c *Cache) UnmarshalJSON(body []byte) error { } c.Type = &typeVar } + case "identity": + if v != nil { + var identity CacheIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + c.Identity = &identity + } case "properties": if v != nil { var cacheProperties CacheProperties @@ -323,6 +354,12 @@ func (c *Cache) UnmarshalJSON(body []byte) error { return nil } +// CacheEncryptionSettings cache encryption settings. +type CacheEncryptionSettings struct { + // KeyEncryptionKey - Specifies the location of the key encryption key in Key Vault. + KeyEncryptionKey *KeyVaultKeyReference `json:"keyEncryptionKey,omitempty"` +} + // CacheHealth an indication of Cache health. Gives more information about health than just that related to // provisioning. type CacheHealth struct { @@ -332,6 +369,42 @@ type CacheHealth struct { StatusDescription *string `json:"statusDescription,omitempty"` } +// CacheIdentity cache identity properties. +type CacheIdentity struct { + // PrincipalID - READ-ONLY; The principal id of the cache. + PrincipalID *string `json:"principalId,omitempty"` + // TenantID - READ-ONLY; The tenant id associated with the cache. + TenantID *string `json:"tenantId,omitempty"` + // Type - The type of identity used for the cache. Possible values include: 'SystemAssigned', 'None' + Type CacheIdentityType `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for CacheIdentity. +func (ci CacheIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ci.Type != "" { + objectMap["type"] = ci.Type + } + return json.Marshal(objectMap) +} + +// CacheNetworkSettings cache network settings. +type CacheNetworkSettings struct { + // Mtu - The IPv4 maximum transmission unit configured for the subnet. + Mtu *int32 `json:"mtu,omitempty"` + // UtilityAddresses - READ-ONLY; Array of additional IP addresses used by this Cache. + UtilityAddresses *[]string `json:"utilityAddresses,omitempty"` +} + +// MarshalJSON is the custom marshaler for CacheNetworkSettings. +func (cns CacheNetworkSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cns.Mtu != nil { + objectMap["mtu"] = cns.Mtu + } + return json.Marshal(objectMap) +} + // CacheProperties properties of the Cache. type CacheProperties struct { // CacheSizeGB - The size of this Cache, in GB. @@ -346,6 +419,12 @@ type CacheProperties struct { Subnet *string `json:"subnet,omitempty"` // UpgradeStatus - Upgrade status of the Cache. UpgradeStatus *CacheUpgradeStatus `json:"upgradeStatus,omitempty"` + // NetworkSettings - Specifies network settings of the cache. + NetworkSettings *CacheNetworkSettings `json:"networkSettings,omitempty"` + // EncryptionSettings - Specifies encryption settings of the cache. + EncryptionSettings *CacheEncryptionSettings `json:"encryptionSettings,omitempty"` + // SecuritySettings - Specifies security settings of the cache. + SecuritySettings *CacheSecuritySettings `json:"securitySettings,omitempty"` } // MarshalJSON is the custom marshaler for CacheProperties. @@ -363,6 +442,15 @@ func (c CacheProperties) MarshalJSON() ([]byte, error) { if c.UpgradeStatus != nil { objectMap["upgradeStatus"] = c.UpgradeStatus } + if c.NetworkSettings != nil { + objectMap["networkSettings"] = c.NetworkSettings + } + if c.EncryptionSettings != nil { + objectMap["encryptionSettings"] = c.EncryptionSettings + } + if c.SecuritySettings != nil { + objectMap["securitySettings"] = c.SecuritySettings + } return json.Marshal(objectMap) } @@ -423,6 +511,12 @@ func (future *CachesDeleteFuture) Result(client CachesClient) (so SetObject, err return } +// CacheSecuritySettings cache security settings. +type CacheSecuritySettings struct { + // RootSquash - root squash of cache property. + RootSquash *bool `json:"rootSquash,omitempty"` +} + // CachesFlushFuture an abstraction for monitoring and retrieving the results of a long-running operation. type CachesFlushFuture struct { azure.Future @@ -713,12 +807,78 @@ type CacheUpgradeStatus struct { PendingFirmwareVersion *string `json:"pendingFirmwareVersion,omitempty"` } -// ClfsTarget storage container for use as a CLFS Storage Target. +// ClfsTarget properties pertained to ClfsTarget type ClfsTarget struct { // Target - Resource ID of storage container. Target *string `json:"target,omitempty"` } +// ClfsTargetProperties storage container for use as a CLFS Storage Target. +type ClfsTargetProperties struct { + // Junctions - List of Cache namespace junctions to target for namespace associations. + Junctions *[]NamespaceJunction `json:"junctions,omitempty"` + // ProvisioningState - ARM provisioning state, see https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Creating', 'Deleting', 'Updating' + ProvisioningState ProvisioningStateType `json:"provisioningState,omitempty"` + // Nfs3 - Properties when targetType is nfs3. + Nfs3 *Nfs3Target `json:"nfs3,omitempty"` + // Clfs - Properties when targetType is clfs. + Clfs *ClfsTarget `json:"clfs,omitempty"` + // Unknown - Properties when targetType is unknown. + Unknown *UnknownTarget `json:"unknown,omitempty"` + // TargetType - Possible values include: 'TargetTypeStorageTargetProperties', 'TargetTypeNfs3', 'TargetTypeClfs', 'TargetTypeUnknown' + TargetType TargetType `json:"targetType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ClfsTargetProperties. +func (ctp ClfsTargetProperties) MarshalJSON() ([]byte, error) { + ctp.TargetType = TargetTypeClfs + objectMap := make(map[string]interface{}) + if ctp.Junctions != nil { + objectMap["junctions"] = ctp.Junctions + } + if ctp.ProvisioningState != "" { + objectMap["provisioningState"] = ctp.ProvisioningState + } + if ctp.Nfs3 != nil { + objectMap["nfs3"] = ctp.Nfs3 + } + if ctp.Clfs != nil { + objectMap["clfs"] = ctp.Clfs + } + if ctp.Unknown != nil { + objectMap["unknown"] = ctp.Unknown + } + if ctp.TargetType != "" { + objectMap["targetType"] = ctp.TargetType + } + return json.Marshal(objectMap) +} + +// AsNfs3TargetProperties is the BasicStorageTargetProperties implementation for ClfsTargetProperties. +func (ctp ClfsTargetProperties) AsNfs3TargetProperties() (*Nfs3TargetProperties, bool) { + return nil, false +} + +// AsClfsTargetProperties is the BasicStorageTargetProperties implementation for ClfsTargetProperties. +func (ctp ClfsTargetProperties) AsClfsTargetProperties() (*ClfsTargetProperties, bool) { + return &ctp, true +} + +// AsUnknownTargetProperties is the BasicStorageTargetProperties implementation for ClfsTargetProperties. +func (ctp ClfsTargetProperties) AsUnknownTargetProperties() (*UnknownTargetProperties, bool) { + return nil, false +} + +// AsStorageTargetProperties is the BasicStorageTargetProperties implementation for ClfsTargetProperties. +func (ctp ClfsTargetProperties) AsStorageTargetProperties() (*StorageTargetProperties, bool) { + return nil, false +} + +// AsBasicStorageTargetProperties is the BasicStorageTargetProperties implementation for ClfsTargetProperties. +func (ctp ClfsTargetProperties) AsBasicStorageTargetProperties() (BasicStorageTargetProperties, bool) { + return &ctp, true +} + // CloudError an error response. type CloudError struct { // Error - The body of the error. @@ -737,6 +897,28 @@ type CloudErrorBody struct { Target *string `json:"target,omitempty"` } +// ErrorResponse describes the format of Error response. +type ErrorResponse struct { + // Code - Error code + Code *string `json:"code,omitempty"` + // Message - Error message indicating why the operation failed. + Message *string `json:"message,omitempty"` +} + +// KeyVaultKeyReference describes a reference to Key Vault Key. +type KeyVaultKeyReference struct { + // KeyURL - The URL referencing a key encryption key in Key Vault. + KeyURL *string `json:"keyUrl,omitempty"` + // SourceVault - Describes a resource Id to source Key Vault. + SourceVault *KeyVaultKeyReferenceSourceVault `json:"sourceVault,omitempty"` +} + +// KeyVaultKeyReferenceSourceVault describes a resource Id to source Key Vault. +type KeyVaultKeyReferenceSourceVault struct { + // ID - Resource Id. + ID *string `json:"id,omitempty"` +} + // NamespaceJunction a namespace junction. type NamespaceJunction struct { // NamespacePath - Namespace path on a Cache for a Storage Target. @@ -747,7 +929,7 @@ type NamespaceJunction struct { NfsExport *string `json:"nfsExport,omitempty"` } -// Nfs3Target an NFSv3 mount point for use as a Storage Target. +// Nfs3Target properties pertained to Nfs3Target type Nfs3Target struct { // Target - IP address or host name of an NFSv3 host (e.g., 10.0.44.44). Target *string `json:"target,omitempty"` @@ -755,6 +937,72 @@ type Nfs3Target struct { UsageModel *string `json:"usageModel,omitempty"` } +// Nfs3TargetProperties an NFSv3 mount point for use as a Storage Target. +type Nfs3TargetProperties struct { + // Junctions - List of Cache namespace junctions to target for namespace associations. + Junctions *[]NamespaceJunction `json:"junctions,omitempty"` + // ProvisioningState - ARM provisioning state, see https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Creating', 'Deleting', 'Updating' + ProvisioningState ProvisioningStateType `json:"provisioningState,omitempty"` + // Nfs3 - Properties when targetType is nfs3. + Nfs3 *Nfs3Target `json:"nfs3,omitempty"` + // Clfs - Properties when targetType is clfs. + Clfs *ClfsTarget `json:"clfs,omitempty"` + // Unknown - Properties when targetType is unknown. + Unknown *UnknownTarget `json:"unknown,omitempty"` + // TargetType - Possible values include: 'TargetTypeStorageTargetProperties', 'TargetTypeNfs3', 'TargetTypeClfs', 'TargetTypeUnknown' + TargetType TargetType `json:"targetType,omitempty"` +} + +// MarshalJSON is the custom marshaler for Nfs3TargetProperties. +func (n3tp Nfs3TargetProperties) MarshalJSON() ([]byte, error) { + n3tp.TargetType = TargetTypeNfs3 + objectMap := make(map[string]interface{}) + if n3tp.Junctions != nil { + objectMap["junctions"] = n3tp.Junctions + } + if n3tp.ProvisioningState != "" { + objectMap["provisioningState"] = n3tp.ProvisioningState + } + if n3tp.Nfs3 != nil { + objectMap["nfs3"] = n3tp.Nfs3 + } + if n3tp.Clfs != nil { + objectMap["clfs"] = n3tp.Clfs + } + if n3tp.Unknown != nil { + objectMap["unknown"] = n3tp.Unknown + } + if n3tp.TargetType != "" { + objectMap["targetType"] = n3tp.TargetType + } + return json.Marshal(objectMap) +} + +// AsNfs3TargetProperties is the BasicStorageTargetProperties implementation for Nfs3TargetProperties. +func (n3tp Nfs3TargetProperties) AsNfs3TargetProperties() (*Nfs3TargetProperties, bool) { + return &n3tp, true +} + +// AsClfsTargetProperties is the BasicStorageTargetProperties implementation for Nfs3TargetProperties. +func (n3tp Nfs3TargetProperties) AsClfsTargetProperties() (*ClfsTargetProperties, bool) { + return nil, false +} + +// AsUnknownTargetProperties is the BasicStorageTargetProperties implementation for Nfs3TargetProperties. +func (n3tp Nfs3TargetProperties) AsUnknownTargetProperties() (*UnknownTargetProperties, bool) { + return nil, false +} + +// AsStorageTargetProperties is the BasicStorageTargetProperties implementation for Nfs3TargetProperties. +func (n3tp Nfs3TargetProperties) AsStorageTargetProperties() (*StorageTargetProperties, bool) { + return nil, false +} + +// AsBasicStorageTargetProperties is the BasicStorageTargetProperties implementation for Nfs3TargetProperties. +func (n3tp Nfs3TargetProperties) AsBasicStorageTargetProperties() (BasicStorageTargetProperties, bool) { + return &n3tp, true +} + // ResourceSku a resource SKU. type ResourceSku struct { // ResourceType - READ-ONLY; The type of resource the SKU applies to. @@ -995,25 +1243,23 @@ type SetObject struct { Value interface{} `json:"value,omitempty"` } -// StorageTarget a storage system being cached by a Cache. +// StorageTarget type of the Storage Target. type StorageTarget struct { autorest.Response `json:"-"` + // BasicStorageTargetProperties - StorageTarget properties + BasicStorageTargetProperties `json:"properties,omitempty"` // Name - READ-ONLY; Name of the Storage Target. Name *string `json:"name,omitempty"` // ID - READ-ONLY; Resource ID of the Storage Target. ID *string `json:"id,omitempty"` // Type - READ-ONLY; Type of the Storage Target; Microsoft.StorageCache/Cache/StorageTarget Type *string `json:"type,omitempty"` - // StorageTargetProperties - Properties of the Storage Target. - *StorageTargetProperties `json:"properties,omitempty"` } // MarshalJSON is the custom marshaler for StorageTarget. func (st StorageTarget) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if st.StorageTargetProperties != nil { - objectMap["properties"] = st.StorageTargetProperties - } + objectMap["properties"] = st.BasicStorageTargetProperties return json.Marshal(objectMap) } @@ -1026,6 +1272,14 @@ func (st *StorageTarget) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { + case "properties": + if v != nil { + basicStorageTargetProperties, err := unmarshalBasicStorageTargetProperties(*v) + if err != nil { + return err + } + st.BasicStorageTargetProperties = basicStorageTargetProperties + } case "name": if v != nil { var name string @@ -1053,27 +1307,24 @@ func (st *StorageTarget) UnmarshalJSON(body []byte) error { } st.Type = &typeVar } - case "properties": - if v != nil { - var storageTargetProperties StorageTargetProperties - err = json.Unmarshal(*v, &storageTargetProperties) - if err != nil { - return err - } - st.StorageTargetProperties = &storageTargetProperties - } } } return nil } +// BasicStorageTargetProperties properties of the Storage Target. +type BasicStorageTargetProperties interface { + AsNfs3TargetProperties() (*Nfs3TargetProperties, bool) + AsClfsTargetProperties() (*ClfsTargetProperties, bool) + AsUnknownTargetProperties() (*UnknownTargetProperties, bool) + AsStorageTargetProperties() (*StorageTargetProperties, bool) +} + // StorageTargetProperties properties of the Storage Target. type StorageTargetProperties struct { // Junctions - List of Cache namespace junctions to target for namespace associations. Junctions *[]NamespaceJunction `json:"junctions,omitempty"` - // TargetType - Type of the Storage Target. Possible values include: 'StorageTargetTypeNfs3', 'StorageTargetTypeClfs', 'StorageTargetTypeUnknown' - TargetType StorageTargetType `json:"targetType,omitempty"` // ProvisioningState - ARM provisioning state, see https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Creating', 'Deleting', 'Updating' ProvisioningState ProvisioningStateType `json:"provisioningState,omitempty"` // Nfs3 - Properties when targetType is nfs3. @@ -1082,6 +1333,113 @@ type StorageTargetProperties struct { Clfs *ClfsTarget `json:"clfs,omitempty"` // Unknown - Properties when targetType is unknown. Unknown *UnknownTarget `json:"unknown,omitempty"` + // TargetType - Possible values include: 'TargetTypeStorageTargetProperties', 'TargetTypeNfs3', 'TargetTypeClfs', 'TargetTypeUnknown' + TargetType TargetType `json:"targetType,omitempty"` +} + +func unmarshalBasicStorageTargetProperties(body []byte) (BasicStorageTargetProperties, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["targetType"] { + case string(TargetTypeNfs3): + var n3tp Nfs3TargetProperties + err := json.Unmarshal(body, &n3tp) + return n3tp, err + case string(TargetTypeClfs): + var ctp ClfsTargetProperties + err := json.Unmarshal(body, &ctp) + return ctp, err + case string(TargetTypeUnknown): + var utp UnknownTargetProperties + err := json.Unmarshal(body, &utp) + return utp, err + default: + var stp StorageTargetProperties + err := json.Unmarshal(body, &stp) + return stp, err + } +} +func unmarshalBasicStorageTargetPropertiesArray(body []byte) ([]BasicStorageTargetProperties, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + stpArray := make([]BasicStorageTargetProperties, len(rawMessages)) + + for index, rawMessage := range rawMessages { + stp, err := unmarshalBasicStorageTargetProperties(*rawMessage) + if err != nil { + return nil, err + } + stpArray[index] = stp + } + return stpArray, nil +} + +// MarshalJSON is the custom marshaler for StorageTargetProperties. +func (stp StorageTargetProperties) MarshalJSON() ([]byte, error) { + stp.TargetType = TargetTypeStorageTargetProperties + objectMap := make(map[string]interface{}) + if stp.Junctions != nil { + objectMap["junctions"] = stp.Junctions + } + if stp.ProvisioningState != "" { + objectMap["provisioningState"] = stp.ProvisioningState + } + if stp.Nfs3 != nil { + objectMap["nfs3"] = stp.Nfs3 + } + if stp.Clfs != nil { + objectMap["clfs"] = stp.Clfs + } + if stp.Unknown != nil { + objectMap["unknown"] = stp.Unknown + } + if stp.TargetType != "" { + objectMap["targetType"] = stp.TargetType + } + return json.Marshal(objectMap) +} + +// AsNfs3TargetProperties is the BasicStorageTargetProperties implementation for StorageTargetProperties. +func (stp StorageTargetProperties) AsNfs3TargetProperties() (*Nfs3TargetProperties, bool) { + return nil, false +} + +// AsClfsTargetProperties is the BasicStorageTargetProperties implementation for StorageTargetProperties. +func (stp StorageTargetProperties) AsClfsTargetProperties() (*ClfsTargetProperties, bool) { + return nil, false +} + +// AsUnknownTargetProperties is the BasicStorageTargetProperties implementation for StorageTargetProperties. +func (stp StorageTargetProperties) AsUnknownTargetProperties() (*UnknownTargetProperties, bool) { + return nil, false +} + +// AsStorageTargetProperties is the BasicStorageTargetProperties implementation for StorageTargetProperties. +func (stp StorageTargetProperties) AsStorageTargetProperties() (*StorageTargetProperties, bool) { + return &stp, true +} + +// AsBasicStorageTargetProperties is the BasicStorageTargetProperties implementation for StorageTargetProperties. +func (stp StorageTargetProperties) AsBasicStorageTargetProperties() (BasicStorageTargetProperties, bool) { + return &stp, true +} + +// StorageTargetResource resource used by a Cache. +type StorageTargetResource struct { + // Name - READ-ONLY; Name of the Storage Target. + Name *string `json:"name,omitempty"` + // ID - READ-ONLY; Resource ID of the Storage Target. + ID *string `json:"id,omitempty"` + // Type - READ-ONLY; Type of the Storage Target; Microsoft.StorageCache/Cache/StorageTarget + Type *string `json:"type,omitempty"` } // StorageTargetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a @@ -1298,7 +1656,7 @@ func NewStorageTargetsResultPage(getNextPage func(context.Context, StorageTarget return StorageTargetsResultPage{fn: getNextPage} } -// UnknownTarget storage container for use as an Unknown Storage Target. +// UnknownTarget properties pertained to UnknownTarget type UnknownTarget struct { // UnknownMap - Dictionary of string->string pairs containing information about the Storage Target. UnknownMap map[string]*string `json:"unknownMap"` @@ -1313,6 +1671,72 @@ func (ut UnknownTarget) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// UnknownTargetProperties storage container for use as an Unknown Storage Target. +type UnknownTargetProperties struct { + // Junctions - List of Cache namespace junctions to target for namespace associations. + Junctions *[]NamespaceJunction `json:"junctions,omitempty"` + // ProvisioningState - ARM provisioning state, see https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Creating', 'Deleting', 'Updating' + ProvisioningState ProvisioningStateType `json:"provisioningState,omitempty"` + // Nfs3 - Properties when targetType is nfs3. + Nfs3 *Nfs3Target `json:"nfs3,omitempty"` + // Clfs - Properties when targetType is clfs. + Clfs *ClfsTarget `json:"clfs,omitempty"` + // Unknown - Properties when targetType is unknown. + Unknown *UnknownTarget `json:"unknown,omitempty"` + // TargetType - Possible values include: 'TargetTypeStorageTargetProperties', 'TargetTypeNfs3', 'TargetTypeClfs', 'TargetTypeUnknown' + TargetType TargetType `json:"targetType,omitempty"` +} + +// MarshalJSON is the custom marshaler for UnknownTargetProperties. +func (utp UnknownTargetProperties) MarshalJSON() ([]byte, error) { + utp.TargetType = TargetTypeUnknown + objectMap := make(map[string]interface{}) + if utp.Junctions != nil { + objectMap["junctions"] = utp.Junctions + } + if utp.ProvisioningState != "" { + objectMap["provisioningState"] = utp.ProvisioningState + } + if utp.Nfs3 != nil { + objectMap["nfs3"] = utp.Nfs3 + } + if utp.Clfs != nil { + objectMap["clfs"] = utp.Clfs + } + if utp.Unknown != nil { + objectMap["unknown"] = utp.Unknown + } + if utp.TargetType != "" { + objectMap["targetType"] = utp.TargetType + } + return json.Marshal(objectMap) +} + +// AsNfs3TargetProperties is the BasicStorageTargetProperties implementation for UnknownTargetProperties. +func (utp UnknownTargetProperties) AsNfs3TargetProperties() (*Nfs3TargetProperties, bool) { + return nil, false +} + +// AsClfsTargetProperties is the BasicStorageTargetProperties implementation for UnknownTargetProperties. +func (utp UnknownTargetProperties) AsClfsTargetProperties() (*ClfsTargetProperties, bool) { + return nil, false +} + +// AsUnknownTargetProperties is the BasicStorageTargetProperties implementation for UnknownTargetProperties. +func (utp UnknownTargetProperties) AsUnknownTargetProperties() (*UnknownTargetProperties, bool) { + return &utp, true +} + +// AsStorageTargetProperties is the BasicStorageTargetProperties implementation for UnknownTargetProperties. +func (utp UnknownTargetProperties) AsStorageTargetProperties() (*StorageTargetProperties, bool) { + return nil, false +} + +// AsBasicStorageTargetProperties is the BasicStorageTargetProperties implementation for UnknownTargetProperties. +func (utp UnknownTargetProperties) AsBasicStorageTargetProperties() (BasicStorageTargetProperties, bool) { + return &utp, true +} + // UsageModel a usage model. type UsageModel struct { // Display - Localized information describing this usage model. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2019-11-01/storagecache/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2020-03-01/storagecache/operations.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2019-11-01/storagecache/operations.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2020-03-01/storagecache/operations.go index 25830061798b..d01fb59b1c99 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2019-11-01/storagecache/operations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2020-03-01/storagecache/operations.go @@ -81,7 +81,7 @@ func (client OperationsClient) List(ctx context.Context) (result APIOperationLis // ListPreparer prepares the List request. func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2019-11-01" + const APIVersion = "2020-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2019-11-01/storagecache/skus.go b/vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2020-03-01/storagecache/skus.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2019-11-01/storagecache/skus.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2020-03-01/storagecache/skus.go index eee99b060ce1..bbd451b15797 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2019-11-01/storagecache/skus.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2020-03-01/storagecache/skus.go @@ -85,7 +85,7 @@ func (client SkusClient) ListPreparer(ctx context.Context) (*http.Request, error "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-11-01" + const APIVersion = "2020-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2019-11-01/storagecache/storagetargets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2020-03-01/storagecache/storagetargets.go similarity index 91% rename from vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2019-11-01/storagecache/storagetargets.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2020-03-01/storagecache/storagetargets.go index 30edbf31f311..b20e42946cb6 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2019-11-01/storagecache/storagetargets.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2020-03-01/storagecache/storagetargets.go @@ -48,8 +48,10 @@ func NewStorageTargetsClientWithBaseURI(baseURI string, subscriptionID string) S // unhealthy, the actual creation/modification of the Storage Target may be delayed until the Cache is healthy again. // Parameters: // resourceGroupName - target resource group. -// cacheName - name of Cache. -// storageTargetName - name of the Storage Target. +// cacheName - name of Cache. Length of name must be not greater than 80 and chars must be in list of +// [-0-9a-zA-Z_] char class. +// storageTargetName - name of the Storage Target. Length of name must be not greater than 80 and chars must be +// in list of [-0-9a-zA-Z_] char class. // storagetarget - object containing the definition of a Storage Target. func (client StorageTargetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, cacheName string, storageTargetName string, storagetarget *StorageTarget) (result StorageTargetsCreateOrUpdateFuture, err error) { if tracing.IsEnabled() { @@ -66,13 +68,13 @@ func (client StorageTargetsClient) CreateOrUpdate(ctx context.Context, resourceG {TargetValue: cacheName, Constraints: []validation.Constraint{{Target: "cacheName", Name: validation.Pattern, Rule: `^[-0-9a-zA-Z_]{1,80}$`, Chain: nil}}}, {TargetValue: storageTargetName, - Constraints: []validation.Constraint{{Target: "storageTargetName", Name: validation.Pattern, Rule: `^[-0-9a-zA-Z_]{1,31}$`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "storageTargetName", Name: validation.Pattern, Rule: `^[-0-9a-zA-Z_]{1,80}$`, Chain: nil}}}, {TargetValue: storagetarget, Constraints: []validation.Constraint{{Target: "storagetarget", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "storagetarget.StorageTargetProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "storagetarget.StorageTargetProperties.Nfs3", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "storagetarget.StorageTargetProperties.Nfs3.Target", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "storagetarget.StorageTargetProperties.Nfs3.Target", Name: validation.Pattern, Rule: `^[-.0-9a-zA-Z]+$`, Chain: nil}}}, + Chain: []validation.Constraint{{Target: "storagetarget.BasicStorageTargetProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "storagetarget.BasicStorageTargetProperties.Nfs3", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "storagetarget.BasicStorageTargetProperties.Nfs3.Target", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "storagetarget.BasicStorageTargetProperties.Nfs3.Target", Name: validation.Pattern, Rule: `^[-.0-9a-zA-Z]+$`, Chain: nil}}}, }}, }}, }}}}}); err != nil { @@ -103,14 +105,11 @@ func (client StorageTargetsClient) CreateOrUpdatePreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-11-01" + const APIVersion = "2020-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } - storagetarget.Name = nil - storagetarget.ID = nil - storagetarget.Type = nil preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), @@ -154,7 +153,8 @@ func (client StorageTargetsClient) CreateOrUpdateResponder(resp *http.Response) // deleted. // Parameters: // resourceGroupName - target resource group. -// cacheName - name of Cache. +// cacheName - name of Cache. Length of name must be not greater than 80 and chars must be in list of +// [-0-9a-zA-Z_] char class. // storageTargetName - name of Storage Target. func (client StorageTargetsClient) Delete(ctx context.Context, resourceGroupName string, cacheName string, storageTargetName string) (result StorageTargetsDeleteFuture, err error) { if tracing.IsEnabled() { @@ -171,7 +171,7 @@ func (client StorageTargetsClient) Delete(ctx context.Context, resourceGroupName {TargetValue: cacheName, Constraints: []validation.Constraint{{Target: "cacheName", Name: validation.Pattern, Rule: `^[-0-9a-zA-Z_]{1,80}$`, Chain: nil}}}, {TargetValue: storageTargetName, - Constraints: []validation.Constraint{{Target: "storageTargetName", Name: validation.Pattern, Rule: `^[-0-9a-zA-Z_]{1,31}$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "storageTargetName", Name: validation.Pattern, Rule: `^[-0-9a-zA-Z_]{1,80}$`, Chain: nil}}}}); err != nil { return result, validation.NewError("storagecache.StorageTargetsClient", "Delete", err.Error()) } @@ -199,7 +199,7 @@ func (client StorageTargetsClient) DeletePreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-11-01" + const APIVersion = "2020-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -239,8 +239,10 @@ func (client StorageTargetsClient) DeleteResponder(resp *http.Response) (result // Get returns a Storage Target from a Cache. // Parameters: // resourceGroupName - target resource group. -// cacheName - name of Cache. -// storageTargetName - name of the Storage Target. +// cacheName - name of Cache. Length of name must be not greater than 80 and chars must be in list of +// [-0-9a-zA-Z_] char class. +// storageTargetName - name of the Storage Target. Length of name must be not greater than 80 and chars must be +// in list of [-0-9a-zA-Z_] char class. func (client StorageTargetsClient) Get(ctx context.Context, resourceGroupName string, cacheName string, storageTargetName string) (result StorageTarget, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/StorageTargetsClient.Get") @@ -256,7 +258,7 @@ func (client StorageTargetsClient) Get(ctx context.Context, resourceGroupName st {TargetValue: cacheName, Constraints: []validation.Constraint{{Target: "cacheName", Name: validation.Pattern, Rule: `^[-0-9a-zA-Z_]{1,80}$`, Chain: nil}}}, {TargetValue: storageTargetName, - Constraints: []validation.Constraint{{Target: "storageTargetName", Name: validation.Pattern, Rule: `^[-0-9a-zA-Z_]{1,31}$`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "storageTargetName", Name: validation.Pattern, Rule: `^[-0-9a-zA-Z_]{1,80}$`, Chain: nil}}}}); err != nil { return result, validation.NewError("storagecache.StorageTargetsClient", "Get", err.Error()) } @@ -290,7 +292,7 @@ func (client StorageTargetsClient) GetPreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-11-01" + const APIVersion = "2020-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -324,7 +326,8 @@ func (client StorageTargetsClient) GetResponder(resp *http.Response) (result Sto // ListByCache returns a list of Storage Targets for the specified Cache. // Parameters: // resourceGroupName - target resource group. -// cacheName - name of Cache. +// cacheName - name of Cache. Length of name must be not greater than 80 and chars must be in list of +// [-0-9a-zA-Z_] char class. func (client StorageTargetsClient) ListByCache(ctx context.Context, resourceGroupName string, cacheName string) (result StorageTargetsResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/StorageTargetsClient.ListByCache") @@ -375,7 +378,7 @@ func (client StorageTargetsClient) ListByCachePreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-11-01" + const APIVersion = "2020-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2019-11-01/storagecache/usagemodels.go b/vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2020-03-01/storagecache/usagemodels.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2019-11-01/storagecache/usagemodels.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2020-03-01/storagecache/usagemodels.go index 4cd71e19643a..ce6da10c3b65 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2019-11-01/storagecache/usagemodels.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2020-03-01/storagecache/usagemodels.go @@ -85,7 +85,7 @@ func (client UsageModelsClient) ListPreparer(ctx context.Context) (*http.Request "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-11-01" + const APIVersion = "2020-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2019-11-01/storagecache/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2020-03-01/storagecache/version.go similarity index 94% rename from vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2019-11-01/storagecache/version.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2020-03-01/storagecache/version.go index 75ce2d61fa6c..de6fc4707922 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2019-11-01/storagecache/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2020-03-01/storagecache/version.go @@ -21,7 +21,7 @@ import "github.com/Azure/azure-sdk-for-go/version" // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/" + Version() + " storagecache/2019-11-01" + return "Azure-SDK-For-Go/" + Version() + " storagecache/2020-03-01" } // Version returns the semantic version (see http://semver.org) of the client. diff --git a/vendor/modules.txt b/vendor/modules.txt index 2998fbe9b6b9..d65319571339 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -101,7 +101,7 @@ github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus github.com/Azure/azure-sdk-for-go/services/servicefabric/mgmt/2018-02-01/servicefabric github.com/Azure/azure-sdk-for-go/services/signalr/mgmt/2018-10-01/signalr github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage -github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2019-11-01/storagecache +github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2020-03-01/storagecache github.com/Azure/azure-sdk-for-go/services/storagesync/mgmt/2020-03-01/storagesync github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2016-03-01/streamanalytics github.com/Azure/azure-sdk-for-go/services/trafficmanager/mgmt/2018-04-01/trafficmanager diff --git a/website/docs/r/hpc_cache.html.markdown b/website/docs/r/hpc_cache.html.markdown index 0cb2e189d161..335f9bfb01f2 100644 --- a/website/docs/r/hpc_cache.html.markdown +++ b/website/docs/r/hpc_cache.html.markdown @@ -62,6 +62,12 @@ The following arguments are supported: * `sku_name` - (Required) The SKU of HPC Cache to use. Possible values are `Standard_2G`, `Standard_4G` and `Standard_8G`. Changing this forces a new resource to be created. +--- + +* `mtu` - (Optional) The IPv4 maximum transmission unit configured for the subnet of the HPC Cache. Possible values range from 576 - 1500. Defaults to 1500. + +* `root_squash_enabled` - (Optional) Whether root squash property is enabled for this HPC Cache. + ## Attributes Reference The following attributes are exported: