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] Adding xms-ids for Batch #12426

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
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-02-09)

- 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 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 Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import com.azure.resourcemanager.batch.models.BatchAccountCreateParameters;
import com.azure.resourcemanager.batch.models.BatchAccountRegenerateKeyParameters;
import com.azure.resourcemanager.batch.models.BatchAccountUpdateParameters;
import reactor.core.publisher.Mono;

/** An instance of this class provides access to all the operations defined in BatchAccountsClient. */
public interface BatchAccountsClient {
Expand All @@ -33,9 +34,10 @@ public interface BatchAccountsClient {
* @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 Azure Batch account.
* @return contains information about an Azure Batch account along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<BatchAccountInner>, BatchAccountInner> beginCreate(
String resourceGroupName, String accountName, BatchAccountCreateParameters parameters);

Expand All @@ -53,9 +55,10 @@ SyncPoller<PollResult<BatchAccountInner>, BatchAccountInner> beginCreate(
* @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 Azure Batch account.
* @return contains information about an Azure Batch account along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<BatchAccountInner>, BatchAccountInner> beginCreate(
String resourceGroupName, String accountName, BatchAccountCreateParameters parameters, Context context);

Expand Down Expand Up @@ -121,7 +124,7 @@ BatchAccountInner 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 contains information about an Azure Batch account.
* @return contains information about an Azure Batch account along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<BatchAccountInner> updateWithResponse(
Expand All @@ -135,9 +138,9 @@ Response<BatchAccountInner> 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 completion.
* @return the {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<Void>, Void> beginDelete(String resourceGroupName, String accountName);

/**
Expand All @@ -149,9 +152,9 @@ Response<BatchAccountInner> 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 completion.
* @return the {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<Void>, Void> beginDelete(String resourceGroupName, String accountName, Context context);

/**
Expand Down Expand Up @@ -201,7 +204,7 @@ Response<BatchAccountInner> 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 information about the specified Batch account.
* @return information about the specified Batch account along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<BatchAccountInner> getByResourceGroupWithResponse(
Expand Down Expand Up @@ -277,7 +280,7 @@ Response<BatchAccountInner> getByResourceGroupWithResponse(
* @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> synchronizeAutoStorageKeysWithResponse(
Expand Down Expand Up @@ -314,7 +317,7 @@ BatchAccountKeysInner regenerateKey(
* @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 a set of Azure Batch account keys.
* @return a set of Azure Batch account keys along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<BatchAccountKeysInner> regenerateKeyWithResponse(
Expand Down Expand Up @@ -346,7 +349,7 @@ Response<BatchAccountKeysInner> regenerateKeyWithResponse(
* @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 a set of Azure Batch account keys.
* @return a set of Azure Batch account keys along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<BatchAccountKeysInner> getKeysWithResponse(String resourceGroupName, String accountName, Context context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import com.azure.core.http.HttpPipeline;
import java.time.Duration;

/** The interface for BatchManagement class. */
public interface BatchManagement {
/** The interface for BatchManagementClient class. */
public interface BatchManagementClient {
/**
* Gets The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
*
Expand Down
Loading