Skip to content

Commit

Permalink
Ljiaqi/batch data plane sdk release for 2023 05 01 API Change (#35112)
Browse files Browse the repository at this point in the history
* Added features like VM Extension automatic upgrade and accelerated networking to upcoming Batch Data plane Java SDK release and remove Job/Pool lifetime statistics

* Regenerated batch data plane test recordings following 2023-05-01 API changes

* Bump the version to a new Major version

* refined assertion in canCRUDTest and canInstallVMExtension

* Included the Certificate Deprecation notice in CHANGELOG.md and removed the @deprecated annotation of private feild “certificateOperations” in BatchClient.java

* Updated CHANGELOG.md: remove content about container type in Breaking Changes

* Modify definition of ContainerType and add a test according to new API changes

* Updated CHANGELOG.md

---------

Co-authored-by: ljiaqi <ljiaqi@microsoft.com>
  • Loading branch information
ljiaqi1998 and ljiaqi1998-work authored Jun 9, 2023
1 parent a5dbf1c commit 6983b8a
Show file tree
Hide file tree
Showing 58 changed files with 3,326 additions and 3,780 deletions.
2 changes: 1 addition & 1 deletion eng/spotbugs-aggregate-report/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-batch</artifactId>
<version>10.2.0-beta.1</version> <!-- {x-version-update;com.microsoft.azure:azure-batch;current} -->
<version>11.0.0</version> <!-- {x-version-update;com.microsoft.azure:azure-batch;current} -->
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
Expand Down
2 changes: 1 addition & 1 deletion eng/versioning/version_data.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Note: com.azure:azure-sdk-parent is in version_client.txt

com.azure:azure-data-sdk-parent;1.3.0;1.3.0
com.microsoft.azure:azure-batch;10.1.0;10.2.0-beta.1
com.microsoft.azure:azure-batch;10.1.0;11.0.0
com.microsoft.azure:azure-applicationinsights-query;1.0.0-Preview-1;1.0.0-Preview-2
com.microsoft.azure.cognitiveservices:azure-cognitiveservices-spellcheck;1.1.0-beta.1;1.1.0-beta.1
com.microsoft.azure.cognitiveservices:azure-cognitiveservices-textanalytics;1.1.0-beta.1;1.1.0-beta.1
Expand Down
20 changes: 17 additions & 3 deletions sdk/batch/microsoft-azure-batch/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,29 @@
# Release History

## 10.2.0-beta.1 (Unreleased)
## 11.0.0 (2023-05-23)

### Features Added
### Features

- Added a new enum `CriCompatible` to type `ContainerType`.
- Added boolean property `enableAutomaticUpgrade` to the `VMExtension` model to determine whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available.
- Added boolean property `enableAcceleratedNetworking` to the `NetworkConfiguration` model to determine whether this pool should enable accelerated networking.

### Breaking Changes

### Bugs Fixed
- Changed property `type` in `ContainerConfiguration` from string type to enum type `ContainerType`.
- Remove the following methods in `JobOperations`.
- `getAllJobsLifetimeStatistics()`.
- `getAllJobsLifetimeStatistics(Iterable<BatchClientBehavior> additionalBehaviors)`.
- Remove the following methods in `PoolOperations`.
- `getAllPoolsLifetimeStatistics()`.
- `getAllPoolsLifetimeStatistics(Iterable<BatchClientBehavior> additionalBehaviors)`.

### Other Changes

- Added @Deprecated annotation to the `CertificateOperations` class.
- This operation is deprecated and will be removed after February 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead.


## 10.1.0 (2022-11-15)

### Features
Expand Down
2 changes: 1 addition & 1 deletion sdk/batch/microsoft-azure-batch/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-batch</artifactId>
<packaging>jar</packaging>
<version>10.2.0-beta.1</version> <!-- {x-version-update;com.microsoft.azure:azure-batch;current} -->
<version>11.0.0</version> <!-- {x-version-update;com.microsoft.azure:azure-batch;current} -->

<name>Microsoft Azure Batch SDK Root</name>
<description>This package contains the root module of Microsoft Azure Batch SDK.</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public IInheritedBehaviors withCustomBehaviors(Collection<BatchClientBehavior> b
/**
* Lists the node agent SKU values supported by the Batch service.
*
* @return A list of {@link NodeAgentSku} objects.
* @return A list of {@link ImageInformation} objects.
* @throws BatchErrorException Exception thrown when an error response is received from the Batch service.
* @throws IOException Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
*/
Expand All @@ -64,7 +64,7 @@ public PagedList<ImageInformation> listSupportedImages() throws BatchErrorExcept
* Lists the node agent SKU values supported by the Batch service.
*
* @param detailLevel A {@link DetailLevel} used for filtering the list and for controlling which properties are retrieved from the service.
* @return A list of {@link NodeAgentSku} objects.
* @return A list of {@link ImageInformation} objects.
* @throws BatchErrorException Exception thrown when an error response is received from the Batch service.
* @throws IOException Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
*/
Expand All @@ -77,7 +77,7 @@ public PagedList<ImageInformation> listSupportedImages(DetailLevel detailLevel)
*
* @param detailLevel A {@link DetailLevel} used for filtering the list and for controlling which properties are retrieved from the service.
* @param additionalBehaviors A collection of {@link BatchClientBehavior} instances that are applied to the Batch service request.
* @return A list of {@link NodeAgentSku} objects.
* @return A list of {@link ImageInformation} objects.
* @throws BatchErrorException Exception thrown when an error response is received from the Batch service.
* @throws IOException Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
*/
Expand All @@ -93,7 +93,7 @@ public PagedList<ImageInformation> listSupportedImages(DetailLevel detailLevel,
/**
* Gets the number of nodes in each state, grouped by pool.
*
* @return A list of {@link NodeAgentSku} objects.
* @return A list of {@link PoolNodeCounts} objects.
* @throws BatchErrorException Exception thrown when an error response is received from the Batch service.
* @throws IOException Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,11 @@ public static BatchClient open(RestClient restClient, String baseUrl) {

/**
* Gets a {@link CertificateOperations} object for performing certificate-related operations on the associated account.
* Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead.
*
* @return An instance of the {@link CertificateOperations} class.
*/
@Deprecated
public CertificateOperations certificateOperations() {
return certificateOperations;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@

/**
* Performs certificate-related operations on an Azure Batch account.
* Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead.
*/
@Deprecated
public class CertificateOperations implements IInheritedBehaviors {

private Collection<BatchClientBehavior> customBehaviors;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import com.microsoft.azure.batch.protocol.models.JobDisableOptions;
import com.microsoft.azure.batch.protocol.models.JobEnableOptions;
import com.microsoft.azure.batch.protocol.models.JobExecutionInformation;
import com.microsoft.azure.batch.protocol.models.JobGetAllLifetimeStatisticsOptions;
import com.microsoft.azure.batch.protocol.models.JobGetOptions;
import com.microsoft.azure.batch.protocol.models.JobGetTaskCountsOptions;
import com.microsoft.azure.batch.protocol.models.JobListFromJobScheduleOptions;
Expand All @@ -25,7 +24,6 @@
import com.microsoft.azure.batch.protocol.models.JobPreparationAndReleaseTaskExecutionInformation;
import com.microsoft.azure.batch.protocol.models.JobPreparationTask;
import com.microsoft.azure.batch.protocol.models.JobReleaseTask;
import com.microsoft.azure.batch.protocol.models.JobStatistics;
import com.microsoft.azure.batch.protocol.models.JobTerminateOptions;
import com.microsoft.azure.batch.protocol.models.JobUpdateOptions;
import com.microsoft.azure.batch.protocol.models.JobUpdateParameter;
Expand Down Expand Up @@ -78,33 +76,6 @@ public IInheritedBehaviors withCustomBehaviors(Collection<BatchClientBehavior> b
return this;
}

/**
* Gets lifetime summary statistics for all of the jobs in the current account.
*
* @return The aggregated job statistics.
* @throws BatchErrorException Exception thrown when an error response is received from the Batch service.
* @throws IOException Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
*/
public JobStatistics getAllJobsLifetimeStatistics() throws BatchErrorException, IOException {
return getAllJobsLifetimeStatistics(null);
}

/**
* Gets lifetime summary statistics for all of the jobs in the current account.
*
* @param additionalBehaviors A collection of {@link BatchClientBehavior} instances that are applied to the Batch service request.
* @return The aggregated job statistics.
* @throws BatchErrorException Exception thrown when an error response is received from the Batch service.
* @throws IOException Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
*/
public JobStatistics getAllJobsLifetimeStatistics(Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException {
JobGetAllLifetimeStatisticsOptions options = new JobGetAllLifetimeStatisticsOptions();
BehaviorManager bhMgr = new BehaviorManager(this.customBehaviors(), additionalBehaviors);
bhMgr.applyRequestBehaviors(options);

return this.parentBatchClient.protocolLayer().jobs().getAllLifetimeStatistics(options);
}

/**
* Gets the specified {@link CloudJob}.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1376,48 +1376,4 @@ public PagedList<PoolUsageMetrics> listPoolUsageMetrics(DateTime startTime, Date

return this.parentBatchClient.protocolLayer().pools().listUsageMetrics(options);
}

/**
* Gets lifetime summary statistics for all of the pools in the current account.
* Statistics are aggregated across all pools that have ever existed in the
* account, from account creation to the last update time of the statistics.
*
* @return The aggregated pool statistics.
* @throws BatchErrorException
* Exception thrown when an error response is received from the
* Batch service.
* @throws IOException
* Exception thrown when there is an error in
* serialization/deserialization of data sent to/received from the
* Batch service.
*/
public PoolStatistics getAllPoolsLifetimeStatistics() throws BatchErrorException, IOException {
return getAllPoolsLifetimeStatistics(null);
}

/**
* Gets lifetime summary statistics for all of the pools in the current account.
* Statistics are aggregated across all pools that have ever existed in the
* account, from account creation to the last update time of the statistics.
*
* @param additionalBehaviors
* A collection of {@link BatchClientBehavior} instances that are
* applied to the Batch service request.
* @return The aggregated pool statistics.
* @throws BatchErrorException
* Exception thrown when an error response is received from the
* Batch service.
* @throws IOException
* Exception thrown when there is an error in
* serialization/deserialization of data sent to/received from the
* Batch service.
*/
public PoolStatistics getAllPoolsLifetimeStatistics(Iterable<BatchClientBehavior> additionalBehaviors)
throws BatchErrorException, IOException {
PoolGetAllLifetimeStatisticsOptions options = new PoolGetAllLifetimeStatisticsOptions();
BehaviorManager bhMgr = new BehaviorManager(this.customBehaviors(), additionalBehaviors);
bhMgr.applyRequestBehaviors(options);

return this.parentBatchClient.protocolLayer().pools().getAllLifetimeStatistics(options);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,6 @@ public interface BatchServiceClient {
*/
Accounts accounts();

/**
* Gets the Jobs object to access its operations.
* @return the Jobs object.
*/
Jobs jobs();

/**
* Gets the Certificates object to access its operations.
* @return the Certificates object.
Expand All @@ -144,6 +138,12 @@ public interface BatchServiceClient {
*/
JobSchedules jobSchedules();

/**
* Gets the Jobs object to access its operations.
* @return the Jobs object.
*/
Jobs jobs();

/**
* Gets the Tasks object to access its operations.
* @return the Tasks object.
Expand Down
Loading

0 comments on commit 6983b8a

Please sign in to comment.