Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR azure-resourcemanager-redisenterprise] Adding E5 SKU to stable branch for GA release #9194

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Release History

## 1.1.0-beta.4 (Unreleased)
## 1.0.0-beta.1 (2024-02-05)

- 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-2024-02. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).

### Features Added

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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-preview-2023-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-2024-02. 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

Expand Down Expand Up @@ -32,7 +32,7 @@ Various documentation is available to help you get started
<dependency>
<groupId>com.azure.resourcemanager</groupId>
<artifactId>azure-resourcemanager-redisenterprise</artifactId>
<version>1.1.0-beta.3</version>
<version>1.1.0-beta.4</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand All @@ -45,7 +45,7 @@ Azure Management Libraries require a `TokenCredential` implementation for authen

### Authentication

By default, Azure Active Directory token authentication depends on correct configuration of the following environment variables.
By default, Microsoft Entra ID token authentication depends on correct configuration of the following environment variables.

- `AZURE_CLIENT_ID` for Azure client ID.
- `AZURE_TENANT_ID` for Azure tenant ID.
Expand Down Expand Up @@ -74,6 +74,16 @@ See [API design][design] for general introduction on design and key concepts on

## Examples

```java
cluster = redisEnterpriseManager.redisEnterprises()
.define(clusterName)
.withRegion(REGION)
.withExistingResourceGroup(resourceGroupName)
.withSku(new Sku().withName(SkuName.ENTERPRISE_E10).withCapacity(2))
.withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE))
.withMinimumTlsVersion(TlsVersion.ONE_TWO)
.create();
```
[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/redisenterprise/azure-resourcemanager-redisenterprise/SAMPLE.md)


