Skip to content

Commit 7cce843

Browse files
author
SDKAuto
committed
CodeGen from PR 18588 in Azure/azure-rest-api-specs
Merge a0bb50ed086a5a14e0999a579475e7ab056104f0 into e7d2d8c48cf6f8f63de7e252c467930449b5fd88
1 parent ada9824 commit 7cce843

File tree

121 files changed

+7890
-805
lines changed

Some content is hidden

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

121 files changed

+7890
-805
lines changed

sdk/azurearcdata/azure-resourcemanager-azurearcdata/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-04-07)
4+
5+
- Azure Resource Manager AzureArcData client library for Java. This package contains Microsoft Azure SDK for AzureArcData Management SDK. The AzureArcData management API provides a RESTful set of web APIs to manage Azure Data Services on Azure Arc Resources. Package tag package-preview-2022-03. 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/azurearcdata/azure-resourcemanager-azurearcdata/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 AzureArcData client library for Java.
44

5-
This package contains Microsoft Azure SDK for AzureArcData Management SDK. The AzureArcData management API provides a RESTful set of web APIs to manage Azure Data Services on Azure Arc Resources. Package tag package-2021-08-01. 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 AzureArcData Management SDK. The AzureArcData management API provides a RESTful set of web APIs to manage Azure Data Services on Azure Arc Resources. Package tag package-preview-2022-03. 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-azurearcdata</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/azurearcdata/azure-resourcemanager-azurearcdata/SAMPLE.md

Lines changed: 361 additions & 24 deletions
Large diffs are not rendered by default.

sdk/azurearcdata/azure-resourcemanager-azurearcdata/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 AzureArcData Management</name>
16-
<description>This package contains Microsoft Azure SDK for AzureArcData Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The AzureArcData management API provides a RESTful set of web APIs to manage Azure Data Services on Azure Arc Resources. Package tag package-2021-08-01.</description>
16+
<description>This package contains Microsoft Azure SDK for AzureArcData Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The AzureArcData management API provides a RESTful set of web APIs to manage Azure Data Services on Azure Arc Resources. Package tag package-preview-2022-03.</description>
1717
<url>https://github.com/Azure/azure-sdk-for-java</url>
1818

1919
<licenses>

sdk/azurearcdata/azure-resourcemanager-azurearcdata/src/main/java/com/azure/resourcemanager/azurearcdata/AzureArcDataManager.java

Lines changed: 82 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,41 @@
88
import com.azure.core.http.HttpClient;
99
import com.azure.core.http.HttpPipeline;
1010
import com.azure.core.http.HttpPipelineBuilder;
11+
import com.azure.core.http.HttpPipelinePosition;
1112
import com.azure.core.http.policy.AddDatePolicy;
13+
import com.azure.core.http.policy.AddHeadersFromContextPolicy;
1214
import com.azure.core.http.policy.HttpLogOptions;
1315
import com.azure.core.http.policy.HttpLoggingPolicy;
1416
import com.azure.core.http.policy.HttpPipelinePolicy;
1517
import com.azure.core.http.policy.HttpPolicyProviders;
1618
import com.azure.core.http.policy.RequestIdPolicy;
19+
import com.azure.core.http.policy.RetryOptions;
1720
import com.azure.core.http.policy.RetryPolicy;
1821
import com.azure.core.http.policy.UserAgentPolicy;
1922
import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy;
2023
import com.azure.core.management.profile.AzureProfile;
2124
import com.azure.core.util.Configuration;
2225
import com.azure.core.util.logging.ClientLogger;
2326
import com.azure.resourcemanager.azurearcdata.fluent.AzureArcDataManagementClient;
27+
import com.azure.resourcemanager.azurearcdata.implementation.ActiveDirectoryConnectorsImpl;
2428
import com.azure.resourcemanager.azurearcdata.implementation.AzureArcDataManagementClientBuilder;
2529
import com.azure.resourcemanager.azurearcdata.implementation.DataControllersImpl;
2630
import com.azure.resourcemanager.azurearcdata.implementation.OperationsImpl;
31+
import com.azure.resourcemanager.azurearcdata.implementation.PostgresInstancesImpl;
2732
import com.azure.resourcemanager.azurearcdata.implementation.SqlManagedInstancesImpl;
2833
import com.azure.resourcemanager.azurearcdata.implementation.SqlServerInstancesImpl;
34+
import com.azure.resourcemanager.azurearcdata.models.ActiveDirectoryConnectors;
2935
import com.azure.resourcemanager.azurearcdata.models.DataControllers;
3036
import com.azure.resourcemanager.azurearcdata.models.Operations;
37+
import com.azure.resourcemanager.azurearcdata.models.PostgresInstances;
3138
import com.azure.resourcemanager.azurearcdata.models.SqlManagedInstances;
3239
import com.azure.resourcemanager.azurearcdata.models.SqlServerInstances;
3340
import java.time.Duration;
3441
import java.time.temporal.ChronoUnit;
3542
import java.util.ArrayList;
3643
import java.util.List;
3744
import java.util.Objects;
45+
import java.util.stream.Collectors;
3846

