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-sqlvirtualmachine] Maulik/mfe stable changes #1713

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.0.0-beta.3 (Unreleased)
## 1.0.0-beta.1 (2022-08-31)

- Azure Resource Manager SqlVirtualMachine client library for Java. This package contains Microsoft Azure SDK for SqlVirtualMachine Management SDK. The SQL virtual machine management API provides a RESTful set of web APIs that interact with Azure Compute, Network & Storage services to manage your SQL Server virtual machine. The API enables users to create, delete and retrieve a SQL virtual machine, SQL virtual machine group or availability group listener. Package tag package-preview-2022-07. 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 SqlVirtualMachine client library for Java.

This package contains Microsoft Azure SDK for SqlVirtualMachine Management SDK. The SQL virtual machine management API provides a RESTful set of web APIs that interact with Azure Compute, Network & Storage services to manage your SQL Server virtual machine. The API enables users to create, delete and retrieve a SQL virtual machine, SQL virtual machine group or availability group listener. Package tag package-preview-2021-11. 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 SqlVirtualMachine Management SDK. The SQL virtual machine management API provides a RESTful set of web APIs that interact with Azure Compute, Network & Storage services to manage your SQL Server virtual machine. The API enables users to create, delete and retrieve a SQL virtual machine, SQL virtual machine group or availability group listener. Package tag package-preview-2022-07. 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-sqlvirtualmachine</artifactId>
<version>1.0.0-beta.2</version>
<version>1.0.0-beta.3</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down

Large diffs are not rendered by default.

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

<name>Microsoft Azure SDK for SqlVirtualMachine Management</name>
<description>This package contains Microsoft Azure SDK for SqlVirtualMachine Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The SQL virtual machine management API provides a RESTful set of web APIs that interact with Azure Compute, Network &amp; Storage services to manage your SQL Server virtual machine. The API enables users to create, delete and retrieve a SQL virtual machine, SQL virtual machine group or availability group listener. Package tag package-preview-2021-11.</description>
<description>This package contains Microsoft Azure SDK for SqlVirtualMachine Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The SQL virtual machine management API provides a RESTful set of web APIs that interact with Azure Compute, Network &amp; Storage services to manage your SQL Server virtual machine. The API enables users to create, delete and retrieve a SQL virtual machine, SQL virtual machine group or availability group listener. Package tag package-preview-2022-07.</description>
<url>https://github.com/Azure/azure-sdk-for-java</url>

<licenses>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
import com.azure.core.http.HttpPipelineBuilder;
import com.azure.core.http.HttpPipelinePosition;
import com.azure.core.http.policy.AddDatePolicy;
import com.azure.core.http.policy.AddHeadersFromContextPolicy;
import com.azure.core.http.policy.HttpLogOptions;
import com.azure.core.http.policy.HttpLoggingPolicy;
import com.azure.core.http.policy.HttpPipelinePolicy;
import com.azure.core.http.policy.HttpPolicyProviders;
import com.azure.core.http.policy.RequestIdPolicy;
import com.azure.core.http.policy.RetryOptions;
import com.azure.core.http.policy.RetryPolicy;
import com.azure.core.http.policy.UserAgentPolicy;
import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy;
Expand Down Expand Up @@ -80,6 +82,19 @@ public static SqlVirtualMachineManager authenticate(TokenCredential credential,
return configure().authenticate(credential, profile);
}

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

/**
* Gets a Configurable instance that can be used to create SqlVirtualMachineManager with optional configuration.
*
Expand All @@ -91,13 +106,14 @@ public static Configurable configure() {

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

private HttpClient httpClient;
private HttpLogOptions httpLogOptions;
private final List<HttpPipelinePolicy> policies = new ArrayList<>();
private final List<String> scopes = new ArrayList<>();
private RetryPolicy retryPolicy;
private RetryOptions retryOptions;
private Duration defaultPollInterval;

private Configurable() {
Expand Down Expand Up @@ -158,16 +174,31 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) {
return this;
}

/**
* 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)}.
*
* @param retryOptions the retry options for the HTTP pipeline retry policy.
* @return the configurable object itself.
*/
public Configurable withRetryOptions(RetryOptions retryOptions) {
this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null.");
return this;
}

