diff --git a/sdk/resourcemanager/storagecache/armstoragecache/CHANGELOG.md b/sdk/resourcemanager/storagecache/armstoragecache/CHANGELOG.md index f362013e64d8..1a0a7e4e82b6 100644 --- a/sdk/resourcemanager/storagecache/armstoragecache/CHANGELOG.md +++ b/sdk/resourcemanager/storagecache/armstoragecache/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 3.2.2 (2023-06-26) +### Other Changes + + ## 3.2.1 (2023-06-23) ### Bugs Fixed diff --git a/sdk/resourcemanager/storagecache/armstoragecache/amlfilesystems_client_example_test.go b/sdk/resourcemanager/storagecache/armstoragecache/amlfilesystems_client_example_test.go deleted file mode 100644 index 07728dca124e..000000000000 --- a/sdk/resourcemanager/storagecache/armstoragecache/amlfilesystems_client_example_test.go +++ /dev/null @@ -1,733 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armstoragecache_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storagecache/armstoragecache/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/examples/amlFilesystems_List.json -func ExampleAmlFilesystemsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstoragecache.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAmlFilesystemsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AmlFilesystemsListResult = armstoragecache.AmlFilesystemsListResult{ - // Value: []*armstoragecache.AmlFilesystem{ - // { - // Name: to.Ptr("fs1"), - // Type: to.Ptr("Microsoft.StorageCache/amlFilesystem"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.StorageCache/amlFilesystems/fs1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "Dept": to.Ptr("ContosoAds"), - // }, - // Identity: &armstoragecache.AmlFilesystemIdentity{ - // Type: to.Ptr(armstoragecache.AmlFilesystemIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armstoragecache.UserAssignedIdentitiesValue{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armstoragecache.UserAssignedIdentitiesValue{ - // }, - // }, - // }, - // Properties: &armstoragecache.AmlFilesystemProperties{ - // ClientInfo: &armstoragecache.AmlFilesystemClientInfo{ - // ContainerStorageInterface: &armstoragecache.AmlFilesystemContainerStorageInterface{ - // PersistentVolume: to.Ptr(""), - // PersistentVolumeClaim: to.Ptr(""), - // StorageClass: to.Ptr(""), - // }, - // LustreVersion: to.Ptr("2.15.0"), - // MgsAddress: to.Ptr("10.0.0.4"), - // MountCommand: to.Ptr("mount -t lustre 10.0.0.4@tcp:/lustrefs /lustre/lustrefs"), - // }, - // EncryptionSettings: &armstoragecache.AmlFilesystemEncryptionSettings{ - // KeyEncryptionKey: &armstoragecache.KeyVaultKeyReference{ - // KeyURL: to.Ptr("https://examplekv.vault.azure.net/keys/kvk/3540a47df75541378d3518c6a4bdf5af"), - // SourceVault: &armstoragecache.KeyVaultKeyReferenceSourceVault{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.KeyVault/vaults/keyvault-cmk"), - // }, - // }, - // }, - // FilesystemSubnet: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/fsSub1"), - // Health: &armstoragecache.AmlFilesystemHealth{ - // State: to.Ptr(armstoragecache.AmlFilesystemHealthStateTypeAvailable), - // StatusDescription: to.Ptr("amlFilesystem is ok."), - // }, - // Hsm: &armstoragecache.AmlFilesystemPropertiesHsm{ - // ArchiveStatus: []*armstoragecache.AmlFilesystemArchive{ - // { - // FilesystemPath: to.Ptr("/"), - // Status: &armstoragecache.AmlFilesystemArchiveStatus{ - // LastCompletionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-21T18:25:43.511Z"); return t}()), - // LastStartedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-21T17:25:43.511Z"); return t}()), - // State: to.Ptr(armstoragecache.ArchiveStatusTypeCompleted), - // }, - // }}, - // Settings: &armstoragecache.AmlFilesystemHsmSettings{ - // Container: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Storage/storageAccounts/storageaccountname/blobServices/default/containers/containername"), - // ImportPrefix: to.Ptr("/"), - // LoggingContainer: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Storage/storageAccounts/storageaccountname/blobServices/default/containers/loggingcontainername"), - // }, - // }, - // MaintenanceWindow: &armstoragecache.AmlFilesystemPropertiesMaintenanceWindow{ - // DayOfWeek: to.Ptr(armstoragecache.MaintenanceDayOfWeekTypeFriday), - // TimeOfDayUTC: to.Ptr("22:00"), - // }, - // ProvisioningState: to.Ptr(armstoragecache.AmlFilesystemProvisioningStateTypeSucceeded), - // StorageCapacityTiB: to.Ptr[float32](16), - // ThroughputProvisionedMBps: to.Ptr[int32](500), - // }, - // SKU: &armstoragecache.SKUName{ - // Name: to.Ptr("AMLFS-Durable-Premium-250"), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // }, - // { - // Name: to.Ptr("fs2"), - // Type: to.Ptr("Microsoft.StorageCache/amlFilesystem"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.StorageCache/amlFilesystems/fs2"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "Dept": to.Ptr("ContosoAds"), - // }, - // Identity: &armstoragecache.AmlFilesystemIdentity{ - // Type: to.Ptr(armstoragecache.AmlFilesystemIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armstoragecache.UserAssignedIdentitiesValue{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armstoragecache.UserAssignedIdentitiesValue{ - // }, - // }, - // }, - // Properties: &armstoragecache.AmlFilesystemProperties{ - // ClientInfo: &armstoragecache.AmlFilesystemClientInfo{ - // ContainerStorageInterface: &armstoragecache.AmlFilesystemContainerStorageInterface{ - // PersistentVolume: to.Ptr(""), - // PersistentVolumeClaim: to.Ptr(""), - // StorageClass: to.Ptr(""), - // }, - // LustreVersion: to.Ptr("2.15.0"), - // MgsAddress: to.Ptr("10.0.0.4"), - // MountCommand: to.Ptr("mount -t lustre 10.0.0.4@tcp:/lustrefs /lustre/lustrefs"), - // }, - // EncryptionSettings: &armstoragecache.AmlFilesystemEncryptionSettings{ - // KeyEncryptionKey: &armstoragecache.KeyVaultKeyReference{ - // KeyURL: to.Ptr("https://examplekv.vault.azure.net/keys/kvk/3540a47df75541378d3518c6a4bdf5af"), - // SourceVault: &armstoragecache.KeyVaultKeyReferenceSourceVault{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.KeyVault/vaults/keyvault-cmk"), - // }, - // }, - // }, - // FilesystemSubnet: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/fsSub2"), - // Health: &armstoragecache.AmlFilesystemHealth{ - // State: to.Ptr(armstoragecache.AmlFilesystemHealthStateTypeAvailable), - // StatusDescription: to.Ptr("amlFilesystem is ok."), - // }, - // Hsm: &armstoragecache.AmlFilesystemPropertiesHsm{ - // ArchiveStatus: []*armstoragecache.AmlFilesystemArchive{ - // { - // FilesystemPath: to.Ptr("/"), - // Status: &armstoragecache.AmlFilesystemArchiveStatus{ - // LastCompletionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-21T18:25:43.511Z"); return t}()), - // LastStartedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-21T17:25:43.511Z"); return t}()), - // State: to.Ptr(armstoragecache.ArchiveStatusTypeCompleted), - // }, - // }}, - // Settings: &armstoragecache.AmlFilesystemHsmSettings{ - // Container: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Storage/storageAccounts/storageaccountname/blobServices/default/containers/containername"), - // ImportPrefix: to.Ptr("/"), - // LoggingContainer: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Storage/storageAccounts/storageaccountname/blobServices/default/containers/loggingcontainername"), - // }, - // }, - // MaintenanceWindow: &armstoragecache.AmlFilesystemPropertiesMaintenanceWindow{ - // DayOfWeek: to.Ptr(armstoragecache.MaintenanceDayOfWeekTypeFriday), - // TimeOfDayUTC: to.Ptr("22:00"), - // }, - // ProvisioningState: to.Ptr(armstoragecache.AmlFilesystemProvisioningStateTypeSucceeded), - // StorageCapacityTiB: to.Ptr[float32](16), - // ThroughputProvisionedMBps: to.Ptr[int32](500), - // }, - // SKU: &armstoragecache.SKUName{ - // Name: to.Ptr("AMLFS-Durable-Premium-250"), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/examples/amlFilesystems_ListByResourceGroup.json -func ExampleAmlFilesystemsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstoragecache.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAmlFilesystemsClient().NewListByResourceGroupPager("scgroup", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AmlFilesystemsListResult = armstoragecache.AmlFilesystemsListResult{ - // Value: []*armstoragecache.AmlFilesystem{ - // { - // Name: to.Ptr("fs1"), - // Type: to.Ptr("Microsoft.StorageCache/amlFilesystem"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.StorageCache/amlFilesystems/fs1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "Dept": to.Ptr("ContosoAds"), - // }, - // Identity: &armstoragecache.AmlFilesystemIdentity{ - // Type: to.Ptr(armstoragecache.AmlFilesystemIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armstoragecache.UserAssignedIdentitiesValue{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armstoragecache.UserAssignedIdentitiesValue{ - // }, - // }, - // }, - // Properties: &armstoragecache.AmlFilesystemProperties{ - // ClientInfo: &armstoragecache.AmlFilesystemClientInfo{ - // ContainerStorageInterface: &armstoragecache.AmlFilesystemContainerStorageInterface{ - // PersistentVolume: to.Ptr(""), - // PersistentVolumeClaim: to.Ptr(""), - // StorageClass: to.Ptr(""), - // }, - // LustreVersion: to.Ptr("2.15.0"), - // MgsAddress: to.Ptr("10.0.0.4"), - // MountCommand: to.Ptr("mount -t lustre 10.0.0.4@tcp:/lustrefs /lustre/lustrefs"), - // }, - // EncryptionSettings: &armstoragecache.AmlFilesystemEncryptionSettings{ - // KeyEncryptionKey: &armstoragecache.KeyVaultKeyReference{ - // KeyURL: to.Ptr("https://examplekv.vault.azure.net/keys/kvk/3540a47df75541378d3518c6a4bdf5af"), - // SourceVault: &armstoragecache.KeyVaultKeyReferenceSourceVault{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.KeyVault/vaults/keyvault-cmk"), - // }, - // }, - // }, - // FilesystemSubnet: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/fsSub1"), - // Health: &armstoragecache.AmlFilesystemHealth{ - // State: to.Ptr(armstoragecache.AmlFilesystemHealthStateTypeAvailable), - // StatusDescription: to.Ptr("amlFilesystem is ok."), - // }, - // Hsm: &armstoragecache.AmlFilesystemPropertiesHsm{ - // ArchiveStatus: []*armstoragecache.AmlFilesystemArchive{ - // { - // FilesystemPath: to.Ptr("/"), - // Status: &armstoragecache.AmlFilesystemArchiveStatus{ - // LastCompletionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-21T18:25:43.511Z"); return t}()), - // LastStartedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-21T17:25:43.511Z"); return t}()), - // State: to.Ptr(armstoragecache.ArchiveStatusTypeCompleted), - // }, - // }}, - // Settings: &armstoragecache.AmlFilesystemHsmSettings{ - // Container: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Storage/storageAccounts/storageaccountname/blobServices/default/containers/containername"), - // ImportPrefix: to.Ptr("/"), - // LoggingContainer: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Storage/storageAccounts/storageaccountname/blobServices/default/containers/loggingcontainername"), - // }, - // }, - // MaintenanceWindow: &armstoragecache.AmlFilesystemPropertiesMaintenanceWindow{ - // DayOfWeek: to.Ptr(armstoragecache.MaintenanceDayOfWeekTypeFriday), - // TimeOfDayUTC: to.Ptr("22:00"), - // }, - // ProvisioningState: to.Ptr(armstoragecache.AmlFilesystemProvisioningStateTypeSucceeded), - // StorageCapacityTiB: to.Ptr[float32](16), - // ThroughputProvisionedMBps: to.Ptr[int32](500), - // }, - // SKU: &armstoragecache.SKUName{ - // Name: to.Ptr("AMLFS-Durable-Premium-250"), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // }, - // { - // Name: to.Ptr("fs2"), - // Type: to.Ptr("Microsoft.StorageCache/amlFilesystem"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.StorageCache/amlFilesystems/fs2"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "Dept": to.Ptr("ContosoAds"), - // }, - // Identity: &armstoragecache.AmlFilesystemIdentity{ - // Type: to.Ptr(armstoragecache.AmlFilesystemIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armstoragecache.UserAssignedIdentitiesValue{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armstoragecache.UserAssignedIdentitiesValue{ - // }, - // }, - // }, - // Properties: &armstoragecache.AmlFilesystemProperties{ - // ClientInfo: &armstoragecache.AmlFilesystemClientInfo{ - // ContainerStorageInterface: &armstoragecache.AmlFilesystemContainerStorageInterface{ - // PersistentVolume: to.Ptr(""), - // PersistentVolumeClaim: to.Ptr(""), - // StorageClass: to.Ptr(""), - // }, - // LustreVersion: to.Ptr("2.15.0"), - // MgsAddress: to.Ptr("10.0.0.4"), - // MountCommand: to.Ptr("mount -t lustre 10.0.0.4@tcp:/lustrefs /lustre/lustrefs"), - // }, - // EncryptionSettings: &armstoragecache.AmlFilesystemEncryptionSettings{ - // KeyEncryptionKey: &armstoragecache.KeyVaultKeyReference{ - // KeyURL: to.Ptr("https://examplekv.vault.azure.net/keys/kvk/3540a47df75541378d3518c6a4bdf5af"), - // SourceVault: &armstoragecache.KeyVaultKeyReferenceSourceVault{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.KeyVault/vaults/keyvault-cmk"), - // }, - // }, - // }, - // FilesystemSubnet: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/fsSub2"), - // Health: &armstoragecache.AmlFilesystemHealth{ - // State: to.Ptr(armstoragecache.AmlFilesystemHealthStateTypeAvailable), - // StatusDescription: to.Ptr("amlFilesystem is ok."), - // }, - // Hsm: &armstoragecache.AmlFilesystemPropertiesHsm{ - // ArchiveStatus: []*armstoragecache.AmlFilesystemArchive{ - // { - // FilesystemPath: to.Ptr("/"), - // Status: &armstoragecache.AmlFilesystemArchiveStatus{ - // LastCompletionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-21T18:25:43.511Z"); return t}()), - // LastStartedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-21T17:25:43.511Z"); return t}()), - // State: to.Ptr(armstoragecache.ArchiveStatusTypeCompleted), - // }, - // }}, - // Settings: &armstoragecache.AmlFilesystemHsmSettings{ - // Container: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Storage/storageAccounts/storageaccountname/blobServices/default/containers/containername"), - // ImportPrefix: to.Ptr("/"), - // LoggingContainer: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Storage/storageAccounts/storageaccountname/blobServices/default/containers/loggingcontainername"), - // }, - // }, - // MaintenanceWindow: &armstoragecache.AmlFilesystemPropertiesMaintenanceWindow{ - // DayOfWeek: to.Ptr(armstoragecache.MaintenanceDayOfWeekTypeFriday), - // TimeOfDayUTC: to.Ptr("22:00"), - // }, - // ProvisioningState: to.Ptr(armstoragecache.AmlFilesystemProvisioningStateTypeSucceeded), - // StorageCapacityTiB: to.Ptr[float32](16), - // ThroughputProvisionedMBps: to.Ptr[int32](500), - // }, - // SKU: &armstoragecache.SKUName{ - // Name: to.Ptr("AMLFS-Durable-Premium-250"), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/examples/amlFilesystems_Delete.json -func ExampleAmlFilesystemsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstoragecache.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAmlFilesystemsClient().BeginDelete(ctx, "scgroup", "fs1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/examples/amlFilesystems_Get.json -func ExampleAmlFilesystemsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstoragecache.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAmlFilesystemsClient().Get(ctx, "scgroup", "fs1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AmlFilesystem = armstoragecache.AmlFilesystem{ - // Name: to.Ptr("fs1"), - // Type: to.Ptr("Microsoft.StorageCache/amlFilesystem"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.StorageCache/amlFilesystems/fs1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "Dept": to.Ptr("ContosoAds"), - // }, - // Identity: &armstoragecache.AmlFilesystemIdentity{ - // Type: to.Ptr(armstoragecache.AmlFilesystemIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armstoragecache.UserAssignedIdentitiesValue{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armstoragecache.UserAssignedIdentitiesValue{ - // }, - // }, - // }, - // Properties: &armstoragecache.AmlFilesystemProperties{ - // ClientInfo: &armstoragecache.AmlFilesystemClientInfo{ - // ContainerStorageInterface: &armstoragecache.AmlFilesystemContainerStorageInterface{ - // PersistentVolume: to.Ptr(""), - // PersistentVolumeClaim: to.Ptr(""), - // StorageClass: to.Ptr(""), - // }, - // LustreVersion: to.Ptr("2.15.0"), - // MgsAddress: to.Ptr("10.0.0.4"), - // MountCommand: to.Ptr("mount -t lustre 10.0.0.4@tcp:/lustrefs /lustre/lustrefs"), - // }, - // EncryptionSettings: &armstoragecache.AmlFilesystemEncryptionSettings{ - // KeyEncryptionKey: &armstoragecache.KeyVaultKeyReference{ - // KeyURL: to.Ptr("https://keyvault-cmk.vault.azure.net/keys/key2048/test"), - // SourceVault: &armstoragecache.KeyVaultKeyReferenceSourceVault{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.KeyVault/vaults/keyvault-cmk"), - // }, - // }, - // }, - // FilesystemSubnet: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/fsSub"), - // Health: &armstoragecache.AmlFilesystemHealth{ - // State: to.Ptr(armstoragecache.AmlFilesystemHealthStateTypeAvailable), - // StatusDescription: to.Ptr("amlFilesystem is ok."), - // }, - // Hsm: &armstoragecache.AmlFilesystemPropertiesHsm{ - // ArchiveStatus: []*armstoragecache.AmlFilesystemArchive{ - // { - // FilesystemPath: to.Ptr("/"), - // Status: &armstoragecache.AmlFilesystemArchiveStatus{ - // LastCompletionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-21T18:25:43.511Z"); return t}()), - // LastStartedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-21T17:25:43.511Z"); return t}()), - // State: to.Ptr(armstoragecache.ArchiveStatusTypeCompleted), - // }, - // }}, - // Settings: &armstoragecache.AmlFilesystemHsmSettings{ - // Container: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Storage/storageAccounts/storageaccountname/blobServices/default/containers/containername"), - // ImportPrefix: to.Ptr("/"), - // LoggingContainer: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Storage/storageAccounts/storageaccountname/blobServices/default/containers/loggingcontainername"), - // }, - // }, - // MaintenanceWindow: &armstoragecache.AmlFilesystemPropertiesMaintenanceWindow{ - // DayOfWeek: to.Ptr(armstoragecache.MaintenanceDayOfWeekTypeFriday), - // TimeOfDayUTC: to.Ptr("22:00"), - // }, - // ProvisioningState: to.Ptr(armstoragecache.AmlFilesystemProvisioningStateTypeSucceeded), - // StorageCapacityTiB: to.Ptr[float32](16), - // ThroughputProvisionedMBps: to.Ptr[int32](500), - // }, - // SKU: &armstoragecache.SKUName{ - // Name: to.Ptr("AMLFS-Durable-Premium-250"), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/examples/amlFilesystems_CreateOrUpdate.json -func ExampleAmlFilesystemsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstoragecache.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAmlFilesystemsClient().BeginCreateOrUpdate(ctx, "scgroup", "fs1", armstoragecache.AmlFilesystem{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "Dept": to.Ptr("ContosoAds"), - }, - Identity: &armstoragecache.AmlFilesystemIdentity{ - Type: to.Ptr(armstoragecache.AmlFilesystemIdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armstoragecache.UserAssignedIdentitiesValue{ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {}, - }, - }, - Properties: &armstoragecache.AmlFilesystemProperties{ - EncryptionSettings: &armstoragecache.AmlFilesystemEncryptionSettings{ - KeyEncryptionKey: &armstoragecache.KeyVaultKeyReference{ - KeyURL: to.Ptr("https://examplekv.vault.azure.net/keys/kvk/3540a47df75541378d3518c6a4bdf5af"), - SourceVault: &armstoragecache.KeyVaultKeyReferenceSourceVault{ - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.KeyVault/vaults/keyvault-cmk"), - }, - }, - }, - FilesystemSubnet: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/fsSub"), - Hsm: &armstoragecache.AmlFilesystemPropertiesHsm{ - Settings: &armstoragecache.AmlFilesystemHsmSettings{ - Container: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Storage/storageAccounts/storageaccountname/blobServices/default/containers/containername"), - ImportPrefix: to.Ptr("/"), - LoggingContainer: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Storage/storageAccounts/storageaccountname/blobServices/default/containers/loggingcontainername"), - }, - }, - MaintenanceWindow: &armstoragecache.AmlFilesystemPropertiesMaintenanceWindow{ - DayOfWeek: to.Ptr(armstoragecache.MaintenanceDayOfWeekTypeFriday), - TimeOfDayUTC: to.Ptr("22:00"), - }, - StorageCapacityTiB: to.Ptr[float32](16), - }, - SKU: &armstoragecache.SKUName{ - Name: to.Ptr("AMLFS-Durable-Premium-250"), - }, - Zones: []*string{ - to.Ptr("1")}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AmlFilesystem = armstoragecache.AmlFilesystem{ - // Name: to.Ptr("fs1"), - // Type: to.Ptr("Microsoft.StorageCache/amlFilesystem"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.StorageCache/amlFilesystems/fs1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "Dept": to.Ptr("ContosoAds"), - // }, - // Identity: &armstoragecache.AmlFilesystemIdentity{ - // Type: to.Ptr(armstoragecache.AmlFilesystemIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armstoragecache.UserAssignedIdentitiesValue{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armstoragecache.UserAssignedIdentitiesValue{ - // }, - // }, - // }, - // Properties: &armstoragecache.AmlFilesystemProperties{ - // ClientInfo: &armstoragecache.AmlFilesystemClientInfo{ - // ContainerStorageInterface: &armstoragecache.AmlFilesystemContainerStorageInterface{ - // PersistentVolume: to.Ptr(""), - // PersistentVolumeClaim: to.Ptr(""), - // StorageClass: to.Ptr(""), - // }, - // LustreVersion: to.Ptr("2.15.0"), - // MgsAddress: to.Ptr("10.0.0.4"), - // MountCommand: to.Ptr("mount -t lustre 10.0.0.4@tcp:/lustrefs /lustre/lustrefs"), - // }, - // FilesystemSubnet: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/fsSub"), - // Health: &armstoragecache.AmlFilesystemHealth{ - // State: to.Ptr(armstoragecache.AmlFilesystemHealthStateTypeAvailable), - // StatusDescription: to.Ptr("amlFilesystem is ok."), - // }, - // Hsm: &armstoragecache.AmlFilesystemPropertiesHsm{ - // ArchiveStatus: []*armstoragecache.AmlFilesystemArchive{ - // { - // FilesystemPath: to.Ptr("/"), - // Status: &armstoragecache.AmlFilesystemArchiveStatus{ - // LastCompletionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-21T18:25:43.511Z"); return t}()), - // LastStartedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-21T17:25:43.511Z"); return t}()), - // State: to.Ptr(armstoragecache.ArchiveStatusTypeCompleted), - // }, - // }}, - // Settings: &armstoragecache.AmlFilesystemHsmSettings{ - // Container: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Storage/storageAccounts/storageaccountname/blobServices/default/containers/containername"), - // ImportPrefix: to.Ptr("/"), - // LoggingContainer: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Storage/storageAccounts/storageaccountname/blobServices/default/containers/loggingcontainername"), - // }, - // }, - // MaintenanceWindow: &armstoragecache.AmlFilesystemPropertiesMaintenanceWindow{ - // DayOfWeek: to.Ptr(armstoragecache.MaintenanceDayOfWeekTypeFriday), - // TimeOfDayUTC: to.Ptr("22:00"), - // }, - // ProvisioningState: to.Ptr(armstoragecache.AmlFilesystemProvisioningStateTypeSucceeded), - // StorageCapacityTiB: to.Ptr[float32](16), - // ThroughputProvisionedMBps: to.Ptr[int32](500), - // }, - // SKU: &armstoragecache.SKUName{ - // Name: to.Ptr("AMLFS-Durable-Premium-250"), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/examples/amlFilesystems_Update.json -func ExampleAmlFilesystemsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstoragecache.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAmlFilesystemsClient().BeginUpdate(ctx, "scgroup", "fs1", armstoragecache.AmlFilesystemUpdate{ - Properties: &armstoragecache.AmlFilesystemUpdateProperties{ - EncryptionSettings: &armstoragecache.AmlFilesystemEncryptionSettings{ - KeyEncryptionKey: &armstoragecache.KeyVaultKeyReference{ - KeyURL: to.Ptr("https://examplekv.vault.azure.net/keys/kvk/3540a47df75541378d3518c6a4bdf5af"), - SourceVault: &armstoragecache.KeyVaultKeyReferenceSourceVault{ - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.KeyVault/vaults/keyvault-cmk"), - }, - }, - }, - MaintenanceWindow: &armstoragecache.AmlFilesystemUpdatePropertiesMaintenanceWindow{ - DayOfWeek: to.Ptr(armstoragecache.MaintenanceDayOfWeekTypeFriday), - TimeOfDayUTC: to.Ptr("22:00"), - }, - }, - Tags: map[string]*string{ - "Dept": to.Ptr("ContosoAds"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AmlFilesystem = armstoragecache.AmlFilesystem{ - // Name: to.Ptr("fs1"), - // Type: to.Ptr("Microsoft.StorageCache/amlFilesystem"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.StorageCache/amlFilesystems/fs1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "Dept": to.Ptr("ContosoAds"), - // }, - // Identity: &armstoragecache.AmlFilesystemIdentity{ - // Type: to.Ptr(armstoragecache.AmlFilesystemIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armstoragecache.UserAssignedIdentitiesValue{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armstoragecache.UserAssignedIdentitiesValue{ - // }, - // }, - // }, - // Properties: &armstoragecache.AmlFilesystemProperties{ - // ClientInfo: &armstoragecache.AmlFilesystemClientInfo{ - // ContainerStorageInterface: &armstoragecache.AmlFilesystemContainerStorageInterface{ - // PersistentVolume: to.Ptr(""), - // PersistentVolumeClaim: to.Ptr(""), - // StorageClass: to.Ptr(""), - // }, - // LustreVersion: to.Ptr("2.15.0"), - // MgsAddress: to.Ptr("10.0.0.4"), - // MountCommand: to.Ptr("mount -t lustre 10.0.0.4@tcp:/lustrefs /lustre/lustrefs"), - // }, - // EncryptionSettings: &armstoragecache.AmlFilesystemEncryptionSettings{ - // KeyEncryptionKey: &armstoragecache.KeyVaultKeyReference{ - // KeyURL: to.Ptr("https://examplekv.vault.azure.net/keys/kvk/3540a47df75541378d3518c6a4bdf5af"), - // SourceVault: &armstoragecache.KeyVaultKeyReferenceSourceVault{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.KeyVault/vaults/keyvault-cmk"), - // }, - // }, - // }, - // FilesystemSubnet: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/fsSub"), - // Health: &armstoragecache.AmlFilesystemHealth{ - // State: to.Ptr(armstoragecache.AmlFilesystemHealthStateTypeAvailable), - // StatusDescription: to.Ptr("amlFilesystem is ok."), - // }, - // Hsm: &armstoragecache.AmlFilesystemPropertiesHsm{ - // ArchiveStatus: []*armstoragecache.AmlFilesystemArchive{ - // { - // FilesystemPath: to.Ptr("/"), - // Status: &armstoragecache.AmlFilesystemArchiveStatus{ - // LastCompletionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-21T18:25:43.511Z"); return t}()), - // LastStartedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-21T17:25:43.511Z"); return t}()), - // State: to.Ptr(armstoragecache.ArchiveStatusTypeCompleted), - // }, - // }}, - // Settings: &armstoragecache.AmlFilesystemHsmSettings{ - // Container: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Storage/storageAccounts/storageaccountname/blobServices/default/containers/containername"), - // ImportPrefix: to.Ptr("/"), - // LoggingContainer: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Storage/storageAccounts/storageaccountname/blobServices/default/containers/loggingcontainername"), - // }, - // }, - // MaintenanceWindow: &armstoragecache.AmlFilesystemPropertiesMaintenanceWindow{ - // DayOfWeek: to.Ptr(armstoragecache.MaintenanceDayOfWeekTypeFriday), - // TimeOfDayUTC: to.Ptr("22:00"), - // }, - // ProvisioningState: to.Ptr(armstoragecache.AmlFilesystemProvisioningStateTypeSucceeded), - // StorageCapacityTiB: to.Ptr[float32](16), - // ThroughputProvisionedMBps: to.Ptr[int32](500), - // }, - // SKU: &armstoragecache.SKUName{ - // Name: to.Ptr("AMLFS-Durable-Premium-250"), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/examples/amlFilesystems_Archive.json -func ExampleAmlFilesystemsClient_Archive() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstoragecache.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewAmlFilesystemsClient().Archive(ctx, "scgroup", "sc", &armstoragecache.AmlFilesystemsClientArchiveOptions{ArchiveInfo: &armstoragecache.AmlFilesystemArchiveInfo{ - FilesystemPath: to.Ptr("/"), - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/examples/amlFilesystems_CancelArchive.json -func ExampleAmlFilesystemsClient_CancelArchive() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstoragecache.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewAmlFilesystemsClient().CancelArchive(ctx, "scgroup", "sc", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/storagecache/armstoragecache/ascoperations_client_example_test.go b/sdk/resourcemanager/storagecache/armstoragecache/ascoperations_client_example_test.go deleted file mode 100644 index 1711925fc5a9..000000000000 --- a/sdk/resourcemanager/storagecache/armstoragecache/ascoperations_client_example_test.go +++ /dev/null @@ -1,45 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armstoragecache_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storagecache/armstoragecache/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/examples/AscOperations_Get.json -func ExampleAscOperationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstoragecache.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAscOperationsClient().Get(ctx, "westus", "testoperationid", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AscOperation = armstoragecache.AscOperation{ - // Name: to.Ptr("testoperationid"), - // EndTime: to.Ptr("2023-01-01T16:13:13.933Z"), - // ID: to.Ptr("/subscriptions/id/locations/westus/ascOperations/testoperationid"), - // StartTime: to.Ptr("2023-01-01T13:13:13.933Z"), - // Status: to.Ptr("Succeeded"), - // } -} diff --git a/sdk/resourcemanager/storagecache/armstoragecache/ascusages_client_example_test.go b/sdk/resourcemanager/storagecache/armstoragecache/ascusages_client_example_test.go deleted file mode 100644 index 9d6e41ab6b6d..000000000000 --- a/sdk/resourcemanager/storagecache/armstoragecache/ascusages_client_example_test.go +++ /dev/null @@ -1,64 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armstoragecache_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storagecache/armstoragecache/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/examples/AscResourceUsages_Get.json -func ExampleAscUsagesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstoragecache.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAscUsagesClient().NewListPager("eastus", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ResourceUsagesListResult = armstoragecache.ResourceUsagesListResult{ - // Value: []*armstoragecache.ResourceUsage{ - // { - // Name: &armstoragecache.ResourceUsageName{ - // LocalizedValue: to.Ptr("Cache"), - // Value: to.Ptr("Cache"), - // }, - // CurrentValue: to.Ptr[int32](1), - // Limit: to.Ptr[int32](4), - // Unit: to.Ptr("Count"), - // }, - // { - // Name: &armstoragecache.ResourceUsageName{ - // LocalizedValue: to.Ptr("AmlFilesystem"), - // Value: to.Ptr("AmlFilesystem"), - // }, - // CurrentValue: to.Ptr[int32](0), - // Limit: to.Ptr[int32](4), - // Unit: to.Ptr("Count"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/storagecache/armstoragecache/autorest.md b/sdk/resourcemanager/storagecache/armstoragecache/autorest.md index 39b1ac0904e6..165405ff0e19 100644 --- a/sdk/resourcemanager/storagecache/armstoragecache/autorest.md +++ b/sdk/resourcemanager/storagecache/armstoragecache/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/storagecache/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/storagecache/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 3.2.1 -tag: package-2023-05 +module-version: 3.2.2 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/storagecache/armstoragecache/caches_client_example_test.go b/sdk/resourcemanager/storagecache/armstoragecache/caches_client_example_test.go deleted file mode 100644 index 50c673f01293..000000000000 --- a/sdk/resourcemanager/storagecache/armstoragecache/caches_client_example_test.go +++ /dev/null @@ -1,1858 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armstoragecache_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storagecache/armstoragecache/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/examples/Caches_List.json -func ExampleCachesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstoragecache.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCachesClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CachesListResult = armstoragecache.CachesListResult{ - // Value: []*armstoragecache.Cache{ - // { - // Name: to.Ptr("sc1"), - // Type: to.Ptr("Microsoft.StorageCache/Cache"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.StorageCache/caches/sc1"), - // Location: to.Ptr("westus"), - // Properties: &armstoragecache.CacheProperties{ - // CacheSizeGB: to.Ptr[int32](3072), - // DirectoryServicesSettings: &armstoragecache.CacheDirectorySettings{ - // ActiveDirectory: &armstoragecache.CacheActiveDirectorySettings{ - // CacheNetBiosName: to.Ptr("contosoSmb"), - // DomainJoined: to.Ptr(armstoragecache.DomainJoinedTypeYes), - // DomainName: to.Ptr("contosoAd.contoso.local"), - // DomainNetBiosName: to.Ptr("contosoAd"), - // PrimaryDNSIPAddress: to.Ptr("192.0.2.10"), - // SecondaryDNSIPAddress: to.Ptr("192.0.2.11"), - // }, - // UsernameDownload: &armstoragecache.CacheUsernameDownloadSettings{ - // AutoDownloadCertificate: to.Ptr(false), - // CaCertificateURI: to.Ptr("http://contoso.net/cacert.pem"), - // EncryptLdapConnection: to.Ptr(false), - // ExtendedGroups: to.Ptr(true), - // GroupFileURI: to.Ptr("http://contoso.net/group.file"), - // LdapBaseDN: to.Ptr("dc=contosoad,dc=contoso,dc=local"), - // LdapServer: to.Ptr("192.0.2.12"), - // RequireValidCertificate: to.Ptr(false), - // UserFileURI: to.Ptr("http://contoso.net/passwd.file"), - // UsernameDownloaded: to.Ptr(armstoragecache.UsernameDownloadedTypeYes), - // UsernameSource: to.Ptr(armstoragecache.UsernameSourceLDAP), - // }, - // }, - // EncryptionSettings: &armstoragecache.CacheEncryptionSettings{ - // KeyEncryptionKey: &armstoragecache.KeyVaultKeyReference{ - // KeyURL: to.Ptr("https://keyvault-cmk.vault.azure.net/keys/key2048/test"), - // SourceVault: &armstoragecache.KeyVaultKeyReferenceSourceVault{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.KeyVault/vaults/keyvault-cmk"), - // }, - // }, - // }, - // Health: &armstoragecache.CacheHealth{ - // Conditions: []*armstoragecache.Condition{ - // { - // Message: to.Ptr("Cannot contact DNS server"), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-21T18:25:43.511Z"); return t}()), - // }}, - // State: to.Ptr(armstoragecache.HealthStateTypeTransitioning), - // StatusDescription: to.Ptr("Cache is being created."), - // }, - // MountAddresses: []*string{ - // to.Ptr("192.168.1.1"), - // to.Ptr("192.168.1.2")}, - // NetworkSettings: &armstoragecache.CacheNetworkSettings{ - // DNSSearchDomain: to.Ptr("contoso.com"), - // DNSServers: []*string{ - // to.Ptr("10.1.22.33"), - // to.Ptr("10.1.12.33")}, - // Mtu: to.Ptr[int32](1500), - // NtpServer: to.Ptr("time.contoso.com"), - // }, - // PrimingJobs: []*armstoragecache.PrimingJob{ - // }, - // ProvisioningState: to.Ptr(armstoragecache.ProvisioningStateTypeSucceeded), - // SecuritySettings: &armstoragecache.CacheSecuritySettings{ - // AccessPolicies: []*armstoragecache.NfsAccessPolicy{ - // { - // Name: to.Ptr("default"), - // AccessRules: []*armstoragecache.NfsAccessRule{ - // { - // Access: to.Ptr(armstoragecache.NfsAccessRuleAccessRw), - // RootSquash: to.Ptr(false), - // Scope: to.Ptr(armstoragecache.NfsAccessRuleScopeDefault), - // SubmountAccess: to.Ptr(true), - // Suid: to.Ptr(false), - // }}, - // }}, - // }, - // SpaceAllocation: []*armstoragecache.StorageTargetSpaceAllocation{ - // { - // Name: to.Ptr("st1"), - // AllocationPercentage: to.Ptr[int32](25), - // }, - // { - // Name: to.Ptr("st2"), - // AllocationPercentage: to.Ptr[int32](50), - // }, - // { - // Name: to.Ptr("st3"), - // AllocationPercentage: to.Ptr[int32](25), - // }}, - // Subnet: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/sub1"), - // UpgradeSettings: &armstoragecache.CacheUpgradeSettings{ - // ScheduledTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-26T18:25:43.511Z"); return t}()), - // UpgradeScheduleEnabled: to.Ptr(true), - // }, - // UpgradeStatus: &armstoragecache.CacheUpgradeStatus{ - // CurrentFirmwareVersion: to.Ptr("2022.08.1"), - // FirmwareUpdateDeadline: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-21T18:25:43.511Z"); return t}()), - // FirmwareUpdateStatus: to.Ptr(armstoragecache.FirmwareStatusTypeAvailable), - // LastFirmwareUpdate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-01-21T18:25:43.511Z"); return t}()), - // PendingFirmwareVersion: to.Ptr("2022.08.1"), - // }, - // }, - // SKU: &armstoragecache.CacheSKU{ - // Name: to.Ptr("Standard_2G"), - // }, - // SystemData: &armstoragecache.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armstoragecache.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armstoragecache.CreatedByTypeUser), - // }, - // Tags: map[string]*string{ - // "Dept": to.Ptr("Contoso"), - // }, - // }, - // { - // Name: to.Ptr("sc2"), - // Type: to.Ptr("Microsoft.StorageCache/Cache"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.StorageCache/caches/sc2"), - // Location: to.Ptr("westus"), - // Properties: &armstoragecache.CacheProperties{ - // CacheSizeGB: to.Ptr[int32](3072), - // DirectoryServicesSettings: &armstoragecache.CacheDirectorySettings{ - // ActiveDirectory: &armstoragecache.CacheActiveDirectorySettings{ - // CacheNetBiosName: to.Ptr("contosoSmb"), - // DomainJoined: to.Ptr(armstoragecache.DomainJoinedTypeYes), - // DomainName: to.Ptr("contosoAd.contoso.local"), - // DomainNetBiosName: to.Ptr("contosoAd"), - // PrimaryDNSIPAddress: to.Ptr("192.0.2.10"), - // SecondaryDNSIPAddress: to.Ptr("192.0.2.11"), - // }, - // UsernameDownload: &armstoragecache.CacheUsernameDownloadSettings{ - // AutoDownloadCertificate: to.Ptr(false), - // CaCertificateURI: to.Ptr("http://contoso.net/cacert.pem"), - // EncryptLdapConnection: to.Ptr(false), - // ExtendedGroups: to.Ptr(true), - // GroupFileURI: to.Ptr("http://contoso.net/group.file"), - // LdapBaseDN: to.Ptr(""), - // LdapServer: to.Ptr(""), - // RequireValidCertificate: to.Ptr(false), - // UserFileURI: to.Ptr("http://contoso.net/passwd.file"), - // UsernameDownloaded: to.Ptr(armstoragecache.UsernameDownloadedTypeYes), - // UsernameSource: to.Ptr(armstoragecache.UsernameSourceAD), - // }, - // }, - // EncryptionSettings: &armstoragecache.CacheEncryptionSettings{ - // KeyEncryptionKey: &armstoragecache.KeyVaultKeyReference{ - // KeyURL: to.Ptr("https://keyvault-cmk.vault.azure.net/keys/key2048/test"), - // SourceVault: &armstoragecache.KeyVaultKeyReferenceSourceVault{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.KeyVault/vaults/keyvault-cmk"), - // }, - // }, - // }, - // Health: &armstoragecache.CacheHealth{ - // Conditions: []*armstoragecache.Condition{ - // { - // Message: to.Ptr("Cannot contact DNS server"), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-21T18:25:43.511Z"); return t}()), - // }}, - // State: to.Ptr(armstoragecache.HealthStateTypeTransitioning), - // StatusDescription: to.Ptr("Cache is being created."), - // }, - // MountAddresses: []*string{ - // to.Ptr("192.168.1.1"), - // to.Ptr("192.168.1.2")}, - // NetworkSettings: &armstoragecache.CacheNetworkSettings{ - // DNSSearchDomain: to.Ptr("contoso.com"), - // DNSServers: []*string{ - // to.Ptr("10.1.22.33"), - // to.Ptr("10.1.12.33")}, - // Mtu: to.Ptr[int32](1500), - // NtpServer: to.Ptr("time.contoso.com"), - // }, - // PrimingJobs: []*armstoragecache.PrimingJob{ - // { - // PrimingJobDetails: to.Ptr("Files: Cached=635, Failed=0, Excluded=80, Data=346030 bytes, Directories: Cached=1003, Failed=0, Excluded=0"), - // PrimingJobID: to.Ptr("00000000000_0000000000"), - // PrimingJobName: to.Ptr("contosoJob1"), - // PrimingJobPercentComplete: to.Ptr[float64](100), - // PrimingJobState: to.Ptr(armstoragecache.PrimingJobStateComplete), - // PrimingJobStatus: to.Ptr("success"), - // }, - // { - // PrimingJobDetails: to.Ptr(""), - // PrimingJobID: to.Ptr("11111111111_1111111111"), - // PrimingJobName: to.Ptr("contosoJob2"), - // PrimingJobPercentComplete: to.Ptr[float64](0), - // PrimingJobState: to.Ptr(armstoragecache.PrimingJobStateQueued), - // PrimingJobStatus: to.Ptr(""), - // }}, - // ProvisioningState: to.Ptr(armstoragecache.ProvisioningStateTypeSucceeded), - // SecuritySettings: &armstoragecache.CacheSecuritySettings{ - // AccessPolicies: []*armstoragecache.NfsAccessPolicy{ - // { - // Name: to.Ptr("default"), - // AccessRules: []*armstoragecache.NfsAccessRule{ - // { - // Access: to.Ptr(armstoragecache.NfsAccessRuleAccessRw), - // RootSquash: to.Ptr(false), - // Scope: to.Ptr(armstoragecache.NfsAccessRuleScopeDefault), - // SubmountAccess: to.Ptr(true), - // Suid: to.Ptr(false), - // }}, - // }}, - // }, - // SpaceAllocation: []*armstoragecache.StorageTargetSpaceAllocation{ - // }, - // Subnet: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/sub2"), - // UpgradeSettings: &armstoragecache.CacheUpgradeSettings{ - // ScheduledTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-26T18:25:43.511Z"); return t}()), - // UpgradeScheduleEnabled: to.Ptr(true), - // }, - // UpgradeStatus: &armstoragecache.CacheUpgradeStatus{ - // CurrentFirmwareVersion: to.Ptr("2022.08.1"), - // FirmwareUpdateDeadline: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-21T18:25:43.511Z"); return t}()), - // FirmwareUpdateStatus: to.Ptr(armstoragecache.FirmwareStatusTypeAvailable), - // LastFirmwareUpdate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-01-21T18:25:43.511Z"); return t}()), - // PendingFirmwareVersion: to.Ptr("2022.08.1"), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // }, - // SKU: &armstoragecache.CacheSKU{ - // Name: to.Ptr("Standard_2G"), - // }, - // SystemData: &armstoragecache.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armstoragecache.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armstoragecache.CreatedByTypeUser), - // }, - // Tags: map[string]*string{ - // "Dept": to.Ptr("Contoso"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/examples/Caches_ListByResourceGroup.json -func ExampleCachesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstoragecache.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCachesClient().NewListByResourceGroupPager("scgroup", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CachesListResult = armstoragecache.CachesListResult{ - // Value: []*armstoragecache.Cache{ - // { - // Name: to.Ptr("sc1"), - // Type: to.Ptr("Microsoft.StorageCache/Cache"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.StorageCache/caches/sc1"), - // Location: to.Ptr("westus"), - // Properties: &armstoragecache.CacheProperties{ - // CacheSizeGB: to.Ptr[int32](3072), - // DirectoryServicesSettings: &armstoragecache.CacheDirectorySettings{ - // ActiveDirectory: &armstoragecache.CacheActiveDirectorySettings{ - // CacheNetBiosName: to.Ptr("contosoSmb"), - // DomainJoined: to.Ptr(armstoragecache.DomainJoinedTypeYes), - // DomainName: to.Ptr("contosoAd.contoso.local"), - // DomainNetBiosName: to.Ptr("contosoAd"), - // PrimaryDNSIPAddress: to.Ptr("192.0.2.10"), - // SecondaryDNSIPAddress: to.Ptr("192.0.2.11"), - // }, - // UsernameDownload: &armstoragecache.CacheUsernameDownloadSettings{ - // AutoDownloadCertificate: to.Ptr(false), - // CaCertificateURI: to.Ptr("http://contoso.net/cacert.pem"), - // EncryptLdapConnection: to.Ptr(false), - // ExtendedGroups: to.Ptr(true), - // GroupFileURI: to.Ptr("http://contoso.net/group.file"), - // LdapBaseDN: to.Ptr("dc=contosoad,dc=contoso,dc=local"), - // LdapServer: to.Ptr("192.0.2.12"), - // RequireValidCertificate: to.Ptr(false), - // UserFileURI: to.Ptr("http://contoso.net/passwd.file"), - // UsernameDownloaded: to.Ptr(armstoragecache.UsernameDownloadedTypeYes), - // UsernameSource: to.Ptr(armstoragecache.UsernameSourceLDAP), - // }, - // }, - // EncryptionSettings: &armstoragecache.CacheEncryptionSettings{ - // KeyEncryptionKey: &armstoragecache.KeyVaultKeyReference{ - // KeyURL: to.Ptr("https://keyvault-cmk.vault.azure.net/keys/key2048/test"), - // SourceVault: &armstoragecache.KeyVaultKeyReferenceSourceVault{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.KeyVault/vaults/keyvault-cmk"), - // }, - // }, - // }, - // Health: &armstoragecache.CacheHealth{ - // Conditions: []*armstoragecache.Condition{ - // { - // Message: to.Ptr("Cannot contact DNS server"), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-21T18:25:43.511Z"); return t}()), - // }}, - // State: to.Ptr(armstoragecache.HealthStateTypeTransitioning), - // StatusDescription: to.Ptr("Cache is being created."), - // }, - // MountAddresses: []*string{ - // to.Ptr("192.168.1.1"), - // to.Ptr("192.168.1.2")}, - // NetworkSettings: &armstoragecache.CacheNetworkSettings{ - // DNSSearchDomain: to.Ptr("contoso.com"), - // DNSServers: []*string{ - // to.Ptr("10.1.22.33"), - // to.Ptr("10.1.12.33")}, - // Mtu: to.Ptr[int32](1500), - // NtpServer: to.Ptr("time.contoso.com"), - // }, - // PrimingJobs: []*armstoragecache.PrimingJob{ - // }, - // ProvisioningState: to.Ptr(armstoragecache.ProvisioningStateTypeSucceeded), - // SecuritySettings: &armstoragecache.CacheSecuritySettings{ - // AccessPolicies: []*armstoragecache.NfsAccessPolicy{ - // { - // Name: to.Ptr("default"), - // AccessRules: []*armstoragecache.NfsAccessRule{ - // { - // Access: to.Ptr(armstoragecache.NfsAccessRuleAccessRw), - // RootSquash: to.Ptr(false), - // Scope: to.Ptr(armstoragecache.NfsAccessRuleScopeDefault), - // SubmountAccess: to.Ptr(true), - // Suid: to.Ptr(false), - // }}, - // }}, - // }, - // SpaceAllocation: []*armstoragecache.StorageTargetSpaceAllocation{ - // { - // Name: to.Ptr("st1"), - // AllocationPercentage: to.Ptr[int32](25), - // }, - // { - // Name: to.Ptr("st2"), - // AllocationPercentage: to.Ptr[int32](50), - // }, - // { - // Name: to.Ptr("st3"), - // AllocationPercentage: to.Ptr[int32](25), - // }}, - // Subnet: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/sub1"), - // UpgradeSettings: &armstoragecache.CacheUpgradeSettings{ - // ScheduledTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-26T18:25:43.511Z"); return t}()), - // UpgradeScheduleEnabled: to.Ptr(true), - // }, - // UpgradeStatus: &armstoragecache.CacheUpgradeStatus{ - // CurrentFirmwareVersion: to.Ptr("2022.08.1"), - // FirmwareUpdateDeadline: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-21T18:25:43.511Z"); return t}()), - // FirmwareUpdateStatus: to.Ptr(armstoragecache.FirmwareStatusTypeAvailable), - // LastFirmwareUpdate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-01-21T18:25:43.511Z"); return t}()), - // PendingFirmwareVersion: to.Ptr("2022.08.1"), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // }, - // SKU: &armstoragecache.CacheSKU{ - // Name: to.Ptr("Standard_2G"), - // }, - // SystemData: &armstoragecache.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armstoragecache.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armstoragecache.CreatedByTypeUser), - // }, - // Tags: map[string]*string{ - // "Dept": to.Ptr("Contoso"), - // }, - // }, - // { - // Name: to.Ptr("sc2"), - // Type: to.Ptr("Microsoft.StorageCache/Cache"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.StorageCache/caches/sc2"), - // Location: to.Ptr("westus"), - // Properties: &armstoragecache.CacheProperties{ - // CacheSizeGB: to.Ptr[int32](3072), - // DirectoryServicesSettings: &armstoragecache.CacheDirectorySettings{ - // ActiveDirectory: &armstoragecache.CacheActiveDirectorySettings{ - // CacheNetBiosName: to.Ptr("contosoSmb"), - // DomainJoined: to.Ptr(armstoragecache.DomainJoinedTypeYes), - // DomainName: to.Ptr("contosoAd.contoso.local"), - // DomainNetBiosName: to.Ptr("contosoAd"), - // PrimaryDNSIPAddress: to.Ptr("192.0.2.10"), - // SecondaryDNSIPAddress: to.Ptr("192.0.2.11"), - // }, - // UsernameDownload: &armstoragecache.CacheUsernameDownloadSettings{ - // AutoDownloadCertificate: to.Ptr(false), - // CaCertificateURI: to.Ptr("http://contoso.net/cacert.pem"), - // EncryptLdapConnection: to.Ptr(false), - // ExtendedGroups: to.Ptr(true), - // GroupFileURI: to.Ptr("http://contoso.net/group.file"), - // LdapBaseDN: to.Ptr(""), - // LdapServer: to.Ptr(""), - // RequireValidCertificate: to.Ptr(false), - // UserFileURI: to.Ptr("http://contoso.net/passwd.file"), - // UsernameDownloaded: to.Ptr(armstoragecache.UsernameDownloadedTypeYes), - // UsernameSource: to.Ptr(armstoragecache.UsernameSourceAD), - // }, - // }, - // EncryptionSettings: &armstoragecache.CacheEncryptionSettings{ - // KeyEncryptionKey: &armstoragecache.KeyVaultKeyReference{ - // KeyURL: to.Ptr("https://keyvault-cmk.vault.azure.net/keys/key2048/test"), - // SourceVault: &armstoragecache.KeyVaultKeyReferenceSourceVault{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.KeyVault/vaults/keyvault-cmk"), - // }, - // }, - // }, - // Health: &armstoragecache.CacheHealth{ - // Conditions: []*armstoragecache.Condition{ - // { - // Message: to.Ptr("Cannot contact DNS server"), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-21T18:25:43.511Z"); return t}()), - // }}, - // State: to.Ptr(armstoragecache.HealthStateTypeTransitioning), - // StatusDescription: to.Ptr("Cache is being created."), - // }, - // MountAddresses: []*string{ - // to.Ptr("192.168.1.1"), - // to.Ptr("192.168.1.2")}, - // NetworkSettings: &armstoragecache.CacheNetworkSettings{ - // DNSSearchDomain: to.Ptr("contoso.com"), - // DNSServers: []*string{ - // to.Ptr("10.1.22.33"), - // to.Ptr("10.1.12.33")}, - // Mtu: to.Ptr[int32](1500), - // NtpServer: to.Ptr("time.contoso.com"), - // }, - // PrimingJobs: []*armstoragecache.PrimingJob{ - // { - // PrimingJobDetails: to.Ptr("Files: Cached=635, Failed=0, Excluded=80, Data=346030 bytes, Directories: Cached=1003, Failed=0, Excluded=0"), - // PrimingJobID: to.Ptr("00000000000_0000000000"), - // PrimingJobName: to.Ptr("contosoJob1"), - // PrimingJobPercentComplete: to.Ptr[float64](100), - // PrimingJobState: to.Ptr(armstoragecache.PrimingJobStateComplete), - // PrimingJobStatus: to.Ptr("success"), - // }, - // { - // PrimingJobDetails: to.Ptr(""), - // PrimingJobID: to.Ptr("11111111111_1111111111"), - // PrimingJobName: to.Ptr("contosoJob2"), - // PrimingJobPercentComplete: to.Ptr[float64](0), - // PrimingJobState: to.Ptr(armstoragecache.PrimingJobStateQueued), - // PrimingJobStatus: to.Ptr(""), - // }}, - // ProvisioningState: to.Ptr(armstoragecache.ProvisioningStateTypeSucceeded), - // SecuritySettings: &armstoragecache.CacheSecuritySettings{ - // AccessPolicies: []*armstoragecache.NfsAccessPolicy{ - // { - // Name: to.Ptr("default"), - // AccessRules: []*armstoragecache.NfsAccessRule{ - // { - // Access: to.Ptr(armstoragecache.NfsAccessRuleAccessRw), - // RootSquash: to.Ptr(false), - // Scope: to.Ptr(armstoragecache.NfsAccessRuleScopeDefault), - // SubmountAccess: to.Ptr(true), - // Suid: to.Ptr(false), - // }}, - // }}, - // }, - // SpaceAllocation: []*armstoragecache.StorageTargetSpaceAllocation{ - // }, - // Subnet: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/sub2"), - // UpgradeSettings: &armstoragecache.CacheUpgradeSettings{ - // ScheduledTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-26T18:25:43.511Z"); return t}()), - // UpgradeScheduleEnabled: to.Ptr(true), - // }, - // UpgradeStatus: &armstoragecache.CacheUpgradeStatus{ - // CurrentFirmwareVersion: to.Ptr("2022.08.1"), - // FirmwareUpdateDeadline: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-21T18:25:43.511Z"); return t}()), - // FirmwareUpdateStatus: to.Ptr(armstoragecache.FirmwareStatusTypeAvailable), - // LastFirmwareUpdate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-01-21T18:25:43.511Z"); return t}()), - // PendingFirmwareVersion: to.Ptr("2022.08.1"), - // }, - // Zones: []*string{ - // to.Ptr("2")}, - // }, - // SKU: &armstoragecache.CacheSKU{ - // Name: to.Ptr("Standard_2G"), - // }, - // SystemData: &armstoragecache.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armstoragecache.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armstoragecache.CreatedByTypeUser), - // }, - // Tags: map[string]*string{ - // "Dept": to.Ptr("Contoso"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/examples/Caches_Delete.json -func ExampleCachesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstoragecache.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCachesClient().BeginDelete(ctx, "scgroup", "sc", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/examples/Caches_Get.json -func ExampleCachesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstoragecache.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCachesClient().Get(ctx, "scgroup", "sc1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Cache = armstoragecache.Cache{ - // Name: to.Ptr("sc1"), - // Type: to.Ptr("Microsoft.StorageCache/Cache"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.StorageCache/caches/sc1"), - // Location: to.Ptr("westus"), - // Properties: &armstoragecache.CacheProperties{ - // CacheSizeGB: to.Ptr[int32](3072), - // DirectoryServicesSettings: &armstoragecache.CacheDirectorySettings{ - // ActiveDirectory: &armstoragecache.CacheActiveDirectorySettings{ - // CacheNetBiosName: to.Ptr("contosoSmb"), - // DomainJoined: to.Ptr(armstoragecache.DomainJoinedTypeYes), - // DomainName: to.Ptr("contosoAd.contoso.local"), - // DomainNetBiosName: to.Ptr("contosoAd"), - // PrimaryDNSIPAddress: to.Ptr("192.0.2.10"), - // SecondaryDNSIPAddress: to.Ptr("192.0.2.11"), - // }, - // UsernameDownload: &armstoragecache.CacheUsernameDownloadSettings{ - // AutoDownloadCertificate: to.Ptr(false), - // CaCertificateURI: to.Ptr("http://contoso.net/cacert.pem"), - // EncryptLdapConnection: to.Ptr(false), - // ExtendedGroups: to.Ptr(true), - // GroupFileURI: to.Ptr("http://contoso.net/group.file"), - // LdapBaseDN: to.Ptr("dc=contosoad,dc=contoso,dc=local"), - // LdapServer: to.Ptr("192.0.2.12"), - // RequireValidCertificate: to.Ptr(false), - // UserFileURI: to.Ptr("http://contoso.net/passwd.file"), - // UsernameDownloaded: to.Ptr(armstoragecache.UsernameDownloadedTypeYes), - // UsernameSource: to.Ptr(armstoragecache.UsernameSourceLDAP), - // }, - // }, - // EncryptionSettings: &armstoragecache.CacheEncryptionSettings{ - // KeyEncryptionKey: &armstoragecache.KeyVaultKeyReference{ - // KeyURL: to.Ptr("https://keyvault-cmk.vault.azure.net/keys/key2048/test"), - // SourceVault: &armstoragecache.KeyVaultKeyReferenceSourceVault{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.KeyVault/vaults/keyvault-cmk"), - // }, - // }, - // }, - // Health: &armstoragecache.CacheHealth{ - // Conditions: []*armstoragecache.Condition{ - // { - // Message: to.Ptr("Cannot contact DNS server"), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-21T18:25:43.511Z"); return t}()), - // }}, - // State: to.Ptr(armstoragecache.HealthStateTypeTransitioning), - // StatusDescription: to.Ptr("Cache is being created."), - // }, - // MountAddresses: []*string{ - // to.Ptr("192.168.1.1"), - // to.Ptr("192.168.1.2")}, - // NetworkSettings: &armstoragecache.CacheNetworkSettings{ - // DNSSearchDomain: to.Ptr("contoso.com"), - // DNSServers: []*string{ - // to.Ptr("10.1.22.33"), - // to.Ptr("10.1.12.33")}, - // Mtu: to.Ptr[int32](1500), - // NtpServer: to.Ptr("time.contoso.com"), - // }, - // PrimingJobs: []*armstoragecache.PrimingJob{ - // { - // PrimingJobDetails: to.Ptr("Files: Cached=635, Failed=0, Excluded=80, Data=346030 bytes, Directories: Cached=1003, Failed=0, Excluded=0"), - // PrimingJobID: to.Ptr("00000000000_0000000000"), - // PrimingJobName: to.Ptr("contosoJob1"), - // PrimingJobPercentComplete: to.Ptr[float64](100), - // PrimingJobState: to.Ptr(armstoragecache.PrimingJobStateComplete), - // PrimingJobStatus: to.Ptr("success"), - // }, - // { - // PrimingJobDetails: to.Ptr(""), - // PrimingJobID: to.Ptr("11111111111_1111111111"), - // PrimingJobName: to.Ptr("contosoJob2"), - // PrimingJobPercentComplete: to.Ptr[float64](0), - // PrimingJobState: to.Ptr(armstoragecache.PrimingJobStateQueued), - // PrimingJobStatus: to.Ptr(""), - // }}, - // ProvisioningState: to.Ptr(armstoragecache.ProvisioningStateTypeSucceeded), - // SecuritySettings: &armstoragecache.CacheSecuritySettings{ - // AccessPolicies: []*armstoragecache.NfsAccessPolicy{ - // { - // Name: to.Ptr("default"), - // AccessRules: []*armstoragecache.NfsAccessRule{ - // { - // Access: to.Ptr(armstoragecache.NfsAccessRuleAccessRw), - // RootSquash: to.Ptr(false), - // Scope: to.Ptr(armstoragecache.NfsAccessRuleScopeDefault), - // SubmountAccess: to.Ptr(true), - // Suid: to.Ptr(false), - // }}, - // }}, - // }, - // SpaceAllocation: []*armstoragecache.StorageTargetSpaceAllocation{ - // { - // Name: to.Ptr("st1"), - // AllocationPercentage: to.Ptr[int32](25), - // }, - // { - // Name: to.Ptr("st2"), - // AllocationPercentage: to.Ptr[int32](50), - // }, - // { - // Name: to.Ptr("st3"), - // AllocationPercentage: to.Ptr[int32](25), - // }}, - // Subnet: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/sub1"), - // UpgradeSettings: &armstoragecache.CacheUpgradeSettings{ - // ScheduledTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-26T18:25:43.511Z"); return t}()), - // UpgradeScheduleEnabled: to.Ptr(true), - // }, - // UpgradeStatus: &armstoragecache.CacheUpgradeStatus{ - // CurrentFirmwareVersion: to.Ptr("2022.08.1"), - // FirmwareUpdateDeadline: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-21T18:25:43.511Z"); return t}()), - // FirmwareUpdateStatus: to.Ptr(armstoragecache.FirmwareStatusTypeAvailable), - // LastFirmwareUpdate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-01-21T18:25:43.511Z"); return t}()), - // PendingFirmwareVersion: to.Ptr("2022.08.1"), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // }, - // SKU: &armstoragecache.CacheSKU{ - // Name: to.Ptr("Standard_2G"), - // }, - // SystemData: &armstoragecache.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armstoragecache.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armstoragecache.CreatedByTypeUser), - // }, - // Tags: map[string]*string{ - // "Dept": to.Ptr("Contoso"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/examples/Caches_CreateOrUpdate.json -func ExampleCachesClient_BeginCreateOrUpdate_cachesCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstoragecache.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCachesClient().BeginCreateOrUpdate(ctx, "scgroup", "sc1", armstoragecache.Cache{ - Identity: &armstoragecache.CacheIdentity{ - Type: to.Ptr(armstoragecache.CacheIdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armstoragecache.UserAssignedIdentitiesValue{ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {}, - }, - }, - Location: to.Ptr("westus"), - Properties: &armstoragecache.CacheProperties{ - CacheSizeGB: to.Ptr[int32](3072), - DirectoryServicesSettings: &armstoragecache.CacheDirectorySettings{ - ActiveDirectory: &armstoragecache.CacheActiveDirectorySettings{ - CacheNetBiosName: to.Ptr("contosoSmb"), - Credentials: &armstoragecache.CacheActiveDirectorySettingsCredentials{ - Password: to.Ptr(""), - Username: to.Ptr("consotoAdmin"), - }, - DomainName: to.Ptr("contosoAd.contoso.local"), - DomainNetBiosName: to.Ptr("contosoAd"), - PrimaryDNSIPAddress: to.Ptr("192.0.2.10"), - SecondaryDNSIPAddress: to.Ptr("192.0.2.11"), - }, - UsernameDownload: &armstoragecache.CacheUsernameDownloadSettings{ - Credentials: &armstoragecache.CacheUsernameDownloadSettingsCredentials{ - BindDn: to.Ptr("cn=ldapadmin,dc=contosoad,dc=contoso,dc=local"), - BindPassword: to.Ptr(""), - }, - ExtendedGroups: to.Ptr(true), - LdapBaseDN: to.Ptr("dc=contosoad,dc=contoso,dc=local"), - LdapServer: to.Ptr("192.0.2.12"), - UsernameSource: to.Ptr(armstoragecache.UsernameSourceLDAP), - }, - }, - EncryptionSettings: &armstoragecache.CacheEncryptionSettings{ - KeyEncryptionKey: &armstoragecache.KeyVaultKeyReference{ - KeyURL: to.Ptr("https://keyvault-cmk.vault.azure.net/keys/key2047/test"), - SourceVault: &armstoragecache.KeyVaultKeyReferenceSourceVault{ - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.KeyVault/vaults/keyvault-cmk"), - }, - }, - }, - SecuritySettings: &armstoragecache.CacheSecuritySettings{ - AccessPolicies: []*armstoragecache.NfsAccessPolicy{ - { - Name: to.Ptr("default"), - AccessRules: []*armstoragecache.NfsAccessRule{ - { - Access: to.Ptr(armstoragecache.NfsAccessRuleAccessRw), - RootSquash: to.Ptr(false), - Scope: to.Ptr(armstoragecache.NfsAccessRuleScopeDefault), - SubmountAccess: to.Ptr(true), - Suid: to.Ptr(false), - }}, - }}, - }, - Subnet: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/sub1"), - UpgradeSettings: &armstoragecache.CacheUpgradeSettings{ - ScheduledTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-26T18:25:43.511Z"); return t }()), - UpgradeScheduleEnabled: to.Ptr(true), - }, - }, - SKU: &armstoragecache.CacheSKU{ - Name: to.Ptr("Standard_2G"), - }, - Tags: map[string]*string{ - "Dept": to.Ptr("Contoso"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Cache = armstoragecache.Cache{ - // Name: to.Ptr("sc1"), - // Type: to.Ptr("Microsoft.StorageCache/Cache"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.StorageCache/caches/sc1"), - // Location: to.Ptr("westus"), - // Properties: &armstoragecache.CacheProperties{ - // CacheSizeGB: to.Ptr[int32](3072), - // DirectoryServicesSettings: &armstoragecache.CacheDirectorySettings{ - // ActiveDirectory: &armstoragecache.CacheActiveDirectorySettings{ - // CacheNetBiosName: to.Ptr("contosoSmb"), - // DomainJoined: to.Ptr(armstoragecache.DomainJoinedTypeYes), - // DomainName: to.Ptr("contosoAd.contoso.local"), - // DomainNetBiosName: to.Ptr("contosoAd"), - // PrimaryDNSIPAddress: to.Ptr("192.0.2.10"), - // SecondaryDNSIPAddress: to.Ptr("192.0.2.11"), - // }, - // UsernameDownload: &armstoragecache.CacheUsernameDownloadSettings{ - // AutoDownloadCertificate: to.Ptr(false), - // CaCertificateURI: to.Ptr("http://contoso.net/cacert.pem"), - // EncryptLdapConnection: to.Ptr(false), - // ExtendedGroups: to.Ptr(true), - // GroupFileURI: to.Ptr("http://contoso.net/group.file"), - // LdapBaseDN: to.Ptr("dc=contosoad,dc=contoso,dc=local"), - // LdapServer: to.Ptr("192.0.2.12"), - // RequireValidCertificate: to.Ptr(false), - // UserFileURI: to.Ptr("http://contoso.net/passwd.file"), - // UsernameDownloaded: to.Ptr(armstoragecache.UsernameDownloadedTypeYes), - // UsernameSource: to.Ptr(armstoragecache.UsernameSourceLDAP), - // }, - // }, - // EncryptionSettings: &armstoragecache.CacheEncryptionSettings{ - // KeyEncryptionKey: &armstoragecache.KeyVaultKeyReference{ - // KeyURL: to.Ptr("https://keyvault-cmk.vault.azure.net/keys/key2048/test"), - // SourceVault: &armstoragecache.KeyVaultKeyReferenceSourceVault{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.KeyVault/vaults/keyvault-cmk"), - // }, - // }, - // }, - // Health: &armstoragecache.CacheHealth{ - // Conditions: []*armstoragecache.Condition{ - // { - // Message: to.Ptr("Cannot contact DNS server"), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-21T18:25:43.511Z"); return t}()), - // }}, - // State: to.Ptr(armstoragecache.HealthStateTypeTransitioning), - // StatusDescription: to.Ptr("Cache is being created."), - // }, - // MountAddresses: []*string{ - // to.Ptr("192.168.1.1"), - // to.Ptr("192.168.1.2")}, - // NetworkSettings: &armstoragecache.CacheNetworkSettings{ - // DNSSearchDomain: to.Ptr("contoso.com"), - // DNSServers: []*string{ - // to.Ptr("10.1.22.33"), - // to.Ptr("10.1.12.33")}, - // Mtu: to.Ptr[int32](1500), - // NtpServer: to.Ptr("time.contoso.com"), - // }, - // PrimingJobs: []*armstoragecache.PrimingJob{ - // { - // PrimingJobDetails: to.Ptr("Files: Cached=635, Failed=0, Excluded=80, Data=346030 bytes, Directories: Cached=1003, Failed=0, Excluded=0"), - // PrimingJobID: to.Ptr("00000000000_0000000000"), - // PrimingJobName: to.Ptr("contosoJob1"), - // PrimingJobPercentComplete: to.Ptr[float64](100), - // PrimingJobState: to.Ptr(armstoragecache.PrimingJobStateComplete), - // PrimingJobStatus: to.Ptr("success"), - // }, - // { - // PrimingJobDetails: to.Ptr(""), - // PrimingJobID: to.Ptr("11111111111_1111111111"), - // PrimingJobName: to.Ptr("contosoJob2"), - // PrimingJobPercentComplete: to.Ptr[float64](0), - // PrimingJobState: to.Ptr(armstoragecache.PrimingJobStateQueued), - // PrimingJobStatus: to.Ptr(""), - // }}, - // ProvisioningState: to.Ptr(armstoragecache.ProvisioningStateTypeSucceeded), - // SecuritySettings: &armstoragecache.CacheSecuritySettings{ - // AccessPolicies: []*armstoragecache.NfsAccessPolicy{ - // { - // Name: to.Ptr("default"), - // AccessRules: []*armstoragecache.NfsAccessRule{ - // { - // Access: to.Ptr(armstoragecache.NfsAccessRuleAccessRw), - // RootSquash: to.Ptr(false), - // Scope: to.Ptr(armstoragecache.NfsAccessRuleScopeDefault), - // SubmountAccess: to.Ptr(true), - // Suid: to.Ptr(false), - // }}, - // }}, - // }, - // SpaceAllocation: []*armstoragecache.StorageTargetSpaceAllocation{ - // }, - // Subnet: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/sub1"), - // UpgradeSettings: &armstoragecache.CacheUpgradeSettings{ - // ScheduledTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-26T18:25:43.511Z"); return t}()), - // UpgradeScheduleEnabled: to.Ptr(true), - // }, - // UpgradeStatus: &armstoragecache.CacheUpgradeStatus{ - // CurrentFirmwareVersion: to.Ptr("2022.08.1"), - // FirmwareUpdateDeadline: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-21T18:25:43.511Z"); return t}()), - // FirmwareUpdateStatus: to.Ptr(armstoragecache.FirmwareStatusTypeAvailable), - // LastFirmwareUpdate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-01-21T18:25:43.511Z"); return t}()), - // PendingFirmwareVersion: to.Ptr("2022.08.1"), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // }, - // SKU: &armstoragecache.CacheSKU{ - // Name: to.Ptr("Standard_2G"), - // }, - // SystemData: &armstoragecache.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armstoragecache.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armstoragecache.CreatedByTypeUser), - // }, - // Tags: map[string]*string{ - // "Dept": to.Ptr("Contoso"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/examples/Caches_CreateOrUpdate_ldap_only.json -func ExampleCachesClient_BeginCreateOrUpdate_cachesCreateOrUpdateLdapOnly() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstoragecache.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCachesClient().BeginCreateOrUpdate(ctx, "scgroup", "sc1", armstoragecache.Cache{ - Location: to.Ptr("westus"), - Properties: &armstoragecache.CacheProperties{ - CacheSizeGB: to.Ptr[int32](3072), - DirectoryServicesSettings: &armstoragecache.CacheDirectorySettings{ - UsernameDownload: &armstoragecache.CacheUsernameDownloadSettings{ - Credentials: &armstoragecache.CacheUsernameDownloadSettingsCredentials{ - BindDn: to.Ptr("cn=ldapadmin,dc=contosoad,dc=contoso,dc=local"), - BindPassword: to.Ptr(""), - }, - ExtendedGroups: to.Ptr(true), - LdapBaseDN: to.Ptr("dc=contosoad,dc=contoso,dc=local"), - LdapServer: to.Ptr("192.0.2.12"), - UsernameSource: to.Ptr(armstoragecache.UsernameSourceLDAP), - }, - }, - EncryptionSettings: &armstoragecache.CacheEncryptionSettings{ - KeyEncryptionKey: &armstoragecache.KeyVaultKeyReference{ - KeyURL: to.Ptr("https://keyvault-cmk.vault.azure.net/keys/key2048/test"), - SourceVault: &armstoragecache.KeyVaultKeyReferenceSourceVault{ - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.KeyVault/vaults/keyvault-cmk"), - }, - }, - }, - SecuritySettings: &armstoragecache.CacheSecuritySettings{ - AccessPolicies: []*armstoragecache.NfsAccessPolicy{ - { - Name: to.Ptr("default"), - AccessRules: []*armstoragecache.NfsAccessRule{ - { - Access: to.Ptr(armstoragecache.NfsAccessRuleAccessRw), - RootSquash: to.Ptr(false), - Scope: to.Ptr(armstoragecache.NfsAccessRuleScopeDefault), - SubmountAccess: to.Ptr(true), - Suid: to.Ptr(false), - }}, - }}, - }, - Subnet: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/sub1"), - UpgradeSettings: &armstoragecache.CacheUpgradeSettings{ - ScheduledTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-26T18:25:43.511Z"); return t }()), - UpgradeScheduleEnabled: to.Ptr(true), - }, - }, - SKU: &armstoragecache.CacheSKU{ - Name: to.Ptr("Standard_2G"), - }, - Tags: map[string]*string{ - "Dept": to.Ptr("Contoso"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Cache = armstoragecache.Cache{ - // Name: to.Ptr("sc1"), - // Type: to.Ptr("Microsoft.StorageCache/Cache"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.StorageCache/caches/sc1"), - // Location: to.Ptr("westus"), - // Properties: &armstoragecache.CacheProperties{ - // CacheSizeGB: to.Ptr[int32](3072), - // DirectoryServicesSettings: &armstoragecache.CacheDirectorySettings{ - // UsernameDownload: &armstoragecache.CacheUsernameDownloadSettings{ - // AutoDownloadCertificate: to.Ptr(false), - // CaCertificateURI: to.Ptr("http://contoso.net/cacert.pem"), - // EncryptLdapConnection: to.Ptr(false), - // ExtendedGroups: to.Ptr(true), - // GroupFileURI: to.Ptr("http://contoso.net/group.file"), - // LdapBaseDN: to.Ptr("dc=contosoad,dc=contoso,dc=local"), - // LdapServer: to.Ptr("192.0.2.12"), - // RequireValidCertificate: to.Ptr(false), - // UserFileURI: to.Ptr("http://contoso.net/passwd.file"), - // UsernameDownloaded: to.Ptr(armstoragecache.UsernameDownloadedTypeYes), - // UsernameSource: to.Ptr(armstoragecache.UsernameSourceLDAP), - // }, - // }, - // EncryptionSettings: &armstoragecache.CacheEncryptionSettings{ - // KeyEncryptionKey: &armstoragecache.KeyVaultKeyReference{ - // KeyURL: to.Ptr("https://keyvault-cmk.vault.azure.net/keys/key2048/test"), - // SourceVault: &armstoragecache.KeyVaultKeyReferenceSourceVault{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.KeyVault/vaults/keyvault-cmk"), - // }, - // }, - // }, - // Health: &armstoragecache.CacheHealth{ - // Conditions: []*armstoragecache.Condition{ - // { - // Message: to.Ptr("Cannot contact DNS server"), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-21T18:25:43.511Z"); return t}()), - // }}, - // State: to.Ptr(armstoragecache.HealthStateTypeTransitioning), - // StatusDescription: to.Ptr("Cache is being created."), - // }, - // MountAddresses: []*string{ - // to.Ptr("192.168.1.1"), - // to.Ptr("192.168.1.2")}, - // NetworkSettings: &armstoragecache.CacheNetworkSettings{ - // DNSSearchDomain: to.Ptr("contoso.com"), - // DNSServers: []*string{ - // to.Ptr("10.1.22.33"), - // to.Ptr("10.1.12.33")}, - // Mtu: to.Ptr[int32](1500), - // NtpServer: to.Ptr("time.contoso.com"), - // }, - // PrimingJobs: []*armstoragecache.PrimingJob{ - // { - // PrimingJobDetails: to.Ptr("Files: Cached=635, Failed=0, Excluded=80, Data=346030 bytes, Directories: Cached=1003, Failed=0, Excluded=0"), - // PrimingJobID: to.Ptr("00000000000_0000000000"), - // PrimingJobName: to.Ptr("contosoJob1"), - // PrimingJobPercentComplete: to.Ptr[float64](100), - // PrimingJobState: to.Ptr(armstoragecache.PrimingJobStateComplete), - // PrimingJobStatus: to.Ptr("success"), - // }, - // { - // PrimingJobDetails: to.Ptr(""), - // PrimingJobID: to.Ptr("11111111111_1111111111"), - // PrimingJobName: to.Ptr("contosoJob2"), - // PrimingJobPercentComplete: to.Ptr[float64](0), - // PrimingJobState: to.Ptr(armstoragecache.PrimingJobStateQueued), - // PrimingJobStatus: to.Ptr(""), - // }}, - // ProvisioningState: to.Ptr(armstoragecache.ProvisioningStateTypeSucceeded), - // SecuritySettings: &armstoragecache.CacheSecuritySettings{ - // AccessPolicies: []*armstoragecache.NfsAccessPolicy{ - // { - // Name: to.Ptr("default"), - // AccessRules: []*armstoragecache.NfsAccessRule{ - // { - // Access: to.Ptr(armstoragecache.NfsAccessRuleAccessRw), - // RootSquash: to.Ptr(false), - // Scope: to.Ptr(armstoragecache.NfsAccessRuleScopeDefault), - // SubmountAccess: to.Ptr(true), - // Suid: to.Ptr(false), - // }}, - // }}, - // }, - // SpaceAllocation: []*armstoragecache.StorageTargetSpaceAllocation{ - // }, - // Subnet: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/sub1"), - // UpgradeSettings: &armstoragecache.CacheUpgradeSettings{ - // ScheduledTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-26T18:25:43.511Z"); return t}()), - // UpgradeScheduleEnabled: to.Ptr(true), - // }, - // UpgradeStatus: &armstoragecache.CacheUpgradeStatus{ - // CurrentFirmwareVersion: to.Ptr("2022.08.1"), - // FirmwareUpdateDeadline: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-21T18:25:43.511Z"); return t}()), - // FirmwareUpdateStatus: to.Ptr(armstoragecache.FirmwareStatusTypeAvailable), - // LastFirmwareUpdate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-01-21T18:25:43.511Z"); return t}()), - // PendingFirmwareVersion: to.Ptr("2022.08.1"), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // }, - // SKU: &armstoragecache.CacheSKU{ - // Name: to.Ptr("Standard_2G"), - // }, - // SystemData: &armstoragecache.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armstoragecache.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armstoragecache.CreatedByTypeUser), - // }, - // Tags: map[string]*string{ - // "Dept": to.Ptr("Contoso"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/examples/Caches_Update.json -func ExampleCachesClient_BeginUpdate_cachesUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstoragecache.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCachesClient().BeginUpdate(ctx, "scgroup", "sc1", armstoragecache.Cache{ - Location: to.Ptr("westus"), - Properties: &armstoragecache.CacheProperties{ - CacheSizeGB: to.Ptr[int32](3072), - DirectoryServicesSettings: &armstoragecache.CacheDirectorySettings{ - ActiveDirectory: &armstoragecache.CacheActiveDirectorySettings{ - CacheNetBiosName: to.Ptr("contosoSmb"), - DomainName: to.Ptr("contosoAd.contoso.local"), - DomainNetBiosName: to.Ptr("contosoAd"), - PrimaryDNSIPAddress: to.Ptr("192.0.2.10"), - SecondaryDNSIPAddress: to.Ptr("192.0.2.11"), - }, - UsernameDownload: &armstoragecache.CacheUsernameDownloadSettings{ - ExtendedGroups: to.Ptr(true), - UsernameSource: to.Ptr(armstoragecache.UsernameSourceAD), - }, - }, - NetworkSettings: &armstoragecache.CacheNetworkSettings{ - DNSSearchDomain: to.Ptr("contoso.com"), - DNSServers: []*string{ - to.Ptr("10.1.22.33"), - to.Ptr("10.1.12.33")}, - Mtu: to.Ptr[int32](1500), - NtpServer: to.Ptr("time.contoso.com"), - }, - SecuritySettings: &armstoragecache.CacheSecuritySettings{ - AccessPolicies: []*armstoragecache.NfsAccessPolicy{ - { - Name: to.Ptr("default"), - AccessRules: []*armstoragecache.NfsAccessRule{ - { - Access: to.Ptr(armstoragecache.NfsAccessRuleAccessRw), - RootSquash: to.Ptr(false), - Scope: to.Ptr(armstoragecache.NfsAccessRuleScopeDefault), - SubmountAccess: to.Ptr(true), - Suid: to.Ptr(false), - }}, - }, - { - Name: to.Ptr("restrictive"), - AccessRules: []*armstoragecache.NfsAccessRule{ - { - Access: to.Ptr(armstoragecache.NfsAccessRuleAccessRw), - Filter: to.Ptr("10.99.3.145"), - RootSquash: to.Ptr(false), - Scope: to.Ptr(armstoragecache.NfsAccessRuleScopeHost), - SubmountAccess: to.Ptr(true), - Suid: to.Ptr(true), - }, - { - Access: to.Ptr(armstoragecache.NfsAccessRuleAccessRw), - Filter: to.Ptr("10.99.1.0/24"), - RootSquash: to.Ptr(false), - Scope: to.Ptr(armstoragecache.NfsAccessRuleScopeNetwork), - SubmountAccess: to.Ptr(true), - Suid: to.Ptr(true), - }, - { - Access: to.Ptr(armstoragecache.NfsAccessRuleAccessNo), - AnonymousGID: to.Ptr("65534"), - AnonymousUID: to.Ptr("65534"), - RootSquash: to.Ptr(true), - Scope: to.Ptr(armstoragecache.NfsAccessRuleScopeDefault), - SubmountAccess: to.Ptr(true), - Suid: to.Ptr(false), - }}, - }}, - }, - Subnet: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/sub1"), - UpgradeSettings: &armstoragecache.CacheUpgradeSettings{ - ScheduledTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-26T18:25:43.511Z"); return t }()), - UpgradeScheduleEnabled: to.Ptr(true), - }, - }, - SKU: &armstoragecache.CacheSKU{ - Name: to.Ptr("Standard_2G"), - }, - Tags: map[string]*string{ - "Dept": to.Ptr("Contoso"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Cache = armstoragecache.Cache{ - // Name: to.Ptr("sc1"), - // Type: to.Ptr("Microsoft.StorageCache/Cache"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.StorageCache/caches/sc1"), - // Location: to.Ptr("westus"), - // Properties: &armstoragecache.CacheProperties{ - // CacheSizeGB: to.Ptr[int32](3072), - // DirectoryServicesSettings: &armstoragecache.CacheDirectorySettings{ - // ActiveDirectory: &armstoragecache.CacheActiveDirectorySettings{ - // CacheNetBiosName: to.Ptr("contosoSmb"), - // DomainJoined: to.Ptr(armstoragecache.DomainJoinedTypeYes), - // DomainName: to.Ptr("contosoAd.contoso.local"), - // DomainNetBiosName: to.Ptr("contosoAd"), - // PrimaryDNSIPAddress: to.Ptr("192.0.2.10"), - // SecondaryDNSIPAddress: to.Ptr("192.0.2.11"), - // }, - // UsernameDownload: &armstoragecache.CacheUsernameDownloadSettings{ - // AutoDownloadCertificate: to.Ptr(false), - // CaCertificateURI: to.Ptr("http://contoso.net/cacert.pem"), - // EncryptLdapConnection: to.Ptr(false), - // ExtendedGroups: to.Ptr(true), - // GroupFileURI: to.Ptr("http://contoso.net/group.file"), - // LdapBaseDN: to.Ptr(""), - // LdapServer: to.Ptr(""), - // RequireValidCertificate: to.Ptr(false), - // UserFileURI: to.Ptr("http://contoso.net/passwd.file"), - // UsernameDownloaded: to.Ptr(armstoragecache.UsernameDownloadedTypeYes), - // UsernameSource: to.Ptr(armstoragecache.UsernameSourceAD), - // }, - // }, - // Health: &armstoragecache.CacheHealth{ - // Conditions: []*armstoragecache.Condition{ - // { - // Message: to.Ptr("Cannot contact DNS server"), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-21T18:25:43.511Z"); return t}()), - // }}, - // State: to.Ptr(armstoragecache.HealthStateTypeTransitioning), - // StatusDescription: to.Ptr("Cache is being created."), - // }, - // MountAddresses: []*string{ - // to.Ptr("192.168.1.1"), - // to.Ptr("192.168.1.2")}, - // NetworkSettings: &armstoragecache.CacheNetworkSettings{ - // DNSSearchDomain: to.Ptr("contoso.com"), - // DNSServers: []*string{ - // to.Ptr("10.1.22.33"), - // to.Ptr("10.1.12.33")}, - // Mtu: to.Ptr[int32](1500), - // NtpServer: to.Ptr("time.contoso.com"), - // }, - // PrimingJobs: []*armstoragecache.PrimingJob{ - // { - // PrimingJobDetails: to.Ptr("Files: Cached=635, Failed=0, Excluded=80, Data=346030 bytes, Directories: Cached=1003, Failed=0, Excluded=0"), - // PrimingJobID: to.Ptr("00000000000_0000000000"), - // PrimingJobName: to.Ptr("contosoJob1"), - // PrimingJobPercentComplete: to.Ptr[float64](100), - // PrimingJobState: to.Ptr(armstoragecache.PrimingJobStateComplete), - // PrimingJobStatus: to.Ptr("success"), - // }, - // { - // PrimingJobDetails: to.Ptr(""), - // PrimingJobID: to.Ptr("11111111111_1111111111"), - // PrimingJobName: to.Ptr("contosoJob2"), - // PrimingJobPercentComplete: to.Ptr[float64](0), - // PrimingJobState: to.Ptr(armstoragecache.PrimingJobStateQueued), - // PrimingJobStatus: to.Ptr(""), - // }}, - // ProvisioningState: to.Ptr(armstoragecache.ProvisioningStateTypeSucceeded), - // SecuritySettings: &armstoragecache.CacheSecuritySettings{ - // AccessPolicies: []*armstoragecache.NfsAccessPolicy{ - // { - // Name: to.Ptr("default"), - // AccessRules: []*armstoragecache.NfsAccessRule{ - // { - // Access: to.Ptr(armstoragecache.NfsAccessRuleAccessRw), - // RootSquash: to.Ptr(false), - // Scope: to.Ptr(armstoragecache.NfsAccessRuleScopeDefault), - // SubmountAccess: to.Ptr(true), - // Suid: to.Ptr(false), - // }}, - // }, - // { - // Name: to.Ptr("restrictive"), - // AccessRules: []*armstoragecache.NfsAccessRule{ - // { - // Access: to.Ptr(armstoragecache.NfsAccessRuleAccessRw), - // Filter: to.Ptr("10.99.3.145"), - // RootSquash: to.Ptr(false), - // Scope: to.Ptr(armstoragecache.NfsAccessRuleScopeHost), - // SubmountAccess: to.Ptr(true), - // Suid: to.Ptr(true), - // }, - // { - // Access: to.Ptr(armstoragecache.NfsAccessRuleAccessRw), - // Filter: to.Ptr("10.99.1.0/24"), - // RootSquash: to.Ptr(false), - // Scope: to.Ptr(armstoragecache.NfsAccessRuleScopeNetwork), - // SubmountAccess: to.Ptr(true), - // Suid: to.Ptr(true), - // }, - // { - // Access: to.Ptr(armstoragecache.NfsAccessRuleAccessNo), - // AnonymousGID: to.Ptr("65534"), - // AnonymousUID: to.Ptr("65534"), - // RootSquash: to.Ptr(true), - // Scope: to.Ptr(armstoragecache.NfsAccessRuleScopeDefault), - // SubmountAccess: to.Ptr(true), - // Suid: to.Ptr(false), - // }}, - // }}, - // }, - // SpaceAllocation: []*armstoragecache.StorageTargetSpaceAllocation{ - // { - // Name: to.Ptr("st1"), - // AllocationPercentage: to.Ptr[int32](25), - // }, - // { - // Name: to.Ptr("st2"), - // AllocationPercentage: to.Ptr[int32](50), - // }, - // { - // Name: to.Ptr("st3"), - // AllocationPercentage: to.Ptr[int32](25), - // }}, - // Subnet: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/sub1"), - // UpgradeSettings: &armstoragecache.CacheUpgradeSettings{ - // ScheduledTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-26T18:25:43.511Z"); return t}()), - // UpgradeScheduleEnabled: to.Ptr(true), - // }, - // UpgradeStatus: &armstoragecache.CacheUpgradeStatus{ - // CurrentFirmwareVersion: to.Ptr("2022.08.1"), - // FirmwareUpdateDeadline: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-21T18:25:43.511Z"); return t}()), - // FirmwareUpdateStatus: to.Ptr(armstoragecache.FirmwareStatusTypeAvailable), - // LastFirmwareUpdate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-01-21T18:25:43.511Z"); return t}()), - // PendingFirmwareVersion: to.Ptr("2022.08.1"), - // }, - // }, - // SKU: &armstoragecache.CacheSKU{ - // Name: to.Ptr("Standard_2G"), - // }, - // SystemData: &armstoragecache.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armstoragecache.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armstoragecache.CreatedByTypeUser), - // }, - // Tags: map[string]*string{ - // "Dept": to.Ptr("Contoso"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/examples/Caches_Update_ldap_only.json -func ExampleCachesClient_BeginUpdate_cachesUpdateLdapOnly() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstoragecache.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCachesClient().BeginUpdate(ctx, "scgroup", "sc1", armstoragecache.Cache{ - Location: to.Ptr("westus"), - Properties: &armstoragecache.CacheProperties{ - CacheSizeGB: to.Ptr[int32](3072), - DirectoryServicesSettings: &armstoragecache.CacheDirectorySettings{ - UsernameDownload: &armstoragecache.CacheUsernameDownloadSettings{ - Credentials: &armstoragecache.CacheUsernameDownloadSettingsCredentials{ - BindDn: to.Ptr("cn=ldapadmin,dc=contosoad,dc=contoso,dc=local"), - BindPassword: to.Ptr(""), - }, - ExtendedGroups: to.Ptr(true), - LdapBaseDN: to.Ptr("dc=contosoad,dc=contoso,dc=local"), - LdapServer: to.Ptr("192.0.2.12"), - UsernameSource: to.Ptr(armstoragecache.UsernameSourceLDAP), - }, - }, - NetworkSettings: &armstoragecache.CacheNetworkSettings{ - DNSSearchDomain: to.Ptr("contoso.com"), - DNSServers: []*string{ - to.Ptr("10.1.22.33"), - to.Ptr("10.1.12.33")}, - Mtu: to.Ptr[int32](1500), - NtpServer: to.Ptr("time.contoso.com"), - }, - SecuritySettings: &armstoragecache.CacheSecuritySettings{ - AccessPolicies: []*armstoragecache.NfsAccessPolicy{ - { - Name: to.Ptr("default"), - AccessRules: []*armstoragecache.NfsAccessRule{ - { - Access: to.Ptr(armstoragecache.NfsAccessRuleAccessRw), - RootSquash: to.Ptr(false), - Scope: to.Ptr(armstoragecache.NfsAccessRuleScopeDefault), - SubmountAccess: to.Ptr(true), - Suid: to.Ptr(false), - }}, - }, - { - Name: to.Ptr("restrictive"), - AccessRules: []*armstoragecache.NfsAccessRule{ - { - Access: to.Ptr(armstoragecache.NfsAccessRuleAccessRw), - Filter: to.Ptr("10.99.3.145"), - RootSquash: to.Ptr(false), - Scope: to.Ptr(armstoragecache.NfsAccessRuleScopeHost), - SubmountAccess: to.Ptr(true), - Suid: to.Ptr(true), - }, - { - Access: to.Ptr(armstoragecache.NfsAccessRuleAccessRw), - Filter: to.Ptr("10.99.1.0/24"), - RootSquash: to.Ptr(false), - Scope: to.Ptr(armstoragecache.NfsAccessRuleScopeNetwork), - SubmountAccess: to.Ptr(true), - Suid: to.Ptr(true), - }, - { - Access: to.Ptr(armstoragecache.NfsAccessRuleAccessNo), - AnonymousGID: to.Ptr("65534"), - AnonymousUID: to.Ptr("65534"), - RootSquash: to.Ptr(true), - Scope: to.Ptr(armstoragecache.NfsAccessRuleScopeDefault), - SubmountAccess: to.Ptr(true), - Suid: to.Ptr(false), - }}, - }}, - }, - Subnet: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/sub1"), - UpgradeSettings: &armstoragecache.CacheUpgradeSettings{ - ScheduledTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-26T18:25:43.511Z"); return t }()), - UpgradeScheduleEnabled: to.Ptr(true), - }, - }, - SKU: &armstoragecache.CacheSKU{ - Name: to.Ptr("Standard_2G"), - }, - Tags: map[string]*string{ - "Dept": to.Ptr("Contoso"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Cache = armstoragecache.Cache{ - // Name: to.Ptr("sc1"), - // Type: to.Ptr("Microsoft.StorageCache/Cache"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.StorageCache/caches/sc1"), - // Location: to.Ptr("westus"), - // Properties: &armstoragecache.CacheProperties{ - // CacheSizeGB: to.Ptr[int32](3072), - // DirectoryServicesSettings: &armstoragecache.CacheDirectorySettings{ - // UsernameDownload: &armstoragecache.CacheUsernameDownloadSettings{ - // AutoDownloadCertificate: to.Ptr(false), - // CaCertificateURI: to.Ptr("http://contoso.net/cacert.pem"), - // EncryptLdapConnection: to.Ptr(false), - // ExtendedGroups: to.Ptr(true), - // GroupFileURI: to.Ptr("http://contoso.net/group.file"), - // LdapBaseDN: to.Ptr("dc=contosoad,dc=contoso,dc=local"), - // LdapServer: to.Ptr("192.0.2.12"), - // RequireValidCertificate: to.Ptr(false), - // UserFileURI: to.Ptr("http://contoso.net/passwd.file"), - // UsernameDownloaded: to.Ptr(armstoragecache.UsernameDownloadedTypeNo), - // UsernameSource: to.Ptr(armstoragecache.UsernameSourceLDAP), - // }, - // }, - // Health: &armstoragecache.CacheHealth{ - // Conditions: []*armstoragecache.Condition{ - // { - // Message: to.Ptr("Cannot contact DNS server"), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-21T18:25:43.511Z"); return t}()), - // }}, - // State: to.Ptr(armstoragecache.HealthStateTypeTransitioning), - // StatusDescription: to.Ptr("Cache is being created."), - // }, - // MountAddresses: []*string{ - // to.Ptr("192.168.1.1"), - // to.Ptr("192.168.1.2")}, - // NetworkSettings: &armstoragecache.CacheNetworkSettings{ - // DNSSearchDomain: to.Ptr("contoso.com"), - // DNSServers: []*string{ - // to.Ptr("10.1.22.33"), - // to.Ptr("10.1.12.33")}, - // Mtu: to.Ptr[int32](1500), - // NtpServer: to.Ptr("time.contoso.com"), - // }, - // PrimingJobs: []*armstoragecache.PrimingJob{ - // { - // PrimingJobDetails: to.Ptr("Files: Cached=635, Failed=0, Excluded=80, Data=346030 bytes, Directories: Cached=1003, Failed=0, Excluded=0"), - // PrimingJobID: to.Ptr("00000000000_0000000000"), - // PrimingJobName: to.Ptr("contosoJob1"), - // PrimingJobPercentComplete: to.Ptr[float64](100), - // PrimingJobState: to.Ptr(armstoragecache.PrimingJobStateComplete), - // PrimingJobStatus: to.Ptr("success"), - // }, - // { - // PrimingJobDetails: to.Ptr(""), - // PrimingJobID: to.Ptr("11111111111_1111111111"), - // PrimingJobName: to.Ptr("contosoJob2"), - // PrimingJobPercentComplete: to.Ptr[float64](0), - // PrimingJobState: to.Ptr(armstoragecache.PrimingJobStateQueued), - // PrimingJobStatus: to.Ptr(""), - // }}, - // ProvisioningState: to.Ptr(armstoragecache.ProvisioningStateTypeSucceeded), - // SecuritySettings: &armstoragecache.CacheSecuritySettings{ - // AccessPolicies: []*armstoragecache.NfsAccessPolicy{ - // { - // Name: to.Ptr("default"), - // AccessRules: []*armstoragecache.NfsAccessRule{ - // { - // Access: to.Ptr(armstoragecache.NfsAccessRuleAccessRw), - // RootSquash: to.Ptr(false), - // Scope: to.Ptr(armstoragecache.NfsAccessRuleScopeDefault), - // SubmountAccess: to.Ptr(true), - // Suid: to.Ptr(false), - // }}, - // }, - // { - // Name: to.Ptr("restrictive"), - // AccessRules: []*armstoragecache.NfsAccessRule{ - // { - // Access: to.Ptr(armstoragecache.NfsAccessRuleAccessRw), - // Filter: to.Ptr("10.99.3.145"), - // RootSquash: to.Ptr(false), - // Scope: to.Ptr(armstoragecache.NfsAccessRuleScopeHost), - // SubmountAccess: to.Ptr(true), - // Suid: to.Ptr(true), - // }, - // { - // Access: to.Ptr(armstoragecache.NfsAccessRuleAccessRw), - // Filter: to.Ptr("10.99.1.0/24"), - // RootSquash: to.Ptr(false), - // Scope: to.Ptr(armstoragecache.NfsAccessRuleScopeNetwork), - // SubmountAccess: to.Ptr(true), - // Suid: to.Ptr(true), - // }, - // { - // Access: to.Ptr(armstoragecache.NfsAccessRuleAccessNo), - // AnonymousGID: to.Ptr("65534"), - // AnonymousUID: to.Ptr("65534"), - // RootSquash: to.Ptr(true), - // Scope: to.Ptr(armstoragecache.NfsAccessRuleScopeDefault), - // SubmountAccess: to.Ptr(true), - // Suid: to.Ptr(false), - // }}, - // }}, - // }, - // SpaceAllocation: []*armstoragecache.StorageTargetSpaceAllocation{ - // }, - // Subnet: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/sub1"), - // UpgradeSettings: &armstoragecache.CacheUpgradeSettings{ - // ScheduledTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-04-26T18:25:43.511Z"); return t}()), - // UpgradeScheduleEnabled: to.Ptr(true), - // }, - // UpgradeStatus: &armstoragecache.CacheUpgradeStatus{ - // CurrentFirmwareVersion: to.Ptr("2022.08.1"), - // FirmwareUpdateDeadline: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-21T18:25:43.511Z"); return t}()), - // FirmwareUpdateStatus: to.Ptr(armstoragecache.FirmwareStatusTypeAvailable), - // LastFirmwareUpdate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-01-21T18:25:43.511Z"); return t}()), - // PendingFirmwareVersion: to.Ptr("2022.08.1"), - // }, - // }, - // SKU: &armstoragecache.CacheSKU{ - // Name: to.Ptr("Standard_2G"), - // }, - // SystemData: &armstoragecache.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armstoragecache.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armstoragecache.CreatedByTypeUser), - // }, - // Tags: map[string]*string{ - // "Dept": to.Ptr("Contoso"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/examples/Caches_DebugInfo.json -func ExampleCachesClient_BeginDebugInfo() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstoragecache.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCachesClient().BeginDebugInfo(ctx, "scgroup", "sc", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/examples/Caches_Flush.json -func ExampleCachesClient_BeginFlush() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstoragecache.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCachesClient().BeginFlush(ctx, "scgroup", "sc", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/examples/Caches_Start.json -func ExampleCachesClient_BeginStart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstoragecache.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCachesClient().BeginStart(ctx, "scgroup", "sc", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/examples/Caches_Stop.json -func ExampleCachesClient_BeginStop() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstoragecache.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCachesClient().BeginStop(ctx, "scgroup", "sc", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/examples/StartPrimingJob.json -func ExampleCachesClient_BeginStartPrimingJob() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstoragecache.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCachesClient().BeginStartPrimingJob(ctx, "scgroup", "sc1", &armstoragecache.CachesClientBeginStartPrimingJobOptions{Primingjob: &armstoragecache.PrimingJob{ - PrimingJobName: to.Ptr("contosoJob"), - PrimingManifestURL: to.Ptr("https://contosostorage.blob.core.windows.net/contosoblob/00000000_00000000000000000000000000000000.00000000000.FFFFFFFF.00000000?sp=r&st=2021-08-11T19:33:35Z&se=2021-08-12T03:33:35Z&spr=https&sv=2020-08-04&sr=b&sig="), - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/examples/StopPrimingJob.json -func ExampleCachesClient_BeginStopPrimingJob() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstoragecache.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCachesClient().BeginStopPrimingJob(ctx, "scgroup", "sc1", &armstoragecache.CachesClientBeginStopPrimingJobOptions{PrimingJobID: &armstoragecache.PrimingJobIDParameter{ - PrimingJobID: to.Ptr("00000000000_0000000000"), - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/examples/PausePrimingJob.json -func ExampleCachesClient_BeginPausePrimingJob() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstoragecache.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCachesClient().BeginPausePrimingJob(ctx, "scgroup", "sc1", &armstoragecache.CachesClientBeginPausePrimingJobOptions{PrimingJobID: &armstoragecache.PrimingJobIDParameter{ - PrimingJobID: to.Ptr("00000000000_0000000000"), - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/examples/ResumePrimingJob.json -func ExampleCachesClient_BeginResumePrimingJob() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstoragecache.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCachesClient().BeginResumePrimingJob(ctx, "scgroup", "sc1", &armstoragecache.CachesClientBeginResumePrimingJobOptions{PrimingJobID: &armstoragecache.PrimingJobIDParameter{ - PrimingJobID: to.Ptr("00000000000_0000000000"), - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/examples/Caches_UpgradeFirmware.json -func ExampleCachesClient_BeginUpgradeFirmware() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstoragecache.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCachesClient().BeginUpgradeFirmware(ctx, "scgroup", "sc1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/examples/SpaceAllocation_Post.json -func ExampleCachesClient_BeginSpaceAllocation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstoragecache.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCachesClient().BeginSpaceAllocation(ctx, "scgroup", "sc1", &armstoragecache.CachesClientBeginSpaceAllocationOptions{SpaceAllocation: []*armstoragecache.StorageTargetSpaceAllocation{ - { - Name: to.Ptr("st1"), - AllocationPercentage: to.Ptr[int32](25), - }, - { - Name: to.Ptr("st2"), - AllocationPercentage: to.Ptr[int32](50), - }, - { - Name: to.Ptr("st3"), - AllocationPercentage: to.Ptr[int32](25), - }}, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/storagecache/armstoragecache/constants.go b/sdk/resourcemanager/storagecache/armstoragecache/constants.go index 950e3282fa7d..0527a61542c5 100644 --- a/sdk/resourcemanager/storagecache/armstoragecache/constants.go +++ b/sdk/resourcemanager/storagecache/armstoragecache/constants.go @@ -11,7 +11,7 @@ package armstoragecache const ( moduleName = "armstoragecache" - moduleVersion = "v3.2.1" + moduleVersion = "v3.2.2" ) // AmlFilesystemHealthStateType - List of AML file system health states. diff --git a/sdk/resourcemanager/storagecache/armstoragecache/go.mod b/sdk/resourcemanager/storagecache/armstoragecache/go.mod index dac92373893c..cb414ed67089 100644 --- a/sdk/resourcemanager/storagecache/armstoragecache/go.mod +++ b/sdk/resourcemanager/storagecache/armstoragecache/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storagecache/armsto go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0 // indirect - github.com/golang-jwt/jwt/v4 v4.5.0 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect - golang.org/x/crypto v0.7.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.8.0 // indirect - golang.org/x/sys v0.6.0 // indirect golang.org/x/text v0.8.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/sdk/resourcemanager/storagecache/armstoragecache/go.sum b/sdk/resourcemanager/storagecache/armstoragecache/go.sum index 21718b486698..07ab621ddddc 100644 --- a/sdk/resourcemanager/storagecache/armstoragecache/go.sum +++ b/sdk/resourcemanager/storagecache/armstoragecache/go.sum @@ -1,31 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.0 h1:8kDqDngH+DmVBiCtIjCFTGa7MBnsIOkF9IccInFEbjk= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.0/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0 h1:vcYCAze6p19qBW7MhZybIsqD8sMV8js0NyQM8JDnVtg= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0/go.mod h1:OQeznEEkTZ9OrhHJoDD8ZDq51FHgXjqtP9z6bEwBq9U= github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM= -github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0 h1:OBhqkivkhkMqLPymWEppkm7vgPQY2XsHoEkaMQ0AdZY= -github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= -github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= -golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/storagecache/armstoragecache/management_client_example_test.go b/sdk/resourcemanager/storagecache/armstoragecache/management_client_example_test.go deleted file mode 100644 index be3cdda7a533..000000000000 --- a/sdk/resourcemanager/storagecache/armstoragecache/management_client_example_test.go +++ /dev/null @@ -1,66 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armstoragecache_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storagecache/armstoragecache/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/examples/checkAmlFSSubnets.json -func ExampleManagementClient_CheckAmlFSSubnets() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstoragecache.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewManagementClient().CheckAmlFSSubnets(ctx, &armstoragecache.ManagementClientCheckAmlFSSubnetsOptions{AmlFilesystemSubnetInfo: &armstoragecache.AmlFilesystemSubnetInfo{ - FilesystemSubnet: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/fsSub"), - SKU: &armstoragecache.SKUName{ - Name: to.Ptr("AMLFS-Durable-Premium-125"), - }, - StorageCapacityTiB: to.Ptr[float32](16), - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/examples/getRequiredAmlFSSubnetsSize.json -func ExampleManagementClient_GetRequiredAmlFSSubnetsSize() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstoragecache.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagementClient().GetRequiredAmlFSSubnetsSize(ctx, &armstoragecache.ManagementClientGetRequiredAmlFSSubnetsSizeOptions{RequiredAMLFilesystemSubnetsSizeInfo: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RequiredAmlFilesystemSubnetsSize = armstoragecache.RequiredAmlFilesystemSubnetsSize{ - // FilesystemSubnetSize: to.Ptr[int32](24), - // } -} diff --git a/sdk/resourcemanager/storagecache/armstoragecache/operations_client_example_test.go b/sdk/resourcemanager/storagecache/armstoragecache/operations_client_example_test.go deleted file mode 100644 index 6231fc55cbc4..000000000000 --- a/sdk/resourcemanager/storagecache/armstoragecache/operations_client_example_test.go +++ /dev/null @@ -1,102 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armstoragecache_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storagecache/armstoragecache/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/examples/Operations_List.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstoragecache.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.APIOperationListResult = armstoragecache.APIOperationListResult{ - // Value: []*armstoragecache.APIOperation{ - // { - // Name: to.Ptr("Microsoft.StorageCache/caches/write"), - // Display: &armstoragecache.APIOperationDisplay{ - // Operation: to.Ptr("Create or Update Cache"), - // Provider: to.Ptr("Azure Storage Cache"), - // Resource: to.Ptr("Caches"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.StorageCache/caches/delete"), - // Display: &armstoragecache.APIOperationDisplay{ - // Operation: to.Ptr("Delete Cache"), - // Provider: to.Ptr("Azure Storage Cache"), - // Resource: to.Ptr("Caches"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.StorageCache/caches/providers/Microsoft.Insights/metricDefinitions/read"), - // Display: &armstoragecache.APIOperationDisplay{ - // Description: to.Ptr("Reads Cache Metric Definitions."), - // Operation: to.Ptr("Get Cache Metric Definitions"), - // Provider: to.Ptr("Microsoft Azure HPC Cache"), - // Resource: to.Ptr("StorageCache Metric Definitions"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("system"), - // Properties: &armstoragecache.APIOperationProperties{ - // ServiceSpecification: &armstoragecache.APIOperationPropertiesServiceSpecification{ - // MetricSpecifications: []*armstoragecache.MetricSpecification{ - // { - // Name: to.Ptr("ClientIOPS"), - // AggregationType: to.Ptr("Average"), - // DisplayDescription: to.Ptr("The rate of client file operations processed by the Cache."), - // DisplayName: to.Ptr("Total Client IOPS"), - // MetricClass: to.Ptr("Transactions"), - // SupportedAggregationTypes: []*armstoragecache.MetricAggregationType{ - // to.Ptr(armstoragecache.MetricAggregationTypeMinimum), - // to.Ptr(armstoragecache.MetricAggregationTypeMaximum), - // to.Ptr(armstoragecache.MetricAggregationTypeAverage)}, - // Unit: to.Ptr("Count"), - // }, - // { - // Name: to.Ptr("ClientLatency"), - // AggregationType: to.Ptr("Average"), - // DisplayDescription: to.Ptr("Average latency of client file operations to the Cache."), - // DisplayName: to.Ptr("Average Client Latency"), - // MetricClass: to.Ptr("Latency"), - // SupportedAggregationTypes: []*armstoragecache.MetricAggregationType{ - // to.Ptr(armstoragecache.MetricAggregationTypeMinimum), - // to.Ptr(armstoragecache.MetricAggregationTypeMaximum), - // to.Ptr(armstoragecache.MetricAggregationTypeAverage)}, - // Unit: to.Ptr("Milliseconds"), - // }}, - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/storagecache/armstoragecache/skus_client_example_test.go b/sdk/resourcemanager/storagecache/armstoragecache/skus_client_example_test.go deleted file mode 100644 index 094485d9fde8..000000000000 --- a/sdk/resourcemanager/storagecache/armstoragecache/skus_client_example_test.go +++ /dev/null @@ -1,115 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armstoragecache_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storagecache/armstoragecache/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/examples/Skus_List.json -func ExampleSKUsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstoragecache.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSKUsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ResourceSKUsResult = armstoragecache.ResourceSKUsResult{ - // Value: []*armstoragecache.ResourceSKU{ - // { - // Name: to.Ptr("Standard_2G"), - // Capabilities: []*armstoragecache.ResourceSKUCapabilities{ - // { - // Name: to.Ptr("throughput GB/s"), - // Value: to.Ptr("2"), - // }, - // { - // Name: to.Ptr("cache sizes(GB)"), - // Value: to.Ptr("3072,6144,12288"), - // }}, - // LocationInfo: []*armstoragecache.ResourceSKULocationInfo{ - // { - // Location: to.Ptr("eastus"), - // Zones: []*string{ - // }, - // }}, - // Locations: []*string{ - // to.Ptr("eastus")}, - // ResourceType: to.Ptr("caches"), - // Restrictions: []*armstoragecache.Restriction{ - // }, - // }, - // { - // Name: to.Ptr("Standard_4G"), - // Capabilities: []*armstoragecache.ResourceSKUCapabilities{ - // { - // Name: to.Ptr("throughput GB/s"), - // Value: to.Ptr("4"), - // }, - // { - // Name: to.Ptr("cache sizes(GB)"), - // Value: to.Ptr("6144,12288,24576"), - // }}, - // LocationInfo: []*armstoragecache.ResourceSKULocationInfo{ - // { - // Location: to.Ptr("eastus"), - // Zones: []*string{ - // }, - // }}, - // Locations: []*string{ - // to.Ptr("eastus")}, - // ResourceType: to.Ptr("caches"), - // Restrictions: []*armstoragecache.Restriction{ - // }, - // }, - // { - // Name: to.Ptr("Standard_8G"), - // Capabilities: []*armstoragecache.ResourceSKUCapabilities{ - // { - // Name: to.Ptr("throughput GB/s"), - // Value: to.Ptr("8"), - // }, - // { - // Name: to.Ptr("cache sizes(GB)"), - // Value: to.Ptr("12288,24576,49152"), - // }}, - // LocationInfo: []*armstoragecache.ResourceSKULocationInfo{ - // { - // Location: to.Ptr("eastus"), - // Zones: []*string{ - // }, - // }}, - // Locations: []*string{ - // to.Ptr("eastus")}, - // ResourceType: to.Ptr("caches"), - // Restrictions: []*armstoragecache.Restriction{ - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/storagecache/armstoragecache/storagetarget_client_example_test.go b/sdk/resourcemanager/storagecache/armstoragecache/storagetarget_client_example_test.go deleted file mode 100644 index 99a05afea143..000000000000 --- a/sdk/resourcemanager/storagecache/armstoragecache/storagetarget_client_example_test.go +++ /dev/null @@ -1,102 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armstoragecache_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storagecache/armstoragecache/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/examples/StorageTargets_Flush.json -func ExampleStorageTargetClient_BeginFlush() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstoragecache.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewStorageTargetClient().BeginFlush(ctx, "scgroup", "sc", "st1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/examples/StorageTargets_Suspend.json -func ExampleStorageTargetClient_BeginSuspend() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstoragecache.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewStorageTargetClient().BeginSuspend(ctx, "scgroup", "sc", "st1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/examples/StorageTargets_Resume.json -func ExampleStorageTargetClient_BeginResume() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstoragecache.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewStorageTargetClient().BeginResume(ctx, "scgroup", "sc", "st1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/examples/StorageTargets_Invalidate.json -func ExampleStorageTargetClient_BeginInvalidate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstoragecache.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewStorageTargetClient().BeginInvalidate(ctx, "scgroup", "sc", "st1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/storagecache/armstoragecache/storagetargets_client_example_test.go b/sdk/resourcemanager/storagecache/armstoragecache/storagetargets_client_example_test.go deleted file mode 100644 index c95d69de0808..000000000000 --- a/sdk/resourcemanager/storagecache/armstoragecache/storagetargets_client_example_test.go +++ /dev/null @@ -1,459 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armstoragecache_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storagecache/armstoragecache/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/examples/StorageTargets_DnsRefresh.json -func ExampleStorageTargetsClient_BeginDNSRefresh() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstoragecache.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewStorageTargetsClient().BeginDNSRefresh(ctx, "scgroup", "sc", "st1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/examples/StorageTargets_ListByCache.json -func ExampleStorageTargetsClient_NewListByCachePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstoragecache.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewStorageTargetsClient().NewListByCachePager("scgroup", "sc1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.StorageTargetsResult = armstoragecache.StorageTargetsResult{ - // Value: []*armstoragecache.StorageTarget{ - // { - // Name: to.Ptr("st1"), - // Type: to.Ptr("Microsoft.StorageCache/Cache/StorageTarget"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.StorageCache/caches/sc1/storagetargets/st1"), - // SystemData: &armstoragecache.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armstoragecache.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armstoragecache.CreatedByTypeUser), - // }, - // Properties: &armstoragecache.StorageTargetProperties{ - // AllocationPercentage: to.Ptr[int32](25), - // Junctions: []*armstoragecache.NamespaceJunction{ - // { - // NamespacePath: to.Ptr("/path/on/cache"), - // NfsAccessPolicy: to.Ptr("default"), - // NfsExport: to.Ptr("exp1"), - // TargetPath: to.Ptr("/path/on/exp1"), - // }, - // { - // NamespacePath: to.Ptr("/path2/on/cache"), - // NfsAccessPolicy: to.Ptr("default"), - // NfsExport: to.Ptr("exp2"), - // TargetPath: to.Ptr("/path2/on/exp2"), - // }}, - // Nfs3: &armstoragecache.Nfs3Target{ - // Target: to.Ptr("10.0.44.44"), - // UsageModel: to.Ptr("READ_ONLY"), - // }, - // State: to.Ptr(armstoragecache.OperationalStateTypeReady), - // TargetType: to.Ptr(armstoragecache.StorageTargetTypeNfs3), - // }, - // }, - // { - // Name: to.Ptr("st2"), - // Type: to.Ptr("Microsoft.StorageCache/Cache/StorageTarget"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.StorageCache/caches/sc1/storagetargets/st2"), - // SystemData: &armstoragecache.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armstoragecache.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armstoragecache.CreatedByTypeUser), - // }, - // Properties: &armstoragecache.StorageTargetProperties{ - // AllocationPercentage: to.Ptr[int32](50), - // Clfs: &armstoragecache.ClfsTarget{ - // Target: to.Ptr("https://contoso123.blob.core.windows.net/contoso123"), - // }, - // Junctions: []*armstoragecache.NamespaceJunction{ - // { - // NamespacePath: to.Ptr("/some/arbitrary/place/on/cache"), - // NfsAccessPolicy: to.Ptr("default"), - // TargetPath: to.Ptr("/"), - // }}, - // State: to.Ptr(armstoragecache.OperationalStateTypeReady), - // TargetType: to.Ptr(armstoragecache.StorageTargetTypeClfs), - // }, - // }, - // { - // Name: to.Ptr("st3"), - // Type: to.Ptr("Microsoft.StorageCache/Cache/StorageTarget"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.StorageCache/caches/sc1/storagetargets/st3"), - // SystemData: &armstoragecache.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armstoragecache.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armstoragecache.CreatedByTypeUser), - // }, - // Properties: &armstoragecache.StorageTargetProperties{ - // AllocationPercentage: to.Ptr[int32](25), - // Junctions: []*armstoragecache.NamespaceJunction{ - // { - // NamespacePath: to.Ptr("/some/crazier/place/on/cache"), - // NfsAccessPolicy: to.Ptr("default"), - // NfsExport: to.Ptr(""), - // TargetPath: to.Ptr("/"), - // }}, - // State: to.Ptr(armstoragecache.OperationalStateTypeReady), - // TargetType: to.Ptr(armstoragecache.StorageTargetTypeUnknown), - // Unknown: &armstoragecache.UnknownTarget{ - // Attributes: map[string]*string{ - // "foo": to.Ptr("bar"), - // "foo2": to.Ptr("test"), - // }, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/examples/StorageTargets_Delete.json -func ExampleStorageTargetsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstoragecache.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewStorageTargetsClient().BeginDelete(ctx, "scgroup", "sc1", "st1", &armstoragecache.StorageTargetsClientBeginDeleteOptions{Force: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/examples/StorageTargets_Get.json -func ExampleStorageTargetsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstoragecache.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewStorageTargetsClient().Get(ctx, "scgroup", "sc1", "st1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.StorageTarget = armstoragecache.StorageTarget{ - // Name: to.Ptr("st1"), - // Type: to.Ptr("Microsoft.StorageCache/Cache/StorageTarget"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.StorageCache/caches/sc1/storagetargets/st1"), - // SystemData: &armstoragecache.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armstoragecache.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armstoragecache.CreatedByTypeUser), - // }, - // Properties: &armstoragecache.StorageTargetProperties{ - // AllocationPercentage: to.Ptr[int32](25), - // Junctions: []*armstoragecache.NamespaceJunction{ - // { - // NamespacePath: to.Ptr("/path/on/cache"), - // NfsAccessPolicy: to.Ptr("default"), - // NfsExport: to.Ptr("exp1"), - // TargetPath: to.Ptr("/path/on/exp1"), - // }, - // { - // NamespacePath: to.Ptr("/path2/on/cache"), - // NfsAccessPolicy: to.Ptr("default"), - // NfsExport: to.Ptr("exp2"), - // TargetPath: to.Ptr("/path2/on/exp2"), - // }}, - // Nfs3: &armstoragecache.Nfs3Target{ - // Target: to.Ptr("10.0.44.44"), - // UsageModel: to.Ptr("READ_HEAVY_FREQ"), - // }, - // State: to.Ptr(armstoragecache.OperationalStateTypeReady), - // TargetType: to.Ptr(armstoragecache.StorageTargetTypeNfs3), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/examples/StorageTargets_CreateOrUpdate.json -func ExampleStorageTargetsClient_BeginCreateOrUpdate_storageTargetsCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstoragecache.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewStorageTargetsClient().BeginCreateOrUpdate(ctx, "scgroup", "sc1", "st1", armstoragecache.StorageTarget{ - Properties: &armstoragecache.StorageTargetProperties{ - Junctions: []*armstoragecache.NamespaceJunction{ - { - NamespacePath: to.Ptr("/path/on/cache"), - NfsAccessPolicy: to.Ptr("default"), - NfsExport: to.Ptr("exp1"), - TargetPath: to.Ptr("/path/on/exp1"), - }, - { - NamespacePath: to.Ptr("/path2/on/cache"), - NfsAccessPolicy: to.Ptr("rootSquash"), - NfsExport: to.Ptr("exp2"), - TargetPath: to.Ptr("/path2/on/exp2"), - }}, - Nfs3: &armstoragecache.Nfs3Target{ - Target: to.Ptr("10.0.44.44"), - UsageModel: to.Ptr("READ_ONLY"), - VerificationTimer: to.Ptr[int32](30), - }, - TargetType: to.Ptr(armstoragecache.StorageTargetTypeNfs3), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.StorageTarget = armstoragecache.StorageTarget{ - // Name: to.Ptr("st1"), - // Type: to.Ptr("Microsoft.StorageCache/Cache/StorageTarget"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.StorageCache/caches/sc1/storagetargets/st1"), - // SystemData: &armstoragecache.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armstoragecache.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armstoragecache.CreatedByTypeUser), - // }, - // Properties: &armstoragecache.StorageTargetProperties{ - // Junctions: []*armstoragecache.NamespaceJunction{ - // { - // NamespacePath: to.Ptr("/path/on/cache"), - // NfsAccessPolicy: to.Ptr("default"), - // NfsExport: to.Ptr("exp1"), - // TargetPath: to.Ptr("/path/on/exp1"), - // }, - // { - // NamespacePath: to.Ptr("/path2/on/cache"), - // NfsAccessPolicy: to.Ptr("rootSquash"), - // NfsExport: to.Ptr("exp2"), - // TargetPath: to.Ptr("/path2/on/exp2"), - // }}, - // Nfs3: &armstoragecache.Nfs3Target{ - // Target: to.Ptr("10.0.44.44"), - // UsageModel: to.Ptr("READ_ONLY"), - // VerificationTimer: to.Ptr[int32](30), - // }, - // State: to.Ptr(armstoragecache.OperationalStateTypeReady), - // TargetType: to.Ptr(armstoragecache.StorageTargetTypeNfs3), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/examples/StorageTargets_CreateOrUpdate_BlobNfs.json -func ExampleStorageTargetsClient_BeginCreateOrUpdate_storageTargetsCreateOrUpdateBlobNfs() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstoragecache.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewStorageTargetsClient().BeginCreateOrUpdate(ctx, "scgroup", "sc1", "st1", armstoragecache.StorageTarget{ - Properties: &armstoragecache.StorageTargetProperties{ - BlobNfs: &armstoragecache.BlobNfsTarget{ - Target: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Storage/storageAccounts/blofnfs/blobServices/default/containers/blobnfs"), - UsageModel: to.Ptr("READ_WRITE"), - VerificationTimer: to.Ptr[int32](28800), - WriteBackTimer: to.Ptr[int32](3600), - }, - Junctions: []*armstoragecache.NamespaceJunction{ - { - NamespacePath: to.Ptr("/blobnfs"), - }}, - TargetType: to.Ptr(armstoragecache.StorageTargetTypeBlobNfs), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.StorageTarget = armstoragecache.StorageTarget{ - // Name: to.Ptr("st1"), - // Type: to.Ptr("Microsoft.StorageCache/Cache/StorageTarget"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.StorageCache/caches/sc1/storagetargets/st1"), - // SystemData: &armstoragecache.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armstoragecache.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armstoragecache.CreatedByTypeUser), - // }, - // Properties: &armstoragecache.StorageTargetProperties{ - // BlobNfs: &armstoragecache.BlobNfsTarget{ - // Target: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Storage/storageAccounts/blofnfs/blobServices/default/containers/blobnfs"), - // UsageModel: to.Ptr("READ_WRITE"), - // VerificationTimer: to.Ptr[int32](28800), - // WriteBackTimer: to.Ptr[int32](3600), - // }, - // Junctions: []*armstoragecache.NamespaceJunction{ - // { - // NamespacePath: to.Ptr("/blobnfs"), - // }}, - // State: to.Ptr(armstoragecache.OperationalStateTypeReady), - // TargetType: to.Ptr(armstoragecache.StorageTargetTypeBlobNfs), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/examples/StorageTargets_CreateOrUpdate_NoJunctions.json -func ExampleStorageTargetsClient_BeginCreateOrUpdate_storageTargetsCreateOrUpdateNoJunctions() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstoragecache.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewStorageTargetsClient().BeginCreateOrUpdate(ctx, "scgroup", "sc1", "st1", armstoragecache.StorageTarget{ - Properties: &armstoragecache.StorageTargetProperties{ - Nfs3: &armstoragecache.Nfs3Target{ - Target: to.Ptr("10.0.44.44"), - UsageModel: to.Ptr("READ_ONLY"), - VerificationTimer: to.Ptr[int32](30), - }, - TargetType: to.Ptr(armstoragecache.StorageTargetTypeNfs3), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.StorageTarget = armstoragecache.StorageTarget{ - // Name: to.Ptr("st1"), - // Type: to.Ptr("Microsoft.StorageCache/Cache/StorageTarget"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.StorageCache/caches/sc1/storagetargets/st1"), - // SystemData: &armstoragecache.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.1234567Z"); return t}()), - // CreatedBy: to.Ptr("user1"), - // CreatedByType: to.Ptr(armstoragecache.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.1234567Z"); return t}()), - // LastModifiedBy: to.Ptr("user2"), - // LastModifiedByType: to.Ptr(armstoragecache.CreatedByTypeUser), - // }, - // Properties: &armstoragecache.StorageTargetProperties{ - // Nfs3: &armstoragecache.Nfs3Target{ - // Target: to.Ptr("10.0.44.44"), - // UsageModel: to.Ptr("READ_ONLY"), - // VerificationTimer: to.Ptr[int32](30), - // }, - // State: to.Ptr(armstoragecache.OperationalStateTypeReady), - // TargetType: to.Ptr(armstoragecache.StorageTargetTypeNfs3), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/examples/StorageTargets_RestoreDefaults.json -func ExampleStorageTargetsClient_BeginRestoreDefaults() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstoragecache.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewStorageTargetsClient().BeginRestoreDefaults(ctx, "scgroup", "sc", "st1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/storagecache/armstoragecache/usagemodels_client_example_test.go b/sdk/resourcemanager/storagecache/armstoragecache/usagemodels_client_example_test.go deleted file mode 100644 index 0f39838ebbcc..000000000000 --- a/sdk/resourcemanager/storagecache/armstoragecache/usagemodels_client_example_test.go +++ /dev/null @@ -1,60 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armstoragecache_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storagecache/armstoragecache/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7f3e601fd326ca910c3d2939b516e15581e7e41/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/examples/UsageModels_List.json -func ExampleUsageModelsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstoragecache.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewUsageModelsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.UsageModelsResult = armstoragecache.UsageModelsResult{ - // Value: []*armstoragecache.UsageModel{ - // { - // Display: &armstoragecache.UsageModelDisplay{ - // Description: to.Ptr("Read only, with a default verification timer of 30 seconds. Verification timer has a minimum value of 1 and maximum value of 31536000. Write-back timer must have value of 0 or be null."), - // }, - // ModelName: to.Ptr("READ_ONLY"), - // TargetType: to.Ptr("nfs3"), - // }, - // { - // Display: &armstoragecache.UsageModelDisplay{ - // Description: to.Ptr("Read-write, with a default verification timer of 8 hours and default write-back timer of 1 hour. Verification timer and write-back timer have a minimum value of 1 and maximum value of 31536000."), - // }, - // ModelName: to.Ptr("READ_WRITE"), - // TargetType: to.Ptr("nfs3"), - // }}, - // } - } -}