Skip to content

Commit

Permalink
CodeGen from PR 30718 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge f77bd75bcd486ef247bc748449e372fff600b9be into fe44d3261ff0ea816315126120672ccec78c3074
  • Loading branch information
SDKAuto committed Oct 24, 2024
1 parent cad4cc9 commit aa6e38f
Show file tree
Hide file tree
Showing 473 changed files with 13,580 additions and 7,355 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Azure Resource Manager PostgreSql client library for Java
# Azure Resource Manager PostgreSqlServer client library for Java

Azure Resource Manager PostgreSql client library for Java.
Azure Resource Manager PostgreSqlServer client library for Java.

This package contains Microsoft Azure SDK for PostgreSql Management SDK. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, security alert policies, log files and configurations with new business model. Package tag package-flexibleserver-2023-12-01-preview. 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 PostgreSqlServer Management SDK. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, security alert policies, log files and configurations with new business model. Package tag package-flexibleserver-2024-11-01-preview. 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-postgresqlflexibleserver</artifactId>
<version>1.1.0-beta.3</version>
<version>1.1.0-beta.4</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand All @@ -45,22 +45,18 @@ Azure Management Libraries require a `TokenCredential` implementation for authen

### Authentication

By default, Microsoft Entra ID token authentication depends on correct configuration of the following environment variables.
Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package.

- `AZURE_CLIENT_ID` for Azure client ID.
- `AZURE_TENANT_ID` for Azure tenant ID.
- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate.
Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable.

In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable.

With above configuration, `azure` client can be authenticated using the following code:
Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code:

```java
AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE);
TokenCredential credential = new DefaultAzureCredentialBuilder()
.authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint())
.build();
PostgreSqlManager manager = PostgreSqlManager
PostgreSqlServerManager manager = PostgreSqlServerManager
.authenticate(credential, profile);
```