/**
* Sets the default poll interval, used when service does not provide "Retry-After" header.
*
* @param defaultPollInterval the default poll interval.
* @return the configurable object itself.
*/
public Configurable withDefaultPollInterval(Duration defaultPollInterval) {
this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null.");
this.defaultPollInterval =
Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null.");
if (this.defaultPollInterval.isNegative()) {
throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative"));
throw LOGGER
.logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative"));
}
return this;
}
Expand All @@ -189,7 +220,7 @@ public SqlVirtualMachineManager authenticate(TokenCredential credential, AzurePr
.append("-")
.append("com.azure.resourcemanager.sqlvirtualmachine")
.append("/")
.append("1.0.0-beta.2");
.append("1.0.0-beta.1");
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
userAgentBuilder
.append(" (")
Expand All @@ -207,10 +238,15 @@ public SqlVirtualMachineManager authenticate(TokenCredential credential, AzurePr
scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default");
}
if (retryPolicy == null) {
retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
if (retryOptions != null) {
retryPolicy = new RetryPolicy(retryOptions);
} else {
retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
}
}
List<HttpPipelinePolicy> policies = new ArrayList<>();
policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
policies.add(new AddHeadersFromContextPolicy());
policies.add(new RequestIdPolicy());
policies
.addAll(
Expand Down Expand Up @@ -241,7 +277,11 @@ public SqlVirtualMachineManager authenticate(TokenCredential credential, AzurePr
}
}

/** @return Resource collection API of AvailabilityGroupListeners. */
/**
* Gets the resource collection API of AvailabilityGroupListeners. It manages AvailabilityGroupListener.
*
* @return Resource collection API of AvailabilityGroupListeners.
*/
public AvailabilityGroupListeners availabilityGroupListeners() {
if (this.availabilityGroupListeners == null) {
this.availabilityGroupListeners =
Expand All @@ -250,15 +290,23 @@ public AvailabilityGroupListeners availabilityGroupListeners() {
return availabilityGroupListeners;
}

/** @return Resource collection API of Operations. */
/**
* Gets the resource collection API of Operations.
*
* @return Resource collection API of Operations.
*/
public Operations operations() {
if (this.operations == null) {
this.operations = new OperationsImpl(clientObject.getOperations(), this);
}
return operations;
}

/** @return Resource collection API of SqlVirtualMachineGroups. */
/**
* Gets the resource collection API of SqlVirtualMachineGroups. It manages SqlVirtualMachineGroup.
*
* @return Resource collection API of SqlVirtualMachineGroups.
*/
public SqlVirtualMachineGroups sqlVirtualMachineGroups() {
if (this.sqlVirtualMachineGroups == null) {
this.sqlVirtualMachineGroups =
Expand All @@ -267,7 +315,11 @@ public SqlVirtualMachineGroups sqlVirtualMachineGroups() {
return sqlVirtualMachineGroups;
}

/** @return Resource collection API of SqlVirtualMachines. */
/**
* Gets the resource collection API of SqlVirtualMachines. It manages SqlVirtualMachine.
*
* @return Resource collection API of SqlVirtualMachines.
*/
public SqlVirtualMachines sqlVirtualMachines() {
if (this.sqlVirtualMachines == null) {
this.sqlVirtualMachines = new SqlVirtualMachinesImpl(clientObject.getSqlVirtualMachines(), this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,63 @@ PagedIterable<SqlVirtualMachineInner> listBySqlVmGroup(
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<SqlVirtualMachineInner> list(Context context);

/**
* Starts Assessment on SQL virtual machine.
*
* @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from
* the Azure Resource Manager API or the portal.
* @param sqlVirtualMachineName Name of the SQL virtual machine.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<Void>, Void> beginStartAssessment(String resourceGroupName, String sqlVirtualMachineName);

/**
* Starts Assessment on SQL virtual machine.
*
* @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from
* the Azure Resource Manager API or the portal.
* @param sqlVirtualMachineName Name of the SQL virtual machine.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<Void>, Void> beginStartAssessment(
String resourceGroupName, String sqlVirtualMachineName, Context context);

/**
* Starts Assessment on SQL virtual machine.
*
* @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from
* the Azure Resource Manager API or the portal.
* @param sqlVirtualMachineName Name of the SQL virtual machine.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
void startAssessment(String resourceGroupName, String sqlVirtualMachineName);

/**
* Starts Assessment on SQL virtual machine.
*
* @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from
* the Azure Resource Manager API or the portal.
* @param sqlVirtualMachineName Name of the SQL virtual machine.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
void startAssessment(String resourceGroupName, String sqlVirtualMachineName, Context context);

/**
* Uninstalls and reinstalls the SQL Iaas Extension.
*
Expand Down Expand Up @@ -373,61 +430,4 @@ SqlVirtualMachineInner update(
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<SqlVirtualMachineInner> listByResourceGroup(String resourceGroupName, Context context);

/**
* Starts Assessment on SQL virtual machine.
*
* @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from
* the Azure Resource Manager API or the portal.
* @param sqlVirtualMachineName Name of the SQL virtual machine.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<Void>, Void> beginStartAssessment(String resourceGroupName, String sqlVirtualMachineName);

/**
* Starts Assessment on SQL virtual machine.
*
* @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from
* the Azure Resource Manager API or the portal.
* @param sqlVirtualMachineName Name of the SQL virtual machine.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<Void>, Void> beginStartAssessment(
String resourceGroupName, String sqlVirtualMachineName, Context context);

/**
* Starts Assessment on SQL virtual machine.
*
* @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from
* the Azure Resource Manager API or the portal.
* @param sqlVirtualMachineName Name of the SQL virtual machine.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
void startAssessment(String resourceGroupName, String sqlVirtualMachineName);

/**
* Starts Assessment on SQL virtual machine.
*
* @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from
* the Azure Resource Manager API or the portal.
* @param sqlVirtualMachineName Name of the SQL virtual machine.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
void startAssessment(String resourceGroupName, String sqlVirtualMachineName, Context context);
}
Loading