diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/CHANGELOG.md b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/CHANGELOG.md index 0dca1c43c802..5df36ba89128 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/CHANGELOG.md +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2021-12-08) +- Azure Resource Manager RedisEnterprise client library for Java. This package contains Microsoft Azure SDK for RedisEnterprise Management SDK. REST API for managing Redis Enterprise resources in Azure. Package tag package-2021-08. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## 1.0.0 (2021-04-21) diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md index f24d3cf4d35c..156792321264 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md @@ -2,7 +2,7 @@ Azure Resource Manager RedisEnterprise client library for Java. -This package contains Microsoft Azure SDK for RedisEnterprise Management SDK. REST API for managing Redis Enterprise resources in Azure. Package tag package-2021-03. 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 RedisEnterprise Management SDK. REST API for managing Redis Enterprise resources in Azure. Package tag package-2021-08. 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-redisenterprise - 1.0.0 + 1.1.0-beta.1 ``` [//]: # ({x-version-update-end}) @@ -74,6 +74,9 @@ See [API design][design] for general introduction on design and key concepts on ## Examples +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/redisenterprise/azure-resourcemanager-redisenterprise/SAMPLE.md) + + ## Troubleshooting ## Next steps diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/SAMPLE.md b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/SAMPLE.md new file mode 100644 index 000000000000..3295f9743998 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/SAMPLE.md @@ -0,0 +1,616 @@ +# Code snippets and samples + + +## Databases + +- [Create](#databases_create) +- [Delete](#databases_delete) +- [Export](#databases_export) +- [Get](#databases_get) +- [ImportMethod](#databases_importmethod) +- [ListByCluster](#databases_listbycluster) +- [ListKeys](#databases_listkeys) +- [RegenerateKey](#databases_regeneratekey) +- [Update](#databases_update) + +## OperationsStatus + +- [Get](#operationsstatus_get) + +## PrivateEndpointConnections + +- [Delete](#privateendpointconnections_delete) +- [Get](#privateendpointconnections_get) +- [List](#privateendpointconnections_list) +- [Put](#privateendpointconnections_put) + +## PrivateLinkResources + +- [ListByCluster](#privatelinkresources_listbycluster) + +## RedisEnterprise + +- [Create](#redisenterprise_create) +- [Delete](#redisenterprise_delete) +- [GetByResourceGroup](#redisenterprise_getbyresourcegroup) +- [List](#redisenterprise_list) +- [ListByResourceGroup](#redisenterprise_listbyresourcegroup) +- [Update](#redisenterprise_update) +### Databases_Create + +```java +import com.azure.resourcemanager.redisenterprise.models.AofFrequency; +import com.azure.resourcemanager.redisenterprise.models.ClusteringPolicy; +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 DatabasesCreateSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/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"))) + .create(); + } +} +``` + +### Databases_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Databases Delete. */ +public final class DatabasesDeleteSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/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", Context.NONE); + } +} +``` + +### Databases_Export + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.redisenterprise.models.ExportClusterParameters; + +/** Samples for Databases Export. */ +public final class DatabasesExportSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/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"), + Context.NONE); + } +} +``` + +### Databases_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Databases Get. */ +public final class DatabasesGetSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/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", Context.NONE); + } +} +``` + +### Databases_ImportMethod + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.redisenterprise.models.ImportClusterParameters; +import java.util.Arrays; + +/** Samples for Databases ImportMethod. */ +public final class DatabasesImportMethodSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/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")), + Context.NONE); + } +} +``` + +### Databases_ListByCluster + +```java +import com.azure.core.util.Context; + +/** Samples for Databases ListByCluster. */ +public final class DatabasesListByClusterSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/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", Context.NONE); + } +} +``` + +### Databases_ListKeys + +```java +import com.azure.core.util.Context; + +/** Samples for Databases ListKeys. */ +public final class DatabasesListKeysSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/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", Context.NONE); + } +} +``` + +### Databases_RegenerateKey + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.redisenterprise.models.AccessKeyType; +import com.azure.resourcemanager.redisenterprise.models.RegenerateKeyParameters; + +/** Samples for Databases RegenerateKey. */ +public final class DatabasesRegenerateKeySamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/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), + Context.NONE); + } +} +``` + +### Databases_Update + +```java +import com.azure.core.util.Context; +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 DatabasesUpdateSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/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", Context.NONE).getValue(); + resource + .update() + .withClientProtocol(Protocol.ENCRYPTED) + .withEvictionPolicy(EvictionPolicy.ALL_KEYS_LRU) + .withPersistence(new Persistence().withRdbEnabled(true).withRdbFrequency(RdbFrequency.ONE_TWOH)) + .apply(); + } +} +``` + +### OperationsStatus_Get + +```java +import com.azure.core.util.Context; + +/** Samples for OperationsStatus Get. */ +public final class OperationsStatusGetSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/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", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Delete. */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/examples/RedisEnterpriseDeletePrivateEndpointConnection.json + */ + /** + * Sample code: RedisEnterpriseDeletePrivateEndpointConnection. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseDeletePrivateEndpointConnection( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.privateEndpointConnections().deleteWithResponse("rg1", "cache1", "pectest01", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Get + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Get. */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/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", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_List + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections List. */ +public final class PrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/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", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Put + +```java +import com.azure.resourcemanager.redisenterprise.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.redisenterprise.models.PrivateLinkServiceConnectionState; + +/** Samples for PrivateEndpointConnections Put. */ +public final class PrivateEndpointConnectionsPutSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/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(); + } +} +``` + +### PrivateLinkResources_ListByCluster + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResources ListByCluster. */ +public final class PrivateLinkResourcesListByClusterSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/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", Context.NONE); + } +} +``` + +### RedisEnterprise_Create + +```java +import com.azure.resourcemanager.redisenterprise.models.Sku; +import com.azure.resourcemanager.redisenterprise.models.SkuName; +import com.azure.resourcemanager.redisenterprise.models.TlsVersion; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for RedisEnterprise Create. */ +public final class RedisEnterpriseCreateSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/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")) + .withMinimumTlsVersion(TlsVersion.ONE_TWO) + .create(); + } + + @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; + } +} +``` + +### RedisEnterprise_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for RedisEnterprise Delete. */ +public final class RedisEnterpriseDeleteSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/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", Context.NONE); + } +} +``` + +### RedisEnterprise_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for RedisEnterprise GetByResourceGroup. */ +public final class RedisEnterpriseGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/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", Context.NONE); + } +} +``` + +### RedisEnterprise_List + +```java +import com.azure.core.util.Context; + +/** Samples for RedisEnterprise List. */ +public final class RedisEnterpriseListSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/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(Context.NONE); + } +} +``` + +### RedisEnterprise_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for RedisEnterprise ListByResourceGroup. */ +public final class RedisEnterpriseListByResourceGroupSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/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", Context.NONE); + } +} +``` + +### RedisEnterprise_Update + +```java +import com.azure.core.util.Context; +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 RedisEnterpriseUpdateSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/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", Context.NONE).getValue(); + resource + .update() + .withTags(mapOf("tag1", "value1")) + .withSku(new Sku().withName(SkuName.ENTERPRISE_FLASH_F300).withCapacity(9)) + .withMinimumTlsVersion(TlsVersion.ONE_TWO) + .apply(); + } + + @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/sdk/redisenterprise/azure-resourcemanager-redisenterprise/pom.xml b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/pom.xml index 54c2d439b657..3b8ce4f8beff 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/pom.xml +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/pom.xml @@ -1,58 +1,81 @@ - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + - com.azure.resourcemanager - azure-resourcemanager-redisenterprise - 1.1.0-beta.1 - jar + com.azure.resourcemanager + azure-resourcemanager-redisenterprise + 1.1.0-beta.1 + jar - Microsoft Azure SDK for RedisEnterprise Management - This package contains Microsoft Azure SDK for RedisEnterprise Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. REST API for managing Redis Enterprise resources in Azure. Package tag package-2021-03. - https://github.com/Azure/azure-sdk-for-java + Microsoft Azure SDK for RedisEnterprise Management + This package contains Microsoft Azure SDK for RedisEnterprise Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. REST API for managing Redis Enterprise resources in Azure. Package tag package-2021-08. + https://github.com/Azure/azure-sdk-for-java - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + - - https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - microsoft - Microsoft - - - - UTF-8 - true + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true false - - - - com.azure - azure-core - 1.23.1 - - - com.azure - azure-core-management - 1.4.4 - - + + + + com.azure + azure-core + 1.23.1 + + + com.azure + azure-core-management + 1.4.4 + + + + + + org.revapi + revapi-maven-plugin + 0.11.2 + + + + + java.method.addedToInterface + + + true + .* + com\.azure\.resourcemanager(\.[^.]+)+\.fluent(\.[^.]+)* + + + + + + + diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/RedisEnterpriseManager.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/RedisEnterpriseManager.java index 3b75d0b288ed..3d77b1e7a857 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/RedisEnterpriseManager.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/RedisEnterpriseManager.java @@ -8,8 +8,8 @@ import com.azure.core.http.HttpClient; import com.azure.core.http.HttpPipeline; 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.BearerTokenAuthenticationPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; @@ -17,6 +17,7 @@ import com.azure.core.http.policy.RequestIdPolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; @@ -39,6 +40,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; +import java.util.stream.Collectors; /** Entry point to RedisEnterpriseManager. REST API for managing Redis Enterprise resources in Azure. */ public final class RedisEnterpriseManager { @@ -97,6 +99,7 @@ public static final class Configurable { private HttpClient httpClient; private HttpLogOptions httpLogOptions; private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); private RetryPolicy retryPolicy; private Duration defaultPollInterval; @@ -136,6 +139,17 @@ public Configurable withPolicy(HttpPipelinePolicy policy) { return this; } + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + /** * Sets the retry policy to the HTTP pipeline. * @@ -178,7 +192,7 @@ public RedisEnterpriseManager authenticate(TokenCredential credential, AzureProf .append("-") .append("com.azure.resourcemanager.redisenterprise") .append("/") - .append("1.0.0"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -192,20 +206,33 @@ public RedisEnterpriseManager authenticate(TokenCredential credential, AzureProf userAgentBuilder.append(" (auto-generated)"); } + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } if (retryPolicy == null) { retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); } List policies = new ArrayList<>(); policies.add(new UserAgentPolicy(userAgentBuilder.toString())); policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies - .add( - new BearerTokenAuthenticationPolicy( - credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); - policies.addAll(this.policies); + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); HttpPipeline httpPipeline = diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/DatabasesClient.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/DatabasesClient.java index f9f98491e9b6..deb97edbe556 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/DatabasesClient.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/DatabasesClient.java @@ -59,7 +59,7 @@ public interface DatabasesClient { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return describes a database on the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DatabaseInner> beginCreate( String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters); @@ -76,7 +76,7 @@ SyncPoller, DatabaseInner> beginCreate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return describes a database on the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DatabaseInner> beginCreate( String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters, Context context); @@ -124,7 +124,7 @@ DatabaseInner create( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return describes a database on the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DatabaseInner> beginUpdate( String resourceGroupName, String clusterName, String databaseName, DatabaseUpdate parameters); @@ -141,7 +141,7 @@ SyncPoller, DatabaseInner> beginUpdate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return describes a database on the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DatabaseInner> beginUpdate( String resourceGroupName, String clusterName, String databaseName, DatabaseUpdate parameters, Context context); @@ -218,7 +218,7 @@ Response getWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String databaseName); /** @@ -233,7 +233,7 @@ Response getWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( String resourceGroupName, String clusterName, String databaseName, Context context); @@ -273,7 +273,7 @@ SyncPoller, Void> beginDelete( * @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 secret access keys used for authenticating connections to redis. + * @return access keys. */ @ServiceMethod(returns = ReturnType.SINGLE) AccessKeysInner listKeys(String resourceGroupName, String clusterName, String databaseName); @@ -288,7 +288,7 @@ SyncPoller, Void> beginDelete( * @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 secret access keys used for authenticating connections to redis. + * @return access keys. */ @ServiceMethod(returns = ReturnType.SINGLE) Response listKeysWithResponse( @@ -304,9 +304,9 @@ Response listKeysWithResponse( * @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 secret access keys used for authenticating connections to redis. + * @return access keys. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, AccessKeysInner> beginRegenerateKey( String resourceGroupName, String clusterName, String databaseName, RegenerateKeyParameters parameters); @@ -321,9 +321,9 @@ SyncPoller, AccessKeysInner> beginRegenerateKey( * @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 secret access keys used for authenticating connections to redis. + * @return access keys. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, AccessKeysInner> beginRegenerateKey( String resourceGroupName, String clusterName, @@ -341,7 +341,7 @@ SyncPoller, AccessKeysInner> beginRegenerateKey( * @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 secret access keys used for authenticating connections to redis. + * @return access keys. */ @ServiceMethod(returns = ReturnType.SINGLE) AccessKeysInner regenerateKey( @@ -358,7 +358,7 @@ AccessKeysInner regenerateKey( * @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 secret access keys used for authenticating connections to redis. + * @return access keys. */ @ServiceMethod(returns = ReturnType.SINGLE) AccessKeysInner regenerateKey( @@ -369,7 +369,7 @@ AccessKeysInner regenerateKey( Context context); /** - * Imports a database file to target database. + * Imports database files to target database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. @@ -380,12 +380,12 @@ AccessKeysInner regenerateKey( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginImportMethod( String resourceGroupName, String clusterName, String databaseName, ImportClusterParameters parameters); /** - * Imports a database file to target database. + * Imports database files to target database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. @@ -397,7 +397,7 @@ SyncPoller, Void> beginImportMethod( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginImportMethod( String resourceGroupName, String clusterName, @@ -406,7 +406,7 @@ SyncPoller, Void> beginImportMethod( Context context); /** - * Imports a database file to target database. + * Imports database files to target database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. @@ -421,7 +421,7 @@ void importMethod( String resourceGroupName, String clusterName, String databaseName, ImportClusterParameters parameters); /** - * Imports a database file to target database. + * Imports database files to target database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. @@ -452,7 +452,7 @@ void importMethod( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginExport( String resourceGroupName, String clusterName, String databaseName, ExportClusterParameters parameters); @@ -469,7 +469,7 @@ SyncPoller, Void> beginExport( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginExport( String resourceGroupName, String clusterName, diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/PrivateEndpointConnectionsClient.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/PrivateEndpointConnectionsClient.java index 498c2b25bd92..3554b3fea611 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/PrivateEndpointConnectionsClient.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/PrivateEndpointConnectionsClient.java @@ -88,7 +88,7 @@ Response getWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the Private Endpoint Connection resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, PrivateEndpointConnectionInner> beginPut( String resourceGroupName, String clusterName, @@ -109,7 +109,7 @@ SyncPoller, PrivateEndpointConnection * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the Private Endpoint Connection resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, PrivateEndpointConnectionInner> beginPut( String resourceGroupName, String clusterName, diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/RedisEnterprisesClient.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/RedisEnterprisesClient.java index 31434fe63c02..c29fcb7c978e 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/RedisEnterprisesClient.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/RedisEnterprisesClient.java @@ -27,7 +27,7 @@ public interface RedisEnterprisesClient { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return describes the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ClusterInner> beginCreate( String resourceGroupName, String clusterName, ClusterInner parameters); @@ -43,7 +43,7 @@ SyncPoller, ClusterInner> beginCreate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return describes the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ClusterInner> beginCreate( String resourceGroupName, String clusterName, ClusterInner parameters, Context context); @@ -87,7 +87,7 @@ SyncPoller, ClusterInner> beginCreate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return describes the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ClusterInner> beginUpdate( String resourceGroupName, String clusterName, ClusterUpdate parameters); @@ -103,7 +103,7 @@ SyncPoller, ClusterInner> beginUpdate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return describes the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ClusterInner> beginUpdate( String resourceGroupName, String clusterName, ClusterUpdate parameters, Context context); @@ -146,7 +146,7 @@ SyncPoller, ClusterInner> beginUpdate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName); /** @@ -160,7 +160,7 @@ SyncPoller, ClusterInner> beginUpdate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, Context context); /** diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/AccessKeysInner.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/AccessKeysInner.java index a95c5c6cf6bf..b19222ad212b 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/AccessKeysInner.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/AccessKeysInner.java @@ -9,7 +9,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** The secret access keys used for authenticating connections to redis. */ +/** Access keys The secret access keys used for authenticating connections to redis. */ @Immutable public final class AccessKeysInner { @JsonIgnore private final ClientLogger logger = new ClientLogger(AccessKeysInner.class); diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/ClusterInner.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/ClusterInner.java index b973c7f29413..2a307d2b003f 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/ClusterInner.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/ClusterInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.redisenterprise.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.redisenterprise.models.ProvisioningState; @@ -18,9 +17,8 @@ import java.util.Map; /** Describes the RedisEnterprise cluster. */ -@JsonFlatten @Fluent -public class ClusterInner extends Resource { +public final class ClusterInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterInner.class); /* @@ -36,41 +34,10 @@ public class ClusterInner extends Resource { private List zones; /* - * The minimum TLS version for the cluster to support, e.g. '1.2' + * RedisEnterprise cluster properties Other properties of the cluster. */ - @JsonProperty(value = "properties.minimumTlsVersion") - private TlsVersion minimumTlsVersion; - - /* - * DNS name of the cluster endpoint - */ - @JsonProperty(value = "properties.hostName", access = JsonProperty.Access.WRITE_ONLY) - private String hostname; - - /* - * Current provisioning status of the cluster - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - - /* - * Current resource status of the cluster - */ - @JsonProperty(value = "properties.resourceState", access = JsonProperty.Access.WRITE_ONLY) - private ResourceState resourceState; - - /* - * Version of redis the cluster supports, e.g. '6' - */ - @JsonProperty(value = "properties.redisVersion", access = JsonProperty.Access.WRITE_ONLY) - private String redisVersion; - - /* - * List of private endpoint connections associated with the specified - * RedisEnterprise cluster - */ - @JsonProperty(value = "properties.privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) - private List privateEndpointConnections; + @JsonProperty(value = "properties") + private ClusterProperties innerProperties; /** * Get the sku property: The SKU to create, which affects price, performance, and features. @@ -112,13 +79,36 @@ public ClusterInner withZones(List zones) { return this; } + /** + * Get the innerProperties property: RedisEnterprise cluster properties Other properties of the cluster. + * + * @return the innerProperties value. + */ + private ClusterProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public ClusterInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ClusterInner withTags(Map tags) { + super.withTags(tags); + return this; + } + /** * Get the minimumTlsVersion property: The minimum TLS version for the cluster to support, e.g. '1.2'. * * @return the minimumTlsVersion value. */ public TlsVersion minimumTlsVersion() { - return this.minimumTlsVersion; + return this.innerProperties() == null ? null : this.innerProperties().minimumTlsVersion(); } /** @@ -128,7 +118,10 @@ public TlsVersion minimumTlsVersion() { * @return the ClusterInner object itself. */ public ClusterInner withMinimumTlsVersion(TlsVersion minimumTlsVersion) { - this.minimumTlsVersion = minimumTlsVersion; + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withMinimumTlsVersion(minimumTlsVersion); return this; } @@ -138,7 +131,7 @@ public ClusterInner withMinimumTlsVersion(TlsVersion minimumTlsVersion) { * @return the hostname value. */ public String hostname() { - return this.hostname; + return this.innerProperties() == null ? null : this.innerProperties().hostname(); } /** @@ -147,7 +140,7 @@ public String hostname() { * @return the provisioningState value. */ public ProvisioningState provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -156,7 +149,7 @@ public ProvisioningState provisioningState() { * @return the resourceState value. */ public ResourceState resourceState() { - return this.resourceState; + return this.innerProperties() == null ? null : this.innerProperties().resourceState(); } /** @@ -165,7 +158,7 @@ public ResourceState resourceState() { * @return the redisVersion value. */ public String redisVersion() { - return this.redisVersion; + return this.innerProperties() == null ? null : this.innerProperties().redisVersion(); } /** @@ -175,21 +168,7 @@ public String redisVersion() { * @return the privateEndpointConnections value. */ public List privateEndpointConnections() { - return this.privateEndpointConnections; - } - - /** {@inheritDoc} */ - @Override - public ClusterInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public ClusterInner withTags(Map tags) { - super.withTags(tags); - return this; + return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections(); } /** @@ -205,8 +184,8 @@ public void validate() { } else { sku().validate(); } - if (privateEndpointConnections() != null) { - privateEndpointConnections().forEach(e -> e.validate()); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/ClusterProperties.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/ClusterProperties.java new file mode 100644 index 000000000000..0157738f2eb8 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/ClusterProperties.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.redisenterprise.models.ProvisioningState; +import com.azure.resourcemanager.redisenterprise.models.ResourceState; +import com.azure.resourcemanager.redisenterprise.models.TlsVersion; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * RedisEnterprise cluster properties Properties of RedisEnterprise clusters, as opposed to general resource properties + * like location, tags. + */ +@Fluent +public final class ClusterProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterProperties.class); + + /* + * The minimum TLS version for the cluster to support, e.g. '1.2' + */ + @JsonProperty(value = "minimumTlsVersion") + private TlsVersion minimumTlsVersion; + + /* + * DNS name of the cluster endpoint + */ + @JsonProperty(value = "hostName", access = JsonProperty.Access.WRITE_ONLY) + private String hostname; + + /* + * Current provisioning status of the cluster + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Current resource status of the cluster + */ + @JsonProperty(value = "resourceState", access = JsonProperty.Access.WRITE_ONLY) + private ResourceState resourceState; + + /* + * Version of redis the cluster supports, e.g. '6' + */ + @JsonProperty(value = "redisVersion", access = JsonProperty.Access.WRITE_ONLY) + private String redisVersion; + + /* + * List of private endpoint connections associated with the specified + * RedisEnterprise cluster + */ + @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpointConnections; + + /** + * Get the minimumTlsVersion property: The minimum TLS version for the cluster to support, e.g. '1.2'. + * + * @return the minimumTlsVersion value. + */ + public TlsVersion minimumTlsVersion() { + return this.minimumTlsVersion; + } + + /** + * Set the minimumTlsVersion property: The minimum TLS version for the cluster to support, e.g. '1.2'. + * + * @param minimumTlsVersion the minimumTlsVersion value to set. + * @return the ClusterProperties object itself. + */ + public ClusterProperties withMinimumTlsVersion(TlsVersion minimumTlsVersion) { + this.minimumTlsVersion = minimumTlsVersion; + return this; + } + + /** + * Get the hostname property: DNS name of the cluster endpoint. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Get the provisioningState property: Current provisioning status of the cluster. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the resourceState property: Current resource status of the cluster. + * + * @return the resourceState value. + */ + public ResourceState resourceState() { + return this.resourceState; + } + + /** + * Get the redisVersion property: Version of redis the cluster supports, e.g. '6'. + * + * @return the redisVersion value. + */ + public String redisVersion() { + return this.redisVersion; + } + + /** + * Get the privateEndpointConnections property: List of private endpoint connections associated with the specified + * RedisEnterprise cluster. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/DatabaseInner.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/DatabaseInner.java index 80d73098f090..82ba783075ae 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/DatabaseInner.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/DatabaseInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.redisenterprise.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.redisenterprise.models.ClusteringPolicy; @@ -20,61 +19,24 @@ import java.util.List; /** Describes a database on the RedisEnterprise cluster. */ -@JsonFlatten @Fluent -public class DatabaseInner extends ProxyResource { +public final class DatabaseInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabaseInner.class); /* - * Specifies whether redis clients can connect using TLS-encrypted or - * plaintext redis protocols. Default is TLS-encrypted. + * RedisEnterprise database properties Other properties of the database. */ - @JsonProperty(value = "properties.clientProtocol") - private Protocol clientProtocol; + @JsonProperty(value = "properties") + private DatabaseProperties innerProperties; - /* - * TCP port of the database endpoint. Specified at create time. Defaults to - * an available port. - */ - @JsonProperty(value = "properties.port") - private Integer port; - - /* - * Current provisioning status of the database - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - - /* - * Current resource status of the database - */ - @JsonProperty(value = "properties.resourceState", access = JsonProperty.Access.WRITE_ONLY) - private ResourceState resourceState; - - /* - * Clustering policy - default is OSSCluster. Specified at create time. - */ - @JsonProperty(value = "properties.clusteringPolicy") - private ClusteringPolicy clusteringPolicy; - - /* - * Redis eviction policy - default is VolatileLRU - */ - @JsonProperty(value = "properties.evictionPolicy") - private EvictionPolicy evictionPolicy; - - /* - * Persistence settings - */ - @JsonProperty(value = "properties.persistence") - private Persistence persistence; - - /* - * Optional set of redis modules to enable in this database - modules can - * only be added at creation time. + /** + * Get the innerProperties property: RedisEnterprise database properties Other properties of the database. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.modules") - private List modules; + private DatabaseProperties innerProperties() { + return this.innerProperties; + } /** * Get the clientProtocol property: Specifies whether redis clients can connect using TLS-encrypted or plaintext @@ -83,7 +45,7 @@ public class DatabaseInner extends ProxyResource { * @return the clientProtocol value. */ public Protocol clientProtocol() { - return this.clientProtocol; + return this.innerProperties() == null ? null : this.innerProperties().clientProtocol(); } /** @@ -94,7 +56,10 @@ public Protocol clientProtocol() { * @return the DatabaseInner object itself. */ public DatabaseInner withClientProtocol(Protocol clientProtocol) { - this.clientProtocol = clientProtocol; + if (this.innerProperties() == null) { + this.innerProperties = new DatabaseProperties(); + } + this.innerProperties().withClientProtocol(clientProtocol); return this; } @@ -105,7 +70,7 @@ public DatabaseInner withClientProtocol(Protocol clientProtocol) { * @return the port value. */ public Integer port() { - return this.port; + return this.innerProperties() == null ? null : this.innerProperties().port(); } /** @@ -116,7 +81,10 @@ public Integer port() { * @return the DatabaseInner object itself. */ public DatabaseInner withPort(Integer port) { - this.port = port; + if (this.innerProperties() == null) { + this.innerProperties = new DatabaseProperties(); + } + this.innerProperties().withPort(port); return this; } @@ -126,7 +94,7 @@ public DatabaseInner withPort(Integer port) { * @return the provisioningState value. */ public ProvisioningState provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -135,7 +103,7 @@ public ProvisioningState provisioningState() { * @return the resourceState value. */ public ResourceState resourceState() { - return this.resourceState; + return this.innerProperties() == null ? null : this.innerProperties().resourceState(); } /** @@ -144,7 +112,7 @@ public ResourceState resourceState() { * @return the clusteringPolicy value. */ public ClusteringPolicy clusteringPolicy() { - return this.clusteringPolicy; + return this.innerProperties() == null ? null : this.innerProperties().clusteringPolicy(); } /** @@ -154,7 +122,10 @@ public ClusteringPolicy clusteringPolicy() { * @return the DatabaseInner object itself. */ public DatabaseInner withClusteringPolicy(ClusteringPolicy clusteringPolicy) { - this.clusteringPolicy = clusteringPolicy; + if (this.innerProperties() == null) { + this.innerProperties = new DatabaseProperties(); + } + this.innerProperties().withClusteringPolicy(clusteringPolicy); return this; } @@ -164,7 +135,7 @@ public DatabaseInner withClusteringPolicy(ClusteringPolicy clusteringPolicy) { * @return the evictionPolicy value. */ public EvictionPolicy evictionPolicy() { - return this.evictionPolicy; + return this.innerProperties() == null ? null : this.innerProperties().evictionPolicy(); } /** @@ -174,7 +145,10 @@ public EvictionPolicy evictionPolicy() { * @return the DatabaseInner object itself. */ public DatabaseInner withEvictionPolicy(EvictionPolicy evictionPolicy) { - this.evictionPolicy = evictionPolicy; + if (this.innerProperties() == null) { + this.innerProperties = new DatabaseProperties(); + } + this.innerProperties().withEvictionPolicy(evictionPolicy); return this; } @@ -184,7 +158,7 @@ public DatabaseInner withEvictionPolicy(EvictionPolicy evictionPolicy) { * @return the persistence value. */ public Persistence persistence() { - return this.persistence; + return this.innerProperties() == null ? null : this.innerProperties().persistence(); } /** @@ -194,7 +168,10 @@ public Persistence persistence() { * @return the DatabaseInner object itself. */ public DatabaseInner withPersistence(Persistence persistence) { - this.persistence = persistence; + if (this.innerProperties() == null) { + this.innerProperties = new DatabaseProperties(); + } + this.innerProperties().withPersistence(persistence); return this; } @@ -205,7 +182,7 @@ public DatabaseInner withPersistence(Persistence persistence) { * @return the modules value. */ public List modules() { - return this.modules; + return this.innerProperties() == null ? null : this.innerProperties().modules(); } /** @@ -216,7 +193,10 @@ public List modules() { * @return the DatabaseInner object itself. */ public DatabaseInner withModules(List modules) { - this.modules = modules; + if (this.innerProperties() == null) { + this.innerProperties = new DatabaseProperties(); + } + this.innerProperties().withModules(modules); return this; } @@ -226,11 +206,8 @@ public DatabaseInner withModules(List modules) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (persistence() != null) { - persistence().validate(); - } - if (modules() != null) { - modules().forEach(e -> e.validate()); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/DatabaseProperties.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/DatabaseProperties.java new file mode 100644 index 000000000000..4591d50125db --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/DatabaseProperties.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.redisenterprise.models.ClusteringPolicy; +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 com.azure.resourcemanager.redisenterprise.models.ProvisioningState; +import com.azure.resourcemanager.redisenterprise.models.ResourceState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * RedisEnterprise database properties Properties of RedisEnterprise databases, as opposed to general resource + * properties like location, tags. + */ +@Fluent +public final class DatabaseProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabaseProperties.class); + + /* + * Specifies whether redis clients can connect using TLS-encrypted or + * plaintext redis protocols. Default is TLS-encrypted. + */ + @JsonProperty(value = "clientProtocol") + private Protocol clientProtocol; + + /* + * TCP port of the database endpoint. Specified at create time. Defaults to + * an available port. + */ + @JsonProperty(value = "port") + private Integer port; + + /* + * Current provisioning status of the database + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Current resource status of the database + */ + @JsonProperty(value = "resourceState", access = JsonProperty.Access.WRITE_ONLY) + private ResourceState resourceState; + + /* + * Clustering policy - default is OSSCluster. Specified at create time. + */ + @JsonProperty(value = "clusteringPolicy") + private ClusteringPolicy clusteringPolicy; + + /* + * Redis eviction policy - default is VolatileLRU + */ + @JsonProperty(value = "evictionPolicy") + private EvictionPolicy evictionPolicy; + + /* + * Persistence settings + */ + @JsonProperty(value = "persistence") + private Persistence persistence; + + /* + * Optional set of redis modules to enable in this database - modules can + * only be added at creation time. + */ + @JsonProperty(value = "modules") + private List modules; + + /** + * Get the clientProtocol property: Specifies whether redis clients can connect using TLS-encrypted or plaintext + * redis protocols. Default is TLS-encrypted. + * + * @return the clientProtocol value. + */ + public Protocol clientProtocol() { + return this.clientProtocol; + } + + /** + * Set the clientProtocol property: Specifies whether redis clients can connect using TLS-encrypted or plaintext + * redis protocols. Default is TLS-encrypted. + * + * @param clientProtocol the clientProtocol value to set. + * @return the DatabaseProperties object itself. + */ + public DatabaseProperties withClientProtocol(Protocol clientProtocol) { + this.clientProtocol = clientProtocol; + return this; + } + + /** + * Get the port property: TCP port of the database endpoint. Specified at create time. Defaults to an available + * port. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: TCP port of the database endpoint. Specified at create time. Defaults to an available + * port. + * + * @param port the port value to set. + * @return the DatabaseProperties object itself. + */ + public DatabaseProperties withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Get the provisioningState property: Current provisioning status of the database. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the resourceState property: Current resource status of the database. + * + * @return the resourceState value. + */ + public ResourceState resourceState() { + return this.resourceState; + } + + /** + * Get the clusteringPolicy property: Clustering policy - default is OSSCluster. Specified at create time. + * + * @return the clusteringPolicy value. + */ + public ClusteringPolicy clusteringPolicy() { + return this.clusteringPolicy; + } + + /** + * Set the clusteringPolicy property: Clustering policy - default is OSSCluster. Specified at create time. + * + * @param clusteringPolicy the clusteringPolicy value to set. + * @return the DatabaseProperties object itself. + */ + public DatabaseProperties withClusteringPolicy(ClusteringPolicy clusteringPolicy) { + this.clusteringPolicy = clusteringPolicy; + return this; + } + + /** + * Get the evictionPolicy property: Redis eviction policy - default is VolatileLRU. + * + * @return the evictionPolicy value. + */ + public EvictionPolicy evictionPolicy() { + return this.evictionPolicy; + } + + /** + * Set the evictionPolicy property: Redis eviction policy - default is VolatileLRU. + * + * @param evictionPolicy the evictionPolicy value to set. + * @return the DatabaseProperties object itself. + */ + public DatabaseProperties withEvictionPolicy(EvictionPolicy evictionPolicy) { + this.evictionPolicy = evictionPolicy; + return this; + } + + /** + * Get the persistence property: Persistence settings. + * + * @return the persistence value. + */ + public Persistence persistence() { + return this.persistence; + } + + /** + * Set the persistence property: Persistence settings. + * + * @param persistence the persistence value to set. + * @return the DatabaseProperties object itself. + */ + public DatabaseProperties withPersistence(Persistence persistence) { + this.persistence = persistence; + return this; + } + + /** + * Get the modules property: Optional set of redis modules to enable in this database - modules can only be added at + * creation time. + * + * @return the modules value. + */ + public List modules() { + return this.modules; + } + + /** + * Set the modules property: Optional set of redis modules to enable in this database - modules can only be added at + * creation time. + * + * @param modules the modules value to set. + * @return the DatabaseProperties object itself. + */ + public DatabaseProperties withModules(List modules) { + this.modules = modules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (persistence() != null) { + persistence().validate(); + } + if (modules() != null) { + modules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/OperationInner.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/OperationInner.java index 150270059ea7..5ad5dcbbda7b 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/OperationInner.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/OperationInner.java @@ -12,7 +12,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** Details of a REST API operation, returned from the Resource Provider Operations API. */ +/** REST API Operation Details of a REST API operation, returned from the Resource Provider Operations API. */ @Fluent public final class OperationInner { @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/OperationStatusInner.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/OperationStatusInner.java index bcb0bd186e2a..42aa974a18cf 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/OperationStatusInner.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/OperationStatusInner.java @@ -46,7 +46,7 @@ public final class OperationStatusInner { private String status; /* - * Error response describing why the operation failed. + * Error response Error response describing why the operation failed. */ @JsonProperty(value = "error") private ManagementError error; @@ -152,7 +152,7 @@ public OperationStatusInner withStatus(String status) { } /** - * Get the error property: Error response describing why the operation failed. + * Get the error property: Error response Error response describing why the operation failed. * * @return the error value. */ @@ -161,7 +161,7 @@ public ManagementError error() { } /** - * Set the error property: Error response describing why the operation failed. + * Set the error property: Error response Error response describing why the operation failed. * * @param error the error value to set. * @return the OperationStatusInner object itself. diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/PrivateEndpointConnectionInner.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/PrivateEndpointConnectionInner.java index 6e69a85bcfd3..297ba1783e6e 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/PrivateEndpointConnectionInner.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/PrivateEndpointConnectionInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.redisenterprise.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.redisenterprise.models.PrivateEndpoint; @@ -15,29 +14,24 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** The Private Endpoint Connection resource. */ -@JsonFlatten @Fluent -public class PrivateEndpointConnectionInner extends ProxyResource { +public final class PrivateEndpointConnectionInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionInner.class); /* - * The resource of private end point. + * Resource properties. */ - @JsonProperty(value = "properties.privateEndpoint") - private PrivateEndpoint privateEndpoint; + @JsonProperty(value = "properties") + private PrivateEndpointConnectionProperties innerProperties; - /* - * A collection of information about the state of the connection between - * service consumer and provider. - */ - @JsonProperty(value = "properties.privateLinkServiceConnectionState") - private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; - - /* - * The provisioning state of the private endpoint connection resource. + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private PrivateEndpointConnectionProvisioningState provisioningState; + private PrivateEndpointConnectionProperties innerProperties() { + return this.innerProperties; + } /** * Get the privateEndpoint property: The resource of private end point. @@ -45,7 +39,7 @@ public class PrivateEndpointConnectionInner extends ProxyResource { * @return the privateEndpoint value. */ public PrivateEndpoint privateEndpoint() { - return this.privateEndpoint; + return this.innerProperties() == null ? null : this.innerProperties().privateEndpoint(); } /** @@ -55,7 +49,10 @@ public PrivateEndpoint privateEndpoint() { * @return the PrivateEndpointConnectionInner object itself. */ public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpoint privateEndpoint) { - this.privateEndpoint = privateEndpoint; + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateEndpoint(privateEndpoint); return this; } @@ -66,7 +63,7 @@ public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpoint privat * @return the privateLinkServiceConnectionState value. */ public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { - return this.privateLinkServiceConnectionState; + return this.innerProperties() == null ? null : this.innerProperties().privateLinkServiceConnectionState(); } /** @@ -78,7 +75,10 @@ public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { */ public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState( PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { - this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); return this; } @@ -88,7 +88,7 @@ public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState( * @return the provisioningState value. */ public PrivateEndpointConnectionProvisioningState provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -97,11 +97,8 @@ public PrivateEndpointConnectionProvisioningState provisioningState() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (privateEndpoint() != null) { - privateEndpoint().validate(); - } - if (privateLinkServiceConnectionState() != null) { - privateLinkServiceConnectionState().validate(); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/PrivateEndpointConnectionProperties.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/PrivateEndpointConnectionProperties.java new file mode 100644 index 000000000000..30b3b0790808 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/PrivateEndpointConnectionProperties.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.redisenterprise.models.PrivateEndpoint; +import com.azure.resourcemanager.redisenterprise.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.redisenterprise.models.PrivateLinkServiceConnectionState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the PrivateEndpointConnectProperties. */ +@Fluent +public final class PrivateEndpointConnectionProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionProperties.class); + + /* + * The resource of private end point. + */ + @JsonProperty(value = "privateEndpoint") + private PrivateEndpoint privateEndpoint; + + /* + * A collection of information about the state of the connection between + * service consumer and provider. + */ + @JsonProperty(value = "privateLinkServiceConnectionState", required = true) + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /* + * The provisioning state of the private endpoint connection resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private PrivateEndpointConnectionProvisioningState provisioningState; + + /** + * Get the privateEndpoint property: The resource of private end point. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the privateEndpoint property: The resource of private end point. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpoint() != null) { + privateEndpoint().validate(); + } + if (privateLinkServiceConnectionState() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property privateLinkServiceConnectionState in model" + + " PrivateEndpointConnectionProperties")); + } else { + privateLinkServiceConnectionState().validate(); + } + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/PrivateLinkResourceInner.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/PrivateLinkResourceInner.java index 2e940994eb86..a039335114e0 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/PrivateLinkResourceInner.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/PrivateLinkResourceInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.redisenterprise.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -13,28 +12,24 @@ import java.util.List; /** A private link resource. */ -@JsonFlatten @Fluent -public class PrivateLinkResourceInner extends ProxyResource { +public final class PrivateLinkResourceInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourceInner.class); /* - * The private link resource group id. + * Resource properties. */ - @JsonProperty(value = "properties.groupId", access = JsonProperty.Access.WRITE_ONLY) - private String groupId; + @JsonProperty(value = "properties") + private PrivateLinkResourceProperties innerProperties; - /* - * The private link resource required member names. - */ - @JsonProperty(value = "properties.requiredMembers", access = JsonProperty.Access.WRITE_ONLY) - private List requiredMembers; - - /* - * The private link resource Private link DNS zone name. + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.requiredZoneNames") - private List requiredZoneNames; + private PrivateLinkResourceProperties innerProperties() { + return this.innerProperties; + } /** * Get the groupId property: The private link resource group id. @@ -42,7 +37,7 @@ public class PrivateLinkResourceInner extends ProxyResource { * @return the groupId value. */ public String groupId() { - return this.groupId; + return this.innerProperties() == null ? null : this.innerProperties().groupId(); } /** @@ -51,7 +46,7 @@ public String groupId() { * @return the requiredMembers value. */ public List requiredMembers() { - return this.requiredMembers; + return this.innerProperties() == null ? null : this.innerProperties().requiredMembers(); } /** @@ -60,7 +55,7 @@ public List requiredMembers() { * @return the requiredZoneNames value. */ public List requiredZoneNames() { - return this.requiredZoneNames; + return this.innerProperties() == null ? null : this.innerProperties().requiredZoneNames(); } /** @@ -70,7 +65,10 @@ public List requiredZoneNames() { * @return the PrivateLinkResourceInner object itself. */ public PrivateLinkResourceInner withRequiredZoneNames(List requiredZoneNames) { - this.requiredZoneNames = requiredZoneNames; + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkResourceProperties(); + } + this.innerProperties().withRequiredZoneNames(requiredZoneNames); return this; } @@ -80,5 +78,8 @@ public PrivateLinkResourceInner withRequiredZoneNames(List requiredZoneN * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } } } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/PrivateLinkResourceProperties.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/PrivateLinkResourceProperties.java new file mode 100644 index 000000000000..ea91426b2f4a --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/models/PrivateLinkResourceProperties.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of a private link resource. */ +@Fluent +public final class PrivateLinkResourceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourceProperties.class); + + /* + * The private link resource group id. + */ + @JsonProperty(value = "groupId", access = JsonProperty.Access.WRITE_ONLY) + private String groupId; + + /* + * The private link resource required member names. + */ + @JsonProperty(value = "requiredMembers", access = JsonProperty.Access.WRITE_ONLY) + private List requiredMembers; + + /* + * The private link resource Private link DNS zone name. + */ + @JsonProperty(value = "requiredZoneNames") + private List requiredZoneNames; + + /** + * Get the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Get the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Get the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + + /** + * Set the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @param requiredZoneNames the requiredZoneNames value to set. + * @return the PrivateLinkResourceProperties object itself. + */ + public PrivateLinkResourceProperties withRequiredZoneNames(List requiredZoneNames) { + this.requiredZoneNames = requiredZoneNames; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/DatabaseImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/DatabaseImpl.java index 33f11b78af91..1e64b7a03499 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/DatabaseImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/DatabaseImpl.java @@ -225,13 +225,8 @@ public DatabaseImpl withPort(Integer port) { } public DatabaseImpl withClusteringPolicy(ClusteringPolicy clusteringPolicy) { - if (isInCreateMode()) { - this.innerModel().withClusteringPolicy(clusteringPolicy); - return this; - } else { - this.updateParameters.withClusteringPolicy(clusteringPolicy); - return this; - } + this.innerModel().withClusteringPolicy(clusteringPolicy); + return this; } public DatabaseImpl withEvictionPolicy(EvictionPolicy evictionPolicy) { @@ -255,13 +250,8 @@ public DatabaseImpl withPersistence(Persistence persistence) { } public DatabaseImpl withModules(List modules) { - if (isInCreateMode()) { - this.innerModel().withModules(modules); - return this; - } else { - this.updateParameters.withModules(modules); - return this; - } + this.innerModel().withModules(modules); + return this; } private boolean isInCreateMode() { diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/DatabasesClientImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/DatabasesClientImpl.java index 54ab0fc95e91..287b8ba410f0 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/DatabasesClientImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/DatabasesClientImpl.java @@ -541,7 +541,7 @@ private Mono>> createWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return describes a database on the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DatabaseInner> beginCreateAsync( String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { Mono>> mono = @@ -549,7 +549,11 @@ private PollerFlux, DatabaseInner> beginCreateAsync( return this .client .getLroResult( - mono, this.client.getHttpPipeline(), DatabaseInner.class, DatabaseInner.class, Context.NONE); + mono, + this.client.getHttpPipeline(), + DatabaseInner.class, + DatabaseInner.class, + this.client.getContext()); } /** @@ -565,7 +569,7 @@ private PollerFlux, DatabaseInner> beginCreateAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return describes a database on the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DatabaseInner> beginCreateAsync( String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters, Context context) { context = this.client.mergeContext(context); @@ -589,7 +593,7 @@ private PollerFlux, DatabaseInner> beginCreateAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return describes a database on the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DatabaseInner> beginCreate( String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { return beginCreateAsync(resourceGroupName, clusterName, databaseName, parameters).getSyncPoller(); @@ -608,7 +612,7 @@ public SyncPoller, DatabaseInner> beginCreate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return describes a database on the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DatabaseInner> beginCreate( String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters, Context context) { return beginCreateAsync(resourceGroupName, clusterName, databaseName, parameters, context).getSyncPoller(); @@ -822,7 +826,7 @@ private Mono>> updateWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return describes a database on the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DatabaseInner> beginUpdateAsync( String resourceGroupName, String clusterName, String databaseName, DatabaseUpdate parameters) { Mono>> mono = @@ -830,7 +834,11 @@ private PollerFlux, DatabaseInner> beginUpdateAsync( return this .client .getLroResult( - mono, this.client.getHttpPipeline(), DatabaseInner.class, DatabaseInner.class, Context.NONE); + mono, + this.client.getHttpPipeline(), + DatabaseInner.class, + DatabaseInner.class, + this.client.getContext()); } /** @@ -846,7 +854,7 @@ private PollerFlux, DatabaseInner> beginUpdateAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return describes a database on the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DatabaseInner> beginUpdateAsync( String resourceGroupName, String clusterName, String databaseName, DatabaseUpdate parameters, Context context) { context = this.client.mergeContext(context); @@ -870,7 +878,7 @@ private PollerFlux, DatabaseInner> beginUpdateAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return describes a database on the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DatabaseInner> beginUpdate( String resourceGroupName, String clusterName, String databaseName, DatabaseUpdate parameters) { return beginUpdateAsync(resourceGroupName, clusterName, databaseName, parameters).getSyncPoller(); @@ -889,7 +897,7 @@ public SyncPoller, DatabaseInner> beginUpdate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return describes a database on the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DatabaseInner> beginUpdate( String resourceGroupName, String clusterName, String databaseName, DatabaseUpdate parameters, Context context) { return beginUpdateAsync(resourceGroupName, clusterName, databaseName, parameters, context).getSyncPoller(); @@ -1250,13 +1258,14 @@ private Mono>> deleteWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String clusterName, String databaseName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, databaseName); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -1271,7 +1280,7 @@ private PollerFlux, Void> beginDeleteAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String clusterName, String databaseName, Context context) { context = this.client.mergeContext(context); @@ -1293,7 +1302,7 @@ private PollerFlux, Void> beginDeleteAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String clusterName, String databaseName) { return beginDeleteAsync(resourceGroupName, clusterName, databaseName).getSyncPoller(); @@ -1311,7 +1320,7 @@ public SyncPoller, Void> beginDelete( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String clusterName, String databaseName, Context context) { return beginDeleteAsync(resourceGroupName, clusterName, databaseName, context).getSyncPoller(); @@ -1394,7 +1403,7 @@ public void delete(String resourceGroupName, String clusterName, String database * @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 secret access keys used for authenticating connections to redis. + * @return access keys. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listKeysWithResponseAsync( @@ -1448,7 +1457,7 @@ private Mono> listKeysWithResponseAsync( * @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 secret access keys used for authenticating connections to redis. + * @return access keys. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listKeysWithResponseAsync( @@ -1498,7 +1507,7 @@ private Mono> listKeysWithResponseAsync( * @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 secret access keys used for authenticating connections to redis. + * @return access keys. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono listKeysAsync(String resourceGroupName, String clusterName, String databaseName) { @@ -1522,7 +1531,7 @@ private Mono listKeysAsync(String resourceGroupName, String clu * @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 secret access keys used for authenticating connections to redis. + * @return access keys. */ @ServiceMethod(returns = ReturnType.SINGLE) public AccessKeysInner listKeys(String resourceGroupName, String clusterName, String databaseName) { @@ -1539,7 +1548,7 @@ public AccessKeysInner listKeys(String resourceGroupName, String clusterName, St * @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 secret access keys used for authenticating connections to redis. + * @return access keys. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response listKeysWithResponse( @@ -1557,7 +1566,7 @@ public Response listKeysWithResponse( * @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 secret access keys used for authenticating connections to redis. + * @return access keys. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> regenerateKeyWithResponseAsync( @@ -1618,7 +1627,7 @@ private Mono>> regenerateKeyWithResponseAsync( * @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 secret access keys used for authenticating connections to redis. + * @return access keys. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> regenerateKeyWithResponseAsync( @@ -1679,9 +1688,9 @@ private Mono>> regenerateKeyWithResponseAsync( * @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 secret access keys used for authenticating connections to redis. + * @return access keys. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, AccessKeysInner> beginRegenerateKeyAsync( String resourceGroupName, String clusterName, String databaseName, RegenerateKeyParameters parameters) { Mono>> mono = @@ -1689,7 +1698,11 @@ private PollerFlux, AccessKeysInner> beginRegenerate return this .client .getLroResult( - mono, this.client.getHttpPipeline(), AccessKeysInner.class, AccessKeysInner.class, Context.NONE); + mono, + this.client.getHttpPipeline(), + AccessKeysInner.class, + AccessKeysInner.class, + this.client.getContext()); } /** @@ -1703,9 +1716,9 @@ private PollerFlux, AccessKeysInner> beginRegenerate * @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 secret access keys used for authenticating connections to redis. + * @return access keys. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, AccessKeysInner> beginRegenerateKeyAsync( String resourceGroupName, String clusterName, @@ -1731,9 +1744,9 @@ private PollerFlux, AccessKeysInner> beginRegenerate * @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 secret access keys used for authenticating connections to redis. + * @return access keys. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, AccessKeysInner> beginRegenerateKey( String resourceGroupName, String clusterName, String databaseName, RegenerateKeyParameters parameters) { return beginRegenerateKeyAsync(resourceGroupName, clusterName, databaseName, parameters).getSyncPoller(); @@ -1750,9 +1763,9 @@ public SyncPoller, AccessKeysInner> beginRegenerateK * @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 secret access keys used for authenticating connections to redis. + * @return access keys. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, AccessKeysInner> beginRegenerateKey( String resourceGroupName, String clusterName, @@ -1773,7 +1786,7 @@ public SyncPoller, AccessKeysInner> beginRegenerateK * @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 secret access keys used for authenticating connections to redis. + * @return access keys. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono regenerateKeyAsync( @@ -1794,7 +1807,7 @@ private Mono regenerateKeyAsync( * @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 secret access keys used for authenticating connections to redis. + * @return access keys. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono regenerateKeyAsync( @@ -1818,7 +1831,7 @@ private Mono regenerateKeyAsync( * @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 secret access keys used for authenticating connections to redis. + * @return access keys. */ @ServiceMethod(returns = ReturnType.SINGLE) public AccessKeysInner regenerateKey( @@ -1837,7 +1850,7 @@ public AccessKeysInner regenerateKey( * @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 secret access keys used for authenticating connections to redis. + * @return access keys. */ @ServiceMethod(returns = ReturnType.SINGLE) public AccessKeysInner regenerateKey( @@ -1850,7 +1863,7 @@ public AccessKeysInner regenerateKey( } /** - * Imports a database file to target database. + * Imports database files to target database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. @@ -1910,7 +1923,7 @@ private Mono>> importMethodWithResponseAsync( } /** - * Imports a database file to target database. + * Imports database files to target database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. @@ -1972,7 +1985,7 @@ private Mono>> importMethodWithResponseAsync( } /** - * Imports a database file to target database. + * Imports database files to target database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. @@ -1983,18 +1996,19 @@ private Mono>> importMethodWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginImportMethodAsync( String resourceGroupName, String clusterName, String databaseName, ImportClusterParameters parameters) { Mono>> mono = importMethodWithResponseAsync(resourceGroupName, clusterName, databaseName, parameters); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** - * Imports a database file to target database. + * Imports database files to target database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. @@ -2006,7 +2020,7 @@ private PollerFlux, Void> beginImportMethodAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginImportMethodAsync( String resourceGroupName, String clusterName, @@ -2022,7 +2036,7 @@ private PollerFlux, Void> beginImportMethodAsync( } /** - * Imports a database file to target database. + * Imports database files to target database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. @@ -2033,14 +2047,14 @@ private PollerFlux, Void> beginImportMethodAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginImportMethod( String resourceGroupName, String clusterName, String databaseName, ImportClusterParameters parameters) { return beginImportMethodAsync(resourceGroupName, clusterName, databaseName, parameters).getSyncPoller(); } /** - * Imports a database file to target database. + * Imports database files to target database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. @@ -2052,7 +2066,7 @@ public SyncPoller, Void> beginImportMethod( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginImportMethod( String resourceGroupName, String clusterName, @@ -2064,7 +2078,7 @@ public SyncPoller, Void> beginImportMethod( } /** - * Imports a database file to target database. + * Imports database files to target database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. @@ -2084,7 +2098,7 @@ private Mono importMethodAsync( } /** - * Imports a database file to target database. + * Imports database files to target database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. @@ -2109,7 +2123,7 @@ private Mono importMethodAsync( } /** - * Imports a database file to target database. + * Imports database files to target database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. @@ -2126,7 +2140,7 @@ public void importMethod( } /** - * Imports a database file to target database. + * Imports database files to target database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. @@ -2281,14 +2295,15 @@ private Mono>> exportWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginExportAsync( String resourceGroupName, String clusterName, String databaseName, ExportClusterParameters parameters) { Mono>> mono = exportWithResponseAsync(resourceGroupName, clusterName, databaseName, parameters); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -2304,7 +2319,7 @@ private PollerFlux, Void> beginExportAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginExportAsync( String resourceGroupName, String clusterName, @@ -2331,7 +2346,7 @@ private PollerFlux, Void> beginExportAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginExport( String resourceGroupName, String clusterName, String databaseName, ExportClusterParameters parameters) { return beginExportAsync(resourceGroupName, clusterName, databaseName, parameters).getSyncPoller(); @@ -2350,7 +2365,7 @@ public SyncPoller, Void> beginExport( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginExport( String resourceGroupName, String clusterName, diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateEndpointConnectionsClientImpl.java index fc91282f51e7..de57c1f0aa19 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateEndpointConnectionsClientImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateEndpointConnectionsClientImpl.java @@ -621,7 +621,7 @@ private Mono>> putWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the Private Endpoint Connection resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, PrivateEndpointConnectionInner> beginPutAsync( String resourceGroupName, String clusterName, @@ -636,7 +636,7 @@ private PollerFlux, PrivateEndpointCo this.client.getHttpPipeline(), PrivateEndpointConnectionInner.class, PrivateEndpointConnectionInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -653,7 +653,7 @@ private PollerFlux, PrivateEndpointCo * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the Private Endpoint Connection resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, PrivateEndpointConnectionInner> beginPutAsync( String resourceGroupName, String clusterName, @@ -686,7 +686,7 @@ private PollerFlux, PrivateEndpointCo * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the Private Endpoint Connection resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, PrivateEndpointConnectionInner> beginPut( String resourceGroupName, String clusterName, @@ -709,7 +709,7 @@ public SyncPoller, PrivateEndpointCon * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the Private Endpoint Connection resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, PrivateEndpointConnectionInner> beginPut( String resourceGroupName, String clusterName, diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateEndpointConnectionsImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateEndpointConnectionsImpl.java index 8a95be421c71..e4acdc58453a 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateEndpointConnectionsImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateEndpointConnectionsImpl.java @@ -169,7 +169,7 @@ public void deleteById(String id) { "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); } - this.deleteWithResponse(resourceGroupName, clusterName, privateEndpointConnectionName, Context.NONE).getValue(); + this.deleteWithResponse(resourceGroupName, clusterName, privateEndpointConnectionName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/RedisEnterpriseManagementClientImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/RedisEnterpriseManagementClientImpl.java index 6ec6f99e977f..60693827d337 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/RedisEnterpriseManagementClientImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/RedisEnterpriseManagementClientImpl.java @@ -209,7 +209,7 @@ public PrivateLinkResourcesClient getPrivateLinkResources() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2021-03-01"; + this.apiVersion = "2021-08-01"; this.operations = new OperationsClientImpl(this); this.operationsStatus = new OperationsStatusClientImpl(this); this.redisEnterprises = new RedisEnterprisesClientImpl(this); diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/RedisEnterprisesClientImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/RedisEnterprisesClientImpl.java index d7f70e4b5c4b..4209c6673436 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/RedisEnterprisesClientImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/RedisEnterprisesClientImpl.java @@ -296,14 +296,14 @@ private Mono>> createWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return describes the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ClusterInner> beginCreateAsync( String resourceGroupName, String clusterName, ClusterInner parameters) { Mono>> mono = createWithResponseAsync(resourceGroupName, clusterName, parameters); return this .client .getLroResult( - mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, Context.NONE); + mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, this.client.getContext()); } /** @@ -318,7 +318,7 @@ private PollerFlux, ClusterInner> beginCreateAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return describes the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ClusterInner> beginCreateAsync( String resourceGroupName, String clusterName, ClusterInner parameters, Context context) { context = this.client.mergeContext(context); @@ -341,7 +341,7 @@ private PollerFlux, ClusterInner> beginCreateAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return describes the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ClusterInner> beginCreate( String resourceGroupName, String clusterName, ClusterInner parameters) { return beginCreateAsync(resourceGroupName, clusterName, parameters).getSyncPoller(); @@ -359,7 +359,7 @@ public SyncPoller, ClusterInner> beginCreate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return describes the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ClusterInner> beginCreate( String resourceGroupName, String clusterName, ClusterInner parameters, Context context) { return beginCreateAsync(resourceGroupName, clusterName, parameters, context).getSyncPoller(); @@ -555,14 +555,14 @@ private Mono>> updateWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return describes the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ClusterInner> beginUpdateAsync( String resourceGroupName, String clusterName, ClusterUpdate parameters) { Mono>> mono = updateWithResponseAsync(resourceGroupName, clusterName, parameters); return this .client .getLroResult( - mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, Context.NONE); + mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, this.client.getContext()); } /** @@ -577,7 +577,7 @@ private PollerFlux, ClusterInner> beginUpdateAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return describes the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ClusterInner> beginUpdateAsync( String resourceGroupName, String clusterName, ClusterUpdate parameters, Context context) { context = this.client.mergeContext(context); @@ -600,7 +600,7 @@ private PollerFlux, ClusterInner> beginUpdateAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return describes the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ClusterInner> beginUpdate( String resourceGroupName, String clusterName, ClusterUpdate parameters) { return beginUpdateAsync(resourceGroupName, clusterName, parameters).getSyncPoller(); @@ -618,7 +618,7 @@ public SyncPoller, ClusterInner> beginUpdate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return describes the RedisEnterprise cluster. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ClusterInner> beginUpdate( String resourceGroupName, String clusterName, ClusterUpdate parameters, Context context) { return beginUpdateAsync(resourceGroupName, clusterName, parameters, context).getSyncPoller(); @@ -799,12 +799,13 @@ private Mono>> deleteWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -818,7 +819,7 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String clusterName, Context context) { context = this.client.mergeContext(context); @@ -838,7 +839,7 @@ private PollerFlux, Void> beginDeleteAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName) { return beginDeleteAsync(resourceGroupName, clusterName).getSyncPoller(); } @@ -854,7 +855,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String clusterName, Context context) { return beginDeleteAsync(resourceGroupName, clusterName, context).getSyncPoller(); diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ClusterUpdate.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ClusterUpdate.java index 88b8de0bd5e9..978b2e175851 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ClusterUpdate.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ClusterUpdate.java @@ -5,18 +5,18 @@ package com.azure.resourcemanager.redisenterprise.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.redisenterprise.fluent.models.ClusterProperties; import com.azure.resourcemanager.redisenterprise.fluent.models.PrivateEndpointConnectionInner; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; import java.util.Map; /** A partial update to the RedisEnterprise cluster. */ -@JsonFlatten @Fluent -public class ClusterUpdate { +public final class ClusterUpdate { @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterUpdate.class); /* @@ -26,47 +26,17 @@ public class ClusterUpdate { private Sku sku; /* - * Resource tags. - */ - @JsonProperty(value = "tags") - private Map tags; - - /* - * The minimum TLS version for the cluster to support, e.g. '1.2' - */ - @JsonProperty(value = "properties.minimumTlsVersion") - private TlsVersion minimumTlsVersion; - - /* - * DNS name of the cluster endpoint + * RedisEnterprise cluster properties Other properties of the cluster. */ - @JsonProperty(value = "properties.hostName", access = JsonProperty.Access.WRITE_ONLY) - private String hostname; + @JsonProperty(value = "properties") + private ClusterProperties innerProperties; /* - * Current provisioning status of the cluster - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - - /* - * Current resource status of the cluster - */ - @JsonProperty(value = "properties.resourceState", access = JsonProperty.Access.WRITE_ONLY) - private ResourceState resourceState; - - /* - * Version of redis the cluster supports, e.g. '6' - */ - @JsonProperty(value = "properties.redisVersion", access = JsonProperty.Access.WRITE_ONLY) - private String redisVersion; - - /* - * List of private endpoint connections associated with the specified - * RedisEnterprise cluster + * Resource tags. */ - @JsonProperty(value = "properties.privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) - private List privateEndpointConnections; + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; /** * Get the sku property: The SKU to create, which affects price, performance, and features. @@ -88,6 +58,15 @@ public ClusterUpdate withSku(Sku sku) { return this; } + /** + * Get the innerProperties property: RedisEnterprise cluster properties Other properties of the cluster. + * + * @return the innerProperties value. + */ + private ClusterProperties innerProperties() { + return this.innerProperties; + } + /** * Get the tags property: Resource tags. * @@ -114,7 +93,7 @@ public ClusterUpdate withTags(Map tags) { * @return the minimumTlsVersion value. */ public TlsVersion minimumTlsVersion() { - return this.minimumTlsVersion; + return this.innerProperties() == null ? null : this.innerProperties().minimumTlsVersion(); } /** @@ -124,7 +103,10 @@ public TlsVersion minimumTlsVersion() { * @return the ClusterUpdate object itself. */ public ClusterUpdate withMinimumTlsVersion(TlsVersion minimumTlsVersion) { - this.minimumTlsVersion = minimumTlsVersion; + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withMinimumTlsVersion(minimumTlsVersion); return this; } @@ -134,7 +116,7 @@ public ClusterUpdate withMinimumTlsVersion(TlsVersion minimumTlsVersion) { * @return the hostname value. */ public String hostname() { - return this.hostname; + return this.innerProperties() == null ? null : this.innerProperties().hostname(); } /** @@ -143,7 +125,7 @@ public String hostname() { * @return the provisioningState value. */ public ProvisioningState provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -152,7 +134,7 @@ public ProvisioningState provisioningState() { * @return the resourceState value. */ public ResourceState resourceState() { - return this.resourceState; + return this.innerProperties() == null ? null : this.innerProperties().resourceState(); } /** @@ -161,7 +143,7 @@ public ResourceState resourceState() { * @return the redisVersion value. */ public String redisVersion() { - return this.redisVersion; + return this.innerProperties() == null ? null : this.innerProperties().redisVersion(); } /** @@ -171,7 +153,7 @@ public String redisVersion() { * @return the privateEndpointConnections value. */ public List privateEndpointConnections() { - return this.privateEndpointConnections; + return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections(); } /** @@ -183,8 +165,8 @@ public void validate() { if (sku() != null) { sku().validate(); } - if (privateEndpointConnections() != null) { - privateEndpointConnections().forEach(e -> e.validate()); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Database.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Database.java index 033afa8b0349..6dc85de3dc78 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Database.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Database.java @@ -220,11 +220,7 @@ interface WithModules { /** The template for Database update. */ interface Update - extends UpdateStages.WithClientProtocol, - UpdateStages.WithClusteringPolicy, - UpdateStages.WithEvictionPolicy, - UpdateStages.WithPersistence, - UpdateStages.WithModules { + extends UpdateStages.WithClientProtocol, UpdateStages.WithEvictionPolicy, UpdateStages.WithPersistence { /** * Executes the update request. * @@ -254,17 +250,6 @@ interface WithClientProtocol { */ Update withClientProtocol(Protocol clientProtocol); } - /** The stage of the Database update allowing to specify clusteringPolicy. */ - interface WithClusteringPolicy { - /** - * Specifies the clusteringPolicy property: Clustering policy - default is OSSCluster. Specified at create - * time.. - * - * @param clusteringPolicy Clustering policy - default is OSSCluster. Specified at create time. - * @return the next definition stage. - */ - Update withClusteringPolicy(ClusteringPolicy clusteringPolicy); - } /** The stage of the Database update allowing to specify evictionPolicy. */ interface WithEvictionPolicy { /** @@ -285,18 +270,6 @@ interface WithPersistence { */ Update withPersistence(Persistence persistence); } - /** The stage of the Database update allowing to specify modules. */ - interface WithModules { - /** - * Specifies the modules property: Optional set of redis modules to enable in this database - modules can - * only be added at creation time.. - * - * @param modules Optional set of redis modules to enable in this database - modules can only be added at - * creation time. - * @return the next definition stage. - */ - Update withModules(List modules); - } } /** * Refreshes the resource to sync with Azure. @@ -318,7 +291,7 @@ interface WithModules { * * @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 secret access keys used for authenticating connections to redis. + * @return access keys. */ AccessKeys listKeys(); @@ -329,7 +302,7 @@ interface WithModules { * @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 secret access keys used for authenticating connections to redis. + * @return access keys. */ Response listKeysWithResponse(Context context); @@ -340,7 +313,7 @@ interface WithModules { * @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 secret access keys used for authenticating connections to redis. + * @return access keys. */ AccessKeys regenerateKey(RegenerateKeyParameters parameters); @@ -352,12 +325,12 @@ interface WithModules { * @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 secret access keys used for authenticating connections to redis. + * @return access keys. */ AccessKeys regenerateKey(RegenerateKeyParameters parameters, Context context); /** - * Imports a database file to target database. + * Imports database files to target database. * * @param parameters Storage information for importing into the cluster. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -367,7 +340,7 @@ interface WithModules { void importMethod(ImportClusterParameters parameters); /** - * Imports a database file to target database. + * Imports database files to target database. * * @param parameters Storage information for importing into the cluster. * @param context The context to associate with this operation. diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/DatabaseUpdate.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/DatabaseUpdate.java index 0bcb8abbd136..f721d565fd05 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/DatabaseUpdate.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/DatabaseUpdate.java @@ -5,68 +5,31 @@ package com.azure.resourcemanager.redisenterprise.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.redisenterprise.fluent.models.DatabaseProperties; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** A partial update to the RedisEnterprise database. */ -@JsonFlatten @Fluent -public class DatabaseUpdate { +public final class DatabaseUpdate { @JsonIgnore private final ClientLogger logger = new ClientLogger(DatabaseUpdate.class); /* - * Specifies whether redis clients can connect using TLS-encrypted or - * plaintext redis protocols. Default is TLS-encrypted. + * RedisEnterprise database properties Properties of the database. */ - @JsonProperty(value = "properties.clientProtocol") - private Protocol clientProtocol; + @JsonProperty(value = "properties") + private DatabaseProperties innerProperties; - /* - * TCP port of the database endpoint. Specified at create time. Defaults to - * an available port. - */ - @JsonProperty(value = "properties.port") - private Integer port; - - /* - * Current provisioning status of the database - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - - /* - * Current resource status of the database - */ - @JsonProperty(value = "properties.resourceState", access = JsonProperty.Access.WRITE_ONLY) - private ResourceState resourceState; - - /* - * Clustering policy - default is OSSCluster. Specified at create time. - */ - @JsonProperty(value = "properties.clusteringPolicy") - private ClusteringPolicy clusteringPolicy; - - /* - * Redis eviction policy - default is VolatileLRU - */ - @JsonProperty(value = "properties.evictionPolicy") - private EvictionPolicy evictionPolicy; - - /* - * Persistence settings - */ - @JsonProperty(value = "properties.persistence") - private Persistence persistence; - - /* - * Optional set of redis modules to enable in this database - modules can - * only be added at creation time. + /** + * Get the innerProperties property: RedisEnterprise database properties Properties of the database. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.modules") - private List modules; + private DatabaseProperties innerProperties() { + return this.innerProperties; + } /** * Get the clientProtocol property: Specifies whether redis clients can connect using TLS-encrypted or plaintext @@ -75,7 +38,7 @@ public class DatabaseUpdate { * @return the clientProtocol value. */ public Protocol clientProtocol() { - return this.clientProtocol; + return this.innerProperties() == null ? null : this.innerProperties().clientProtocol(); } /** @@ -86,7 +49,10 @@ public Protocol clientProtocol() { * @return the DatabaseUpdate object itself. */ public DatabaseUpdate withClientProtocol(Protocol clientProtocol) { - this.clientProtocol = clientProtocol; + if (this.innerProperties() == null) { + this.innerProperties = new DatabaseProperties(); + } + this.innerProperties().withClientProtocol(clientProtocol); return this; } @@ -97,7 +63,7 @@ public DatabaseUpdate withClientProtocol(Protocol clientProtocol) { * @return the port value. */ public Integer port() { - return this.port; + return this.innerProperties() == null ? null : this.innerProperties().port(); } /** @@ -108,7 +74,10 @@ public Integer port() { * @return the DatabaseUpdate object itself. */ public DatabaseUpdate withPort(Integer port) { - this.port = port; + if (this.innerProperties() == null) { + this.innerProperties = new DatabaseProperties(); + } + this.innerProperties().withPort(port); return this; } @@ -118,7 +87,7 @@ public DatabaseUpdate withPort(Integer port) { * @return the provisioningState value. */ public ProvisioningState provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -127,7 +96,7 @@ public ProvisioningState provisioningState() { * @return the resourceState value. */ public ResourceState resourceState() { - return this.resourceState; + return this.innerProperties() == null ? null : this.innerProperties().resourceState(); } /** @@ -136,7 +105,7 @@ public ResourceState resourceState() { * @return the clusteringPolicy value. */ public ClusteringPolicy clusteringPolicy() { - return this.clusteringPolicy; + return this.innerProperties() == null ? null : this.innerProperties().clusteringPolicy(); } /** @@ -146,7 +115,10 @@ public ClusteringPolicy clusteringPolicy() { * @return the DatabaseUpdate object itself. */ public DatabaseUpdate withClusteringPolicy(ClusteringPolicy clusteringPolicy) { - this.clusteringPolicy = clusteringPolicy; + if (this.innerProperties() == null) { + this.innerProperties = new DatabaseProperties(); + } + this.innerProperties().withClusteringPolicy(clusteringPolicy); return this; } @@ -156,7 +128,7 @@ public DatabaseUpdate withClusteringPolicy(ClusteringPolicy clusteringPolicy) { * @return the evictionPolicy value. */ public EvictionPolicy evictionPolicy() { - return this.evictionPolicy; + return this.innerProperties() == null ? null : this.innerProperties().evictionPolicy(); } /** @@ -166,7 +138,10 @@ public EvictionPolicy evictionPolicy() { * @return the DatabaseUpdate object itself. */ public DatabaseUpdate withEvictionPolicy(EvictionPolicy evictionPolicy) { - this.evictionPolicy = evictionPolicy; + if (this.innerProperties() == null) { + this.innerProperties = new DatabaseProperties(); + } + this.innerProperties().withEvictionPolicy(evictionPolicy); return this; } @@ -176,7 +151,7 @@ public DatabaseUpdate withEvictionPolicy(EvictionPolicy evictionPolicy) { * @return the persistence value. */ public Persistence persistence() { - return this.persistence; + return this.innerProperties() == null ? null : this.innerProperties().persistence(); } /** @@ -186,7 +161,10 @@ public Persistence persistence() { * @return the DatabaseUpdate object itself. */ public DatabaseUpdate withPersistence(Persistence persistence) { - this.persistence = persistence; + if (this.innerProperties() == null) { + this.innerProperties = new DatabaseProperties(); + } + this.innerProperties().withPersistence(persistence); return this; } @@ -197,7 +175,7 @@ public DatabaseUpdate withPersistence(Persistence persistence) { * @return the modules value. */ public List modules() { - return this.modules; + return this.innerProperties() == null ? null : this.innerProperties().modules(); } /** @@ -208,7 +186,10 @@ public List modules() { * @return the DatabaseUpdate object itself. */ public DatabaseUpdate withModules(List modules) { - this.modules = modules; + if (this.innerProperties() == null) { + this.innerProperties = new DatabaseProperties(); + } + this.innerProperties().withModules(modules); return this; } @@ -218,11 +199,8 @@ public DatabaseUpdate withModules(List modules) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (persistence() != null) { - persistence().validate(); - } - if (modules() != null) { - modules().forEach(e -> e.validate()); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Databases.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Databases.java index ec608137ddc2..1eccc0222644 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Databases.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Databases.java @@ -97,7 +97,7 @@ Response getWithResponse( * @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 secret access keys used for authenticating connections to redis. + * @return access keys. */ AccessKeys listKeys(String resourceGroupName, String clusterName, String databaseName); @@ -111,7 +111,7 @@ Response getWithResponse( * @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 secret access keys used for authenticating connections to redis. + * @return access keys. */ Response listKeysWithResponse( String resourceGroupName, String clusterName, String databaseName, Context context); @@ -126,7 +126,7 @@ Response listKeysWithResponse( * @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 secret access keys used for authenticating connections to redis. + * @return access keys. */ AccessKeys regenerateKey( String resourceGroupName, String clusterName, String databaseName, RegenerateKeyParameters parameters); @@ -142,7 +142,7 @@ AccessKeys regenerateKey( * @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 secret access keys used for authenticating connections to redis. + * @return access keys. */ AccessKeys regenerateKey( String resourceGroupName, @@ -152,7 +152,7 @@ AccessKeys regenerateKey( Context context); /** - * Imports a database file to target database. + * Imports database files to target database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. @@ -166,7 +166,7 @@ void importMethod( String resourceGroupName, String clusterName, String databaseName, ImportClusterParameters parameters); /** - * Imports a database file to target database. + * Imports database files to target database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the RedisEnterprise cluster. diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ExportClusterParameters.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ExportClusterParameters.java index 002784922ec9..0a90b64c0da7 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ExportClusterParameters.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ExportClusterParameters.java @@ -9,7 +9,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** Parameters for a Redis Enterprise export operation. */ +/** Export an RDB file into a target database Parameters for a Redis Enterprise export operation. */ @Fluent public final class ExportClusterParameters { @JsonIgnore private final ClientLogger logger = new ClientLogger(ExportClusterParameters.class); diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ImportClusterParameters.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ImportClusterParameters.java index 872f97600235..429dd4437c55 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ImportClusterParameters.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/ImportClusterParameters.java @@ -8,35 +8,36 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; -/** Parameters for a Redis Enterprise import operation. */ +/** Import RDB files into a target database Parameters for a Redis Enterprise import operation. */ @Fluent public final class ImportClusterParameters { @JsonIgnore private final ClientLogger logger = new ClientLogger(ImportClusterParameters.class); /* - * SAS URI for the target blob to import from + * SAS URIs for the target blobs to import from */ - @JsonProperty(value = "sasUri", required = true) - private String sasUri; + @JsonProperty(value = "sasUris", required = true) + private List sasUris; /** - * Get the sasUri property: SAS URI for the target blob to import from. + * Get the sasUris property: SAS URIs for the target blobs to import from. * - * @return the sasUri value. + * @return the sasUris value. */ - public String sasUri() { - return this.sasUri; + public List sasUris() { + return this.sasUris; } /** - * Set the sasUri property: SAS URI for the target blob to import from. + * Set the sasUris property: SAS URIs for the target blobs to import from. * - * @param sasUri the sasUri value to set. + * @param sasUris the sasUris value to set. * @return the ImportClusterParameters object itself. */ - public ImportClusterParameters withSasUri(String sasUri) { - this.sasUri = sasUri; + public ImportClusterParameters withSasUris(List sasUris) { + this.sasUris = sasUris; return this; } @@ -46,10 +47,10 @@ public ImportClusterParameters withSasUri(String sasUri) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (sasUri() == null) { + if (sasUris() == null) { throw logger .logExceptionAsError( - new IllegalArgumentException("Missing required property sasUri in model ImportClusterParameters")); + new IllegalArgumentException("Missing required property sasUris in model ImportClusterParameters")); } } } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Module.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Module.java index cd014bb8cc02..3c27d4478e92 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Module.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Module.java @@ -9,7 +9,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** Specifies configuration of a redis module. */ +/** Module settings Specifies configuration of a redis module. */ @Fluent public final class Module { @JsonIgnore private final ClientLogger logger = new ClientLogger(Module.class); diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/OperationStatus.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/OperationStatus.java index c5e2593dd468..384c42984a4a 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/OperationStatus.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/OperationStatus.java @@ -45,7 +45,7 @@ public interface OperationStatus { String status(); /** - * Gets the error property: Error response describing why the operation failed. + * Gets the error property: Error response Error response describing why the operation failed. * * @return the error value. */ diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Persistence.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Persistence.java index df4f7aac6593..245afe45b7da 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Persistence.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/Persistence.java @@ -9,7 +9,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** Persistence-related configuration for the RedisEnterprise database. */ +/** Persistence settings Persistence-related configuration for the RedisEnterprise database. */ @Fluent public final class Persistence { @JsonIgnore private final ClientLogger logger = new ClientLogger(Persistence.class); diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/RegenerateKeyParameters.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/RegenerateKeyParameters.java index 545ec905c946..5472bedb00cc 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/RegenerateKeyParameters.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/models/RegenerateKeyParameters.java @@ -9,7 +9,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** Specifies which access keys to reset to a new random value. */ +/** Regenerate access keys request Specifies which access keys to reset to a new random value. */ @Fluent public final class RegenerateKeyParameters { @JsonIgnore private final ClientLogger logger = new ClientLogger(RegenerateKeyParameters.class); diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesCreateSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesCreateSamples.java new file mode 100644 index 000000000000..f4d0ca408a67 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesCreateSamples.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.redisenterprise.generated; + +import com.azure.resourcemanager.redisenterprise.models.AofFrequency; +import com.azure.resourcemanager.redisenterprise.models.ClusteringPolicy; +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 DatabasesCreateSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/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"))) + .create(); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesDeleteSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesDeleteSamples.java new file mode 100644 index 000000000000..c5c65faa4417 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.Context; + +/** Samples for Databases Delete. */ +public final class DatabasesDeleteSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/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", Context.NONE); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesExportSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesExportSamples.java new file mode 100644 index 000000000000..24615da73724 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesExportSamples.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.redisenterprise.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.redisenterprise.models.ExportClusterParameters; + +/** Samples for Databases Export. */ +public final class DatabasesExportSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/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"), + Context.NONE); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesGetSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesGetSamples.java new file mode 100644 index 000000000000..e301a035ea20 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.Context; + +/** Samples for Databases Get. */ +public final class DatabasesGetSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/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", Context.NONE); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesImportMethodSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesImportMethodSamples.java new file mode 100644 index 000000000000..e50875ae74f1 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesImportMethodSamples.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.redisenterprise.models.ImportClusterParameters; +import java.util.Arrays; + +/** Samples for Databases ImportMethod. */ +public final class DatabasesImportMethodSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/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")), + Context.NONE); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesListByClusterSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesListByClusterSamples.java new file mode 100644 index 000000000000..48ae90e52570 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesListByClusterSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.Context; + +/** Samples for Databases ListByCluster. */ +public final class DatabasesListByClusterSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/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", Context.NONE); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesListKeysSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesListKeysSamples.java new file mode 100644 index 000000000000..5672260c82f5 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesListKeysSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.Context; + +/** Samples for Databases ListKeys. */ +public final class DatabasesListKeysSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/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", Context.NONE); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesRegenerateKeySamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesRegenerateKeySamples.java new file mode 100644 index 000000000000..2911c8a2c650 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesRegenerateKeySamples.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.redisenterprise.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.redisenterprise.models.AccessKeyType; +import com.azure.resourcemanager.redisenterprise.models.RegenerateKeyParameters; + +/** Samples for Databases RegenerateKey. */ +public final class DatabasesRegenerateKeySamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/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), + Context.NONE); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesUpdateSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesUpdateSamples.java new file mode 100644 index 000000000000..2db8df5dae65 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/DatabasesUpdateSamples.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.redisenterprise.generated; + +import com.azure.core.util.Context; +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 DatabasesUpdateSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/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", Context.NONE).getValue(); + resource + .update() + .withClientProtocol(Protocol.ENCRYPTED) + .withEvictionPolicy(EvictionPolicy.ALL_KEYS_LRU) + .withPersistence(new Persistence().withRdbEnabled(true).withRdbFrequency(RdbFrequency.ONE_TWOH)) + .apply(); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/OperationsStatusGetSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/OperationsStatusGetSamples.java new file mode 100644 index 000000000000..ee6d515f2275 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/OperationsStatusGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.Context; + +/** Samples for OperationsStatus Get. */ +public final class OperationsStatusGetSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/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", Context.NONE); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointConnectionsDeleteSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointConnectionsDeleteSamples.java new file mode 100644 index 000000000000..255655fb6592 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointConnectionsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Delete. */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/examples/RedisEnterpriseDeletePrivateEndpointConnection.json + */ + /** + * Sample code: RedisEnterpriseDeletePrivateEndpointConnection. + * + * @param manager Entry point to RedisEnterpriseManager. + */ + public static void redisEnterpriseDeletePrivateEndpointConnection( + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager) { + manager.privateEndpointConnections().deleteWithResponse("rg1", "cache1", "pectest01", Context.NONE); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointConnectionsGetSamples.java new file mode 100644 index 000000000000..df2a9f4ad983 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointConnectionsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Get. */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/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", Context.NONE); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointConnectionsListSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointConnectionsListSamples.java new file mode 100644 index 000000000000..e60bfaca8518 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointConnectionsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections List. */ +public final class PrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/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", Context.NONE); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointConnectionsPutSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointConnectionsPutSamples.java new file mode 100644 index 000000000000..7cb8b8c38af0 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/PrivateEndpointConnectionsPutSamples.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.redisenterprise.generated; + +import com.azure.resourcemanager.redisenterprise.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.redisenterprise.models.PrivateLinkServiceConnectionState; + +/** Samples for PrivateEndpointConnections Put. */ +public final class PrivateEndpointConnectionsPutSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/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/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/PrivateLinkResourcesListByClusterSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/PrivateLinkResourcesListByClusterSamples.java new file mode 100644 index 000000000000..0a43e3b3ccd8 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/PrivateLinkResourcesListByClusterSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResources ListByCluster. */ +public final class PrivateLinkResourcesListByClusterSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/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", Context.NONE); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterpriseCreateSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterpriseCreateSamples.java new file mode 100644 index 000000000000..a5cbf5b719d4 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterpriseCreateSamples.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.resourcemanager.redisenterprise.models.Sku; +import com.azure.resourcemanager.redisenterprise.models.SkuName; +import com.azure.resourcemanager.redisenterprise.models.TlsVersion; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for RedisEnterprise Create. */ +public final class RedisEnterpriseCreateSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/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")) + .withMinimumTlsVersion(TlsVersion.ONE_TWO) + .create(); + } + + @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/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterpriseDeleteSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterpriseDeleteSamples.java new file mode 100644 index 000000000000..260002d33ba7 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterpriseDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.Context; + +/** Samples for RedisEnterprise Delete. */ +public final class RedisEnterpriseDeleteSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/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", Context.NONE); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterpriseGetByResourceGroupSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterpriseGetByResourceGroupSamples.java new file mode 100644 index 000000000000..d4316da2781d --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterpriseGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.Context; + +/** Samples for RedisEnterprise GetByResourceGroup. */ +public final class RedisEnterpriseGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/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", Context.NONE); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterpriseListByResourceGroupSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterpriseListByResourceGroupSamples.java new file mode 100644 index 000000000000..5c3d110dd782 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterpriseListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.Context; + +/** Samples for RedisEnterprise ListByResourceGroup. */ +public final class RedisEnterpriseListByResourceGroupSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/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", Context.NONE); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterpriseListSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterpriseListSamples.java new file mode 100644 index 000000000000..a25222b4b4f8 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterpriseListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.Context; + +/** Samples for RedisEnterprise List. */ +public final class RedisEnterpriseListSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/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(Context.NONE); + } +} diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterpriseUpdateSamples.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterpriseUpdateSamples.java new file mode 100644 index 000000000000..4612d20eaaf6 --- /dev/null +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/samples/java/com/azure/resourcemanager/redisenterprise/generated/RedisEnterpriseUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.redisenterprise.generated; + +import com.azure.core.util.Context; +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 RedisEnterpriseUpdateSamples { + /* + * x-ms-original-file: specification/redisenterprise/resource-manager/Microsoft.Cache/stable/2021-08-01/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", Context.NONE).getValue(); + resource + .update() + .withTags(mapOf("tag1", "value1")) + .withSku(new Sku().withName(SkuName.ENTERPRISE_FLASH_F300).withCapacity(9)) + .withMinimumTlsVersion(TlsVersion.ONE_TWO) + .apply(); + } + + @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; + } +}