Expand Down Expand Up @@ -120,6 +116,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m
[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_identity_credentials]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials
[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty
[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md
[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
<version>1.1.0-beta.4</version> <!-- {x-version-update;com.azure.resourcemanager:azure-resourcemanager-postgresqlflexibleserver;current} -->
<packaging>jar</packaging>

<name>Microsoft Azure SDK for PostgreSql Management</name>
<description>This package contains Microsoft Azure SDK for PostgreSql Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, security alert policies, log files and configurations with new business model. Package tag package-flexibleserver-2023-12-01-preview.</description>
<name>Microsoft Azure SDK for PostgreSqlServer Management</name>
<description>This package contains Microsoft Azure SDK for PostgreSqlServer Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, security alert policies, log files and configurations with new business model. Package tag package-flexibleserver-2024-11-01-preview.</description>
<url>https://github.com/Azure/azure-sdk-for-java</url>

<licenses>
Expand Down Expand Up @@ -46,6 +46,7 @@
<jacoco.min.linecoverage>0</jacoco.min.linecoverage>
<jacoco.min.branchcoverage>0</jacoco.min.branchcoverage>
<revapi.skip>true</revapi.skip>
<spotless.skip>false</spotless.skip>
</properties>
<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
import com.azure.core.http.HttpPipelinePosition;
import com.azure.core.http.policy.AddDatePolicy;
import com.azure.core.http.policy.AddHeadersFromContextPolicy;
import com.azure.core.http.policy.HttpLoggingPolicy;
import com.azure.core.http.policy.HttpLogOptions;
import com.azure.core.http.policy.HttpLoggingPolicy;
import com.azure.core.http.policy.HttpPipelinePolicy;
import com.azure.core.http.policy.HttpPolicyProviders;
import com.azure.core.http.policy.RequestIdPolicy;
Expand All @@ -23,7 +23,7 @@
import com.azure.core.management.profile.AzureProfile;
import com.azure.core.util.Configuration;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.postgresqlflexibleserver.fluent.PostgreSqlManagementClient;
import com.azure.resourcemanager.postgresqlflexibleserver.fluent.PostgreSqlServerManagementClient;
import com.azure.resourcemanager.postgresqlflexibleserver.implementation.AdministratorsImpl;
import com.azure.resourcemanager.postgresqlflexibleserver.implementation.BackupsImpl;
import com.azure.resourcemanager.postgresqlflexibleserver.implementation.CheckNameAvailabilitiesImpl;
Expand All @@ -38,16 +38,17 @@
import com.azure.resourcemanager.postgresqlflexibleserver.implementation.LtrBackupOperationsImpl;
import com.azure.resourcemanager.postgresqlflexibleserver.implementation.MigrationsImpl;
import com.azure.resourcemanager.postgresqlflexibleserver.implementation.OperationsImpl;
import com.azure.resourcemanager.postgresqlflexibleserver.implementation.PostgreSqlManagementClientBuilder;
import com.azure.resourcemanager.postgresqlflexibleserver.implementation.PostgreSqlServerManagementClientBuilder;
import com.azure.resourcemanager.postgresqlflexibleserver.implementation.PrivateEndpointConnectionOperationsImpl;
import com.azure.resourcemanager.postgresqlflexibleserver.implementation.PrivateEndpointConnectionsImpl;
import com.azure.resourcemanager.postgresqlflexibleserver.implementation.PrivateLinkResourcesImpl;
import com.azure.resourcemanager.postgresqlflexibleserver.implementation.QuotaUsagesImpl;
import com.azure.resourcemanager.postgresqlflexibleserver.implementation.ReplicasImpl;
import com.azure.resourcemanager.postgresqlflexibleserver.implementation.ResourceProvidersImpl;
import com.azure.resourcemanager.postgresqlflexibleserver.implementation.ServerCapabilitiesImpl;
import com.azure.resourcemanager.postgresqlflexibleserver.implementation.ServersImpl;
import com.azure.resourcemanager.postgresqlflexibleserver.implementation.ServerThreatProtectionSettingsImpl;
import com.azure.resourcemanager.postgresqlflexibleserver.implementation.ServersImpl;
import com.azure.resourcemanager.postgresqlflexibleserver.implementation.TuningOptionsImpl;
import com.azure.resourcemanager.postgresqlflexibleserver.implementation.VirtualEndpointsImpl;
import com.azure.resourcemanager.postgresqlflexibleserver.implementation.VirtualNetworkSubnetUsagesImpl;
import com.azure.resourcemanager.postgresqlflexibleserver.models.Administrators;
Expand All @@ -71,8 +72,9 @@
import com.azure.resourcemanager.postgresqlflexibleserver.models.Replicas;
import com.azure.resourcemanager.postgresqlflexibleserver.models.ResourceProviders;
import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerCapabilities;
import com.azure.resourcemanager.postgresqlflexibleserver.models.Servers;
import com.azure.resourcemanager.postgresqlflexibleserver.models.ServerThreatProtectionSettings;
import com.azure.resourcemanager.postgresqlflexibleserver.models.Servers;
import com.azure.resourcemanager.postgresqlflexibleserver.models.TuningOptions;
import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualEndpoints;
import com.azure.resourcemanager.postgresqlflexibleserver.models.VirtualNetworkSubnetUsages;
import java.time.Duration;
Expand All @@ -83,12 +85,12 @@
import java.util.stream.Collectors;

/**
* Entry point to PostgreSqlManager.
* Entry point to PostgreSqlServerManager.
* The Microsoft Azure management API provides create, read, update, and delete functionality for Azure PostgreSQL
* resources including servers, databases, firewall rules, VNET rules, security alert policies, log files and
* configurations with new business model.
*/
public final class PostgreSqlManager {
public final class PostgreSqlServerManager {
private Administrators administrators;

private Backups backups;
Expand Down Expand Up @@ -135,55 +137,57 @@ public final class PostgreSqlManager {

private ServerThreatProtectionSettings serverThreatProtectionSettings;

private TuningOptions tuningOptions;

private VirtualEndpoints virtualEndpoints;

private VirtualNetworkSubnetUsages virtualNetworkSubnetUsages;

private final PostgreSqlManagementClient clientObject;
private final PostgreSqlServerManagementClient clientObject;

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

/**
* Creates an instance of PostgreSql service API entry point.
* Creates an instance of PostgreSqlServer service API entry point.
*
* @param credential the credential to use.
* @param profile the Azure profile for client.
* @return the PostgreSql service API instance.
* @return the PostgreSqlServer service API instance.
*/
public static PostgreSqlManager authenticate(TokenCredential credential, AzureProfile profile) {
public static PostgreSqlServerManager authenticate(TokenCredential credential, AzureProfile profile) {
Objects.requireNonNull(credential, "'credential' cannot be null.");
Objects.requireNonNull(profile, "'profile' cannot be null.");
return configure().authenticate(credential, profile);
}

/**
* Creates an instance of PostgreSql service API entry point.
* Creates an instance of PostgreSqlServer service API entry point.
*
* @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential.
* @param profile the Azure profile for client.
* @return the PostgreSql service API instance.
* @return the PostgreSqlServer service API instance.
*/
public static PostgreSqlManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) {
public static PostgreSqlServerManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) {
Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null.");
Objects.requireNonNull(profile, "'profile' cannot be null.");
return new PostgreSqlManager(httpPipeline, profile, null);
return new PostgreSqlServerManager(httpPipeline, profile, null);
}

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

/**
Expand Down Expand Up @@ -288,13 +292,13 @@ public Configurable withDefaultPollInterval(Duration defaultPollInterval) {
}

/**
* Creates an instance of PostgreSql service API entry point.
* Creates an instance of PostgreSqlServer service API entry point.
*
* @param credential the credential to use.
* @param profile the Azure profile for client.
* @return the PostgreSql service API instance.
* @return the PostgreSqlServer service API instance.
*/
public PostgreSqlManager authenticate(TokenCredential credential, AzureProfile profile) {
public PostgreSqlServerManager authenticate(TokenCredential credential, AzureProfile profile) {
Objects.requireNonNull(credential, "'credential' cannot be null.");
Objects.requireNonNull(profile, "'profile' cannot be null.");

Expand All @@ -303,7 +307,7 @@ public PostgreSqlManager authenticate(TokenCredential credential, AzureProfile p
.append("-")
.append("com.azure.resourcemanager.postgresqlflexibleserver")
.append("/")
.append("1.1.0-beta.3");
.append("1.0.0-beta.1");
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
userAgentBuilder.append(" (")
.append(Configuration.getGlobalConfiguration().get("java.version"))
Expand Down Expand Up @@ -345,7 +349,7 @@ public PostgreSqlManager authenticate(TokenCredential credential, AzureProfile p
HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient)
.policies(policies.toArray(new HttpPipelinePolicy[0]))
.build();
return new PostgreSqlManager(httpPipeline, profile, defaultPollInterval);
return new PostgreSqlServerManager(httpPipeline, profile, defaultPollInterval);
}
}

Expand Down Expand Up @@ -633,6 +637,18 @@ public ServerThreatProtectionSettings serverThreatProtectionSettings() {
return serverThreatProtectionSettings;
}

/**
* Gets the resource collection API of TuningOptions.
*
* @return Resource collection API of TuningOptions.
*/
public TuningOptions tuningOptions() {
if (this.tuningOptions == null) {
this.tuningOptions = new TuningOptionsImpl(clientObject.getTuningOptions(), this);
}
return tuningOptions;
}

/**
* Gets the resource collection API of VirtualEndpoints. It manages VirtualEndpointResource.
*
Expand All @@ -659,12 +675,12 @@ public VirtualNetworkSubnetUsages virtualNetworkSubnetUsages() {
}

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

0 comments on commit aa6e38f

Please sign in to comment.