diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/CHANGELOG.md b/sdk/storagecache/azure-resourcemanager-storagecache/CHANGELOG.md index 19c77d3cb9e0..44cff0ba043a 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/CHANGELOG.md +++ b/sdk/storagecache/azure-resourcemanager-storagecache/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.6 (Unreleased) +## 1.0.0-beta.1 (2022-06-08) + +- Azure Resource Manager StorageCache client library for Java. This package contains Microsoft Azure SDK for StorageCache Management SDK. A Storage Cache provides scalable caching service for NAS clients, serving data from either NFSv3 or Blob at-rest storage (referred to as "Storage Targets"). These operations allow you to manage Caches. Package tag package-2022-05. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/README.md b/sdk/storagecache/azure-resourcemanager-storagecache/README.md index c96127f7a44e..5b97788c2070 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/README.md +++ b/sdk/storagecache/azure-resourcemanager-storagecache/README.md @@ -2,7 +2,7 @@ Azure Resource Manager StorageCache client library for Java. -This package contains Microsoft Azure SDK for StorageCache Management SDK. A Storage Cache provides scalable caching service for NAS clients, serving data from either NFSv3 or Blob at-rest storage (referred to as "Storage Targets"). These operations allow you to manage Caches. Package tag package-2022-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for StorageCache Management SDK. A Storage Cache provides scalable caching service for NAS clients, serving data from either NFSv3 or Blob at-rest storage (referred to as "Storage Targets"). These operations allow you to manage Caches. Package tag package-2022-05. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-storagecache - 1.0.0-beta.5 + 1.0.0-beta.6 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/SAMPLE.md b/sdk/storagecache/azure-resourcemanager-storagecache/SAMPLE.md index d43b2107700e..a5b6f67a7993 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/SAMPLE.md +++ b/sdk/storagecache/azure-resourcemanager-storagecache/SAMPLE.md @@ -18,8 +18,13 @@ - [GetByResourceGroup](#caches_getbyresourcegroup) - [List](#caches_list) - [ListByResourceGroup](#caches_listbyresourcegroup) +- [PausePrimingJob](#caches_pauseprimingjob) +- [ResumePrimingJob](#caches_resumeprimingjob) +- [SpaceAllocation](#caches_spaceallocation) - [Start](#caches_start) +- [StartPrimingJob](#caches_startprimingjob) - [Stop](#caches_stop) +- [StopPrimingJob](#caches_stopprimingjob) - [Update](#caches_update) - [UpgradeFirmware](#caches_upgradefirmware) @@ -57,7 +62,7 @@ import com.azure.core.util.Context; /** Samples for AscOperations Get. */ public final class AscOperationsGetSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/AscOperations_Get.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/AscOperations_Get.json */ /** * Sample code: AscOperations_Get. @@ -78,7 +83,7 @@ import com.azure.core.util.Context; /** Samples for AscUsages List. */ public final class AscUsagesListSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/AscResourceUsages_Get.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/AscResourceUsages_Get.json */ /** * Sample code: AscUsages_List. @@ -102,6 +107,7 @@ import com.azure.resourcemanager.storagecache.models.CacheIdentity; import com.azure.resourcemanager.storagecache.models.CacheIdentityType; import com.azure.resourcemanager.storagecache.models.CacheSecuritySettings; import com.azure.resourcemanager.storagecache.models.CacheSku; +import com.azure.resourcemanager.storagecache.models.CacheUpgradeSettings; import com.azure.resourcemanager.storagecache.models.CacheUsernameDownloadSettings; import com.azure.resourcemanager.storagecache.models.CacheUsernameDownloadSettingsCredentials; import com.azure.resourcemanager.storagecache.models.KeyVaultKeyReference; @@ -112,6 +118,7 @@ import com.azure.resourcemanager.storagecache.models.NfsAccessRuleAccess; import com.azure.resourcemanager.storagecache.models.NfsAccessRuleScope; import com.azure.resourcemanager.storagecache.models.UserAssignedIdentitiesValue; import com.azure.resourcemanager.storagecache.models.UsernameSource; +import java.time.OffsetDateTime; import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -119,7 +126,7 @@ import java.util.Map; /** Samples for Caches CreateOrUpdate. */ public final class CachesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/Caches_CreateOrUpdate_ldap_only.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/Caches_CreateOrUpdate_ldap_only.json */ /** * Sample code: Caches_CreateOrUpdate_ldap_only. @@ -138,6 +145,10 @@ public final class CachesCreateOrUpdateSamples { .withCacheSizeGB(3072) .withSubnet( "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/sub1") + .withUpgradeSettings( + new CacheUpgradeSettings() + .withUpgradeScheduleEnabled(true) + .withScheduledTime(OffsetDateTime.parse("2022-04-26T18:25:43.511Z"))) .withEncryptionSettings( new CacheEncryptionSettings() .withKeyEncryptionKey( @@ -179,7 +190,7 @@ public final class CachesCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/Caches_CreateOrUpdate.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/Caches_CreateOrUpdate.json */ /** * Sample code: Caches_CreateOrUpdate. @@ -204,6 +215,10 @@ public final class CachesCreateOrUpdateSamples { .withCacheSizeGB(3072) .withSubnet( "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/sub1") + .withUpgradeSettings( + new CacheUpgradeSettings() + .withUpgradeScheduleEnabled(true) + .withScheduledTime(OffsetDateTime.parse("2022-04-26T18:25:43.511Z"))) .withEncryptionSettings( new CacheEncryptionSettings() .withKeyEncryptionKey( @@ -276,7 +291,7 @@ import com.azure.core.util.Context; /** Samples for Caches DebugInfo. */ public final class CachesDebugInfoSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/Caches_DebugInfo.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/Caches_DebugInfo.json */ /** * Sample code: Caches_DebugInfo. @@ -297,7 +312,7 @@ import com.azure.core.util.Context; /** Samples for Caches Delete. */ public final class CachesDeleteSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/Caches_Delete.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/Caches_Delete.json */ /** * Sample code: Caches_Delete. @@ -318,7 +333,7 @@ import com.azure.core.util.Context; /** Samples for Caches Flush. */ public final class CachesFlushSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/Caches_Flush.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/Caches_Flush.json */ /** * Sample code: Caches_Flush. @@ -339,7 +354,7 @@ import com.azure.core.util.Context; /** Samples for Caches GetByResourceGroup. */ public final class CachesGetByResourceGroupSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/Caches_Get.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/Caches_Get.json */ /** * Sample code: Caches_Get. @@ -360,7 +375,7 @@ import com.azure.core.util.Context; /** Samples for Caches List. */ public final class CachesListSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/Caches_List.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/Caches_List.json */ /** * Sample code: Caches_List. @@ -381,7 +396,7 @@ import com.azure.core.util.Context; /** Samples for Caches ListByResourceGroup. */ public final class CachesListByResourceGroupSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/Caches_ListByResourceGroup.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/Caches_ListByResourceGroup.json */ /** * Sample code: Caches_ListByResourceGroup. @@ -394,6 +409,89 @@ public final class CachesListByResourceGroupSamples { } ``` +### Caches_PausePrimingJob + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagecache.models.PrimingJobIdParameter; + +/** Samples for Caches PausePrimingJob. */ +public final class CachesPausePrimingJobSamples { + /* + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/PausePrimingJob.json + */ + /** + * Sample code: PausePrimingJob. + * + * @param manager Entry point to StorageCacheManager. + */ + public static void pausePrimingJob(com.azure.resourcemanager.storagecache.StorageCacheManager manager) { + manager + .caches() + .pausePrimingJob( + "scgroup", "sc1", new PrimingJobIdParameter().withPrimingJobId("00000000000_0000000000"), Context.NONE); + } +} +``` + +### Caches_ResumePrimingJob + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagecache.models.PrimingJobIdParameter; + +/** Samples for Caches ResumePrimingJob. */ +public final class CachesResumePrimingJobSamples { + /* + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/ResumePrimingJob.json + */ + /** + * Sample code: ResumePrimingJob. + * + * @param manager Entry point to StorageCacheManager. + */ + public static void resumePrimingJob(com.azure.resourcemanager.storagecache.StorageCacheManager manager) { + manager + .caches() + .resumePrimingJob( + "scgroup", "sc1", new PrimingJobIdParameter().withPrimingJobId("00000000000_0000000000"), Context.NONE); + } +} +``` + +### Caches_SpaceAllocation + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagecache.models.StorageTargetSpaceAllocation; +import java.util.Arrays; + +/** Samples for Caches SpaceAllocation. */ +public final class CachesSpaceAllocationSamples { + /* + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/SpaceAllocation_Post.json + */ + /** + * Sample code: SpaceAllocation_Post. + * + * @param manager Entry point to StorageCacheManager. + */ + public static void spaceAllocationPost(com.azure.resourcemanager.storagecache.StorageCacheManager manager) { + manager + .caches() + .spaceAllocation( + "scgroup", + "sc1", + Arrays + .asList( + new StorageTargetSpaceAllocation().withName("st1").withAllocationPercentage(25), + new StorageTargetSpaceAllocation().withName("st2").withAllocationPercentage(50), + new StorageTargetSpaceAllocation().withName("st3").withAllocationPercentage(25)), + Context.NONE); + } +} +``` + ### Caches_Start ```java @@ -402,7 +500,7 @@ import com.azure.core.util.Context; /** Samples for Caches Start. */ public final class CachesStartSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/Caches_Start.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/Caches_Start.json */ /** * Sample code: Caches_Start. @@ -415,6 +513,37 @@ public final class CachesStartSamples { } ``` +### Caches_StartPrimingJob + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagecache.models.PrimingJob; + +/** Samples for Caches StartPrimingJob. */ +public final class CachesStartPrimingJobSamples { + /* + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/StartPrimingJob.json + */ + /** + * Sample code: StartPrimingJob. + * + * @param manager Entry point to StorageCacheManager. + */ + public static void startPrimingJob(com.azure.resourcemanager.storagecache.StorageCacheManager manager) { + manager + .caches() + .startPrimingJob( + "scgroup", + "sc1", + new PrimingJob() + .withPrimingJobName("contosoJob") + .withPrimingManifestUrl( + "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="), + Context.NONE); + } +} +``` + ### Caches_Stop ```java @@ -423,7 +552,7 @@ import com.azure.core.util.Context; /** Samples for Caches Stop. */ public final class CachesStopSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/Caches_Stop.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/Caches_Stop.json */ /** * Sample code: Caches_Stop. @@ -436,6 +565,31 @@ public final class CachesStopSamples { } ``` +### Caches_StopPrimingJob + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagecache.models.PrimingJobIdParameter; + +/** Samples for Caches StopPrimingJob. */ +public final class CachesStopPrimingJobSamples { + /* + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/StopPrimingJob.json + */ + /** + * Sample code: StopPrimingJob. + * + * @param manager Entry point to StorageCacheManager. + */ + public static void stopPrimingJob(com.azure.resourcemanager.storagecache.StorageCacheManager manager) { + manager + .caches() + .stopPrimingJob( + "scgroup", "sc1", new PrimingJobIdParameter().withPrimingJobId("00000000000_0000000000"), Context.NONE); + } +} +``` + ### Caches_Update ```java @@ -445,6 +599,7 @@ import com.azure.resourcemanager.storagecache.models.CacheActiveDirectorySetting import com.azure.resourcemanager.storagecache.models.CacheDirectorySettings; import com.azure.resourcemanager.storagecache.models.CacheNetworkSettings; import com.azure.resourcemanager.storagecache.models.CacheSecuritySettings; +import com.azure.resourcemanager.storagecache.models.CacheUpgradeSettings; import com.azure.resourcemanager.storagecache.models.CacheUsernameDownloadSettings; import com.azure.resourcemanager.storagecache.models.CacheUsernameDownloadSettingsCredentials; import com.azure.resourcemanager.storagecache.models.NfsAccessPolicy; @@ -452,6 +607,7 @@ import com.azure.resourcemanager.storagecache.models.NfsAccessRule; import com.azure.resourcemanager.storagecache.models.NfsAccessRuleAccess; import com.azure.resourcemanager.storagecache.models.NfsAccessRuleScope; import com.azure.resourcemanager.storagecache.models.UsernameSource; +import java.time.OffsetDateTime; import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -459,7 +615,7 @@ import java.util.Map; /** Samples for Caches Update. */ public final class CachesUpdateSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/Caches_Update_ldap_only.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/Caches_Update_ldap_only.json */ /** * Sample code: Caches_Update_ldap_only. @@ -471,6 +627,10 @@ public final class CachesUpdateSamples { resource .update() .withTags(mapOf("Dept", "Contoso")) + .withUpgradeSettings( + new CacheUpgradeSettings() + .withUpgradeScheduleEnabled(true) + .withScheduledTime(OffsetDateTime.parse("2022-04-26T18:25:43.511Z"))) .withNetworkSettings( new CacheNetworkSettings() .withMtu(1500) @@ -536,7 +696,7 @@ public final class CachesUpdateSamples { } /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/Caches_Update.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/Caches_Update.json */ /** * Sample code: Caches_Update. @@ -548,6 +708,10 @@ public final class CachesUpdateSamples { resource .update() .withTags(mapOf("Dept", "Contoso")) + .withUpgradeSettings( + new CacheUpgradeSettings() + .withUpgradeScheduleEnabled(true) + .withScheduledTime(OffsetDateTime.parse("2022-04-26T18:25:43.511Z"))) .withNetworkSettings( new CacheNetworkSettings() .withMtu(1500) @@ -634,7 +798,7 @@ import com.azure.core.util.Context; /** Samples for Caches UpgradeFirmware. */ public final class CachesUpgradeFirmwareSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/Caches_UpgradeFirmware.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/Caches_UpgradeFirmware.json */ /** * Sample code: Caches_UpgradeFirmware. @@ -655,7 +819,7 @@ import com.azure.core.util.Context; /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/Operations_List.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/Operations_List.json */ /** * Sample code: Operations_List. @@ -676,7 +840,7 @@ import com.azure.core.util.Context; /** Samples for Skus List. */ public final class SkusListSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/Skus_List.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/Skus_List.json */ /** * Sample code: Skus_List. @@ -697,7 +861,7 @@ import com.azure.core.util.Context; /** Samples for StorageTargetOperation Flush. */ public final class StorageTargetOperationFlushSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/StorageTargets_Flush.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/StorageTargets_Flush.json */ /** * Sample code: StorageTargets_Flush. @@ -718,7 +882,7 @@ import com.azure.core.util.Context; /** Samples for StorageTargetOperation Invalidate. */ public final class StorageTargetOperationInvalidateSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/StorageTargets_Invalidate.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/StorageTargets_Invalidate.json */ /** * Sample code: StorageTargets_Invalidate. @@ -739,7 +903,7 @@ import com.azure.core.util.Context; /** Samples for StorageTargetOperation Resume. */ public final class StorageTargetOperationResumeSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/StorageTargets_Resume.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/StorageTargets_Resume.json */ /** * Sample code: StorageTargets_Resume. @@ -760,7 +924,7 @@ import com.azure.core.util.Context; /** Samples for StorageTargetOperation Suspend. */ public final class StorageTargetOperationSuspendSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/StorageTargets_Suspend.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/StorageTargets_Suspend.json */ /** * Sample code: StorageTargets_Suspend. @@ -785,7 +949,7 @@ import java.util.Arrays; /** Samples for StorageTargets CreateOrUpdate. */ public final class StorageTargetsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/StorageTargets_CreateOrUpdate.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/StorageTargets_CreateOrUpdate.json */ /** * Sample code: StorageTargets_CreateOrUpdate. @@ -817,7 +981,7 @@ public final class StorageTargetsCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/StorageTargets_CreateOrUpdate_BlobNfs.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/StorageTargets_CreateOrUpdate_BlobNfs.json */ /** * Sample code: StorageTargets_CreateOrUpdate_BlobNfs. @@ -841,7 +1005,7 @@ public final class StorageTargetsCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/StorageTargets_CreateOrUpdate_NoJunctions.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/StorageTargets_CreateOrUpdate_NoJunctions.json */ /** * Sample code: StorageTargets_CreateOrUpdate_NoJunctions. @@ -869,7 +1033,7 @@ import com.azure.core.util.Context; /** Samples for StorageTargets Delete. */ public final class StorageTargetsDeleteSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/StorageTargets_Delete.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/StorageTargets_Delete.json */ /** * Sample code: StorageTargets_Delete. @@ -890,7 +1054,7 @@ import com.azure.core.util.Context; /** Samples for StorageTargets DnsRefresh. */ public final class StorageTargetsDnsRefreshSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/StorageTargets_DnsRefresh.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/StorageTargets_DnsRefresh.json */ /** * Sample code: Caches_DnsRefresh. @@ -911,7 +1075,7 @@ import com.azure.core.util.Context; /** Samples for StorageTargets Get. */ public final class StorageTargetsGetSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/StorageTargets_Get.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/StorageTargets_Get.json */ /** * Sample code: StorageTargets_Get. @@ -932,7 +1096,7 @@ import com.azure.core.util.Context; /** Samples for StorageTargets ListByCache. */ public final class StorageTargetsListByCacheSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/StorageTargets_ListByCache.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/StorageTargets_ListByCache.json */ /** * Sample code: StorageTargets_List. @@ -953,7 +1117,7 @@ import com.azure.core.util.Context; /** Samples for UsageModels List. */ public final class UsageModelsListSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/UsageModels_List.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/UsageModels_List.json */ /** * Sample code: UsageModels_List. diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/pom.xml b/sdk/storagecache/azure-resourcemanager-storagecache/pom.xml index ebe694c344fb..2114f72f6996 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/pom.xml +++ b/sdk/storagecache/azure-resourcemanager-storagecache/pom.xml @@ -13,7 +13,7 @@ jar Microsoft Azure SDK for StorageCache Management - This package contains Microsoft Azure SDK for StorageCache Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. A Storage Cache provides scalable caching service for NAS clients, serving data from either NFSv3 or Blob at-rest storage (referred to as "Storage Targets"). These operations allow you to manage Caches. Package tag package-2022-01. + This package contains Microsoft Azure SDK for StorageCache Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. A Storage Cache provides scalable caching service for NAS clients, serving data from either NFSv3 or Blob at-rest storage (referred to as "Storage Targets"). These operations allow you to manage Caches. Package tag package-2022-05. https://github.com/Azure/azure-sdk-for-java diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/StorageCacheManager.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/StorageCacheManager.java index 119a7f70a0df..98ed5b5b394a 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/StorageCacheManager.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/StorageCacheManager.java @@ -10,11 +10,13 @@ import com.azure.core.http.HttpPipelineBuilder; import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.http.policy.HttpPolicyProviders; import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; @@ -95,6 +97,19 @@ public static StorageCacheManager authenticate(TokenCredential credential, Azure return configure().authenticate(credential, profile); } + /** + * Creates an instance of StorageCache service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the StorageCache service API instance. + */ + public static StorageCacheManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new StorageCacheManager(httpPipeline, profile, null); + } + /** * Gets a Configurable instance that can be used to create StorageCacheManager with optional configuration. * @@ -113,6 +128,7 @@ public static final class Configurable { private final List policies = new ArrayList<>(); private final List scopes = new ArrayList<>(); private RetryPolicy retryPolicy; + private RetryOptions retryOptions; private Duration defaultPollInterval; private Configurable() { @@ -173,6 +189,19 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { return this; } + /** + * Sets the retry options for the HTTP pipeline retry policy. + * + *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + /** * Sets the default poll interval, used when service does not provide "Retry-After" header. * @@ -206,7 +235,7 @@ public StorageCacheManager authenticate(TokenCredential credential, AzureProfile .append("-") .append("com.azure.resourcemanager.storagecache") .append("/") - .append("1.0.0-beta.5"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -224,10 +253,15 @@ public StorageCacheManager authenticate(TokenCredential credential, AzureProfile scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); } if (retryPolicy == null) { - retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } } List policies = new ArrayList<>(); policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); policies.add(new RequestIdPolicy()); policies .addAll( @@ -258,7 +292,11 @@ public StorageCacheManager authenticate(TokenCredential credential, AzureProfile } } - /** @return Resource collection API of Operations. */ + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ public Operations operations() { if (this.operations == null) { this.operations = new OperationsImpl(clientObject.getOperations(), this); @@ -266,7 +304,11 @@ public Operations operations() { return operations; } - /** @return Resource collection API of Skus. */ + /** + * Gets the resource collection API of Skus. + * + * @return Resource collection API of Skus. + */ public Skus skus() { if (this.skus == null) { this.skus = new SkusImpl(clientObject.getSkus(), this); @@ -274,7 +316,11 @@ public Skus skus() { return skus; } - /** @return Resource collection API of UsageModels. */ + /** + * Gets the resource collection API of UsageModels. + * + * @return Resource collection API of UsageModels. + */ public UsageModels usageModels() { if (this.usageModels == null) { this.usageModels = new UsageModelsImpl(clientObject.getUsageModels(), this); @@ -282,7 +328,11 @@ public UsageModels usageModels() { return usageModels; } - /** @return Resource collection API of AscOperations. */ + /** + * Gets the resource collection API of AscOperations. + * + * @return Resource collection API of AscOperations. + */ public AscOperations ascOperations() { if (this.ascOperations == null) { this.ascOperations = new AscOperationsImpl(clientObject.getAscOperations(), this); @@ -290,7 +340,11 @@ public AscOperations ascOperations() { return ascOperations; } - /** @return Resource collection API of AscUsages. */ + /** + * Gets the resource collection API of AscUsages. + * + * @return Resource collection API of AscUsages. + */ public AscUsages ascUsages() { if (this.ascUsages == null) { this.ascUsages = new AscUsagesImpl(clientObject.getAscUsages(), this); @@ -298,7 +352,11 @@ public AscUsages ascUsages() { return ascUsages; } - /** @return Resource collection API of Caches. */ + /** + * Gets the resource collection API of Caches. It manages Cache. + * + * @return Resource collection API of Caches. + */ public Caches caches() { if (this.caches == null) { this.caches = new CachesImpl(clientObject.getCaches(), this); @@ -306,7 +364,11 @@ public Caches caches() { return caches; } - /** @return Resource collection API of StorageTargets. */ + /** + * Gets the resource collection API of StorageTargets. It manages StorageTarget. + * + * @return Resource collection API of StorageTargets. + */ public StorageTargets storageTargets() { if (this.storageTargets == null) { this.storageTargets = new StorageTargetsImpl(clientObject.getStorageTargets(), this); @@ -314,7 +376,11 @@ public StorageTargets storageTargets() { return storageTargets; } - /** @return Resource collection API of StorageTargetOperations. */ + /** + * Gets the resource collection API of StorageTargetOperations. + * + * @return Resource collection API of StorageTargetOperations. + */ public StorageTargetOperations storageTargetOperations() { if (this.storageTargetOperations == null) { this.storageTargetOperations = diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/CachesClient.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/CachesClient.java index 6d8139311058..8a5056f54bbd 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/CachesClient.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/CachesClient.java @@ -12,6 +12,10 @@ import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.storagecache.fluent.models.CacheInner; +import com.azure.resourcemanager.storagecache.models.PrimingJob; +import com.azure.resourcemanager.storagecache.models.PrimingJobIdParameter; +import com.azure.resourcemanager.storagecache.models.StorageTargetSpaceAllocation; +import java.util.List; /** An instance of this class provides access to all the operations defined in CachesClient. */ public interface CachesClient { @@ -489,6 +493,309 @@ Response updateWithResponse( @ServiceMethod(returns = ReturnType.SINGLE) void stop(String resourceGroupName, String cacheName, Context context); + /** + * Create a priming job. This operation is only allowed when the cache is healthy. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingjob Object containing the definition of a priming job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStartPrimingJob( + String resourceGroupName, String cacheName, PrimingJob primingjob); + + /** + * Create a priming job. This operation is only allowed when the cache is healthy. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingjob Object containing the definition of a priming job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStartPrimingJob( + String resourceGroupName, String cacheName, PrimingJob primingjob, Context context); + + /** + * Create a priming job. This operation is only allowed when the cache is healthy. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingjob Object containing the definition of a priming job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void startPrimingJob(String resourceGroupName, String cacheName, PrimingJob primingjob); + + /** + * Create a priming job. This operation is only allowed when the cache is healthy. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void startPrimingJob(String resourceGroupName, String cacheName); + + /** + * Create a priming job. This operation is only allowed when the cache is healthy. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingjob Object containing the definition of a priming job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void startPrimingJob(String resourceGroupName, String cacheName, PrimingJob primingjob, Context context); + + /** + * Schedule a priming job for deletion. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStopPrimingJob( + String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId); + + /** + * Schedule a priming job for deletion. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStopPrimingJob( + String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId, Context context); + + /** + * Schedule a priming job for deletion. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void stopPrimingJob(String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId); + + /** + * Schedule a priming job for deletion. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void stopPrimingJob(String resourceGroupName, String cacheName); + + /** + * Schedule a priming job for deletion. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void stopPrimingJob( + String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId, Context context); + + /** + * Schedule a priming job to be paused. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginPausePrimingJob( + String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId); + + /** + * Schedule a priming job to be paused. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginPausePrimingJob( + String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId, Context context); + + /** + * Schedule a priming job to be paused. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void pausePrimingJob(String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId); + + /** + * Schedule a priming job to be paused. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void pausePrimingJob(String resourceGroupName, String cacheName); + + /** + * Schedule a priming job to be paused. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void pausePrimingJob( + String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId, Context context); + + /** + * Resumes a paused priming job. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginResumePrimingJob( + String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId); + + /** + * Resumes a paused priming job. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginResumePrimingJob( + String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId, Context context); + + /** + * Resumes a paused priming job. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void resumePrimingJob(String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId); + + /** + * Resumes a paused priming job. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void resumePrimingJob(String resourceGroupName, String cacheName); + + /** + * Resumes a paused priming job. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void resumePrimingJob( + String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId, Context context); + /** * Upgrade a Cache's firmware if a new version is available. Otherwise, this operation has no effect. * @@ -545,4 +852,87 @@ SyncPoller, Void> beginUpgradeFirmware( */ @ServiceMethod(returns = ReturnType.SINGLE) void upgradeFirmware(String resourceGroupName, String cacheName, Context context); + + /** + * Update cache space allocation. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param spaceAllocation List containing storage target cache space percentage allocations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginSpaceAllocation( + String resourceGroupName, String cacheName, List spaceAllocation); + + /** + * Update cache space allocation. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param spaceAllocation List containing storage target cache space percentage allocations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginSpaceAllocation( + String resourceGroupName, + String cacheName, + List spaceAllocation, + Context context); + + /** + * Update cache space allocation. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param spaceAllocation List containing storage target cache space percentage allocations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void spaceAllocation( + String resourceGroupName, String cacheName, List spaceAllocation); + + /** + * Update cache space allocation. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void spaceAllocation(String resourceGroupName, String cacheName); + + /** + * Update cache space allocation. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param spaceAllocation List containing storage target cache space percentage allocations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void spaceAllocation( + String resourceGroupName, + String cacheName, + List spaceAllocation, + Context context); } diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/CacheInner.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/CacheInner.java index e86db299e5ec..8ec27d6e206c 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/CacheInner.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/CacheInner.java @@ -14,8 +14,11 @@ import com.azure.resourcemanager.storagecache.models.CacheNetworkSettings; import com.azure.resourcemanager.storagecache.models.CacheSecuritySettings; import com.azure.resourcemanager.storagecache.models.CacheSku; +import com.azure.resourcemanager.storagecache.models.CacheUpgradeSettings; import com.azure.resourcemanager.storagecache.models.CacheUpgradeStatus; +import com.azure.resourcemanager.storagecache.models.PrimingJob; import com.azure.resourcemanager.storagecache.models.ProvisioningStateType; +import com.azure.resourcemanager.storagecache.models.StorageTargetSpaceAllocation; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; import java.util.Map; @@ -205,6 +208,29 @@ public CacheUpgradeStatus upgradeStatus() { return this.innerProperties() == null ? null : this.innerProperties().upgradeStatus(); } + /** + * Get the upgradeSettings property: Upgrade settings of the Cache. + * + * @return the upgradeSettings value. + */ + public CacheUpgradeSettings upgradeSettings() { + return this.innerProperties() == null ? null : this.innerProperties().upgradeSettings(); + } + + /** + * Set the upgradeSettings property: Upgrade settings of the Cache. + * + * @param upgradeSettings the upgradeSettings value to set. + * @return the CacheInner object itself. + */ + public CacheInner withUpgradeSettings(CacheUpgradeSettings upgradeSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new CacheProperties(); + } + this.innerProperties().withUpgradeSettings(upgradeSettings); + return this; + } + /** * Get the networkSettings property: Specifies network settings of the cache. * @@ -322,6 +348,24 @@ public CacheInner withZones(List zones) { return this; } + /** + * Get the primingJobs property: Specifies the priming jobs defined in the cache. + * + * @return the primingJobs value. + */ + public List primingJobs() { + return this.innerProperties() == null ? null : this.innerProperties().primingJobs(); + } + + /** + * Get the spaceAllocation property: Specifies the space allocation percentage for each storage target in the cache. + * + * @return the spaceAllocation value. + */ + public List spaceAllocation() { + return this.innerProperties() == null ? null : this.innerProperties().spaceAllocation(); + } + /** * Validates the instance. * diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/CacheProperties.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/CacheProperties.java index 87e53c61cb26..2f76fa8e435a 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/CacheProperties.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/CacheProperties.java @@ -10,8 +10,11 @@ import com.azure.resourcemanager.storagecache.models.CacheHealth; import com.azure.resourcemanager.storagecache.models.CacheNetworkSettings; import com.azure.resourcemanager.storagecache.models.CacheSecuritySettings; +import com.azure.resourcemanager.storagecache.models.CacheUpgradeSettings; import com.azure.resourcemanager.storagecache.models.CacheUpgradeStatus; +import com.azure.resourcemanager.storagecache.models.PrimingJob; import com.azure.resourcemanager.storagecache.models.ProvisioningStateType; +import com.azure.resourcemanager.storagecache.models.StorageTargetSpaceAllocation; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -55,6 +58,12 @@ public final class CacheProperties { @JsonProperty(value = "upgradeStatus", access = JsonProperty.Access.WRITE_ONLY) private CacheUpgradeStatus upgradeStatus; + /* + * Upgrade settings of the Cache. + */ + @JsonProperty(value = "upgradeSettings") + private CacheUpgradeSettings upgradeSettings; + /* * Specifies network settings of the cache. */ @@ -86,6 +95,19 @@ public final class CacheProperties { @JsonProperty(value = "zones") private List zones; + /* + * Specifies the priming jobs defined in the cache. + */ + @JsonProperty(value = "primingJobs", access = JsonProperty.Access.WRITE_ONLY) + private List primingJobs; + + /* + * Specifies the space allocation percentage for each storage target in the + * cache. + */ + @JsonProperty(value = "spaceAllocation", access = JsonProperty.Access.WRITE_ONLY) + private List spaceAllocation; + /** * Get the cacheSizeGB property: The size of this Cache, in GB. * @@ -163,6 +185,26 @@ public CacheUpgradeStatus upgradeStatus() { return this.upgradeStatus; } + /** + * Get the upgradeSettings property: Upgrade settings of the Cache. + * + * @return the upgradeSettings value. + */ + public CacheUpgradeSettings upgradeSettings() { + return this.upgradeSettings; + } + + /** + * Set the upgradeSettings property: Upgrade settings of the Cache. + * + * @param upgradeSettings the upgradeSettings value to set. + * @return the CacheProperties object itself. + */ + public CacheProperties withUpgradeSettings(CacheUpgradeSettings upgradeSettings) { + this.upgradeSettings = upgradeSettings; + return this; + } + /** * Get the networkSettings property: Specifies network settings of the cache. * @@ -265,6 +307,24 @@ public CacheProperties withZones(List zones) { return this; } + /** + * Get the primingJobs property: Specifies the priming jobs defined in the cache. + * + * @return the primingJobs value. + */ + public List primingJobs() { + return this.primingJobs; + } + + /** + * Get the spaceAllocation property: Specifies the space allocation percentage for each storage target in the cache. + * + * @return the spaceAllocation value. + */ + public List spaceAllocation() { + return this.spaceAllocation; + } + /** * Validates the instance. * @@ -277,6 +337,9 @@ public void validate() { if (upgradeStatus() != null) { upgradeStatus().validate(); } + if (upgradeSettings() != null) { + upgradeSettings().validate(); + } if (networkSettings() != null) { networkSettings().validate(); } @@ -289,5 +352,11 @@ public void validate() { if (directoryServicesSettings() != null) { directoryServicesSettings().validate(); } + if (primingJobs() != null) { + primingJobs().forEach(e -> e.validate()); + } + if (spaceAllocation() != null) { + spaceAllocation().forEach(e -> e.validate()); + } } } diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/StorageTargetInner.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/StorageTargetInner.java index dc09afc7e1ba..6ff75911a949 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/StorageTargetInner.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/StorageTargetInner.java @@ -206,6 +206,15 @@ public StorageTargetInner withBlobNfs(BlobNfsTarget blobNfs) { return this; } + /** + * Get the allocationPercentage property: The percentage of cache space allocated for this storage target. + * + * @return the allocationPercentage value. + */ + public Integer allocationPercentage() { + return this.innerProperties() == null ? null : this.innerProperties().allocationPercentage(); + } + /** * Validates the instance. * diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/StorageTargetProperties.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/StorageTargetProperties.java index 88b99b9ac77e..f40f23bd69b4 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/StorageTargetProperties.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/fluent/models/StorageTargetProperties.java @@ -69,6 +69,12 @@ public final class StorageTargetProperties { @JsonProperty(value = "blobNfs") private BlobNfsTarget blobNfs; + /* + * The percentage of cache space allocated for this storage target + */ + @JsonProperty(value = "allocationPercentage", access = JsonProperty.Access.WRITE_ONLY) + private Integer allocationPercentage; + /** * Get the junctions property: List of Cache namespace junctions to target for namespace associations. * @@ -219,6 +225,15 @@ public StorageTargetProperties withBlobNfs(BlobNfsTarget blobNfs) { return this; } + /** + * Get the allocationPercentage property: The percentage of cache space allocated for this storage target. + * + * @return the allocationPercentage value. + */ + public Integer allocationPercentage() { + return this.allocationPercentage; + } + /** * Validates the instance. * diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/implementation/AscOperationsClientImpl.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/implementation/AscOperationsClientImpl.java index f65612b0184d..b00c2eb9ff34 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/implementation/AscOperationsClientImpl.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/implementation/AscOperationsClientImpl.java @@ -172,15 +172,7 @@ private Mono> getWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String location, String operationId) { - return getWithResponseAsync(location, operationId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return getWithResponseAsync(location, operationId).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/implementation/CacheImpl.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/implementation/CacheImpl.java index 2f216aedf7b9..223fb1eba2a1 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/implementation/CacheImpl.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/implementation/CacheImpl.java @@ -16,8 +16,12 @@ import com.azure.resourcemanager.storagecache.models.CacheNetworkSettings; import com.azure.resourcemanager.storagecache.models.CacheSecuritySettings; import com.azure.resourcemanager.storagecache.models.CacheSku; +import com.azure.resourcemanager.storagecache.models.CacheUpgradeSettings; import com.azure.resourcemanager.storagecache.models.CacheUpgradeStatus; +import com.azure.resourcemanager.storagecache.models.PrimingJob; +import com.azure.resourcemanager.storagecache.models.PrimingJobIdParameter; import com.azure.resourcemanager.storagecache.models.ProvisioningStateType; +import com.azure.resourcemanager.storagecache.models.StorageTargetSpaceAllocation; import java.util.Collections; import java.util.List; import java.util.Map; @@ -93,6 +97,10 @@ public CacheUpgradeStatus upgradeStatus() { return this.innerModel().upgradeStatus(); } + public CacheUpgradeSettings upgradeSettings() { + return this.innerModel().upgradeSettings(); + } + public CacheNetworkSettings networkSettings() { return this.innerModel().networkSettings(); } @@ -118,6 +126,24 @@ public List zones() { } } + public List primingJobs() { + List inner = this.innerModel().primingJobs(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List spaceAllocation() { + List inner = this.innerModel().spaceAllocation(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + public Region region() { return Region.fromName(this.regionName()); } @@ -126,6 +152,10 @@ public String regionName() { return this.location(); } + public String resourceGroupName() { + return resourceGroupName; + } + public CacheInner innerModel() { return this.innerObject; } @@ -250,6 +280,54 @@ public void stop(Context context) { serviceManager.caches().stop(resourceGroupName, cacheName, context); } + public void startPrimingJob(PrimingJob primingjob) { + serviceManager.caches().startPrimingJob(resourceGroupName, cacheName, primingjob); + } + + public void startPrimingJob() { + serviceManager.caches().startPrimingJob(resourceGroupName, cacheName); + } + + public void startPrimingJob(PrimingJob primingjob, Context context) { + serviceManager.caches().startPrimingJob(resourceGroupName, cacheName, primingjob, context); + } + + public void stopPrimingJob(PrimingJobIdParameter primingJobId) { + serviceManager.caches().stopPrimingJob(resourceGroupName, cacheName, primingJobId); + } + + public void stopPrimingJob() { + serviceManager.caches().stopPrimingJob(resourceGroupName, cacheName); + } + + public void stopPrimingJob(PrimingJobIdParameter primingJobId, Context context) { + serviceManager.caches().stopPrimingJob(resourceGroupName, cacheName, primingJobId, context); + } + + public void pausePrimingJob(PrimingJobIdParameter primingJobId) { + serviceManager.caches().pausePrimingJob(resourceGroupName, cacheName, primingJobId); + } + + public void pausePrimingJob() { + serviceManager.caches().pausePrimingJob(resourceGroupName, cacheName); + } + + public void pausePrimingJob(PrimingJobIdParameter primingJobId, Context context) { + serviceManager.caches().pausePrimingJob(resourceGroupName, cacheName, primingJobId, context); + } + + public void resumePrimingJob(PrimingJobIdParameter primingJobId) { + serviceManager.caches().resumePrimingJob(resourceGroupName, cacheName, primingJobId); + } + + public void resumePrimingJob() { + serviceManager.caches().resumePrimingJob(resourceGroupName, cacheName); + } + + public void resumePrimingJob(PrimingJobIdParameter primingJobId, Context context) { + serviceManager.caches().resumePrimingJob(resourceGroupName, cacheName, primingJobId, context); + } + public void upgradeFirmware() { serviceManager.caches().upgradeFirmware(resourceGroupName, cacheName); } @@ -293,6 +371,11 @@ public CacheImpl withSubnet(String subnet) { return this; } + public CacheImpl withUpgradeSettings(CacheUpgradeSettings upgradeSettings) { + this.innerModel().withUpgradeSettings(upgradeSettings); + return this; + } + public CacheImpl withNetworkSettings(CacheNetworkSettings networkSettings) { this.innerModel().withNetworkSettings(networkSettings); return this; diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/implementation/CachesClientImpl.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/implementation/CachesClientImpl.java index 650d7d373073..2c561d4f6352 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/implementation/CachesClientImpl.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/implementation/CachesClientImpl.java @@ -36,7 +36,11 @@ import com.azure.resourcemanager.storagecache.fluent.CachesClient; import com.azure.resourcemanager.storagecache.fluent.models.CacheInner; import com.azure.resourcemanager.storagecache.models.CachesListResult; +import com.azure.resourcemanager.storagecache.models.PrimingJob; +import com.azure.resourcemanager.storagecache.models.PrimingJobIdParameter; +import com.azure.resourcemanager.storagecache.models.StorageTargetSpaceAllocation; import java.nio.ByteBuffer; +import java.util.List; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -212,6 +216,70 @@ Mono>> stop( @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches" + + "/{cacheName}/startPrimingJob") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> startPrimingJob( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("cacheName") String cacheName, + @BodyParam("application/json") PrimingJob primingjob, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches" + + "/{cacheName}/stopPrimingJob") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> stopPrimingJob( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cacheName") String cacheName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") PrimingJobIdParameter primingJobId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches" + + "/{cacheName}/pausePrimingJob") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> pausePrimingJob( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cacheName") String cacheName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") PrimingJobIdParameter primingJobId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches" + + "/{cacheName}/resumePrimingJob") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> resumePrimingJob( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cacheName") String cacheName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") PrimingJobIdParameter primingJobId, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Post( "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches" @@ -227,6 +295,22 @@ Mono>> upgradeFirmware( @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches" + + "/{cacheName}/spaceAllocation") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> spaceAllocation( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("cacheName") String cacheName, + @BodyParam("application/json") List spaceAllocation, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -900,14 +984,7 @@ private Mono> getByResourceGroupWithResponseAsync( @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, String cacheName) { return getByResourceGroupWithResponseAsync(resourceGroupName, cacheName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1379,14 +1456,7 @@ private Mono> updateWithResponseAsync( @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String cacheName, CacheInner cache) { return updateWithResponseAsync(resourceGroupName, cacheName, cache) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -1404,14 +1474,7 @@ private Mono updateAsync(String resourceGroupName, String cacheName, private Mono updateAsync(String resourceGroupName, String cacheName) { final CacheInner cache = null; return updateWithResponseAsync(resourceGroupName, cacheName, cache) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -2407,19 +2470,20 @@ public void stop(String resourceGroupName, String cacheName, Context context) { } /** - * Upgrade a Cache's firmware if a new version is available. Otherwise, this operation has no effect. + * Create a priming job. This operation is only allowed when the cache is healthy. * * @param resourceGroupName Target resource group. * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the * [-0-9a-zA-Z_] char class. + * @param primingjob Object containing the definition of a priming job. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> upgradeFirmwareWithResponseAsync( - String resourceGroupName, String cacheName) { + private Mono>> startPrimingJobWithResponseAsync( + String resourceGroupName, String cacheName, PrimingJob primingjob) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -2439,28 +2503,33 @@ private Mono>> upgradeFirmwareWithResponseAsync( if (cacheName == null) { return Mono.error(new IllegalArgumentException("Parameter cacheName is required and cannot be null.")); } + if (primingjob != null) { + primingjob.validate(); + } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .upgradeFirmware( + .startPrimingJob( this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), this.client.getSubscriptionId(), cacheName, + primingjob, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Upgrade a Cache's firmware if a new version is available. Otherwise, this operation has no effect. + * Create a priming job. This operation is only allowed when the cache is healthy. * * @param resourceGroupName Target resource group. * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the * [-0-9a-zA-Z_] char class. + * @param primingjob Object containing the definition of a priming job. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2468,8 +2537,8 @@ private Mono>> upgradeFirmwareWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> upgradeFirmwareWithResponseAsync( - String resourceGroupName, String cacheName, Context context) { + private Mono>> startPrimingJobWithResponseAsync( + String resourceGroupName, String cacheName, PrimingJob primingjob, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -2489,33 +2558,40 @@ private Mono>> upgradeFirmwareWithResponseAsync( if (cacheName == null) { return Mono.error(new IllegalArgumentException("Parameter cacheName is required and cannot be null.")); } + if (primingjob != null) { + primingjob.validate(); + } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .upgradeFirmware( + .startPrimingJob( this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), this.client.getSubscriptionId(), cacheName, + primingjob, accept, context); } /** - * Upgrade a Cache's firmware if a new version is available. Otherwise, this operation has no effect. + * Create a priming job. This operation is only allowed when the cache is healthy. * * @param resourceGroupName Target resource group. * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the * [-0-9a-zA-Z_] char class. + * @param primingjob Object containing the definition of a priming job. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginUpgradeFirmwareAsync(String resourceGroupName, String cacheName) { - Mono>> mono = upgradeFirmwareWithResponseAsync(resourceGroupName, cacheName); + private PollerFlux, Void> beginStartPrimingJobAsync( + String resourceGroupName, String cacheName, PrimingJob primingjob) { + Mono>> mono = + startPrimingJobWithResponseAsync(resourceGroupName, cacheName, primingjob); return this .client .getLroResult( @@ -2523,11 +2599,12 @@ private PollerFlux, Void> beginUpgradeFirmwareAsync(String reso } /** - * Upgrade a Cache's firmware if a new version is available. Otherwise, this operation has no effect. + * Create a priming job. This operation is only allowed when the cache is healthy. * * @param resourceGroupName Target resource group. * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the * [-0-9a-zA-Z_] char class. + * @param primingjob Object containing the definition of a priming job. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2535,37 +2612,41 @@ private PollerFlux, Void> beginUpgradeFirmwareAsync(String reso * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginUpgradeFirmwareAsync( - String resourceGroupName, String cacheName, Context context) { + private PollerFlux, Void> beginStartPrimingJobAsync( + String resourceGroupName, String cacheName, PrimingJob primingjob, Context context) { context = this.client.mergeContext(context); - Mono>> mono = upgradeFirmwareWithResponseAsync(resourceGroupName, cacheName, context); + Mono>> mono = + startPrimingJobWithResponseAsync(resourceGroupName, cacheName, primingjob, context); return this .client .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); } /** - * Upgrade a Cache's firmware if a new version is available. Otherwise, this operation has no effect. + * Create a priming job. This operation is only allowed when the cache is healthy. * * @param resourceGroupName Target resource group. * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the * [-0-9a-zA-Z_] char class. + * @param primingjob Object containing the definition of a priming job. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginUpgradeFirmware(String resourceGroupName, String cacheName) { - return beginUpgradeFirmwareAsync(resourceGroupName, cacheName).getSyncPoller(); + public SyncPoller, Void> beginStartPrimingJob( + String resourceGroupName, String cacheName, PrimingJob primingjob) { + return beginStartPrimingJobAsync(resourceGroupName, cacheName, primingjob).getSyncPoller(); } /** - * Upgrade a Cache's firmware if a new version is available. Otherwise, this operation has no effect. + * Create a priming job. This operation is only allowed when the cache is healthy. * * @param resourceGroupName Target resource group. * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the * [-0-9a-zA-Z_] char class. + * @param primingjob Object containing the definition of a priming job. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2573,35 +2654,56 @@ public SyncPoller, Void> beginUpgradeFirmware(String resourceGr * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginUpgradeFirmware( - String resourceGroupName, String cacheName, Context context) { - return beginUpgradeFirmwareAsync(resourceGroupName, cacheName, context).getSyncPoller(); + public SyncPoller, Void> beginStartPrimingJob( + String resourceGroupName, String cacheName, PrimingJob primingjob, Context context) { + return beginStartPrimingJobAsync(resourceGroupName, cacheName, primingjob, context).getSyncPoller(); } /** - * Upgrade a Cache's firmware if a new version is available. Otherwise, this operation has no effect. + * Create a priming job. This operation is only allowed when the cache is healthy. * * @param resourceGroupName Target resource group. * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the * [-0-9a-zA-Z_] char class. + * @param primingjob Object containing the definition of a priming job. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono upgradeFirmwareAsync(String resourceGroupName, String cacheName) { - return beginUpgradeFirmwareAsync(resourceGroupName, cacheName) + private Mono startPrimingJobAsync(String resourceGroupName, String cacheName, PrimingJob primingjob) { + return beginStartPrimingJobAsync(resourceGroupName, cacheName, primingjob) .last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Upgrade a Cache's firmware if a new version is available. Otherwise, this operation has no effect. + * Create a priming job. This operation is only allowed when the cache is healthy. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startPrimingJobAsync(String resourceGroupName, String cacheName) { + final PrimingJob primingjob = null; + return beginStartPrimingJobAsync(resourceGroupName, cacheName, primingjob) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a priming job. This operation is only allowed when the cache is healthy. * * @param resourceGroupName Target resource group. * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the * [-0-9a-zA-Z_] char class. + * @param primingjob Object containing the definition of a priming job. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2609,41 +2711,1516 @@ private Mono upgradeFirmwareAsync(String resourceGroupName, String cacheNa * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono upgradeFirmwareAsync(String resourceGroupName, String cacheName, Context context) { - return beginUpgradeFirmwareAsync(resourceGroupName, cacheName, context) + private Mono startPrimingJobAsync( + String resourceGroupName, String cacheName, PrimingJob primingjob, Context context) { + return beginStartPrimingJobAsync(resourceGroupName, cacheName, primingjob, context) .last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Upgrade a Cache's firmware if a new version is available. Otherwise, this operation has no effect. + * Create a priming job. This operation is only allowed when the cache is healthy. * * @param resourceGroupName Target resource group. * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the * [-0-9a-zA-Z_] char class. + * @param primingjob Object containing the definition of a priming job. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void upgradeFirmware(String resourceGroupName, String cacheName) { - upgradeFirmwareAsync(resourceGroupName, cacheName).block(); + public void startPrimingJob(String resourceGroupName, String cacheName, PrimingJob primingjob) { + startPrimingJobAsync(resourceGroupName, cacheName, primingjob).block(); } /** - * Upgrade a Cache's firmware if a new version is available. Otherwise, this operation has no effect. + * Create a priming job. This operation is only allowed when the cache is healthy. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void startPrimingJob(String resourceGroupName, String cacheName) { + final PrimingJob primingjob = null; + startPrimingJobAsync(resourceGroupName, cacheName, primingjob).block(); + } + + /** + * Create a priming job. This operation is only allowed when the cache is healthy. * * @param resourceGroupName Target resource group. * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the * [-0-9a-zA-Z_] char class. + * @param primingjob Object containing the definition of a priming job. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void upgradeFirmware(String resourceGroupName, String cacheName, Context context) { - upgradeFirmwareAsync(resourceGroupName, cacheName, context).block(); + public void startPrimingJob(String resourceGroupName, String cacheName, PrimingJob primingjob, Context context) { + startPrimingJobAsync(resourceGroupName, cacheName, primingjob, context).block(); + } + + /** + * Schedule a priming job for deletion. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopPrimingJobWithResponseAsync( + String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cacheName == null) { + return Mono.error(new IllegalArgumentException("Parameter cacheName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (primingJobId != null) { + primingJobId.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .stopPrimingJob( + this.client.getEndpoint(), + resourceGroupName, + cacheName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + primingJobId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Schedule a priming job for deletion. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopPrimingJobWithResponseAsync( + String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cacheName == null) { + return Mono.error(new IllegalArgumentException("Parameter cacheName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (primingJobId != null) { + primingJobId.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .stopPrimingJob( + this.client.getEndpoint(), + resourceGroupName, + cacheName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + primingJobId, + accept, + context); + } + + /** + * Schedule a priming job for deletion. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStopPrimingJobAsync( + String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId) { + Mono>> mono = + stopPrimingJobWithResponseAsync(resourceGroupName, cacheName, primingJobId); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Schedule a priming job for deletion. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStopPrimingJobAsync( + String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + stopPrimingJobWithResponseAsync(resourceGroupName, cacheName, primingJobId, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Schedule a priming job for deletion. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStopPrimingJob( + String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId) { + return beginStopPrimingJobAsync(resourceGroupName, cacheName, primingJobId).getSyncPoller(); + } + + /** + * Schedule a priming job for deletion. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStopPrimingJob( + String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId, Context context) { + return beginStopPrimingJobAsync(resourceGroupName, cacheName, primingJobId, context).getSyncPoller(); + } + + /** + * Schedule a priming job for deletion. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopPrimingJobAsync( + String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId) { + return beginStopPrimingJobAsync(resourceGroupName, cacheName, primingJobId) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Schedule a priming job for deletion. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopPrimingJobAsync(String resourceGroupName, String cacheName) { + final PrimingJobIdParameter primingJobId = null; + return beginStopPrimingJobAsync(resourceGroupName, cacheName, primingJobId) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Schedule a priming job for deletion. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopPrimingJobAsync( + String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId, Context context) { + return beginStopPrimingJobAsync(resourceGroupName, cacheName, primingJobId, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Schedule a priming job for deletion. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void stopPrimingJob(String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId) { + stopPrimingJobAsync(resourceGroupName, cacheName, primingJobId).block(); + } + + /** + * Schedule a priming job for deletion. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void stopPrimingJob(String resourceGroupName, String cacheName) { + final PrimingJobIdParameter primingJobId = null; + stopPrimingJobAsync(resourceGroupName, cacheName, primingJobId).block(); + } + + /** + * Schedule a priming job for deletion. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void stopPrimingJob( + String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId, Context context) { + stopPrimingJobAsync(resourceGroupName, cacheName, primingJobId, context).block(); + } + + /** + * Schedule a priming job to be paused. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> pausePrimingJobWithResponseAsync( + String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cacheName == null) { + return Mono.error(new IllegalArgumentException("Parameter cacheName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (primingJobId != null) { + primingJobId.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .pausePrimingJob( + this.client.getEndpoint(), + resourceGroupName, + cacheName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + primingJobId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Schedule a priming job to be paused. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> pausePrimingJobWithResponseAsync( + String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cacheName == null) { + return Mono.error(new IllegalArgumentException("Parameter cacheName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (primingJobId != null) { + primingJobId.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .pausePrimingJob( + this.client.getEndpoint(), + resourceGroupName, + cacheName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + primingJobId, + accept, + context); + } + + /** + * Schedule a priming job to be paused. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginPausePrimingJobAsync( + String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId) { + Mono>> mono = + pausePrimingJobWithResponseAsync(resourceGroupName, cacheName, primingJobId); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Schedule a priming job to be paused. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginPausePrimingJobAsync( + String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + pausePrimingJobWithResponseAsync(resourceGroupName, cacheName, primingJobId, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Schedule a priming job to be paused. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPausePrimingJob( + String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId) { + return beginPausePrimingJobAsync(resourceGroupName, cacheName, primingJobId).getSyncPoller(); + } + + /** + * Schedule a priming job to be paused. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPausePrimingJob( + String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId, Context context) { + return beginPausePrimingJobAsync(resourceGroupName, cacheName, primingJobId, context).getSyncPoller(); + } + + /** + * Schedule a priming job to be paused. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono pausePrimingJobAsync( + String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId) { + return beginPausePrimingJobAsync(resourceGroupName, cacheName, primingJobId) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Schedule a priming job to be paused. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono pausePrimingJobAsync(String resourceGroupName, String cacheName) { + final PrimingJobIdParameter primingJobId = null; + return beginPausePrimingJobAsync(resourceGroupName, cacheName, primingJobId) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Schedule a priming job to be paused. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono pausePrimingJobAsync( + String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId, Context context) { + return beginPausePrimingJobAsync(resourceGroupName, cacheName, primingJobId, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Schedule a priming job to be paused. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void pausePrimingJob(String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId) { + pausePrimingJobAsync(resourceGroupName, cacheName, primingJobId).block(); + } + + /** + * Schedule a priming job to be paused. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void pausePrimingJob(String resourceGroupName, String cacheName) { + final PrimingJobIdParameter primingJobId = null; + pausePrimingJobAsync(resourceGroupName, cacheName, primingJobId).block(); + } + + /** + * Schedule a priming job to be paused. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void pausePrimingJob( + String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId, Context context) { + pausePrimingJobAsync(resourceGroupName, cacheName, primingJobId, context).block(); + } + + /** + * Resumes a paused priming job. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resumePrimingJobWithResponseAsync( + String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cacheName == null) { + return Mono.error(new IllegalArgumentException("Parameter cacheName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (primingJobId != null) { + primingJobId.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .resumePrimingJob( + this.client.getEndpoint(), + resourceGroupName, + cacheName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + primingJobId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Resumes a paused priming job. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resumePrimingJobWithResponseAsync( + String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (cacheName == null) { + return Mono.error(new IllegalArgumentException("Parameter cacheName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (primingJobId != null) { + primingJobId.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .resumePrimingJob( + this.client.getEndpoint(), + resourceGroupName, + cacheName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + primingJobId, + accept, + context); + } + + /** + * Resumes a paused priming job. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginResumePrimingJobAsync( + String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId) { + Mono>> mono = + resumePrimingJobWithResponseAsync(resourceGroupName, cacheName, primingJobId); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Resumes a paused priming job. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginResumePrimingJobAsync( + String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + resumePrimingJobWithResponseAsync(resourceGroupName, cacheName, primingJobId, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Resumes a paused priming job. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginResumePrimingJob( + String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId) { + return beginResumePrimingJobAsync(resourceGroupName, cacheName, primingJobId).getSyncPoller(); + } + + /** + * Resumes a paused priming job. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginResumePrimingJob( + String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId, Context context) { + return beginResumePrimingJobAsync(resourceGroupName, cacheName, primingJobId, context).getSyncPoller(); + } + + /** + * Resumes a paused priming job. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resumePrimingJobAsync( + String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId) { + return beginResumePrimingJobAsync(resourceGroupName, cacheName, primingJobId) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Resumes a paused priming job. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resumePrimingJobAsync(String resourceGroupName, String cacheName) { + final PrimingJobIdParameter primingJobId = null; + return beginResumePrimingJobAsync(resourceGroupName, cacheName, primingJobId) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Resumes a paused priming job. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resumePrimingJobAsync( + String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId, Context context) { + return beginResumePrimingJobAsync(resourceGroupName, cacheName, primingJobId, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Resumes a paused priming job. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void resumePrimingJob(String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId) { + resumePrimingJobAsync(resourceGroupName, cacheName, primingJobId).block(); + } + + /** + * Resumes a paused priming job. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void resumePrimingJob(String resourceGroupName, String cacheName) { + final PrimingJobIdParameter primingJobId = null; + resumePrimingJobAsync(resourceGroupName, cacheName, primingJobId).block(); + } + + /** + * Resumes a paused priming job. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void resumePrimingJob( + String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId, Context context) { + resumePrimingJobAsync(resourceGroupName, cacheName, primingJobId, context).block(); + } + + /** + * Upgrade a Cache's firmware if a new version is available. Otherwise, this operation has no effect. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> upgradeFirmwareWithResponseAsync( + String resourceGroupName, String cacheName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (cacheName == null) { + return Mono.error(new IllegalArgumentException("Parameter cacheName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .upgradeFirmware( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + cacheName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Upgrade a Cache's firmware if a new version is available. Otherwise, this operation has no effect. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> upgradeFirmwareWithResponseAsync( + String resourceGroupName, String cacheName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (cacheName == null) { + return Mono.error(new IllegalArgumentException("Parameter cacheName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .upgradeFirmware( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + cacheName, + accept, + context); + } + + /** + * Upgrade a Cache's firmware if a new version is available. Otherwise, this operation has no effect. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginUpgradeFirmwareAsync(String resourceGroupName, String cacheName) { + Mono>> mono = upgradeFirmwareWithResponseAsync(resourceGroupName, cacheName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Upgrade a Cache's firmware if a new version is available. Otherwise, this operation has no effect. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginUpgradeFirmwareAsync( + String resourceGroupName, String cacheName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = upgradeFirmwareWithResponseAsync(resourceGroupName, cacheName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Upgrade a Cache's firmware if a new version is available. Otherwise, this operation has no effect. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginUpgradeFirmware(String resourceGroupName, String cacheName) { + return beginUpgradeFirmwareAsync(resourceGroupName, cacheName).getSyncPoller(); + } + + /** + * Upgrade a Cache's firmware if a new version is available. Otherwise, this operation has no effect. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginUpgradeFirmware( + String resourceGroupName, String cacheName, Context context) { + return beginUpgradeFirmwareAsync(resourceGroupName, cacheName, context).getSyncPoller(); + } + + /** + * Upgrade a Cache's firmware if a new version is available. Otherwise, this operation has no effect. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono upgradeFirmwareAsync(String resourceGroupName, String cacheName) { + return beginUpgradeFirmwareAsync(resourceGroupName, cacheName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Upgrade a Cache's firmware if a new version is available. Otherwise, this operation has no effect. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono upgradeFirmwareAsync(String resourceGroupName, String cacheName, Context context) { + return beginUpgradeFirmwareAsync(resourceGroupName, cacheName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Upgrade a Cache's firmware if a new version is available. Otherwise, this operation has no effect. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void upgradeFirmware(String resourceGroupName, String cacheName) { + upgradeFirmwareAsync(resourceGroupName, cacheName).block(); + } + + /** + * Upgrade a Cache's firmware if a new version is available. Otherwise, this operation has no effect. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void upgradeFirmware(String resourceGroupName, String cacheName, Context context) { + upgradeFirmwareAsync(resourceGroupName, cacheName, context).block(); + } + + /** + * Update cache space allocation. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param spaceAllocation List containing storage target cache space percentage allocations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> spaceAllocationWithResponseAsync( + String resourceGroupName, String cacheName, List spaceAllocation) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (cacheName == null) { + return Mono.error(new IllegalArgumentException("Parameter cacheName is required and cannot be null.")); + } + if (spaceAllocation != null) { + spaceAllocation.forEach(e -> e.validate()); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .spaceAllocation( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + cacheName, + spaceAllocation, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update cache space allocation. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param spaceAllocation List containing storage target cache space percentage allocations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> spaceAllocationWithResponseAsync( + String resourceGroupName, + String cacheName, + List spaceAllocation, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (cacheName == null) { + return Mono.error(new IllegalArgumentException("Parameter cacheName is required and cannot be null.")); + } + if (spaceAllocation != null) { + spaceAllocation.forEach(e -> e.validate()); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .spaceAllocation( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + cacheName, + spaceAllocation, + accept, + context); + } + + /** + * Update cache space allocation. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param spaceAllocation List containing storage target cache space percentage allocations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginSpaceAllocationAsync( + String resourceGroupName, String cacheName, List spaceAllocation) { + Mono>> mono = + spaceAllocationWithResponseAsync(resourceGroupName, cacheName, spaceAllocation); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Update cache space allocation. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param spaceAllocation List containing storage target cache space percentage allocations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginSpaceAllocationAsync( + String resourceGroupName, + String cacheName, + List spaceAllocation, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + spaceAllocationWithResponseAsync(resourceGroupName, cacheName, spaceAllocation, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Update cache space allocation. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param spaceAllocation List containing storage target cache space percentage allocations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginSpaceAllocation( + String resourceGroupName, String cacheName, List spaceAllocation) { + return beginSpaceAllocationAsync(resourceGroupName, cacheName, spaceAllocation).getSyncPoller(); + } + + /** + * Update cache space allocation. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param spaceAllocation List containing storage target cache space percentage allocations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginSpaceAllocation( + String resourceGroupName, + String cacheName, + List spaceAllocation, + Context context) { + return beginSpaceAllocationAsync(resourceGroupName, cacheName, spaceAllocation, context).getSyncPoller(); + } + + /** + * Update cache space allocation. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param spaceAllocation List containing storage target cache space percentage allocations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono spaceAllocationAsync( + String resourceGroupName, String cacheName, List spaceAllocation) { + return beginSpaceAllocationAsync(resourceGroupName, cacheName, spaceAllocation) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update cache space allocation. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono spaceAllocationAsync(String resourceGroupName, String cacheName) { + final List spaceAllocation = null; + return beginSpaceAllocationAsync(resourceGroupName, cacheName, spaceAllocation) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update cache space allocation. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param spaceAllocation List containing storage target cache space percentage allocations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono spaceAllocationAsync( + String resourceGroupName, + String cacheName, + List spaceAllocation, + Context context) { + return beginSpaceAllocationAsync(resourceGroupName, cacheName, spaceAllocation, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update cache space allocation. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param spaceAllocation List containing storage target cache space percentage allocations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void spaceAllocation( + String resourceGroupName, String cacheName, List spaceAllocation) { + spaceAllocationAsync(resourceGroupName, cacheName, spaceAllocation).block(); + } + + /** + * Update cache space allocation. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void spaceAllocation(String resourceGroupName, String cacheName) { + final List spaceAllocation = null; + spaceAllocationAsync(resourceGroupName, cacheName, spaceAllocation).block(); + } + + /** + * Update cache space allocation. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param spaceAllocation List containing storage target cache space percentage allocations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void spaceAllocation( + String resourceGroupName, + String cacheName, + List spaceAllocation, + Context context) { + spaceAllocationAsync(resourceGroupName, cacheName, spaceAllocation, context).block(); } /** diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/implementation/CachesImpl.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/implementation/CachesImpl.java index ebc07255bde2..f51b02e289ad 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/implementation/CachesImpl.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/implementation/CachesImpl.java @@ -13,6 +13,10 @@ import com.azure.resourcemanager.storagecache.fluent.models.CacheInner; import com.azure.resourcemanager.storagecache.models.Cache; import com.azure.resourcemanager.storagecache.models.Caches; +import com.azure.resourcemanager.storagecache.models.PrimingJob; +import com.azure.resourcemanager.storagecache.models.PrimingJobIdParameter; +import com.azure.resourcemanager.storagecache.models.StorageTargetSpaceAllocation; +import java.util.List; public final class CachesImpl implements Caches { private static final ClientLogger LOGGER = new ClientLogger(CachesImpl.class); @@ -110,6 +114,57 @@ public void stop(String resourceGroupName, String cacheName, Context context) { this.serviceClient().stop(resourceGroupName, cacheName, context); } + public void startPrimingJob(String resourceGroupName, String cacheName, PrimingJob primingjob) { + this.serviceClient().startPrimingJob(resourceGroupName, cacheName, primingjob); + } + + public void startPrimingJob(String resourceGroupName, String cacheName) { + this.serviceClient().startPrimingJob(resourceGroupName, cacheName); + } + + public void startPrimingJob(String resourceGroupName, String cacheName, PrimingJob primingjob, Context context) { + this.serviceClient().startPrimingJob(resourceGroupName, cacheName, primingjob, context); + } + + public void stopPrimingJob(String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId) { + this.serviceClient().stopPrimingJob(resourceGroupName, cacheName, primingJobId); + } + + public void stopPrimingJob(String resourceGroupName, String cacheName) { + this.serviceClient().stopPrimingJob(resourceGroupName, cacheName); + } + + public void stopPrimingJob( + String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId, Context context) { + this.serviceClient().stopPrimingJob(resourceGroupName, cacheName, primingJobId, context); + } + + public void pausePrimingJob(String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId) { + this.serviceClient().pausePrimingJob(resourceGroupName, cacheName, primingJobId); + } + + public void pausePrimingJob(String resourceGroupName, String cacheName) { + this.serviceClient().pausePrimingJob(resourceGroupName, cacheName); + } + + public void pausePrimingJob( + String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId, Context context) { + this.serviceClient().pausePrimingJob(resourceGroupName, cacheName, primingJobId, context); + } + + public void resumePrimingJob(String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId) { + this.serviceClient().resumePrimingJob(resourceGroupName, cacheName, primingJobId); + } + + public void resumePrimingJob(String resourceGroupName, String cacheName) { + this.serviceClient().resumePrimingJob(resourceGroupName, cacheName); + } + + public void resumePrimingJob( + String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId, Context context) { + this.serviceClient().resumePrimingJob(resourceGroupName, cacheName, primingJobId, context); + } + public void upgradeFirmware(String resourceGroupName, String cacheName) { this.serviceClient().upgradeFirmware(resourceGroupName, cacheName); } @@ -118,6 +173,23 @@ public void upgradeFirmware(String resourceGroupName, String cacheName, Context this.serviceClient().upgradeFirmware(resourceGroupName, cacheName, context); } + public void spaceAllocation( + String resourceGroupName, String cacheName, List spaceAllocation) { + this.serviceClient().spaceAllocation(resourceGroupName, cacheName, spaceAllocation); + } + + public void spaceAllocation(String resourceGroupName, String cacheName) { + this.serviceClient().spaceAllocation(resourceGroupName, cacheName); + } + + public void spaceAllocation( + String resourceGroupName, + String cacheName, + List spaceAllocation, + Context context) { + this.serviceClient().spaceAllocation(resourceGroupName, cacheName, spaceAllocation, context); + } + public Cache getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourcegroups"); if (resourceGroupName == null) { diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/implementation/StorageCacheManagementClientBuilder.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/implementation/StorageCacheManagementClientBuilder.java index 3561de6543d4..7d18ba757d6e 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/implementation/StorageCacheManagementClientBuilder.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/implementation/StorageCacheManagementClientBuilder.java @@ -7,7 +7,6 @@ import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.CookiePolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.AzureEnvironment; @@ -70,34 +69,34 @@ public StorageCacheManagementClientBuilder environment(AzureEnvironment environm } /* - * The default poll interval for long-running operation + * The HTTP pipeline to send requests through */ - private Duration defaultPollInterval; + private HttpPipeline pipeline; /** - * Sets The default poll interval for long-running operation. + * Sets The HTTP pipeline to send requests through. * - * @param defaultPollInterval the defaultPollInterval value. + * @param pipeline the pipeline value. * @return the StorageCacheManagementClientBuilder. */ - public StorageCacheManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = defaultPollInterval; + public StorageCacheManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; return this; } /* - * The HTTP pipeline to send requests through + * The default poll interval for long-running operation */ - private HttpPipeline pipeline; + private Duration defaultPollInterval; /** - * Sets The HTTP pipeline to send requests through. + * Sets The default poll interval for long-running operation. * - * @param pipeline the pipeline value. + * @param defaultPollInterval the defaultPollInterval value. * @return the StorageCacheManagementClientBuilder. */ - public StorageCacheManagementClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; + public StorageCacheManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; return this; } @@ -129,15 +128,12 @@ public StorageCacheManagementClientImpl buildClient() { if (environment == null) { this.environment = AzureEnvironment.AZURE; } + if (pipeline == null) { + this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + } if (defaultPollInterval == null) { this.defaultPollInterval = Duration.ofSeconds(30); } - if (pipeline == null) { - this.pipeline = - new HttpPipelineBuilder() - .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) - .build(); - } if (serializerAdapter == null) { this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); } diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/implementation/StorageCacheManagementClientImpl.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/implementation/StorageCacheManagementClientImpl.java index 79c075fd0e02..2c49066ef961 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/implementation/StorageCacheManagementClientImpl.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/implementation/StorageCacheManagementClientImpl.java @@ -15,6 +15,7 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.management.polling.PollerFactory; import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; import com.azure.core.util.polling.LongRunningOperationStatus; @@ -36,7 +37,6 @@ import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.time.Duration; -import java.util.Map; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -238,7 +238,7 @@ public StorageTargetOperationsClient getStorageTargetOperations() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2022-01-01"; + this.apiVersion = "2022-05-01"; this.operations = new OperationsClientImpl(this); this.skus = new SkusClientImpl(this); this.usageModels = new UsageModelsClientImpl(this); @@ -265,10 +265,7 @@ public Context getContext() { * @return the merged context. */ public Context mergeContext(Context context) { - for (Map.Entry entry : this.getContext().getValues().entrySet()) { - context = context.addData(entry.getKey(), entry.getValue()); - } - return context; + return CoreUtils.mergeContexts(this.getContext(), context); } /** diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/implementation/StorageTargetImpl.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/implementation/StorageTargetImpl.java index bd5b94c9fc9c..734c787a8201 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/implementation/StorageTargetImpl.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/implementation/StorageTargetImpl.java @@ -82,6 +82,10 @@ public BlobNfsTarget blobNfs() { return this.innerModel().blobNfs(); } + public Integer allocationPercentage() { + return this.innerModel().allocationPercentage(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -90,6 +94,10 @@ public String regionName() { return this.location(); } + public String resourceGroupName() { + return resourceGroupName; + } + public StorageTargetInner innerModel() { return this.innerObject; } diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/implementation/StorageTargetsClientImpl.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/implementation/StorageTargetsClientImpl.java index 93ba6b01d19a..f9db0085bed5 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/implementation/StorageTargetsClientImpl.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/implementation/StorageTargetsClientImpl.java @@ -1091,14 +1091,7 @@ private Mono> getWithResponseAsync( @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String cacheName, String storageTargetName) { return getWithResponseAsync(resourceGroupName, cacheName, storageTargetName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/ApiOperationPropertiesServiceSpecification.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/ApiOperationPropertiesServiceSpecification.java index 752ed641f247..c6a7ce9fcd4d 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/ApiOperationPropertiesServiceSpecification.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/ApiOperationPropertiesServiceSpecification.java @@ -17,6 +17,12 @@ public final class ApiOperationPropertiesServiceSpecification { @JsonProperty(value = "metricSpecifications") private List metricSpecifications; + /* + * Details about operations related to logs. + */ + @JsonProperty(value = "logSpecifications") + private List logSpecifications; + /** * Get the metricSpecifications property: Details about operations related to metrics. * @@ -38,6 +44,26 @@ public ApiOperationPropertiesServiceSpecification withMetricSpecifications( return this; } + /** + * Get the logSpecifications property: Details about operations related to logs. + * + * @return the logSpecifications value. + */ + public List logSpecifications() { + return this.logSpecifications; + } + + /** + * Set the logSpecifications property: Details about operations related to logs. + * + * @param logSpecifications the logSpecifications value to set. + * @return the ApiOperationPropertiesServiceSpecification object itself. + */ + public ApiOperationPropertiesServiceSpecification withLogSpecifications(List logSpecifications) { + this.logSpecifications = logSpecifications; + return this; + } + /** * Validates the instance. * @@ -47,5 +73,8 @@ public void validate() { if (metricSpecifications() != null) { metricSpecifications().forEach(e -> e.validate()); } + if (logSpecifications() != null) { + logSpecifications().forEach(e -> e.validate()); + } } } diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/Cache.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/Cache.java index cc9a29a45045..ee86c98a89c3 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/Cache.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/Cache.java @@ -112,6 +112,13 @@ public interface Cache { */ CacheUpgradeStatus upgradeStatus(); + /** + * Gets the upgradeSettings property: Upgrade settings of the Cache. + * + * @return the upgradeSettings value. + */ + CacheUpgradeSettings upgradeSettings(); + /** * Gets the networkSettings property: Specifies network settings of the cache. * @@ -148,6 +155,21 @@ public interface Cache { */ List zones(); + /** + * Gets the primingJobs property: Specifies the priming jobs defined in the cache. + * + * @return the primingJobs value. + */ + List primingJobs(); + + /** + * Gets the spaceAllocation property: Specifies the space allocation percentage for each storage target in the + * cache. + * + * @return the spaceAllocation value. + */ + List spaceAllocation(); + /** * Gets the region of the resource. * @@ -162,6 +184,13 @@ public interface Cache { */ String regionName(); + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.storagecache.fluent.models.CacheInner object. * @@ -219,6 +248,7 @@ interface WithCreate DefinitionStages.WithSku, DefinitionStages.WithCacheSizeGB, DefinitionStages.WithSubnet, + DefinitionStages.WithUpgradeSettings, DefinitionStages.WithNetworkSettings, DefinitionStages.WithEncryptionSettings, DefinitionStages.WithSecuritySettings, @@ -289,6 +319,16 @@ interface WithSubnet { */ WithCreate withSubnet(String subnet); } + /** The stage of the Cache definition allowing to specify upgradeSettings. */ + interface WithUpgradeSettings { + /** + * Specifies the upgradeSettings property: Upgrade settings of the Cache.. + * + * @param upgradeSettings Upgrade settings of the Cache. + * @return the next definition stage. + */ + WithCreate withUpgradeSettings(CacheUpgradeSettings upgradeSettings); + } /** The stage of the Cache definition allowing to specify networkSettings. */ interface WithNetworkSettings { /** @@ -353,6 +393,7 @@ interface WithZones { interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, + UpdateStages.WithUpgradeSettings, UpdateStages.WithNetworkSettings, UpdateStages.WithEncryptionSettings, UpdateStages.WithSecuritySettings, @@ -394,6 +435,16 @@ interface WithIdentity { */ Update withIdentity(CacheIdentity identity); } + /** The stage of the Cache update allowing to specify upgradeSettings. */ + interface WithUpgradeSettings { + /** + * Specifies the upgradeSettings property: Upgrade settings of the Cache.. + * + * @param upgradeSettings Upgrade settings of the Cache. + * @return the next definition stage. + */ + Update withUpgradeSettings(CacheUpgradeSettings upgradeSettings); + } /** The stage of the Cache update allowing to specify networkSettings. */ interface WithNetworkSettings { /** @@ -524,6 +575,122 @@ interface WithDirectoryServicesSettings { */ void stop(Context context); + /** + * Create a priming job. This operation is only allowed when the cache is healthy. + * + * @param primingjob Object containing the definition of a priming job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void startPrimingJob(PrimingJob primingjob); + + /** + * Create a priming job. This operation is only allowed when the cache is healthy. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void startPrimingJob(); + + /** + * Create a priming job. This operation is only allowed when the cache is healthy. + * + * @param primingjob Object containing the definition of a priming job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void startPrimingJob(PrimingJob primingjob, Context context); + + /** + * Schedule a priming job for deletion. + * + * @param primingJobId Object containing the priming job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stopPrimingJob(PrimingJobIdParameter primingJobId); + + /** + * Schedule a priming job for deletion. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stopPrimingJob(); + + /** + * Schedule a priming job for deletion. + * + * @param primingJobId Object containing the priming job ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stopPrimingJob(PrimingJobIdParameter primingJobId, Context context); + + /** + * Schedule a priming job to be paused. + * + * @param primingJobId Object containing the priming job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void pausePrimingJob(PrimingJobIdParameter primingJobId); + + /** + * Schedule a priming job to be paused. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void pausePrimingJob(); + + /** + * Schedule a priming job to be paused. + * + * @param primingJobId Object containing the priming job ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void pausePrimingJob(PrimingJobIdParameter primingJobId, Context context); + + /** + * Resumes a paused priming job. + * + * @param primingJobId Object containing the priming job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void resumePrimingJob(PrimingJobIdParameter primingJobId); + + /** + * Resumes a paused priming job. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void resumePrimingJob(); + + /** + * Resumes a paused priming job. + * + * @param primingJobId Object containing the priming job ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void resumePrimingJob(PrimingJobIdParameter primingJobId, Context context); + /** * Upgrade a Cache's firmware if a new version is available. Otherwise, this operation has no effect. * diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/CacheUpgradeSettings.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/CacheUpgradeSettings.java new file mode 100644 index 000000000000..9643702015aa --- /dev/null +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/CacheUpgradeSettings.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagecache.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Cache Upgrade Settings. */ +@Fluent +public final class CacheUpgradeSettings { + /* + * True if the user chooses to select an installation time between now and + * firmwareUpdateDeadline. Else the firmware will automatically be + * installed after firmwareUpdateDeadline if not triggered earlier via the + * upgrade operation. + */ + @JsonProperty(value = "upgradeScheduleEnabled") + private Boolean upgradeScheduleEnabled; + + /* + * When upgradeScheduleEnabled is true, this field holds the user-chosen + * upgrade time. At the user-chosen time, the firmware update will + * automatically be installed on the cache. + */ + @JsonProperty(value = "scheduledTime") + private OffsetDateTime scheduledTime; + + /** + * Get the upgradeScheduleEnabled property: True if the user chooses to select an installation time between now and + * firmwareUpdateDeadline. Else the firmware will automatically be installed after firmwareUpdateDeadline if not + * triggered earlier via the upgrade operation. + * + * @return the upgradeScheduleEnabled value. + */ + public Boolean upgradeScheduleEnabled() { + return this.upgradeScheduleEnabled; + } + + /** + * Set the upgradeScheduleEnabled property: True if the user chooses to select an installation time between now and + * firmwareUpdateDeadline. Else the firmware will automatically be installed after firmwareUpdateDeadline if not + * triggered earlier via the upgrade operation. + * + * @param upgradeScheduleEnabled the upgradeScheduleEnabled value to set. + * @return the CacheUpgradeSettings object itself. + */ + public CacheUpgradeSettings withUpgradeScheduleEnabled(Boolean upgradeScheduleEnabled) { + this.upgradeScheduleEnabled = upgradeScheduleEnabled; + return this; + } + + /** + * Get the scheduledTime property: When upgradeScheduleEnabled is true, this field holds the user-chosen upgrade + * time. At the user-chosen time, the firmware update will automatically be installed on the cache. + * + * @return the scheduledTime value. + */ + public OffsetDateTime scheduledTime() { + return this.scheduledTime; + } + + /** + * Set the scheduledTime property: When upgradeScheduleEnabled is true, this field holds the user-chosen upgrade + * time. At the user-chosen time, the firmware update will automatically be installed on the cache. + * + * @param scheduledTime the scheduledTime value to set. + * @return the CacheUpgradeSettings object itself. + */ + public CacheUpgradeSettings withScheduledTime(OffsetDateTime scheduledTime) { + this.scheduledTime = scheduledTime; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/Caches.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/Caches.java index d0b5818c1a24..9f09dc3c5193 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/Caches.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/Caches.java @@ -7,6 +7,7 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; +import java.util.List; /** Resource collection API of Caches. */ public interface Caches { @@ -207,6 +208,165 @@ public interface Caches { */ void stop(String resourceGroupName, String cacheName, Context context); + /** + * Create a priming job. This operation is only allowed when the cache is healthy. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingjob Object containing the definition of a priming job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void startPrimingJob(String resourceGroupName, String cacheName, PrimingJob primingjob); + + /** + * Create a priming job. This operation is only allowed when the cache is healthy. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void startPrimingJob(String resourceGroupName, String cacheName); + + /** + * Create a priming job. This operation is only allowed when the cache is healthy. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingjob Object containing the definition of a priming job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void startPrimingJob(String resourceGroupName, String cacheName, PrimingJob primingjob, Context context); + + /** + * Schedule a priming job for deletion. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stopPrimingJob(String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId); + + /** + * Schedule a priming job for deletion. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stopPrimingJob(String resourceGroupName, String cacheName); + + /** + * Schedule a priming job for deletion. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stopPrimingJob( + String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId, Context context); + + /** + * Schedule a priming job to be paused. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void pausePrimingJob(String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId); + + /** + * Schedule a priming job to be paused. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void pausePrimingJob(String resourceGroupName, String cacheName); + + /** + * Schedule a priming job to be paused. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void pausePrimingJob( + String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId, Context context); + + /** + * Resumes a paused priming job. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void resumePrimingJob(String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId); + + /** + * Resumes a paused priming job. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void resumePrimingJob(String resourceGroupName, String cacheName); + + /** + * Resumes a paused priming job. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param primingJobId Object containing the priming job ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void resumePrimingJob( + String resourceGroupName, String cacheName, PrimingJobIdParameter primingJobId, Context context); + /** * Upgrade a Cache's firmware if a new version is available. Otherwise, this operation has no effect. * @@ -232,6 +392,50 @@ public interface Caches { */ void upgradeFirmware(String resourceGroupName, String cacheName, Context context); + /** + * Update cache space allocation. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param spaceAllocation List containing storage target cache space percentage allocations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void spaceAllocation( + String resourceGroupName, String cacheName, List spaceAllocation); + + /** + * Update cache space allocation. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void spaceAllocation(String resourceGroupName, String cacheName); + + /** + * Update cache space allocation. + * + * @param resourceGroupName Target resource group. + * @param cacheName Name of Cache. Length of name must not be greater than 80 and chars must be from the + * [-0-9a-zA-Z_] char class. + * @param spaceAllocation List containing storage target cache space percentage allocations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void spaceAllocation( + String resourceGroupName, + String cacheName, + List spaceAllocation, + Context context); + /** * Returns a Cache. * diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/DomainJoinedType.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/DomainJoinedType.java index d53098001aaf..e25642540c7f 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/DomainJoinedType.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/DomainJoinedType.java @@ -30,7 +30,11 @@ public static DomainJoinedType fromString(String name) { return fromString(name, DomainJoinedType.class); } - /** @return known DomainJoinedType values. */ + /** + * Gets known DomainJoinedType values. + * + * @return known DomainJoinedType values. + */ public static Collection values() { return values(DomainJoinedType.class); } diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/FirmwareStatusType.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/FirmwareStatusType.java index 5525104ec66c..66dfd14e815f 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/FirmwareStatusType.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/FirmwareStatusType.java @@ -27,7 +27,11 @@ public static FirmwareStatusType fromString(String name) { return fromString(name, FirmwareStatusType.class); } - /** @return known FirmwareStatusType values. */ + /** + * Gets known FirmwareStatusType values. + * + * @return known FirmwareStatusType values. + */ public static Collection values() { return values(FirmwareStatusType.class); } diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/HealthStateType.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/HealthStateType.java index 755ac8e583da..421168b15ca7 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/HealthStateType.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/HealthStateType.java @@ -37,6 +37,15 @@ public final class HealthStateType extends ExpandableStringEnum /** Static value Flushing for HealthStateType. */ public static final HealthStateType FLUSHING = fromString("Flushing"); + /** Static value WaitingForKey for HealthStateType. */ + public static final HealthStateType WAITING_FOR_KEY = fromString("WaitingForKey"); + + /** Static value StartFailed for HealthStateType. */ + public static final HealthStateType START_FAILED = fromString("StartFailed"); + + /** Static value UpgradeFailed for HealthStateType. */ + public static final HealthStateType UPGRADE_FAILED = fromString("UpgradeFailed"); + /** * Creates or finds a HealthStateType from its string representation. * @@ -48,7 +57,11 @@ public static HealthStateType fromString(String name) { return fromString(name, HealthStateType.class); } - /** @return known HealthStateType values. */ + /** + * Gets known HealthStateType values. + * + * @return known HealthStateType values. + */ public static Collection values() { return values(HealthStateType.class); } diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/LogSpecification.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/LogSpecification.java new file mode 100644 index 000000000000..07a0282e117a --- /dev/null +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/LogSpecification.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagecache.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Details about operation related to logs. */ +@Fluent +public final class LogSpecification { + /* + * The name of the log. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Localized display name of the log. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Get the name property: The name of the log. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the log. + * + * @param name the name value to set. + * @return the LogSpecification object itself. + */ + public LogSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: Localized display name of the log. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Localized display name of the log. + * + * @param displayName the displayName value to set. + * @return the LogSpecification object itself. + */ + public LogSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/MetricAggregationType.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/MetricAggregationType.java index 67e98dbb68ac..fdcd6740947c 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/MetricAggregationType.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/MetricAggregationType.java @@ -42,7 +42,11 @@ public static MetricAggregationType fromString(String name) { return fromString(name, MetricAggregationType.class); } - /** @return known MetricAggregationType values. */ + /** + * Gets known MetricAggregationType values. + * + * @return known MetricAggregationType values. + */ public static Collection values() { return values(MetricAggregationType.class); } diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/NfsAccessRuleAccess.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/NfsAccessRuleAccess.java index 09399a108fb3..14ebd0b31eee 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/NfsAccessRuleAccess.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/NfsAccessRuleAccess.java @@ -30,7 +30,11 @@ public static NfsAccessRuleAccess fromString(String name) { return fromString(name, NfsAccessRuleAccess.class); } - /** @return known NfsAccessRuleAccess values. */ + /** + * Gets known NfsAccessRuleAccess values. + * + * @return known NfsAccessRuleAccess values. + */ public static Collection values() { return values(NfsAccessRuleAccess.class); } diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/NfsAccessRuleScope.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/NfsAccessRuleScope.java index b51b085c8055..836173341d84 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/NfsAccessRuleScope.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/NfsAccessRuleScope.java @@ -30,7 +30,11 @@ public static NfsAccessRuleScope fromString(String name) { return fromString(name, NfsAccessRuleScope.class); } - /** @return known NfsAccessRuleScope values. */ + /** + * Gets known NfsAccessRuleScope values. + * + * @return known NfsAccessRuleScope values. + */ public static Collection values() { return values(NfsAccessRuleScope.class); } diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/OperationalStateType.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/OperationalStateType.java index 16875069a442..f2911d7e402e 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/OperationalStateType.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/OperationalStateType.java @@ -33,7 +33,11 @@ public static OperationalStateType fromString(String name) { return fromString(name, OperationalStateType.class); } - /** @return known OperationalStateType values. */ + /** + * Gets known OperationalStateType values. + * + * @return known OperationalStateType values. + */ public static Collection values() { return values(OperationalStateType.class); } diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/PrimingJob.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/PrimingJob.java new file mode 100644 index 000000000000..926aa256b5ec --- /dev/null +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/PrimingJob.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagecache.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A priming job instance. */ +@Fluent +public final class PrimingJob { + /* + * The priming job name. + */ + @JsonProperty(value = "primingJobName", required = true) + private String primingJobName; + + /* + * The URL for the priming manifest file to download. This file must be + * readable from the HPC Cache. When the file is in Azure blob storage the + * URL should include a Shared Access Signature (SAS) granting read + * permissions on the blob. + */ + @JsonProperty(value = "primingManifestUrl", required = true) + private String primingManifestUrl; + + /* + * The unique identifier of the priming job. + */ + @JsonProperty(value = "primingJobId", access = JsonProperty.Access.WRITE_ONLY) + private String primingJobId; + + /* + * The state of the priming operation. + */ + @JsonProperty(value = "primingJobState", access = JsonProperty.Access.WRITE_ONLY) + private PrimingJobState primingJobState; + + /* + * The status code of the priming job. + */ + @JsonProperty(value = "primingJobStatus", access = JsonProperty.Access.WRITE_ONLY) + private String primingJobStatus; + + /* + * The job details or error information if any. + */ + @JsonProperty(value = "primingJobDetails", access = JsonProperty.Access.WRITE_ONLY) + private String primingJobDetails; + + /* + * The current progress of the priming job, as a percentage. + */ + @JsonProperty(value = "primingJobPercentComplete", access = JsonProperty.Access.WRITE_ONLY) + private Double primingJobPercentComplete; + + /** + * Get the primingJobName property: The priming job name. + * + * @return the primingJobName value. + */ + public String primingJobName() { + return this.primingJobName; + } + + /** + * Set the primingJobName property: The priming job name. + * + * @param primingJobName the primingJobName value to set. + * @return the PrimingJob object itself. + */ + public PrimingJob withPrimingJobName(String primingJobName) { + this.primingJobName = primingJobName; + return this; + } + + /** + * Get the primingManifestUrl property: The URL for the priming manifest file to download. This file must be + * readable from the HPC Cache. When the file is in Azure blob storage the URL should include a Shared Access + * Signature (SAS) granting read permissions on the blob. + * + * @return the primingManifestUrl value. + */ + public String primingManifestUrl() { + return this.primingManifestUrl; + } + + /** + * Set the primingManifestUrl property: The URL for the priming manifest file to download. This file must be + * readable from the HPC Cache. When the file is in Azure blob storage the URL should include a Shared Access + * Signature (SAS) granting read permissions on the blob. + * + * @param primingManifestUrl the primingManifestUrl value to set. + * @return the PrimingJob object itself. + */ + public PrimingJob withPrimingManifestUrl(String primingManifestUrl) { + this.primingManifestUrl = primingManifestUrl; + return this; + } + + /** + * Get the primingJobId property: The unique identifier of the priming job. + * + * @return the primingJobId value. + */ + public String primingJobId() { + return this.primingJobId; + } + + /** + * Get the primingJobState property: The state of the priming operation. + * + * @return the primingJobState value. + */ + public PrimingJobState primingJobState() { + return this.primingJobState; + } + + /** + * Get the primingJobStatus property: The status code of the priming job. + * + * @return the primingJobStatus value. + */ + public String primingJobStatus() { + return this.primingJobStatus; + } + + /** + * Get the primingJobDetails property: The job details or error information if any. + * + * @return the primingJobDetails value. + */ + public String primingJobDetails() { + return this.primingJobDetails; + } + + /** + * Get the primingJobPercentComplete property: The current progress of the priming job, as a percentage. + * + * @return the primingJobPercentComplete value. + */ + public Double primingJobPercentComplete() { + return this.primingJobPercentComplete; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (primingJobName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property primingJobName in model PrimingJob")); + } + if (primingManifestUrl() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property primingManifestUrl in model PrimingJob")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PrimingJob.class); +} diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/PrimingJobIdParameter.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/PrimingJobIdParameter.java new file mode 100644 index 000000000000..022bce69d26c --- /dev/null +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/PrimingJobIdParameter.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagecache.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Object containing the priming job ID. */ +@Fluent +public final class PrimingJobIdParameter { + /* + * The unique identifier of the priming job. + */ + @JsonProperty(value = "primingJobId", required = true) + private String primingJobId; + + /** + * Get the primingJobId property: The unique identifier of the priming job. + * + * @return the primingJobId value. + */ + public String primingJobId() { + return this.primingJobId; + } + + /** + * Set the primingJobId property: The unique identifier of the priming job. + * + * @param primingJobId the primingJobId value to set. + * @return the PrimingJobIdParameter object itself. + */ + public PrimingJobIdParameter withPrimingJobId(String primingJobId) { + this.primingJobId = primingJobId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (primingJobId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property primingJobId in model PrimingJobIdParameter")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PrimingJobIdParameter.class); +} diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/PrimingJobState.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/PrimingJobState.java new file mode 100644 index 000000000000..b721de6697d7 --- /dev/null +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/PrimingJobState.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagecache.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PrimingJobState. */ +public final class PrimingJobState extends ExpandableStringEnum { + /** Static value Queued for PrimingJobState. */ + public static final PrimingJobState QUEUED = fromString("Queued"); + + /** Static value Running for PrimingJobState. */ + public static final PrimingJobState RUNNING = fromString("Running"); + + /** Static value Paused for PrimingJobState. */ + public static final PrimingJobState PAUSED = fromString("Paused"); + + /** Static value Complete for PrimingJobState. */ + public static final PrimingJobState COMPLETE = fromString("Complete"); + + /** + * Creates or finds a PrimingJobState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrimingJobState. + */ + @JsonCreator + public static PrimingJobState fromString(String name) { + return fromString(name, PrimingJobState.class); + } + + /** + * Gets known PrimingJobState values. + * + * @return known PrimingJobState values. + */ + public static Collection values() { + return values(PrimingJobState.class); + } +} diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/ProvisioningStateType.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/ProvisioningStateType.java index 4f746fae8507..52aefc8058e0 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/ProvisioningStateType.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/ProvisioningStateType.java @@ -39,7 +39,11 @@ public static ProvisioningStateType fromString(String name) { return fromString(name, ProvisioningStateType.class); } - /** @return known ProvisioningStateType values. */ + /** + * Gets known ProvisioningStateType values. + * + * @return known ProvisioningStateType values. + */ public static Collection values() { return values(ProvisioningStateType.class); } diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/ReasonCode.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/ReasonCode.java index eb9b49076b25..3f59658d82b4 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/ReasonCode.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/ReasonCode.java @@ -27,7 +27,11 @@ public static ReasonCode fromString(String name) { return fromString(name, ReasonCode.class); } - /** @return known ReasonCode values. */ + /** + * Gets known ReasonCode values. + * + * @return known ReasonCode values. + */ public static Collection values() { return values(ReasonCode.class); } diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/StorageTarget.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/StorageTarget.java index aeeef2830c19..256baa0f0935 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/StorageTarget.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/StorageTarget.java @@ -104,6 +104,13 @@ public interface StorageTarget { */ BlobNfsTarget blobNfs(); + /** + * Gets the allocationPercentage property: The percentage of cache space allocated for this storage target. + * + * @return the allocationPercentage value. + */ + Integer allocationPercentage(); + /** * Gets the region of the resource. * @@ -118,6 +125,13 @@ public interface StorageTarget { */ String regionName(); + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.storagecache.fluent.models.StorageTargetInner object. * diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/StorageTargetSpaceAllocation.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/StorageTargetSpaceAllocation.java new file mode 100644 index 000000000000..137a7ffdb16d --- /dev/null +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/StorageTargetSpaceAllocation.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagecache.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Storage Target space allocation properties. */ +@Fluent +public final class StorageTargetSpaceAllocation { + /* + * Name of the storage target. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The percentage of cache space allocated for this storage target + */ + @JsonProperty(value = "allocationPercentage") + private Integer allocationPercentage; + + /** + * Get the name property: Name of the storage target. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the storage target. + * + * @param name the name value to set. + * @return the StorageTargetSpaceAllocation object itself. + */ + public StorageTargetSpaceAllocation withName(String name) { + this.name = name; + return this; + } + + /** + * Get the allocationPercentage property: The percentage of cache space allocated for this storage target. + * + * @return the allocationPercentage value. + */ + public Integer allocationPercentage() { + return this.allocationPercentage; + } + + /** + * Set the allocationPercentage property: The percentage of cache space allocated for this storage target. + * + * @param allocationPercentage the allocationPercentage value to set. + * @return the StorageTargetSpaceAllocation object itself. + */ + public StorageTargetSpaceAllocation withAllocationPercentage(Integer allocationPercentage) { + this.allocationPercentage = allocationPercentage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/StorageTargetType.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/StorageTargetType.java index 167558a4fb2e..e7e745d811ff 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/StorageTargetType.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/StorageTargetType.java @@ -33,7 +33,11 @@ public static StorageTargetType fromString(String name) { return fromString(name, StorageTargetType.class); } - /** @return known StorageTargetType values. */ + /** + * Gets known StorageTargetType values. + * + * @return known StorageTargetType values. + */ public static Collection values() { return values(StorageTargetType.class); } diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/UsernameDownloadedType.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/UsernameDownloadedType.java index ae0b22663664..f0fad062e09d 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/UsernameDownloadedType.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/UsernameDownloadedType.java @@ -30,7 +30,11 @@ public static UsernameDownloadedType fromString(String name) { return fromString(name, UsernameDownloadedType.class); } - /** @return known UsernameDownloadedType values. */ + /** + * Gets known UsernameDownloadedType values. + * + * @return known UsernameDownloadedType values. + */ public static Collection values() { return values(UsernameDownloadedType.class); } diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/UsernameSource.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/UsernameSource.java index 9ea5aae9b441..33b1b66041a9 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/UsernameSource.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/main/java/com/azure/resourcemanager/storagecache/models/UsernameSource.java @@ -33,7 +33,11 @@ public static UsernameSource fromString(String name) { return fromString(name, UsernameSource.class); } - /** @return known UsernameSource values. */ + /** + * Gets known UsernameSource values. + * + * @return known UsernameSource values. + */ public static Collection values() { return values(UsernameSource.class); } diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/AscOperationsGetSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/AscOperationsGetSamples.java index 24a96dd052c6..b3cbc83955d9 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/AscOperationsGetSamples.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/AscOperationsGetSamples.java @@ -9,7 +9,7 @@ /** Samples for AscOperations Get. */ public final class AscOperationsGetSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/AscOperations_Get.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/AscOperations_Get.json */ /** * Sample code: AscOperations_Get. diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/AscUsagesListSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/AscUsagesListSamples.java index e8685c8a8df8..ffd9f82c8df4 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/AscUsagesListSamples.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/AscUsagesListSamples.java @@ -9,7 +9,7 @@ /** Samples for AscUsages List. */ public final class AscUsagesListSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/AscResourceUsages_Get.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/AscResourceUsages_Get.json */ /** * Sample code: AscUsages_List. diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesCreateOrUpdateSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesCreateOrUpdateSamples.java index caf85990b5cf..baa113be41fd 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesCreateOrUpdateSamples.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesCreateOrUpdateSamples.java @@ -12,6 +12,7 @@ import com.azure.resourcemanager.storagecache.models.CacheIdentityType; import com.azure.resourcemanager.storagecache.models.CacheSecuritySettings; import com.azure.resourcemanager.storagecache.models.CacheSku; +import com.azure.resourcemanager.storagecache.models.CacheUpgradeSettings; import com.azure.resourcemanager.storagecache.models.CacheUsernameDownloadSettings; import com.azure.resourcemanager.storagecache.models.CacheUsernameDownloadSettingsCredentials; import com.azure.resourcemanager.storagecache.models.KeyVaultKeyReference; @@ -22,6 +23,7 @@ import com.azure.resourcemanager.storagecache.models.NfsAccessRuleScope; import com.azure.resourcemanager.storagecache.models.UserAssignedIdentitiesValue; import com.azure.resourcemanager.storagecache.models.UsernameSource; +import java.time.OffsetDateTime; import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -29,7 +31,7 @@ /** Samples for Caches CreateOrUpdate. */ public final class CachesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/Caches_CreateOrUpdate_ldap_only.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/Caches_CreateOrUpdate_ldap_only.json */ /** * Sample code: Caches_CreateOrUpdate_ldap_only. @@ -48,6 +50,10 @@ public static void cachesCreateOrUpdateLdapOnly( .withCacheSizeGB(3072) .withSubnet( "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/sub1") + .withUpgradeSettings( + new CacheUpgradeSettings() + .withUpgradeScheduleEnabled(true) + .withScheduledTime(OffsetDateTime.parse("2022-04-26T18:25:43.511Z"))) .withEncryptionSettings( new CacheEncryptionSettings() .withKeyEncryptionKey( @@ -89,7 +95,7 @@ public static void cachesCreateOrUpdateLdapOnly( } /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/Caches_CreateOrUpdate.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/Caches_CreateOrUpdate.json */ /** * Sample code: Caches_CreateOrUpdate. @@ -114,6 +120,10 @@ public static void cachesCreateOrUpdate(com.azure.resourcemanager.storagecache.S .withCacheSizeGB(3072) .withSubnet( "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/sub1") + .withUpgradeSettings( + new CacheUpgradeSettings() + .withUpgradeScheduleEnabled(true) + .withScheduledTime(OffsetDateTime.parse("2022-04-26T18:25:43.511Z"))) .withEncryptionSettings( new CacheEncryptionSettings() .withKeyEncryptionKey( diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesDebugInfoSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesDebugInfoSamples.java index b377c3704f1c..2020f831d9b5 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesDebugInfoSamples.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesDebugInfoSamples.java @@ -9,7 +9,7 @@ /** Samples for Caches DebugInfo. */ public final class CachesDebugInfoSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/Caches_DebugInfo.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/Caches_DebugInfo.json */ /** * Sample code: Caches_DebugInfo. diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesDeleteSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesDeleteSamples.java index 808885866e50..850778c5a437 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesDeleteSamples.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesDeleteSamples.java @@ -9,7 +9,7 @@ /** Samples for Caches Delete. */ public final class CachesDeleteSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/Caches_Delete.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/Caches_Delete.json */ /** * Sample code: Caches_Delete. diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesFlushSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesFlushSamples.java index a16c507ccf54..b2b6b9f704c9 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesFlushSamples.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesFlushSamples.java @@ -9,7 +9,7 @@ /** Samples for Caches Flush. */ public final class CachesFlushSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/Caches_Flush.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/Caches_Flush.json */ /** * Sample code: Caches_Flush. diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesGetByResourceGroupSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesGetByResourceGroupSamples.java index c810dfcdd7fb..57c424ff5b15 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesGetByResourceGroupSamples.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesGetByResourceGroupSamples.java @@ -9,7 +9,7 @@ /** Samples for Caches GetByResourceGroup. */ public final class CachesGetByResourceGroupSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/Caches_Get.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/Caches_Get.json */ /** * Sample code: Caches_Get. diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesListByResourceGroupSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesListByResourceGroupSamples.java index 1a5209526b95..d0d52684320e 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesListByResourceGroupSamples.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesListByResourceGroupSamples.java @@ -9,7 +9,7 @@ /** Samples for Caches ListByResourceGroup. */ public final class CachesListByResourceGroupSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/Caches_ListByResourceGroup.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/Caches_ListByResourceGroup.json */ /** * Sample code: Caches_ListByResourceGroup. diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesListSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesListSamples.java index 50ac2e024461..219b18c7a0cb 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesListSamples.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesListSamples.java @@ -9,7 +9,7 @@ /** Samples for Caches List. */ public final class CachesListSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/Caches_List.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/Caches_List.json */ /** * Sample code: Caches_List. diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesPausePrimingJobSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesPausePrimingJobSamples.java new file mode 100644 index 000000000000..dc07a770132d --- /dev/null +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesPausePrimingJobSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagecache.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagecache.models.PrimingJobIdParameter; + +/** Samples for Caches PausePrimingJob. */ +public final class CachesPausePrimingJobSamples { + /* + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/PausePrimingJob.json + */ + /** + * Sample code: PausePrimingJob. + * + * @param manager Entry point to StorageCacheManager. + */ + public static void pausePrimingJob(com.azure.resourcemanager.storagecache.StorageCacheManager manager) { + manager + .caches() + .pausePrimingJob( + "scgroup", "sc1", new PrimingJobIdParameter().withPrimingJobId("00000000000_0000000000"), Context.NONE); + } +} diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesResumePrimingJobSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesResumePrimingJobSamples.java new file mode 100644 index 000000000000..3d94937122da --- /dev/null +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesResumePrimingJobSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagecache.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagecache.models.PrimingJobIdParameter; + +/** Samples for Caches ResumePrimingJob. */ +public final class CachesResumePrimingJobSamples { + /* + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/ResumePrimingJob.json + */ + /** + * Sample code: ResumePrimingJob. + * + * @param manager Entry point to StorageCacheManager. + */ + public static void resumePrimingJob(com.azure.resourcemanager.storagecache.StorageCacheManager manager) { + manager + .caches() + .resumePrimingJob( + "scgroup", "sc1", new PrimingJobIdParameter().withPrimingJobId("00000000000_0000000000"), Context.NONE); + } +} diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesSpaceAllocationSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesSpaceAllocationSamples.java new file mode 100644 index 000000000000..6e321dcbe578 --- /dev/null +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesSpaceAllocationSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagecache.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagecache.models.StorageTargetSpaceAllocation; +import java.util.Arrays; + +/** Samples for Caches SpaceAllocation. */ +public final class CachesSpaceAllocationSamples { + /* + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/SpaceAllocation_Post.json + */ + /** + * Sample code: SpaceAllocation_Post. + * + * @param manager Entry point to StorageCacheManager. + */ + public static void spaceAllocationPost(com.azure.resourcemanager.storagecache.StorageCacheManager manager) { + manager + .caches() + .spaceAllocation( + "scgroup", + "sc1", + Arrays + .asList( + new StorageTargetSpaceAllocation().withName("st1").withAllocationPercentage(25), + new StorageTargetSpaceAllocation().withName("st2").withAllocationPercentage(50), + new StorageTargetSpaceAllocation().withName("st3").withAllocationPercentage(25)), + Context.NONE); + } +} diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesStartPrimingJobSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesStartPrimingJobSamples.java new file mode 100644 index 000000000000..bdfd507e4912 --- /dev/null +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesStartPrimingJobSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagecache.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagecache.models.PrimingJob; + +/** Samples for Caches StartPrimingJob. */ +public final class CachesStartPrimingJobSamples { + /* + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/StartPrimingJob.json + */ + /** + * Sample code: StartPrimingJob. + * + * @param manager Entry point to StorageCacheManager. + */ + public static void startPrimingJob(com.azure.resourcemanager.storagecache.StorageCacheManager manager) { + manager + .caches() + .startPrimingJob( + "scgroup", + "sc1", + new PrimingJob() + .withPrimingJobName("contosoJob") + .withPrimingManifestUrl( + "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="), + Context.NONE); + } +} diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesStartSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesStartSamples.java index e54d4916ed9e..7d538f017b2f 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesStartSamples.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesStartSamples.java @@ -9,7 +9,7 @@ /** Samples for Caches Start. */ public final class CachesStartSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/Caches_Start.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/Caches_Start.json */ /** * Sample code: Caches_Start. diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesStopPrimingJobSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesStopPrimingJobSamples.java new file mode 100644 index 000000000000..4e756cfb1527 --- /dev/null +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesStopPrimingJobSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagecache.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagecache.models.PrimingJobIdParameter; + +/** Samples for Caches StopPrimingJob. */ +public final class CachesStopPrimingJobSamples { + /* + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/StopPrimingJob.json + */ + /** + * Sample code: StopPrimingJob. + * + * @param manager Entry point to StorageCacheManager. + */ + public static void stopPrimingJob(com.azure.resourcemanager.storagecache.StorageCacheManager manager) { + manager + .caches() + .stopPrimingJob( + "scgroup", "sc1", new PrimingJobIdParameter().withPrimingJobId("00000000000_0000000000"), Context.NONE); + } +} diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesStopSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesStopSamples.java index f4fd6b5581f9..86533a7d34b1 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesStopSamples.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesStopSamples.java @@ -9,7 +9,7 @@ /** Samples for Caches Stop. */ public final class CachesStopSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/Caches_Stop.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/Caches_Stop.json */ /** * Sample code: Caches_Stop. diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesUpdateSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesUpdateSamples.java index 86f8680dcc0c..63728fa99819 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesUpdateSamples.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesUpdateSamples.java @@ -10,6 +10,7 @@ import com.azure.resourcemanager.storagecache.models.CacheDirectorySettings; import com.azure.resourcemanager.storagecache.models.CacheNetworkSettings; import com.azure.resourcemanager.storagecache.models.CacheSecuritySettings; +import com.azure.resourcemanager.storagecache.models.CacheUpgradeSettings; import com.azure.resourcemanager.storagecache.models.CacheUsernameDownloadSettings; import com.azure.resourcemanager.storagecache.models.CacheUsernameDownloadSettingsCredentials; import com.azure.resourcemanager.storagecache.models.NfsAccessPolicy; @@ -17,6 +18,7 @@ import com.azure.resourcemanager.storagecache.models.NfsAccessRuleAccess; import com.azure.resourcemanager.storagecache.models.NfsAccessRuleScope; import com.azure.resourcemanager.storagecache.models.UsernameSource; +import java.time.OffsetDateTime; import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -24,7 +26,7 @@ /** Samples for Caches Update. */ public final class CachesUpdateSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/Caches_Update_ldap_only.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/Caches_Update_ldap_only.json */ /** * Sample code: Caches_Update_ldap_only. @@ -36,6 +38,10 @@ public static void cachesUpdateLdapOnly(com.azure.resourcemanager.storagecache.S resource .update() .withTags(mapOf("Dept", "Contoso")) + .withUpgradeSettings( + new CacheUpgradeSettings() + .withUpgradeScheduleEnabled(true) + .withScheduledTime(OffsetDateTime.parse("2022-04-26T18:25:43.511Z"))) .withNetworkSettings( new CacheNetworkSettings() .withMtu(1500) @@ -101,7 +107,7 @@ public static void cachesUpdateLdapOnly(com.azure.resourcemanager.storagecache.S } /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/Caches_Update.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/Caches_Update.json */ /** * Sample code: Caches_Update. @@ -113,6 +119,10 @@ public static void cachesUpdate(com.azure.resourcemanager.storagecache.StorageCa resource .update() .withTags(mapOf("Dept", "Contoso")) + .withUpgradeSettings( + new CacheUpgradeSettings() + .withUpgradeScheduleEnabled(true) + .withScheduledTime(OffsetDateTime.parse("2022-04-26T18:25:43.511Z"))) .withNetworkSettings( new CacheNetworkSettings() .withMtu(1500) diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesUpgradeFirmwareSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesUpgradeFirmwareSamples.java index 58356fd8157b..cd034e312a0a 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesUpgradeFirmwareSamples.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesUpgradeFirmwareSamples.java @@ -9,7 +9,7 @@ /** Samples for Caches UpgradeFirmware. */ public final class CachesUpgradeFirmwareSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/Caches_UpgradeFirmware.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/Caches_UpgradeFirmware.json */ /** * Sample code: Caches_UpgradeFirmware. diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/OperationsListSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/OperationsListSamples.java index cfd1251c6564..5913640e1c73 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/OperationsListSamples.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/OperationsListSamples.java @@ -9,7 +9,7 @@ /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/Operations_List.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/Operations_List.json */ /** * Sample code: Operations_List. diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/SkusListSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/SkusListSamples.java index 088407a9e725..a4bd0093ae98 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/SkusListSamples.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/SkusListSamples.java @@ -9,7 +9,7 @@ /** Samples for Skus List. */ public final class SkusListSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/Skus_List.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/Skus_List.json */ /** * Sample code: Skus_List. diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/StorageTargetOperationFlushSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/StorageTargetOperationFlushSamples.java index 649db49afd09..512427bff119 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/StorageTargetOperationFlushSamples.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/StorageTargetOperationFlushSamples.java @@ -9,7 +9,7 @@ /** Samples for StorageTargetOperation Flush. */ public final class StorageTargetOperationFlushSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/StorageTargets_Flush.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/StorageTargets_Flush.json */ /** * Sample code: StorageTargets_Flush. diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/StorageTargetOperationInvalidateSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/StorageTargetOperationInvalidateSamples.java index 5a1bcd3d2f5f..6855c76cb11b 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/StorageTargetOperationInvalidateSamples.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/StorageTargetOperationInvalidateSamples.java @@ -9,7 +9,7 @@ /** Samples for StorageTargetOperation Invalidate. */ public final class StorageTargetOperationInvalidateSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/StorageTargets_Invalidate.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/StorageTargets_Invalidate.json */ /** * Sample code: StorageTargets_Invalidate. diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/StorageTargetOperationResumeSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/StorageTargetOperationResumeSamples.java index b0c94a72825a..26c5eb05ef5a 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/StorageTargetOperationResumeSamples.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/StorageTargetOperationResumeSamples.java @@ -9,7 +9,7 @@ /** Samples for StorageTargetOperation Resume. */ public final class StorageTargetOperationResumeSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/StorageTargets_Resume.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/StorageTargets_Resume.json */ /** * Sample code: StorageTargets_Resume. diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/StorageTargetOperationSuspendSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/StorageTargetOperationSuspendSamples.java index 48ed70a87a2e..ee8e59ff740f 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/StorageTargetOperationSuspendSamples.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/StorageTargetOperationSuspendSamples.java @@ -9,7 +9,7 @@ /** Samples for StorageTargetOperation Suspend. */ public final class StorageTargetOperationSuspendSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/StorageTargets_Suspend.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/StorageTargets_Suspend.json */ /** * Sample code: StorageTargets_Suspend. diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/StorageTargetsCreateOrUpdateSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/StorageTargetsCreateOrUpdateSamples.java index d874ef45863a..0d0ef23c1917 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/StorageTargetsCreateOrUpdateSamples.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/StorageTargetsCreateOrUpdateSamples.java @@ -13,7 +13,7 @@ /** Samples for StorageTargets CreateOrUpdate. */ public final class StorageTargetsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/StorageTargets_CreateOrUpdate.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/StorageTargets_CreateOrUpdate.json */ /** * Sample code: StorageTargets_CreateOrUpdate. @@ -45,7 +45,7 @@ public static void storageTargetsCreateOrUpdate( } /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/StorageTargets_CreateOrUpdate_BlobNfs.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/StorageTargets_CreateOrUpdate_BlobNfs.json */ /** * Sample code: StorageTargets_CreateOrUpdate_BlobNfs. @@ -69,7 +69,7 @@ public static void storageTargetsCreateOrUpdateBlobNfs( } /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/StorageTargets_CreateOrUpdate_NoJunctions.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/StorageTargets_CreateOrUpdate_NoJunctions.json */ /** * Sample code: StorageTargets_CreateOrUpdate_NoJunctions. diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/StorageTargetsDeleteSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/StorageTargetsDeleteSamples.java index 7edaa4dab506..69d71e51af5c 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/StorageTargetsDeleteSamples.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/StorageTargetsDeleteSamples.java @@ -9,7 +9,7 @@ /** Samples for StorageTargets Delete. */ public final class StorageTargetsDeleteSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/StorageTargets_Delete.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/StorageTargets_Delete.json */ /** * Sample code: StorageTargets_Delete. diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/StorageTargetsDnsRefreshSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/StorageTargetsDnsRefreshSamples.java index 6eb9c279ec82..e0d4188ba5ee 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/StorageTargetsDnsRefreshSamples.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/StorageTargetsDnsRefreshSamples.java @@ -9,7 +9,7 @@ /** Samples for StorageTargets DnsRefresh. */ public final class StorageTargetsDnsRefreshSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/StorageTargets_DnsRefresh.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/StorageTargets_DnsRefresh.json */ /** * Sample code: Caches_DnsRefresh. diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/StorageTargetsGetSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/StorageTargetsGetSamples.java index 36d9ae4041ad..86de8eb57c15 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/StorageTargetsGetSamples.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/StorageTargetsGetSamples.java @@ -9,7 +9,7 @@ /** Samples for StorageTargets Get. */ public final class StorageTargetsGetSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/StorageTargets_Get.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/StorageTargets_Get.json */ /** * Sample code: StorageTargets_Get. diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/StorageTargetsListByCacheSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/StorageTargetsListByCacheSamples.java index de87a03171c0..7ee403e4cf69 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/StorageTargetsListByCacheSamples.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/StorageTargetsListByCacheSamples.java @@ -9,7 +9,7 @@ /** Samples for StorageTargets ListByCache. */ public final class StorageTargetsListByCacheSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/StorageTargets_ListByCache.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/StorageTargets_ListByCache.json */ /** * Sample code: StorageTargets_List. diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/UsageModelsListSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/UsageModelsListSamples.java index 8f24c148ce1e..01356a8d5391 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/UsageModelsListSamples.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/UsageModelsListSamples.java @@ -9,7 +9,7 @@ /** Samples for UsageModels List. */ public final class UsageModelsListSamples { /* - * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-01-01/examples/UsageModels_List.json + * x-ms-original-file: specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2022-05-01/examples/UsageModels_List.json */ /** * Sample code: UsageModels_List.