diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/OperationsList.java b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/OperationsList.java new file mode 100644 index 0000000000..bf21aab439 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/OperationsList.java @@ -0,0 +1,19 @@ + +/** + * Samples for Operations List. + */ +public final class Main { + /* + * x-ms-original-file: + * specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/OperationsList + * .json + */ + /** + * Sample code: OperationsList. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void operationsList(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/OperationsList.json b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/OperationsList.json new file mode 100644 index 0000000000..a4c0976a80 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/OperationsList.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-redisenterprise_2.1.0-beta.2/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md"} \ No newline at end of file diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/OperationsStatusGet.java b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/OperationsStatusGet.java new file mode 100644 index 0000000000..a43e327d85 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/OperationsStatusGet.java @@ -0,0 +1,19 @@ + +/** + * Samples for OperationsStatus Get. + */ +public final class Main { + /* + * x-ms-original-file: + * specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/ + * OperationsStatusGet.json + */ + /** + * Sample code: OperationsStatusGet. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void operationsStatusGet(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.operationsStatus().getWithResponse("West US", "testoperationid", com.azure.core.util.Context.NONE); + } +} diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/OperationsStatusGet.json b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/OperationsStatusGet.json new file mode 100644 index 0000000000..a4c0976a80 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/OperationsStatusGet.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-redisenterprise_2.1.0-beta.2/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md"} \ No newline at end of file diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseAccessPolicyAssignmentCreateUpdate.java b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseAccessPolicyAssignmentCreateUpdate.java new file mode 100644 index 0000000000..6cbb53ac8d --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseAccessPolicyAssignmentCreateUpdate.java @@ -0,0 +1,25 @@ + +import com.azure.resourcemanager.redisenterprise.models.AccessPolicyAssignmentPropertiesUser; + +/** + * Samples for AccessPolicyAssignment CreateUpdate. + */ +public final class Main { + /* + * x-ms-original-file: + * specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/ + * RedisEnterpriseAccessPolicyAssignmentCreateUpdate.json + */ + /** + * Sample code: RedisEnterpriseAccessPolicyAssignmentCreateUpdate. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseAccessPolicyAssignmentCreateUpdate( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.accessPolicyAssignments().define("defaultTestEntraApp1") + .withExistingDatabase("rg1", "cache1", "default").withAccessPolicyName("default") + .withUser(new AccessPolicyAssignmentPropertiesUser().withObjectId("6497c918-11ad-41e7-1b0f-7c518a87d0b0")) + .create(); + } +} diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseAccessPolicyAssignmentCreateUpdate.json b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseAccessPolicyAssignmentCreateUpdate.json new file mode 100644 index 0000000000..a4c0976a80 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseAccessPolicyAssignmentCreateUpdate.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-redisenterprise_2.1.0-beta.2/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md"} \ No newline at end of file diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseAccessPolicyAssignmentDelete.java b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseAccessPolicyAssignmentDelete.java new file mode 100644 index 0000000000..873fef4a11 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseAccessPolicyAssignmentDelete.java @@ -0,0 +1,21 @@ + +/** + * Samples for AccessPolicyAssignment Delete. + */ +public final class Main { + /* + * x-ms-original-file: + * specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/ + * RedisEnterpriseAccessPolicyAssignmentDelete.json + */ + /** + * Sample code: RedisEnterpriseAccessPolicyAssignmentDelete. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseAccessPolicyAssignmentDelete( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.accessPolicyAssignments().delete("rg1", "cache1", "default", "defaultTestEntraApp1", + com.azure.core.util.Context.NONE); + } +} diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseAccessPolicyAssignmentDelete.json b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseAccessPolicyAssignmentDelete.json new file mode 100644 index 0000000000..a4c0976a80 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseAccessPolicyAssignmentDelete.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-redisenterprise_2.1.0-beta.2/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md"} \ No newline at end of file diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseAccessPolicyAssignmentGet.java b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseAccessPolicyAssignmentGet.java new file mode 100644 index 0000000000..56fa25e91b --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseAccessPolicyAssignmentGet.java @@ -0,0 +1,21 @@ + +/** + * Samples for AccessPolicyAssignment Get. + */ +public final class Main { + /* + * x-ms-original-file: + * specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/ + * RedisEnterpriseAccessPolicyAssignmentGet.json + */ + /** + * Sample code: RedisEnterpriseAccessPolicyAssignmentGet. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseAccessPolicyAssignmentGet( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.accessPolicyAssignments().getWithResponse("rg1", "cache1", "default", "accessPolicyAssignmentName1", + com.azure.core.util.Context.NONE); + } +} diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseAccessPolicyAssignmentGet.json b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseAccessPolicyAssignmentGet.json new file mode 100644 index 0000000000..a4c0976a80 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseAccessPolicyAssignmentGet.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-redisenterprise_2.1.0-beta.2/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md"} \ No newline at end of file diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseAccessPolicyAssignmentsList.java b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseAccessPolicyAssignmentsList.java new file mode 100644 index 0000000000..f14c173fa8 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseAccessPolicyAssignmentsList.java @@ -0,0 +1,20 @@ + +/** + * Samples for AccessPolicyAssignment List. + */ +public final class Main { + /* + * x-ms-original-file: + * specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/ + * RedisEnterpriseAccessPolicyAssignmentsList.json + */ + /** + * Sample code: RedisEnterpriseAccessPolicyAssignmentList. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseAccessPolicyAssignmentList( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.accessPolicyAssignments().list("rg1", "cache1", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseAccessPolicyAssignmentsList.json b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseAccessPolicyAssignmentsList.json new file mode 100644 index 0000000000..a4c0976a80 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseAccessPolicyAssignmentsList.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-redisenterprise_2.1.0-beta.2/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md"} \ No newline at end of file diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseCreate.java b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseCreate.java new file mode 100644 index 0000000000..fa305ebcff --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseCreate.java @@ -0,0 +1,60 @@ + +import com.azure.resourcemanager.redisenterprise.models.ClusterPropertiesEncryption; +import com.azure.resourcemanager.redisenterprise.models.ClusterPropertiesEncryptionCustomerManagedKeyEncryption; +import com.azure.resourcemanager.redisenterprise.models.ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity; +import com.azure.resourcemanager.redisenterprise.models.CmkIdentityType; +import com.azure.resourcemanager.redisenterprise.models.ManagedServiceIdentity; +import com.azure.resourcemanager.redisenterprise.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.redisenterprise.models.Sku; +import com.azure.resourcemanager.redisenterprise.models.SkuName; +import com.azure.resourcemanager.redisenterprise.models.TlsVersion; +import com.azure.resourcemanager.redisenterprise.models.UserAssignedIdentity; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RedisEnterprise Create. + */ +public final class Main { + /* + * x-ms-original-file: + * specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/ + * RedisEnterpriseCreate.json + */ + /** + * Sample code: RedisEnterpriseCreate. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseCreate(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.redisEnterprises().define("cache1").withRegion("West US").withExistingResourceGroup("rg1") + .withSku(new Sku().withName(SkuName.ENTERPRISE_FLASH_F300).withCapacity(3)) + .withTags(mapOf("tag1", "value1")).withZones(Arrays.asList("1", "2", "3")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/your-subscription/resourceGroups/your-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/your-identity", + new UserAssignedIdentity()))) + .withMinimumTlsVersion(TlsVersion.ONE_TWO) + .withEncryption(new ClusterPropertiesEncryption().withCustomerManagedKeyEncryption( + new ClusterPropertiesEncryptionCustomerManagedKeyEncryption().withKeyEncryptionKeyIdentity( + new ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity() + .withUserAssignedIdentityResourceId( + "/subscriptions/your-subscription/resourceGroups/your-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/your-identity") + .withIdentityType(CmkIdentityType.USER_ASSIGNED_IDENTITY)) + .withKeyEncryptionKeyUrl("fakeTokenPlaceholder"))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseCreate.json b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseCreate.json new file mode 100644 index 0000000000..a4c0976a80 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseCreate.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-redisenterprise_2.1.0-beta.2/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md"} \ No newline at end of file diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesCreate.java b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesCreate.java new file mode 100644 index 0000000000..20ee52853c --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesCreate.java @@ -0,0 +1,38 @@ + +import com.azure.resourcemanager.redisenterprise.models.AccessKeysAuthentication; +import com.azure.resourcemanager.redisenterprise.models.AofFrequency; +import com.azure.resourcemanager.redisenterprise.models.ClusteringPolicy; +import com.azure.resourcemanager.redisenterprise.models.DeferUpgradeSetting; +import com.azure.resourcemanager.redisenterprise.models.EvictionPolicy; +import com.azure.resourcemanager.redisenterprise.models.Module; +import com.azure.resourcemanager.redisenterprise.models.Persistence; +import com.azure.resourcemanager.redisenterprise.models.Protocol; +import java.util.Arrays; + +/** + * Samples for Databases Create. + */ +public final class Main { + /* + * x-ms-original-file: + * specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/ + * RedisEnterpriseDatabasesCreate.json + */ + /** + * Sample code: RedisEnterpriseDatabasesCreate. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void + redisEnterpriseDatabasesCreate(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.databases().define("default").withExistingRedisEnterprise("rg1", "cache1") + .withClientProtocol(Protocol.ENCRYPTED).withPort(10000) + .withClusteringPolicy(ClusteringPolicy.ENTERPRISE_CLUSTER).withEvictionPolicy(EvictionPolicy.ALL_KEYS_LRU) + .withPersistence(new Persistence().withAofEnabled(true).withAofFrequency(AofFrequency.ONES)) + .withModules(Arrays.asList(new Module().withName("RedisBloom").withArgs("ERROR_RATE 0.00 INITIAL_SIZE 400"), + new Module().withName("RedisTimeSeries").withArgs("RETENTION_POLICY 20"), + new Module().withName("RediSearch"))) + .withDeferUpgrade(DeferUpgradeSetting.NOT_DEFERRED) + .withAccessKeysAuthentication(AccessKeysAuthentication.ENABLED).create(); + } +} diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesCreate.json b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesCreate.json new file mode 100644 index 0000000000..a4c0976a80 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesCreate.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-redisenterprise_2.1.0-beta.2/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md"} \ No newline at end of file diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesCreateWithGeoReplication.java b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesCreateWithGeoReplication.java new file mode 100644 index 0000000000..cdb8f1e921 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesCreateWithGeoReplication.java @@ -0,0 +1,36 @@ + +import com.azure.resourcemanager.redisenterprise.models.AccessKeysAuthentication; +import com.azure.resourcemanager.redisenterprise.models.ClusteringPolicy; +import com.azure.resourcemanager.redisenterprise.models.DatabasePropertiesGeoReplication; +import com.azure.resourcemanager.redisenterprise.models.EvictionPolicy; +import com.azure.resourcemanager.redisenterprise.models.LinkedDatabase; +import com.azure.resourcemanager.redisenterprise.models.Protocol; +import java.util.Arrays; + +/** + * Samples for Databases Create. + */ +public final class Main { + /* + * x-ms-original-file: + * specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/ + * RedisEnterpriseDatabasesCreateWithGeoReplication.json + */ + /** + * Sample code: RedisEnterpriseDatabasesCreate With Active Geo Replication. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseDatabasesCreateWithActiveGeoReplication( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.databases().define("default").withExistingRedisEnterprise("rg1", "cache1") + .withClientProtocol(Protocol.ENCRYPTED).withPort(10000) + .withClusteringPolicy(ClusteringPolicy.ENTERPRISE_CLUSTER).withEvictionPolicy(EvictionPolicy.NO_EVICTION) + .withGeoReplication(new DatabasePropertiesGeoReplication().withGroupNickname("groupName") + .withLinkedDatabases(Arrays.asList(new LinkedDatabase().withId( + "/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default"), + new LinkedDatabase().withId( + "/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8e/resourceGroups/rg2/providers/Microsoft.Cache/redisEnterprise/cache2/databases/default")))) + .withAccessKeysAuthentication(AccessKeysAuthentication.ENABLED).create(); + } +} diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesCreateWithGeoReplication.json b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesCreateWithGeoReplication.json new file mode 100644 index 0000000000..a4c0976a80 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesCreateWithGeoReplication.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-redisenterprise_2.1.0-beta.2/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md"} \ No newline at end of file diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesDelete.java b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesDelete.java new file mode 100644 index 0000000000..ccc8e0a603 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesDelete.java @@ -0,0 +1,20 @@ + +/** + * Samples for Databases Delete. + */ +public final class Main { + /* + * x-ms-original-file: + * specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/ + * RedisEnterpriseDatabasesDelete.json + */ + /** + * Sample code: RedisEnterpriseDatabasesDelete. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void + redisEnterpriseDatabasesDelete(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.databases().delete("rg1", "cache1", "db1", com.azure.core.util.Context.NONE); + } +} diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesDelete.json b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesDelete.json new file mode 100644 index 0000000000..a4c0976a80 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesDelete.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-redisenterprise_2.1.0-beta.2/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md"} \ No newline at end of file diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesExport.java b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesExport.java new file mode 100644 index 0000000000..c9cac6fbef --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesExport.java @@ -0,0 +1,25 @@ + +import com.azure.resourcemanager.redisenterprise.models.ExportClusterParameters; + +/** + * Samples for Databases Export. + */ +public final class Main { + /* + * x-ms-original-file: + * specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/ + * RedisEnterpriseDatabasesExport.json + */ + /** + * Sample code: RedisEnterpriseDatabasesExport. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void + redisEnterpriseDatabasesExport(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.databases().export("rg1", "cache1", "default", + new ExportClusterParameters() + .withSasUri("https://contosostorage.blob.core.window.net/urlToBlobContainer?sasKeyParameters"), + com.azure.core.util.Context.NONE); + } +} diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesExport.json b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesExport.json new file mode 100644 index 0000000000..a4c0976a80 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesExport.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-redisenterprise_2.1.0-beta.2/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md"} \ No newline at end of file diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesFlush.java b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesFlush.java new file mode 100644 index 0000000000..d69abc05db --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesFlush.java @@ -0,0 +1,25 @@ + +import com.azure.resourcemanager.redisenterprise.models.FlushParameters; +import java.util.Arrays; + +/** + * Samples for Databases Flush. + */ +public final class Main { + /* + * x-ms-original-file: + * specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/ + * RedisEnterpriseDatabasesFlush.json + */ + /** + * Sample code: How to flush all the keys in the database. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void + howToFlushAllTheKeysInTheDatabase(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.databases().flush("rg1", "cache1", "default", new FlushParameters().withIds(Arrays.asList( + "/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f2/resourceGroups/rg2/providers/Microsoft.Cache/redisEnterprise/cache2/databases/default")), + com.azure.core.util.Context.NONE); + } +} diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesFlush.json b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesFlush.json new file mode 100644 index 0000000000..a4c0976a80 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesFlush.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-redisenterprise_2.1.0-beta.2/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md"} \ No newline at end of file diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesForceLink.java b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesForceLink.java new file mode 100644 index 0000000000..c69c264c07 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesForceLink.java @@ -0,0 +1,30 @@ + +import com.azure.resourcemanager.redisenterprise.models.ForceLinkParameters; +import com.azure.resourcemanager.redisenterprise.models.LinkedDatabase; +import java.util.Arrays; + +/** + * Samples for Databases ForceLinkToReplicationGroup. + */ +public final class Main { + /* + * x-ms-original-file: + * specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/ + * RedisEnterpriseDatabasesForceLink.json + */ + /** + * Sample code: How to relink a database after a regional outage. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void howToRelinkADatabaseAfterARegionalOutage( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.databases().forceLinkToReplicationGroup("rg1", "cache1", "default", new ForceLinkParameters() + .withGroupNickname("groupName") + .withLinkedDatabases(Arrays.asList(new LinkedDatabase().withId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default"), + new LinkedDatabase().withId( + "/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rg2/providers/Microsoft.Cache/redisEnterprise/cache2/databases/default"))), + com.azure.core.util.Context.NONE); + } +} diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesForceLink.json b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesForceLink.json new file mode 100644 index 0000000000..a4c0976a80 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesForceLink.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-redisenterprise_2.1.0-beta.2/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md"} \ No newline at end of file diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesForceUnlink.java b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesForceUnlink.java new file mode 100644 index 0000000000..3c4d3941e5 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesForceUnlink.java @@ -0,0 +1,25 @@ + +import com.azure.resourcemanager.redisenterprise.models.ForceUnlinkParameters; +import java.util.Arrays; + +/** + * Samples for Databases ForceUnlink. + */ +public final class Main { + /* + * x-ms-original-file: + * specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/ + * RedisEnterpriseDatabasesForceUnlink.json + */ + /** + * Sample code: How to unlink a database during a regional outage. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void howToUnlinkADatabaseDuringARegionalOutage( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.databases().forceUnlink("rg1", "cache1", "default", new ForceUnlinkParameters().withIds(Arrays.asList( + "/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f2/resourceGroups/rg2/providers/Microsoft.Cache/redisEnterprise/cache2/databases/default")), + com.azure.core.util.Context.NONE); + } +} diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesForceUnlink.json b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesForceUnlink.json new file mode 100644 index 0000000000..a4c0976a80 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesForceUnlink.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-redisenterprise_2.1.0-beta.2/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md"} \ No newline at end of file diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesGet.java b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesGet.java new file mode 100644 index 0000000000..ebd5805f31 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesGet.java @@ -0,0 +1,20 @@ + +/** + * Samples for Databases Get. + */ +public final class Main { + /* + * x-ms-original-file: + * specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/ + * RedisEnterpriseDatabasesGet.json + */ + /** + * Sample code: RedisEnterpriseDatabasesGet. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void + redisEnterpriseDatabasesGet(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.databases().getWithResponse("rg1", "cache1", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesGet.json b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesGet.json new file mode 100644 index 0000000000..a4c0976a80 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesGet.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-redisenterprise_2.1.0-beta.2/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md"} \ No newline at end of file diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesImport.java b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesImport.java new file mode 100644 index 0000000000..24ff509f6b --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesImport.java @@ -0,0 +1,27 @@ + +import com.azure.resourcemanager.redisenterprise.models.ImportClusterParameters; +import java.util.Arrays; + +/** + * Samples for Databases ImportMethod. + */ +public final class Main { + /* + * x-ms-original-file: + * specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/ + * RedisEnterpriseDatabasesImport.json + */ + /** + * Sample code: RedisEnterpriseDatabasesImport. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void + redisEnterpriseDatabasesImport(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.databases().importMethod("rg1", "cache1", "default", + new ImportClusterParameters().withSasUris( + Arrays.asList("https://contosostorage.blob.core.window.net/urltoBlobFile1?sasKeyParameters", + "https://contosostorage.blob.core.window.net/urltoBlobFile2?sasKeyParameters")), + com.azure.core.util.Context.NONE); + } +} diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesImport.json b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesImport.json new file mode 100644 index 0000000000..a4c0976a80 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesImport.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-redisenterprise_2.1.0-beta.2/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md"} \ No newline at end of file diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesListByCluster.java b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesListByCluster.java new file mode 100644 index 0000000000..0013b670b8 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesListByCluster.java @@ -0,0 +1,20 @@ + +/** + * Samples for Databases ListByCluster. + */ +public final class Main { + /* + * x-ms-original-file: + * specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/ + * RedisEnterpriseDatabasesListByCluster.json + */ + /** + * Sample code: RedisEnterpriseDatabasesListByCluster. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseDatabasesListByCluster( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.databases().listByCluster("rg1", "cache1", com.azure.core.util.Context.NONE); + } +} diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesListByCluster.json b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesListByCluster.json new file mode 100644 index 0000000000..a4c0976a80 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesListByCluster.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-redisenterprise_2.1.0-beta.2/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md"} \ No newline at end of file diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesListKeys.java b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesListKeys.java new file mode 100644 index 0000000000..fc2e5ea203 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesListKeys.java @@ -0,0 +1,20 @@ + +/** + * Samples for Databases ListKeys. + */ +public final class Main { + /* + * x-ms-original-file: + * specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/ + * RedisEnterpriseDatabasesListKeys.json + */ + /** + * Sample code: RedisEnterpriseDatabasesListKeys. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void + redisEnterpriseDatabasesListKeys(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.databases().listKeysWithResponse("rg1", "cache1", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesListKeys.json b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesListKeys.json new file mode 100644 index 0000000000..a4c0976a80 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesListKeys.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-redisenterprise_2.1.0-beta.2/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md"} \ No newline at end of file diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesRegenerateKey.java b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesRegenerateKey.java new file mode 100644 index 0000000000..37266a03c7 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesRegenerateKey.java @@ -0,0 +1,24 @@ + +import com.azure.resourcemanager.redisenterprise.models.AccessKeyType; +import com.azure.resourcemanager.redisenterprise.models.RegenerateKeyParameters; + +/** + * Samples for Databases RegenerateKey. + */ +public final class Main { + /* + * x-ms-original-file: + * specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/ + * RedisEnterpriseDatabasesRegenerateKey.json + */ + /** + * Sample code: RedisEnterpriseDatabasesRegenerateKey. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseDatabasesRegenerateKey( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.databases().regenerateKey("rg1", "cache1", "default", + new RegenerateKeyParameters().withKeyType(AccessKeyType.PRIMARY), com.azure.core.util.Context.NONE); + } +} diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesRegenerateKey.json b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesRegenerateKey.json new file mode 100644 index 0000000000..a4c0976a80 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesRegenerateKey.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-redisenterprise_2.1.0-beta.2/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md"} \ No newline at end of file diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesUpdate.java b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesUpdate.java new file mode 100644 index 0000000000..aa3173ee6d --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesUpdate.java @@ -0,0 +1,31 @@ + +import com.azure.resourcemanager.redisenterprise.models.AccessKeysAuthentication; +import com.azure.resourcemanager.redisenterprise.models.Database; +import com.azure.resourcemanager.redisenterprise.models.EvictionPolicy; +import com.azure.resourcemanager.redisenterprise.models.Persistence; +import com.azure.resourcemanager.redisenterprise.models.Protocol; +import com.azure.resourcemanager.redisenterprise.models.RdbFrequency; + +/** + * Samples for Databases Update. + */ +public final class Main { + /* + * x-ms-original-file: + * specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/ + * RedisEnterpriseDatabasesUpdate.json + */ + /** + * Sample code: RedisEnterpriseDatabasesUpdate. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void + redisEnterpriseDatabasesUpdate(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + Database resource = manager.databases() + .getWithResponse("rg1", "cache1", "default", com.azure.core.util.Context.NONE).getValue(); + resource.update().withClientProtocol(Protocol.ENCRYPTED).withEvictionPolicy(EvictionPolicy.ALL_KEYS_LRU) + .withPersistence(new Persistence().withRdbEnabled(true).withRdbFrequency(RdbFrequency.ONE_TWOH)) + .withAccessKeysAuthentication(AccessKeysAuthentication.ENABLED).apply(); + } +} diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesUpdate.json b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesUpdate.json new file mode 100644 index 0000000000..a4c0976a80 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesUpdate.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-redisenterprise_2.1.0-beta.2/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md"} \ No newline at end of file diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesUpgradeDBRedisVersion.java b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesUpgradeDBRedisVersion.java new file mode 100644 index 0000000000..a55293ccb2 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesUpgradeDBRedisVersion.java @@ -0,0 +1,20 @@ + +/** + * Samples for Databases UpgradeDBRedisVersion. + */ +public final class Main { + /* + * x-ms-original-file: + * specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/ + * RedisEnterpriseDatabasesUpgradeDBRedisVersion.json + */ + /** + * Sample code: How to upgrade your database Redis version. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void + howToUpgradeYourDatabaseRedisVersion(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.databases().upgradeDBRedisVersion("rg1", "cache1", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesUpgradeDBRedisVersion.json b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesUpgradeDBRedisVersion.json new file mode 100644 index 0000000000..a4c0976a80 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDatabasesUpgradeDBRedisVersion.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-redisenterprise_2.1.0-beta.2/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md"} \ No newline at end of file diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDelete.java b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDelete.java new file mode 100644 index 0000000000..6de503b637 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDelete.java @@ -0,0 +1,19 @@ + +/** + * Samples for RedisEnterprise Delete. + */ +public final class Main { + /* + * x-ms-original-file: + * specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/ + * RedisEnterpriseDelete.json + */ + /** + * Sample code: RedisEnterpriseDelete. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseDelete(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.redisEnterprises().delete("rg1", "cache1", com.azure.core.util.Context.NONE); + } +} diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDelete.json b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDelete.json new file mode 100644 index 0000000000..a4c0976a80 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDelete.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-redisenterprise_2.1.0-beta.2/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md"} \ No newline at end of file diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDeletePrivateEndpointConnection.java b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDeletePrivateEndpointConnection.java new file mode 100644 index 0000000000..9bcdeaf883 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDeletePrivateEndpointConnection.java @@ -0,0 +1,20 @@ + +/** + * Samples for PrivateEndpointConnections Delete. + */ +public final class Main { + /* + * x-ms-original-file: + * specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/ + * RedisEnterpriseDeletePrivateEndpointConnection.json + */ + /** + * Sample code: RedisEnterpriseDeletePrivateEndpointConnection. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseDeletePrivateEndpointConnection( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.privateEndpointConnections().delete("rg1", "cache1", "pectest01", com.azure.core.util.Context.NONE); + } +} diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDeletePrivateEndpointConnection.json b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDeletePrivateEndpointConnection.json new file mode 100644 index 0000000000..a4c0976a80 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseDeletePrivateEndpointConnection.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-redisenterprise_2.1.0-beta.2/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md"} \ No newline at end of file diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseGet.java b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseGet.java new file mode 100644 index 0000000000..660553186b --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseGet.java @@ -0,0 +1,19 @@ + +/** + * Samples for RedisEnterprise GetByResourceGroup. + */ +public final class Main { + /* + * x-ms-original-file: + * specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/ + * RedisEnterpriseGet.json + */ + /** + * Sample code: RedisEnterpriseGet. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseGet(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.redisEnterprises().getByResourceGroupWithResponse("rg1", "cache1", com.azure.core.util.Context.NONE); + } +} diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseGet.json b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseGet.json new file mode 100644 index 0000000000..a4c0976a80 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseGet.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-redisenterprise_2.1.0-beta.2/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md"} \ No newline at end of file diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseGetPrivateEndpointConnection.java b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseGetPrivateEndpointConnection.java new file mode 100644 index 0000000000..f906cdde2f --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseGetPrivateEndpointConnection.java @@ -0,0 +1,21 @@ + +/** + * Samples for PrivateEndpointConnections Get. + */ +public final class Main { + /* + * x-ms-original-file: + * specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/ + * RedisEnterpriseGetPrivateEndpointConnection.json + */ + /** + * Sample code: RedisEnterpriseGetPrivateEndpointConnection. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseGetPrivateEndpointConnection( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.privateEndpointConnections().getWithResponse("rg1", "cache1", "pectest01", + com.azure.core.util.Context.NONE); + } +} diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseGetPrivateEndpointConnection.json b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseGetPrivateEndpointConnection.json new file mode 100644 index 0000000000..a4c0976a80 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseGetPrivateEndpointConnection.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-redisenterprise_2.1.0-beta.2/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md"} \ No newline at end of file diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseList.java b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseList.java new file mode 100644 index 0000000000..0e99f49e86 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseList.java @@ -0,0 +1,19 @@ + +/** + * Samples for RedisEnterprise List. + */ +public final class Main { + /* + * x-ms-original-file: + * specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/ + * RedisEnterpriseList.json + */ + /** + * Sample code: RedisEnterpriseList. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseList(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.redisEnterprises().list(com.azure.core.util.Context.NONE); + } +} diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseList.json b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseList.json new file mode 100644 index 0000000000..a4c0976a80 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseList.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-redisenterprise_2.1.0-beta.2/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md"} \ No newline at end of file diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseListByResourceGroup.java b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseListByResourceGroup.java new file mode 100644 index 0000000000..6a9f43966f --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseListByResourceGroup.java @@ -0,0 +1,20 @@ + +/** + * Samples for RedisEnterprise ListByResourceGroup. + */ +public final class Main { + /* + * x-ms-original-file: + * specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/ + * RedisEnterpriseListByResourceGroup.json + */ + /** + * Sample code: RedisEnterpriseListByResourceGroup. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void + redisEnterpriseListByResourceGroup(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.redisEnterprises().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseListByResourceGroup.json b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseListByResourceGroup.json new file mode 100644 index 0000000000..a4c0976a80 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseListByResourceGroup.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-redisenterprise_2.1.0-beta.2/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md"} \ No newline at end of file diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseListPrivateEndpointConnections.java b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseListPrivateEndpointConnections.java new file mode 100644 index 0000000000..e8654faf1a --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseListPrivateEndpointConnections.java @@ -0,0 +1,20 @@ + +/** + * Samples for PrivateEndpointConnections List. + */ +public final class Main { + /* + * x-ms-original-file: + * specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/ + * RedisEnterpriseListPrivateEndpointConnections.json + */ + /** + * Sample code: RedisEnterpriseListPrivateEndpointConnections. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseListPrivateEndpointConnections( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.privateEndpointConnections().list("rg1", "cache1", com.azure.core.util.Context.NONE); + } +} diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseListPrivateEndpointConnections.json b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseListPrivateEndpointConnections.json new file mode 100644 index 0000000000..a4c0976a80 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseListPrivateEndpointConnections.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-redisenterprise_2.1.0-beta.2/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md"} \ No newline at end of file diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseListPrivateLinkResources.java b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseListPrivateLinkResources.java new file mode 100644 index 0000000000..8befacfa11 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseListPrivateLinkResources.java @@ -0,0 +1,20 @@ + +/** + * Samples for PrivateLinkResources ListByCluster. + */ +public final class Main { + /* + * x-ms-original-file: + * specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/ + * RedisEnterpriseListPrivateLinkResources.json + */ + /** + * Sample code: RedisEnterpriseListPrivateLinkResources. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseListPrivateLinkResources( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.privateLinkResources().listByCluster("rg1", "cache1", com.azure.core.util.Context.NONE); + } +} diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseListPrivateLinkResources.json b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseListPrivateLinkResources.json new file mode 100644 index 0000000000..a4c0976a80 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseListPrivateLinkResources.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-redisenterprise_2.1.0-beta.2/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md"} \ No newline at end of file diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterprisePutPrivateEndpointConnection.java b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterprisePutPrivateEndpointConnection.java new file mode 100644 index 0000000000..d369684b00 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterprisePutPrivateEndpointConnection.java @@ -0,0 +1,26 @@ + +import com.azure.resourcemanager.redisenterprise.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.redisenterprise.models.PrivateLinkServiceConnectionState; + +/** + * Samples for PrivateEndpointConnections Put. + */ +public final class Main { + /* + * x-ms-original-file: + * specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/ + * RedisEnterprisePutPrivateEndpointConnection.json + */ + /** + * Sample code: RedisEnterprisePutPrivateEndpointConnection. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterprisePutPrivateEndpointConnection( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.privateEndpointConnections().define("pectest01").withExistingRedisEnterprise("rg1", "cache1") + .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED).withDescription("Auto-Approved")) + .create(); + } +} diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterprisePutPrivateEndpointConnection.json b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterprisePutPrivateEndpointConnection.json new file mode 100644 index 0000000000..a4c0976a80 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterprisePutPrivateEndpointConnection.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-redisenterprise_2.1.0-beta.2/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md"} \ No newline at end of file diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseUpdate.java b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseUpdate.java new file mode 100644 index 0000000000..60b9fc53d7 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseUpdate.java @@ -0,0 +1,42 @@ + +import com.azure.resourcemanager.redisenterprise.models.Cluster; +import com.azure.resourcemanager.redisenterprise.models.Sku; +import com.azure.resourcemanager.redisenterprise.models.SkuName; +import com.azure.resourcemanager.redisenterprise.models.TlsVersion; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RedisEnterprise Update. + */ +public final class Main { + /* + * x-ms-original-file: + * specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples/ + * RedisEnterpriseUpdate.json + */ + /** + * Sample code: RedisEnterpriseUpdate. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseUpdate(com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + Cluster resource = manager.redisEnterprises() + .getByResourceGroupWithResponse("rg1", "cache1", com.azure.core.util.Context.NONE).getValue(); + resource.update().withTags(mapOf("tag1", "value1")) + .withSku(new Sku().withName(SkuName.ENTERPRISE_FLASH_F300).withCapacity(9)) + .withMinimumTlsVersion(TlsVersion.ONE_TWO).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseUpdate.json b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseUpdate.json new file mode 100644 index 0000000000..a4c0976a80 --- /dev/null +++ b/specification/redisenterprise/resource-manager/Microsoft.Cache/preview/2024-09-01-preview/examples-java/RedisEnterpriseUpdate.json @@ -0,0 +1 @@ +{"sdkUrl": "https://github.com/Azure/azure-sdk-for-java/blob/azure-resourcemanager-redisenterprise_2.1.0-beta.2/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md"} \ No newline at end of file