Expand All @@ -94,7 +104,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m
<!-- LINKS -->
[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS
[docs]: https://azure.github.io/azure-sdk-for-java/
[jdk]: https://docs.microsoft.com/java/azure/jdk/
[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/
[azure_subscription]: https://azure.microsoft.com/free/
[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity
[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty
Expand All @@ -103,3 +113,5 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m
[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md
[coc]: https://opensource.microsoft.com/codeofconduct/
[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/

![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fredisenterprise%2Fazure-resourcemanager-redisenterprise%2FREADME.png)
451 changes: 163 additions & 288 deletions sdk/redisenterprise/azure-resourcemanager-redisenterprise/SAMPLE.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<packaging>jar</packaging>

<name>Microsoft Azure SDK for RedisEnterprise Management</name>
<description>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-preview-2023-03.</description>
<description>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-2024-02.</description>
<url>https://github.com/Azure/azure-sdk-for-java</url>

<licenses>
Expand Down Expand Up @@ -94,8 +94,6 @@
<version>4.11.0</version> <!-- {x-version-update;org.mockito:mockito-core;external_dependency} -->
<scope>test</scope>
</dependency>
<!-- bytebuddy dependencies are required for mockito 4.11.0 to work with Java 21. Mockito 4.11.0 is the last release -->
<!-- of Mockito supporting Java 8 as a baseline. -->
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,23 @@
import com.azure.resourcemanager.redisenterprise.implementation.PrivateLinkResourcesImpl;
import com.azure.resourcemanager.redisenterprise.implementation.RedisEnterpriseManagementClientBuilder;
import com.azure.resourcemanager.redisenterprise.implementation.RedisEnterprisesImpl;
import com.azure.resourcemanager.redisenterprise.implementation.SkusImpl;
import com.azure.resourcemanager.redisenterprise.models.Databases;
import com.azure.resourcemanager.redisenterprise.models.Operations;
import com.azure.resourcemanager.redisenterprise.models.OperationsStatus;
import com.azure.resourcemanager.redisenterprise.models.PrivateEndpointConnections;
import com.azure.resourcemanager.redisenterprise.models.PrivateLinkResources;
import com.azure.resourcemanager.redisenterprise.models.RedisEnterprises;
import com.azure.resourcemanager.redisenterprise.models.Skus;
import java.time.Duration;
import java.time.temporal.ChronoUnit;
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. */
/**
* Entry point to RedisEnterpriseManager.
* REST API for managing Redis Enterprise resources in Azure.
*/
public final class RedisEnterpriseManager {
private Operations operations;

Expand All @@ -60,25 +61,19 @@ public final class RedisEnterpriseManager {

private PrivateLinkResources privateLinkResources;

private Skus skus;

private final RedisEnterpriseManagementClient clientObject;

private RedisEnterpriseManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) {
Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null.");
Objects.requireNonNull(profile, "'profile' cannot be null.");
this.clientObject =
new RedisEnterpriseManagementClientBuilder()
.pipeline(httpPipeline)
.endpoint(profile.getEnvironment().getResourceManagerEndpoint())
.subscriptionId(profile.getSubscriptionId())
.defaultPollInterval(defaultPollInterval)
.buildClient();
this.clientObject = new RedisEnterpriseManagementClientBuilder().pipeline(httpPipeline)
.endpoint(profile.getEnvironment().getResourceManagerEndpoint()).subscriptionId(profile.getSubscriptionId())
.defaultPollInterval(defaultPollInterval).buildClient();
}

/**
* Creates an instance of RedisEnterprise service API entry point.
*
*
* @param credential the credential to use.
* @param profile the Azure profile for client.
* @return the RedisEnterprise service API instance.
Expand All @@ -91,7 +86,7 @@ public static RedisEnterpriseManager authenticate(TokenCredential credential, Az

/**
* Creates an instance of RedisEnterprise service API entry point.
*
*
* @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential.
* @param profile the Azure profile for client.
* @return the RedisEnterprise service API instance.
Expand All @@ -104,14 +99,16 @@ public static RedisEnterpriseManager authenticate(HttpPipeline httpPipeline, Azu

/**
* Gets a Configurable instance that can be used to create RedisEnterpriseManager with optional configuration.
*
*
* @return the Configurable instance allowing configurations.
*/
public static Configurable configure() {
return new RedisEnterpriseManager.Configurable();
}

/** The Configurable allowing configurations to be set. */
/**
* The Configurable allowing configurations to be set.
*/
public static final class Configurable {
private static final ClientLogger LOGGER = new ClientLogger(Configurable.class);

Expand Down Expand Up @@ -183,8 +180,8 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) {

/**
* Sets the retry options for the HTTP pipeline retry policy.
*
* <p>This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}.
* <p>
* This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}.
*
* @param retryOptions the retry options for the HTTP pipeline retry policy.
* @return the configurable object itself.
Expand All @@ -201,8 +198,8 @@ public Configurable withRetryOptions(RetryOptions retryOptions) {
* @return the configurable object itself.
*/
public Configurable withDefaultPollInterval(Duration defaultPollInterval) {
this.defaultPollInterval =
Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null.");
this.defaultPollInterval
= Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null.");
if (this.defaultPollInterval.isNegative()) {
throw LOGGER
.logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative"));
Expand All @@ -222,21 +219,12 @@ public RedisEnterpriseManager authenticate(TokenCredential credential, AzureProf
Objects.requireNonNull(profile, "'profile' cannot be null.");

StringBuilder userAgentBuilder = new StringBuilder();
userAgentBuilder
.append("azsdk-java")
.append("-")
.append("com.azure.resourcemanager.redisenterprise")
.append("/")
.append("1.1.0-beta.3");
userAgentBuilder.append("azsdk-java").append("-").append("com.azure.resourcemanager.redisenterprise")
.append("/").append("1.0.0-beta.1");
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
userAgentBuilder
.append(" (")
.append(Configuration.getGlobalConfiguration().get("java.version"))
.append("; ")
.append(Configuration.getGlobalConfiguration().get("os.name"))
.append("; ")
.append(Configuration.getGlobalConfiguration().get("os.version"))
.append("; auto-generated)");
userAgentBuilder.append(" (").append(Configuration.getGlobalConfiguration().get("java.version"))
.append("; ").append(Configuration.getGlobalConfiguration().get("os.name")).append("; ")
.append(Configuration.getGlobalConfiguration().get("os.version")).append("; auto-generated)");
} else {
userAgentBuilder.append(" (auto-generated)");
}
Expand All @@ -255,38 +243,25 @@ public RedisEnterpriseManager authenticate(TokenCredential credential, AzureProf
policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
policies.add(new AddHeadersFromContextPolicy());
policies.add(new RequestIdPolicy());
policies
.addAll(
this
.policies
.stream()
.filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
.collect(Collectors.toList()));
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
.addAll(
this
.policies
.stream()
.filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
.collect(Collectors.toList()));
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 =
new HttpPipelineBuilder()
.httpClient(httpClient)
.policies(policies.toArray(new HttpPipelinePolicy[0]))
.build();
HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient)
.policies(policies.toArray(new HttpPipelinePolicy[0])).build();
return new RedisEnterpriseManager(httpPipeline, profile, defaultPollInterval);
}
}

/**
* Gets the resource collection API of Operations.
*
*
* @return Resource collection API of Operations.
*/
public Operations operations() {
Expand All @@ -298,7 +273,7 @@ public Operations operations() {

/**
* Gets the resource collection API of OperationsStatus.
*
*
* @return Resource collection API of OperationsStatus.
*/
public OperationsStatus operationsStatus() {
Expand All @@ -310,7 +285,7 @@ public OperationsStatus operationsStatus() {

/**
* Gets the resource collection API of RedisEnterprises. It manages Cluster.
*
*
* @return Resource collection API of RedisEnterprises.
*/
public RedisEnterprises redisEnterprises() {
Expand All @@ -322,7 +297,7 @@ public RedisEnterprises redisEnterprises() {

/**
* Gets the resource collection API of Databases. It manages Database.
*
*
* @return Resource collection API of Databases.
*/
public Databases databases() {
Expand All @@ -334,20 +309,20 @@ public Databases databases() {

/**
* Gets the resource collection API of PrivateEndpointConnections. It manages PrivateEndpointConnection.
*
*
* @return Resource collection API of PrivateEndpointConnections.
*/
public PrivateEndpointConnections privateEndpointConnections() {
if (this.privateEndpointConnections == null) {
this.privateEndpointConnections =
new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this);
this.privateEndpointConnections
= new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this);
}
return privateEndpointConnections;
}

/**
* Gets the resource collection API of PrivateLinkResources.
*
*
* @return Resource collection API of PrivateLinkResources.
*/
public PrivateLinkResources privateLinkResources() {
Expand All @@ -358,20 +333,10 @@ public PrivateLinkResources privateLinkResources() {
}

/**
* Gets the resource collection API of Skus.
*
* @return Resource collection API of Skus.
*/
public Skus skus() {
if (this.skus == null) {
this.skus = new SkusImpl(clientObject.getSkus(), this);
}
return skus;
}

/**
* @return Wrapped service client RedisEnterpriseManagementClient providing direct access to the underlying
* auto-generated API implementation, based on Azure REST API.
* Gets wrapped service client RedisEnterpriseManagementClient providing direct access to the underlying
* auto-generated API implementation, based on Azure REST API.
*
* @return Wrapped service client RedisEnterpriseManagementClient.
*/
public RedisEnterpriseManagementClient serviceClient() {
return this.clientObject;
Expand Down
Loading
Loading