Skip to content

Commit b77257b

Browse files
author
SDKAuto
committed
CodeGen from PR 19471 in Azure/azure-rest-api-specs
Merge 0fa44acca5f7df0d2872a3c9328cbaf1491f1ef9 into 2139e4c0f3a5df27ed4b08008c20d76410a58f91
1 parent a88aa28 commit b77257b

File tree

103 files changed

+1356
-770
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+1356
-770
lines changed

sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Release History
22

3-
## 1.0.0-beta.3 (Unreleased)
3+
## 1.0.0-beta.1 (2022-06-15)
4+
5+
- 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-2022-02. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
46

57
### Features Added
68

sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Azure Resource Manager SqlVirtualMachine client library for Java.
44

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

77
## We'd love to hear your feedback
88

@@ -32,7 +32,7 @@ Various documentation is available to help you get started
3232
<dependency>
3333
<groupId>com.azure.resourcemanager</groupId>
3434
<artifactId>azure-resourcemanager-sqlvirtualmachine</artifactId>
35-
<version>1.0.0-beta.2</version>
35+
<version>1.0.0-beta.3</version>
3636
</dependency>
3737
```
3838
[//]: # ({x-version-update-end})

sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/SAMPLE.md

Lines changed: 80 additions & 33 deletions
Large diffs are not rendered by default.

sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<packaging>jar</packaging>
1414

1515
<name>Microsoft Azure SDK for SqlVirtualMachine Management</name>
16-
<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>
16+
<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-2022-02.</description>
1717
<url>https://github.com/Azure/azure-sdk-for-java</url>
1818

1919
<licenses>

sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/SqlVirtualMachineManager.java

Lines changed: 61 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@
1010
import com.azure.core.http.HttpPipelineBuilder;
1111
import com.azure.core.http.HttpPipelinePosition;
1212
import com.azure.core.http.policy.AddDatePolicy;
13+
import com.azure.core.http.policy.AddHeadersFromContextPolicy;
1314
import com.azure.core.http.policy.HttpLogOptions;
1415
import com.azure.core.http.policy.HttpLoggingPolicy;
1516
import com.azure.core.http.policy.HttpPipelinePolicy;
1617
import com.azure.core.http.policy.HttpPolicyProviders;
1718
import com.azure.core.http.policy.RequestIdPolicy;
19+
import com.azure.core.http.policy.RetryOptions;
1820
import com.azure.core.http.policy.RetryPolicy;
1921
import com.azure.core.http.policy.UserAgentPolicy;
2022
import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy;
@@ -80,6 +82,19 @@ public static SqlVirtualMachineManager authenticate(TokenCredential credential,
8082
return configure().authenticate(credential, profile);
8183
}
8284

85+
/**
86+
* Creates an instance of SqlVirtualMachine service API entry point.
87+
*
88+
* @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential.
89+
* @param profile the Azure profile for client.
90+
* @return the SqlVirtualMachine service API instance.
91+
*/
92+
public static SqlVirtualMachineManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) {
93+
Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null.");
94+
Objects.requireNonNull(profile, "'profile' cannot be null.");
95+
return new SqlVirtualMachineManager(httpPipeline, profile, null);
96+
}
97+
8398
/**
8499
* Gets a Configurable instance that can be used to create SqlVirtualMachineManager with optional configuration.
85100
*
@@ -91,13 +106,14 @@ public static Configurable configure() {
91106

92107
/** The Configurable allowing configurations to be set. */
93108
public static final class Configurable {
94-
private final ClientLogger logger = new ClientLogger(Configurable.class);
109+
private static final ClientLogger LOGGER = new ClientLogger(Configurable.class);
95110

96111
private HttpClient httpClient;
97112
private HttpLogOptions httpLogOptions;
98113
private final List<HttpPipelinePolicy> policies = new ArrayList<>();
99114
private final List<String> scopes = new ArrayList<>();
100115
private RetryPolicy retryPolicy;
116+
private RetryOptions retryOptions;
101117
private Duration defaultPollInterval;
102118

103119
private Configurable() {
@@ -158,16 +174,31 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) {
158174
return this;
159175
}
160176

177+
/**
178+
* Sets the retry options for the HTTP pipeline retry policy.
179+
*
180+
* <p>This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}.
181+
*
182+
* @param retryOptions the retry options for the HTTP pipeline retry policy.
183+
* @return the configurable object itself.
184+
*/
185+
public Configurable withRetryOptions(RetryOptions retryOptions) {
186+
this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null.");
187+
return this;
188+
}
189+
161190
/**
162191
* Sets the default poll interval, used when service does not provide "Retry-After" header.
163192
*
164193
* @param defaultPollInterval the default poll interval.
165194
* @return the configurable object itself.
166195
*/
167196
public Configurable withDefaultPollInterval(Duration defaultPollInterval) {
168-
this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null.");
197+
this.defaultPollInterval =
198+
Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null.");
169199
if (this.defaultPollInterval.isNegative()) {
170-
throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative"));
200+
throw LOGGER
201+
.logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative"));
171202
}
172203
return this;
173204
}
@@ -189,7 +220,7 @@ public SqlVirtualMachineManager authenticate(TokenCredential credential, AzurePr
189220
.append("-")
190221
.append("com.azure.resourcemanager.sqlvirtualmachine")
191222
.append("/")
192-
.append("1.0.0-beta.2");
223+
.append("1.0.0-beta.1");
193224
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
194225
userAgentBuilder
195226
.append(" (")
@@ -207,10 +238,15 @@ public SqlVirtualMachineManager authenticate(TokenCredential credential, AzurePr
207238
scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default");
208239
}
209240
if (retryPolicy == null) {
210-
retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
241+
if (retryOptions != null) {
242+
retryPolicy = new RetryPolicy(retryOptions);
243+
} else {
244+
retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
245+
}
211246
}
212247
List<HttpPipelinePolicy> policies = new ArrayList<>();
213248
policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
249+
policies.add(new AddHeadersFromContextPolicy());
214250
policies.add(new RequestIdPolicy());
215251
policies
216252
.addAll(
@@ -241,7 +277,11 @@ public SqlVirtualMachineManager authenticate(TokenCredential credential, AzurePr
241277
}
242278
}
243279

244-
/** @return Resource collection API of AvailabilityGroupListeners. */
280+
/**
281+
* Gets the resource collection API of AvailabilityGroupListeners. It manages AvailabilityGroupListener.
282+
*
283+
* @return Resource collection API of AvailabilityGroupListeners.
284+
*/
245285
public AvailabilityGroupListeners availabilityGroupListeners() {
246286
if (this.availabilityGroupListeners == null) {
247287
this.availabilityGroupListeners =
@@ -250,15 +290,23 @@ public AvailabilityGroupListeners availabilityGroupListeners() {
250290
return availabilityGroupListeners;
251291
}
252292

253-
/** @return Resource collection API of Operations. */
293+
/**
294+
* Gets the resource collection API of Operations.
295+
*
296+
* @return Resource collection API of Operations.
297+
*/
254298
public Operations operations() {
255299
if (this.operations == null) {
256300
this.operations = new OperationsImpl(clientObject.getOperations(), this);
257301
}
258302
return operations;
259303
}
260304

261-
/** @return Resource collection API of SqlVirtualMachineGroups. */
305+
/**
306+
* Gets the resource collection API of SqlVirtualMachineGroups. It manages SqlVirtualMachineGroup.
307+
*
308+
* @return Resource collection API of SqlVirtualMachineGroups.
309+
*/
262310
public SqlVirtualMachineGroups sqlVirtualMachineGroups() {
263311
if (this.sqlVirtualMachineGroups == null) {
264312
this.sqlVirtualMachineGroups =
@@ -267,7 +315,11 @@ public SqlVirtualMachineGroups sqlVirtualMachineGroups() {
267315
return sqlVirtualMachineGroups;
268316
}
269317

270-
/** @return Resource collection API of SqlVirtualMachines. */
318+
/**
319+
* Gets the resource collection API of SqlVirtualMachines. It manages SqlVirtualMachine.
320+
*
321+
* @return Resource collection API of SqlVirtualMachines.
322+
*/
271323
public SqlVirtualMachines sqlVirtualMachines() {
272324
if (this.sqlVirtualMachines == null) {
273325
this.sqlVirtualMachines = new SqlVirtualMachinesImpl(clientObject.getSqlVirtualMachines(), this);

sdk/sqlvirtualmachine/azure-resourcemanager-sqlvirtualmachine/src/main/java/com/azure/resourcemanager/sqlvirtualmachine/fluent/SqlVirtualMachinesClient.java

Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -70,63 +70,6 @@ PagedIterable<SqlVirtualMachineInner> listBySqlVmGroup(
7070
@ServiceMethod(returns = ReturnType.COLLECTION)
7171
PagedIterable<SqlVirtualMachineInner> list(Context context);
7272

73-
/**
74-
* Uninstalls and reinstalls the SQL Iaas Extension.
75-
*
76-
* @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from
77-
* the Azure Resource Manager API or the portal.
78-
* @param sqlVirtualMachineName Name of the SQL virtual machine.
79-
* @throws IllegalArgumentException thrown if parameters fail the validation.
80-
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
81-
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
82-
* @return the {@link SyncPoller} for polling of long-running operation.
83-
*/
84-
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
85-
SyncPoller<PollResult<Void>, Void> beginRedeploy(String resourceGroupName, String sqlVirtualMachineName);
86-
87-
/**
88-
* Uninstalls and reinstalls the SQL Iaas Extension.
89-
*
90-
* @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from
91-
* the Azure Resource Manager API or the portal.
92-
* @param sqlVirtualMachineName Name of the SQL virtual machine.
93-
* @param context The context to associate with this operation.
94-
* @throws IllegalArgumentException thrown if parameters fail the validation.
95-
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
96-
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
97-
* @return the {@link SyncPoller} for polling of long-running operation.
98-
*/
99-
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
100-
SyncPoller<PollResult<Void>, Void> beginRedeploy(
101-
String resourceGroupName, String sqlVirtualMachineName, Context context);
102-
103-
/**
104-
* Uninstalls and reinstalls the SQL Iaas Extension.
105-
*
106-
* @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from
107-
* the Azure Resource Manager API or the portal.
108-
* @param sqlVirtualMachineName Name of the SQL virtual machine.
109-
* @throws IllegalArgumentException thrown if parameters fail the validation.
110-
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
111-
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
112-
*/
113-
@ServiceMethod(returns = ReturnType.SINGLE)
114-
void redeploy(String resourceGroupName, String sqlVirtualMachineName);
115-
116-
/**
117-
* Uninstalls and reinstalls the SQL Iaas Extension.
118-
*
119-
* @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from
120-
* the Azure Resource Manager API or the portal.
121-
* @param sqlVirtualMachineName Name of the SQL virtual machine.
122-
* @param context The context to associate with this operation.
123-
* @throws IllegalArgumentException thrown if parameters fail the validation.
124-
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
125-
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
126-
*/
127-
@ServiceMethod(returns = ReturnType.SINGLE)
128-
void redeploy(String resourceGroupName, String sqlVirtualMachineName, Context context);
129-
13073
/**
13174
* Gets a SQL virtual machine.
13275
*
@@ -374,6 +317,63 @@ SqlVirtualMachineInner update(
374317
@ServiceMethod(returns = ReturnType.COLLECTION)
375318
PagedIterable<SqlVirtualMachineInner> listByResourceGroup(String resourceGroupName, Context context);
376319

320+
/**
321+
* Uninstalls and reinstalls the SQL Iaas Extension.
322+
*
323+
* @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from
324+
* the Azure Resource Manager API or the portal.
325+
* @param sqlVirtualMachineName Name of the SQL virtual machine.
326+
* @throws IllegalArgumentException thrown if parameters fail the validation.
327+
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
328+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
329+
* @return the {@link SyncPoller} for polling of long-running operation.
330+
*/
331+
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
332+
SyncPoller<PollResult<Void>, Void> beginRedeploy(String resourceGroupName, String sqlVirtualMachineName);
333+
334+
/**
335+
* Uninstalls and reinstalls the SQL Iaas Extension.
336+
*
337+
* @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from
338+
* the Azure Resource Manager API or the portal.
339+
* @param sqlVirtualMachineName Name of the SQL virtual machine.
340+
* @param context The context to associate with this operation.
341+
* @throws IllegalArgumentException thrown if parameters fail the validation.
342+
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
343+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
344+
* @return the {@link SyncPoller} for polling of long-running operation.
345+
*/
346+
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
347+
SyncPoller<PollResult<Void>, Void> beginRedeploy(
348+
String resourceGroupName, String sqlVirtualMachineName, Context context);
349+
350+
/**
351+
* Uninstalls and reinstalls the SQL Iaas Extension.
352+
*
353+
* @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from
354+
* the Azure Resource Manager API or the portal.
355+
* @param sqlVirtualMachineName Name of the SQL virtual machine.
356+
* @throws IllegalArgumentException thrown if parameters fail the validation.
357+
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
358+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
359+
*/
360+
@ServiceMethod(returns = ReturnType.SINGLE)
361+
void redeploy(String resourceGroupName, String sqlVirtualMachineName);
362+
363+
/**
364+
* Uninstalls and reinstalls the SQL Iaas Extension.
365+
*
366+
* @param resourceGroupName Name of the resource group that contains the resource. You can obtain this value from
367+
* the Azure Resource Manager API or the portal.
368+
* @param sqlVirtualMachineName Name of the SQL virtual machine.
369+
* @param context The context to associate with this operation.
370+
* @throws IllegalArgumentException thrown if parameters fail the validation.
371+
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
372+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
373+
*/
374+
@ServiceMethod(returns = ReturnType.SINGLE)
375+
void redeploy(String resourceGroupName, String sqlVirtualMachineName, Context context);
376+
377377
/**
378378
* Starts Assessment on SQL virtual machine.
379379
*

0 commit comments

Comments
 (0)