Skip to content

Commit

Permalink
CodeGen from PR 18838 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 4913674bacd0320a4999e7f27f04819f9162f482 into d7216e49a7b0d5a7e15f77c4bab753208bf7870d
  • Loading branch information
SDKAuto committed May 24, 2022
1 parent 8d5049c commit ecc5357
Show file tree
Hide file tree
Showing 79 changed files with 382 additions and 346 deletions.
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-05-24)

- 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).

### Features Added

Expand Down
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -353,13 +353,14 @@ public final class SqlVirtualMachineGroupsUpdateSamples {

```java
import com.azure.resourcemanager.sqlvirtualmachine.models.AdditionalFeaturesServerConfigurations;
import com.azure.resourcemanager.sqlvirtualmachine.models.AssessmentDayOfWeek;
import com.azure.resourcemanager.sqlvirtualmachine.models.AssessmentSettings;
import com.azure.resourcemanager.sqlvirtualmachine.models.AutoBackupDaysOfWeek;
import com.azure.resourcemanager.sqlvirtualmachine.models.AutoBackupSettings;
import com.azure.resourcemanager.sqlvirtualmachine.models.AutoPatchingSettings;
import com.azure.resourcemanager.sqlvirtualmachine.models.BackupScheduleType;
import com.azure.resourcemanager.sqlvirtualmachine.models.ConnectivityType;
import com.azure.resourcemanager.sqlvirtualmachine.models.DayOfWeek;
import com.azure.resourcemanager.sqlvirtualmachine.models.DaysOfWeek;
import com.azure.resourcemanager.sqlvirtualmachine.models.DiskConfigurationType;
import com.azure.resourcemanager.sqlvirtualmachine.models.FullBackupFrequencyType;
import com.azure.resourcemanager.sqlvirtualmachine.models.KeyVaultCredentialSettings;
Expand Down Expand Up @@ -473,7 +474,7 @@ public final class SqlVirtualMachinesCreateOrUpdateSamples {
.withBackupSystemDbs(true)
.withBackupScheduleType(BackupScheduleType.MANUAL)
.withFullBackupFrequency(FullBackupFrequencyType.WEEKLY)
.withDaysOfWeek(Arrays.asList(DaysOfWeek.MONDAY, DaysOfWeek.FRIDAY))
.withDaysOfWeek(Arrays.asList(AutoBackupDaysOfWeek.MONDAY, AutoBackupDaysOfWeek.FRIDAY))
.withFullBackupStartTime(6)
.withFullBackupWindowHours(11)
.withLogBackupFrequency(10))
Expand Down Expand Up @@ -611,7 +612,7 @@ public final class SqlVirtualMachinesCreateOrUpdateSamples {
new Schedule()
.withEnable(true)
.withWeeklyInterval(1)
.withDayOfWeek(DayOfWeek.SUNDAY)
.withDayOfWeek(AssessmentDayOfWeek.SUNDAY)
.withStartTime("23:17")))
.create();
}
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 @@ -7,18 +7,14 @@
import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.core.management.SystemData;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.sqlvirtualmachine.models.AgConfiguration;
import com.azure.resourcemanager.sqlvirtualmachine.models.LoadBalancerConfiguration;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** A SQL Server availability group listener. */
@Fluent
public final class AvailabilityGroupListenerInner extends ProxyResource {
@JsonIgnore private final ClientLogger logger = new ClientLogger(AvailabilityGroupListenerInner.class);

/*
* Resource properties.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,14 @@
package com.azure.resourcemanager.sqlvirtualmachine.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.sqlvirtualmachine.models.AgConfiguration;
import com.azure.resourcemanager.sqlvirtualmachine.models.LoadBalancerConfiguration;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** The properties of an availability group listener. */
@Fluent
public final class AvailabilityGroupListenerProperties {
@JsonIgnore private final ClientLogger logger = new ClientLogger(AvailabilityGroupListenerProperties.class);

/*
* Provisioning state to track the async operation status.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,15 @@
package com.azure.resourcemanager.sqlvirtualmachine.fluent.models;

import com.azure.core.annotation.Immutable;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.sqlvirtualmachine.models.OperationDisplay;
import com.azure.resourcemanager.sqlvirtualmachine.models.OperationOrigin;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** SQL REST API operation definition. */
@Immutable
public final class OperationInner {
@JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class);

/*
* The name of the operation being performed on this particular object.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,17 @@
import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
import com.azure.core.management.SystemData;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.sqlvirtualmachine.models.ClusterConfiguration;
import com.azure.resourcemanager.sqlvirtualmachine.models.ClusterManagerType;
import com.azure.resourcemanager.sqlvirtualmachine.models.ScaleType;
import com.azure.resourcemanager.sqlvirtualmachine.models.SqlVmGroupImageSku;
import com.azure.resourcemanager.sqlvirtualmachine.models.WsfcDomainProfile;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** A SQL virtual machine group. */
@Fluent
public final class SqlVirtualMachineGroupInner extends Resource {
@JsonIgnore private final ClientLogger logger = new ClientLogger(SqlVirtualMachineGroupInner.class);

/*
* Resource properties.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,16 @@
package com.azure.resourcemanager.sqlvirtualmachine.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.sqlvirtualmachine.models.ClusterConfiguration;
import com.azure.resourcemanager.sqlvirtualmachine.models.ClusterManagerType;
import com.azure.resourcemanager.sqlvirtualmachine.models.ScaleType;
import com.azure.resourcemanager.sqlvirtualmachine.models.SqlVmGroupImageSku;
import com.azure.resourcemanager.sqlvirtualmachine.models.WsfcDomainProfile;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;

/** The properties of a SQL virtual machine group. */
@Fluent
public final class SqlVirtualMachineGroupProperties {
@JsonIgnore private final ClientLogger logger = new ClientLogger(SqlVirtualMachineGroupProperties.class);

/*
* Provisioning state to track the async operation status.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
import com.azure.core.management.SystemData;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.sqlvirtualmachine.models.AssessmentSettings;
import com.azure.resourcemanager.sqlvirtualmachine.models.AutoBackupSettings;
import com.azure.resourcemanager.sqlvirtualmachine.models.AutoPatchingSettings;
Expand All @@ -19,15 +18,12 @@
import com.azure.resourcemanager.sqlvirtualmachine.models.SqlServerLicenseType;
import com.azure.resourcemanager.sqlvirtualmachine.models.StorageConfigurationSettings;
import com.azure.resourcemanager.sqlvirtualmachine.models.WsfcDomainCredentials;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** A SQL virtual machine. */
@Fluent
public final class SqlVirtualMachineInner extends Resource {
@JsonIgnore private final ClientLogger logger = new ClientLogger(SqlVirtualMachineInner.class);

/*
* Azure Active Directory identity of the server.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
package com.azure.resourcemanager.sqlvirtualmachine.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.sqlvirtualmachine.models.AssessmentSettings;
import com.azure.resourcemanager.sqlvirtualmachine.models.AutoBackupSettings;
import com.azure.resourcemanager.sqlvirtualmachine.models.AutoPatchingSettings;
Expand All @@ -16,14 +15,11 @@
import com.azure.resourcemanager.sqlvirtualmachine.models.SqlServerLicenseType;
import com.azure.resourcemanager.sqlvirtualmachine.models.StorageConfigurationSettings;
import com.azure.resourcemanager.sqlvirtualmachine.models.WsfcDomainCredentials;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;

/** The SQL virtual machine properties. */
@Fluent
public final class SqlVirtualMachineProperties {
@JsonIgnore private final ClientLogger logger = new ClientLogger(SqlVirtualMachineProperties.class);

/*
* ARM Resource id of underlying virtual machine created from SQL
* marketplace image.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ public AgConfiguration availabilityGroupConfiguration() {
return this.innerModel().availabilityGroupConfiguration();
}

public String resourceGroupName() {
return resourceGroupName;
}

public AvailabilityGroupListenerInner innerModel() {
return this.innerObject;
}
Expand Down
Loading

0 comments on commit ecc5357

Please sign in to comment.