3947
/**
4048
* Entry point to AzureArcDataManager. The AzureArcData management API provides a RESTful set of web APIs to manage
@@ -49,6 +57,10 @@ public final class AzureArcDataManager {
4957

5058
private DataControllers dataControllers;
5159

60+
private ActiveDirectoryConnectors activeDirectoryConnectors;
61+
62+
private PostgresInstances postgresInstances;
63+
5264
private final AzureArcDataManagementClient clientObject;
5365

5466
private AzureArcDataManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) {
@@ -76,6 +88,19 @@ public static AzureArcDataManager authenticate(TokenCredential credential, Azure
7688
return configure().authenticate(credential, profile);
7789
}
7890

91+
/**
92+
* Creates an instance of AzureArcData service API entry point.
93+
*
94+
* @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential.
95+
* @param profile the Azure profile for client.
96+
* @return the AzureArcData service API instance.
97+
*/
98+
public static AzureArcDataManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) {
99+
Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null.");
100+
Objects.requireNonNull(profile, "'profile' cannot be null.");
101+
return new AzureArcDataManager(httpPipeline, profile, null);
102+
}
103+
79104
/**
80105
* Gets a Configurable instance that can be used to create AzureArcDataManager with optional configuration.
81106
*
@@ -87,13 +112,14 @@ public static Configurable configure() {
87112

88113
/** The Configurable allowing configurations to be set. */
89114
public static final class Configurable {
90-
private final ClientLogger logger = new ClientLogger(Configurable.class);
115+
private static final ClientLogger LOGGER = new ClientLogger(Configurable.class);
91116

92117
private HttpClient httpClient;
93118
private HttpLogOptions httpLogOptions;
94119
private final List<HttpPipelinePolicy> policies = new ArrayList<>();
95120
private final List<String> scopes = new ArrayList<>();
96121
private RetryPolicy retryPolicy;
122+
private RetryOptions retryOptions;
97123
private Duration defaultPollInterval;
98124

99125
private Configurable() {
@@ -154,16 +180,31 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) {
154180
return this;
155181
}
156182

183+
/**
184+
* Sets the retry options for the HTTP pipeline retry policy.
185+
*
186+
* <p>This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}.
187+
*
188+
* @param retryOptions the retry options for the HTTP pipeline retry policy.
189+
* @return the configurable object itself.
190+
*/
191+
public Configurable withRetryOptions(RetryOptions retryOptions) {
192+
this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null.");
193+
return this;
194+
}
195+
157196
/**
158197
* Sets the default poll interval, used when service does not provide "Retry-After" header.
159198
*
160199
* @param defaultPollInterval the default poll interval.
161200
* @return the configurable object itself.
162201
*/
163202
public Configurable withDefaultPollInterval(Duration defaultPollInterval) {
164-
this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null.");
203+
this.defaultPollInterval =
204+
Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null.");
165205
if (this.defaultPollInterval.isNegative()) {
166-
throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative"));
206+
throw LOGGER
207+
.logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative"));
167208
}
168209
return this;
169210
}
@@ -185,7 +226,7 @@ public AzureArcDataManager authenticate(TokenCredential credential, AzureProfile
185226
.append("-")
186227
.append("com.azure.resourcemanager.azurearcdata")
187228
.append("/")
188-
.append("1.0.0-beta.2");
229+
.append("1.0.0-beta.1");
189230
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
190231
userAgentBuilder
191232
.append(" (")
@@ -203,16 +244,34 @@ public AzureArcDataManager authenticate(TokenCredential credential, AzureProfile
203244
scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default");
204245
}
205246
if (retryPolicy == null) {
206-
retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
247+
if (retryOptions != null) {
248+
retryPolicy = new RetryPolicy(retryOptions);
249+
} else {
250+
retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
251+
}
207252
}
208253
List<HttpPipelinePolicy> policies = new ArrayList<>();
209254
policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
255+
policies.add(new AddHeadersFromContextPolicy());
210256
policies.add(new RequestIdPolicy());
257+
policies
258+
.addAll(
259+
this
260+
.policies
261+
.stream()
262+
.filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
263+
.collect(Collectors.toList()));
211264
HttpPolicyProviders.addBeforeRetryPolicies(policies);
212265
policies.add(retryPolicy);
213266
policies.add(new AddDatePolicy());
214267
policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0])));
215-
policies.addAll(this.policies);
268+
policies
269+
.addAll(
270+
this
271+
.policies
272+
.stream()
273+
.filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
274+
.collect(Collectors.toList()));
216275
HttpPolicyProviders.addAfterRetryPolicies(policies);
217276
policies.add(new HttpLoggingPolicy(httpLogOptions));
218277
HttpPipeline httpPipeline =
@@ -256,6 +315,23 @@ public DataControllers dataControllers() {
256315
return dataControllers;
257316
}
258317

318+
/** @return Resource collection API of ActiveDirectoryConnectors. */
319+
public ActiveDirectoryConnectors activeDirectoryConnectors() {
320+
if (this.activeDirectoryConnectors == null) {
321+
this.activeDirectoryConnectors =
322+
new ActiveDirectoryConnectorsImpl(clientObject.getActiveDirectoryConnectors(), this);
323+
}
324+
return activeDirectoryConnectors;
325+
}
326+
327+
/** @return Resource collection API of PostgresInstances. */
328+
public PostgresInstances postgresInstances() {
329+
if (this.postgresInstances == null) {
330+
this.postgresInstances = new PostgresInstancesImpl(clientObject.getPostgresInstances(), this);
331+
}
332+
return postgresInstances;
333+
}
334+
259335
/**
260336
* @return Wrapped service client AzureArcDataManagementClient providing direct access to the underlying
261337
* auto-generated API implementation, based on Azure REST API.

0 commit comments

Comments
 (0)