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-batch] Dev/matyang/connection #13008

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
3 changes: 2 additions & 1 deletion sdk/batch/azure-resourcemanager-batch/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Release History

## 1.0.0-beta.3 (Unreleased)
## 1.0.0-beta.1 (2022-03-01)

- Azure Resource Manager Batch client library for Java. This package contains Microsoft Azure SDK for Batch Management SDK. Batch Client. Package tag package-2021-06. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).

## 1.0.0-beta.2 (2021-07-29)

Expand Down
4 changes: 2 additions & 2 deletions sdk/batch/azure-resourcemanager-batch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Azure Resource Manager Batch client library for Java.

This package contains Microsoft Azure SDK for Batch Management SDK. Package tag package-2021-06. 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 Batch Management SDK. Batch Client. Package tag package-2021-06. 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-batch</artifactId>
<version>1.0.0-beta.2</version>
<version>1.0.0-beta.3</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down
2,003 changes: 1,938 additions & 65 deletions sdk/batch/azure-resourcemanager-batch/SAMPLE.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion sdk/batch/azure-resourcemanager-batch/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<packaging>jar</packaging>

<name>Microsoft Azure SDK for Batch Management</name>
<description>This package contains Microsoft Azure SDK for Batch Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2021-06.</description>
<description>This package contains Microsoft Azure SDK for Batch Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Batch Client. Package tag package-2021-06.</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 @@ -8,6 +8,7 @@
import com.azure.core.http.HttpClient;
import com.azure.core.http.HttpPipeline;
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.HttpLogOptions;
import com.azure.core.http.policy.HttpLoggingPolicy;
Expand All @@ -20,11 +21,11 @@
import com.azure.core.management.profile.AzureProfile;
import com.azure.core.util.Configuration;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.batch.fluent.BatchManagement;
import com.azure.resourcemanager.batch.fluent.BatchManagementClient;
import com.azure.resourcemanager.batch.implementation.ApplicationPackagesImpl;
import com.azure.resourcemanager.batch.implementation.ApplicationsImpl;
import com.azure.resourcemanager.batch.implementation.BatchAccountsImpl;
import com.azure.resourcemanager.batch.implementation.BatchManagementBuilder;
import com.azure.resourcemanager.batch.implementation.BatchManagementClientBuilder;
import com.azure.resourcemanager.batch.implementation.CertificatesImpl;
import com.azure.resourcemanager.batch.implementation.LocationsImpl;
import com.azure.resourcemanager.batch.implementation.OperationsImpl;
Expand All @@ -45,8 +46,9 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;

/** Entry point to BatchManager. */
/** Entry point to BatchManager. Batch Client. */
public final class BatchManager {
private BatchAccounts batchAccounts;

Expand All @@ -66,13 +68,13 @@ public final class BatchManager {

private Pools pools;

private final BatchManagement clientObject;
private final BatchManagementClient clientObject;

private BatchManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) {
Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null.");
Objects.requireNonNull(profile, "'profile' cannot be null.");
this.clientObject =
new BatchManagementBuilder()
new BatchManagementClientBuilder()
.pipeline(httpPipeline)
.endpoint(profile.getEnvironment().getResourceManagerEndpoint())
.subscriptionId(profile.getSubscriptionId())
Expand Down Expand Up @@ -202,7 +204,7 @@ public BatchManager authenticate(TokenCredential credential, AzureProfile profil
.append("-")
.append("com.azure.resourcemanager.batch")
.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 @@ -225,11 +227,24 @@ public BatchManager authenticate(TokenCredential credential, AzureProfile profil
List<HttpPipelinePolicy> policies = new ArrayList<>();
policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
policies.add(new RequestIdPolicy());
policies
.addAll(
this
.policies
.stream()
.filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
.collect(Collectors.toList()));
HttpPolicyProviders.addBeforeRetryPolicies(policies);
policies.add(retryPolicy);
policies.add(new AddDatePolicy());
policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0])));
policies.addAll(this.policies);
policies
.addAll(
this
.policies
.stream()
.filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
.collect(Collectors.toList()));
HttpPolicyProviders.addAfterRetryPolicies(policies);
policies.add(new HttpLoggingPolicy(httpLogOptions));
HttpPipeline httpPipeline =
Expand Down Expand Up @@ -315,10 +330,10 @@ public Pools pools() {
}

/**
* @return Wrapped service client BatchManagement providing direct access to the underlying auto-generated API
* @return Wrapped service client BatchManagementClient providing direct access to the underlying auto-generated API
* implementation, based on Azure REST API.
*/
public BatchManagement serviceClient() {
public BatchManagementClient serviceClient() {
return this.clientObject;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ ApplicationPackageInner activate(
* @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 an application package which represents a particular version of an application.
* @return an application package which represents a particular version of an application along with {@link
* Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<ApplicationPackageInner> activateWithResponse(
Expand Down Expand Up @@ -92,7 +93,8 @@ ApplicationPackageInner create(
* @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 an application package which represents a particular version of an application.
* @return an application package which represents a particular version of an application along with {@link
* Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<ApplicationPackageInner> createWithResponse(
Expand Down Expand Up @@ -128,7 +130,7 @@ Response<ApplicationPackageInner> createWithResponse(
* @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 response.
* @return the {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<Void> deleteWithResponse(
Expand Down Expand Up @@ -161,7 +163,7 @@ ApplicationPackageInner get(
* @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 information about the specified application package.
* @return information about the specified application package along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<ApplicationPackageInner> getWithResponse(
Expand All @@ -176,7 +178,7 @@ Response<ApplicationPackageInner> getWithResponse(
* @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 result of performing list application packages.
* @return the result of performing list application packages as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<ApplicationPackageInner> list(String resourceGroupName, String accountName, String applicationName);
Expand All @@ -192,7 +194,7 @@ Response<ApplicationPackageInner> getWithResponse(
* @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 result of performing list application packages.
* @return the result of performing list application packages as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<ApplicationPackageInner> list(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public interface ApplicationsClient {
* @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 contains information about an application in a Batch account.
* @return contains information about an application in a Batch account along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<ApplicationInner> createWithResponse(
Expand Down Expand Up @@ -71,7 +71,7 @@ Response<ApplicationInner> createWithResponse(
* @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 response.
* @return the {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<Void> deleteWithResponse(
Expand Down Expand Up @@ -101,7 +101,7 @@ Response<Void> deleteWithResponse(
* @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 information about the specified application.
* @return information about the specified application along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<ApplicationInner> getWithResponse(
Expand Down Expand Up @@ -134,7 +134,7 @@ ApplicationInner update(
* @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 contains information about an application in a Batch account.
* @return contains information about an application in a Batch account along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<ApplicationInner> updateWithResponse(
Expand All @@ -152,7 +152,7 @@ Response<ApplicationInner> updateWithResponse(
* @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 result of performing list applications.
* @return the result of performing list applications as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<ApplicationInner> list(String resourceGroupName, String accountName);
Expand All @@ -167,7 +167,7 @@ Response<ApplicationInner> updateWithResponse(
* @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 result of performing list applications.
* @return the result of performing list applications as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<ApplicationInner> list(
Expand Down
Loading