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-compute-batch] [test tsp breakingchange] 10 multi tsp file #12955

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

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
*/
public enum BatchServiceVersion implements ServiceVersion {
/**
* Enum value 2024-02-01.19.0.
* Enum value 2024-07-01.20.0.
*/
V2024_02_01_19_0("2024-02-01.19.0");
V2024_07_01_20_0("2024-07-01.20.0");

private final String version;

Expand All @@ -35,6 +35,6 @@ public String getVersion() {
* @return The latest {@link BatchServiceVersion}.
*/
public static BatchServiceVersion getLatest() {
return V2024_02_01_19_0;
return V2024_07_01_20_0;
}
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ public AutomaticOsUpgradePolicy setOsRollingUpgradeDeferral(Boolean osRollingUpg
/*
* Indicates whether OS upgrades should automatically be applied to scale set instances in a rolling fashion when a
* newer version of the OS image becomes available. <br /><br /> If this is set to true for Windows based pools,
* [WindowsConfiguration.enableAutomaticUpdates](https://learn.microsoft.com/en-us/rest/api/batchservice/pool/add?
* tabs=HTTP#windowsconfiguration) cannot be set to true.
* [WindowsConfiguration.enableAutomaticUpdates](https://learn.microsoft.com/rest/api/batchservice/pool/add?tabs=
* HTTP#windowsconfiguration) cannot be set to true.
*/
@Generated
private Boolean enableAutomaticOsUpgrade;
Expand All @@ -124,7 +124,7 @@ public AutomaticOsUpgradePolicy setOsRollingUpgradeDeferral(Boolean osRollingUpg
* Get the enableAutomaticOsUpgrade property: Indicates whether OS upgrades should automatically be applied to scale
* set instances in a rolling fashion when a newer version of the OS image becomes available. &lt;br /&gt;&lt;br
* /&gt; If this is set to true for Windows based pools,
* [WindowsConfiguration.enableAutomaticUpdates](https://learn.microsoft.com/en-us/rest/api/batchservice/pool/add?tabs=HTTP#windowsconfiguration)
* [WindowsConfiguration.enableAutomaticUpdates](https://learn.microsoft.com/rest/api/batchservice/pool/add?tabs=HTTP#windowsconfiguration)
* cannot be set to true.
*
* @return the enableAutomaticOsUpgrade value.
Expand All @@ -138,7 +138,7 @@ public Boolean isEnableAutomaticOsUpgrade() {
* Set the enableAutomaticOsUpgrade property: Indicates whether OS upgrades should automatically be applied to scale
* set instances in a rolling fashion when a newer version of the OS image becomes available. &lt;br /&gt;&lt;br
* /&gt; If this is set to true for Windows based pools,
* [WindowsConfiguration.enableAutomaticUpdates](https://learn.microsoft.com/en-us/rest/api/batchservice/pool/add?tabs=HTTP#windowsconfiguration)
* [WindowsConfiguration.enableAutomaticUpdates](https://learn.microsoft.com/rest/api/batchservice/pool/add?tabs=HTTP#windowsconfiguration)
* cannot be set to true.
*
* @param enableAutomaticOsUpgrade the enableAutomaticOsUpgrade value to set.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public final class BatchJob implements JsonSerializable<BatchJob> {
private BatchJobExecutionInfo executionInfo;

/*
* Resource usage statistics for the entire lifetime of the Job. This property is populated only if the CloudJob was
* Resource usage statistics for the entire lifetime of the Job. This property is populated only if the BatchJob was
* retrieved with an expand clause including the 'stats' attribute; otherwise it is null. The statistics may not be
* immediately available. The Batch service performs periodic roll-up of statistics. The typical delay is about 30
* minutes.
Expand Down Expand Up @@ -567,7 +567,7 @@ public BatchJobExecutionInfo getExecutionInfo() {

/**
* Get the stats property: Resource usage statistics for the entire lifetime of the Job. This property is populated
* only if the CloudJob was retrieved with an expand clause including the 'stats' attribute; otherwise it is null.
* only if the BatchJob was retrieved with an expand clause including the 'stats' attribute; otherwise it is null.
* The statistics may not be immediately available. The Batch service performs periodic roll-up of statistics. The
* typical delay is about 30 minutes.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public final class BatchJobManagerTask implements JsonSerializable<BatchJobManag
* features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or
* "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path
* (relative to the Task working directory), or use the Batch provided environment variable
* (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables).
* (https://docs.microsoft.com/azure/batch/batch-compute-node-environment-variables).
*/
@Generated
private final String commandLine;
Expand Down Expand Up @@ -229,7 +229,7 @@ public BatchJobManagerTask setDisplayName(String displayName) {
* to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c
* MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use
* a relative path (relative to the Task working directory), or use the Batch provided environment variable
* (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables).
* (https://docs.microsoft.com/azure/batch/batch-compute-node-environment-variables).
*
* @return the commandLine value.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,50 +19,40 @@ public final class BatchJobNetworkConfiguration implements JsonSerializable<Batc

/*
* The ARM resource identifier of the virtual network subnet which Compute Nodes running Tasks from the Job will
* join for the duration of the Task. This will only work with a VirtualMachineConfiguration Pool. The virtual
* network must be in the same region and subscription as the Azure Batch Account. The specified subnet should have
* enough free IP addresses to accommodate the number of Compute Nodes which will run Tasks from the Job. This can
* be up to the number of Compute Nodes in the Pool. The 'MicrosoftAzureBatch' service principal must have the
* 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC) role for the specified VNet so that Azure
* Batch service can schedule Tasks on the Nodes. This can be verified by checking if the specified VNet has any
* associated Network Security Groups (NSG). If communication to the Nodes in the specified subnet is denied by an
* NSG, then the Batch service will set the state of the Compute Nodes to unusable. This is of the form
* join for the duration of the Task. The virtual network must be in the same region and subscription as the Azure
* Batch Account. The specified subnet should have enough free IP addresses to accommodate the number of Compute
* Nodes which will run Tasks from the Job. This can be up to the number of Compute Nodes in the Pool. The
* 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor' Role-Based Access
* Control (RBAC) role for the specified VNet so that Azure Batch service can schedule Tasks on the Nodes. This can
* be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication
* to the Nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the
* Compute Nodes to unusable. This is of the form
* /subscriptions/{subscription}/resourceGroups/{group}/providers/{provider}/virtualNetworks/{network}/subnets/{
* subnet}. If the specified VNet has any associated Network Security Groups (NSG), then a few reserved system ports
* must be enabled for inbound communication from the Azure Batch service. For Pools created with a Virtual Machine
* configuration, enable ports 29876 and 29877, as well as port 22 for Linux and port 3389 for Windows. Port 443 is
* also required to be open for outbound connections for communications to Azure Storage. For more details see:
* https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration.
* https://docs.microsoft.com/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration.
*/
@Generated
private final String subnetId;

/**
* Creates an instance of BatchJobNetworkConfiguration class.
*
* @param subnetId the subnetId value to set.
*/
@Generated
public BatchJobNetworkConfiguration(String subnetId) {
this.subnetId = subnetId;
}

/**
* Get the subnetId property: The ARM resource identifier of the virtual network subnet which Compute Nodes running
* Tasks from the Job will join for the duration of the Task. This will only work with a VirtualMachineConfiguration
* Pool. The virtual network must be in the same region and subscription as the Azure Batch Account. The specified
* subnet should have enough free IP addresses to accommodate the number of Compute Nodes which will run Tasks from
* the Job. This can be up to the number of Compute Nodes in the Pool. The 'MicrosoftAzureBatch' service principal
* must have the 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC) role for the specified VNet
* so that Azure Batch service can schedule Tasks on the Nodes. This can be verified by checking if the specified
* VNet has any associated Network Security Groups (NSG). If communication to the Nodes in the specified subnet is
* denied by an NSG, then the Batch service will set the state of the Compute Nodes to unusable. This is of the form
* Tasks from the Job will join for the duration of the Task. The virtual network must be in the same region and
* subscription as the Azure Batch Account. The specified subnet should have enough free IP addresses to accommodate
* the number of Compute Nodes which will run Tasks from the Job. This can be up to the number of Compute Nodes in
* the Pool. The 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor'
* Role-Based Access Control (RBAC) role for the specified VNet so that Azure Batch service can schedule Tasks on
* the Nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups
* (NSG). If communication to the Nodes in the specified subnet is denied by an NSG, then the Batch service will set
* the state of the Compute Nodes to unusable. This is of the form
* /subscriptions/{subscription}/resourceGroups/{group}/providers/{provider}/virtualNetworks/{network}/subnets/{subnet}.
* If the specified VNet has any associated Network Security Groups (NSG), then a few reserved system ports must be
* enabled for inbound communication from the Azure Batch service. For Pools created with a Virtual Machine
* configuration, enable ports 29876 and 29877, as well as port 22 for Linux and port 3389 for Windows. Port 443 is
* also required to be open for outbound connections for communications to Azure Storage. For more details see:
* https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration.
* https://docs.microsoft.com/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration.
*
* @return the subnetId value.
*/
Expand All @@ -79,6 +69,7 @@ public String getSubnetId() {
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("subnetId", this.subnetId);
jsonWriter.writeBooleanField("skipWithdrawFromVNet", this.skipWithdrawFromVNet);
return jsonWriter.writeEndObject();
}

Expand All @@ -95,16 +86,51 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
public static BatchJobNetworkConfiguration fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
String subnetId = null;
boolean skipWithdrawFromVNet = false;
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("subnetId".equals(fieldName)) {
subnetId = reader.getString();
} else if ("skipWithdrawFromVNet".equals(fieldName)) {
skipWithdrawFromVNet = reader.getBoolean();
} else {
reader.skipChildren();
}
}
return new BatchJobNetworkConfiguration(subnetId);
return new BatchJobNetworkConfiguration(subnetId, skipWithdrawFromVNet);
});
}

/*
* Whether to withdraw Compute Nodes from the virtual network to DNC when the job is terminated or deleted. If true,
* nodes will remain joined to the virtual network to DNC. If false, nodes will automatically withdraw when the job
* ends. Defaults to false.
*/
@Generated
private final boolean skipWithdrawFromVNet;

/**
* Creates an instance of BatchJobNetworkConfiguration class.
*
* @param subnetId the subnetId value to set.
* @param skipWithdrawFromVNet the skipWithdrawFromVNet value to set.
*/
@Generated
public BatchJobNetworkConfiguration(String subnetId, boolean skipWithdrawFromVNet) {
this.subnetId = subnetId;
this.skipWithdrawFromVNet = skipWithdrawFromVNet;
}

/**
* Get the skipWithdrawFromVNet property: Whether to withdraw Compute Nodes from the virtual network to DNC when the
* job is terminated or deleted. If true, nodes will remain joined to the virtual network to DNC. If false, nodes
* will automatically withdraw when the job ends. Defaults to false.
*
* @return the skipWithdrawFromVNet value.
*/
@Generated
public boolean isSkipWithdrawFromVNet() {
return this.skipWithdrawFromVNet;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public final class BatchJobPreparationTask implements JsonSerializable<BatchJobP
* features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or
* "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path
* (relative to the Task working directory), or use the Batch provided environment variable
* (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables).
* (https://docs.microsoft.com/azure/batch/batch-compute-node-environment-variables).
*/
@Generated
private final String commandLine;
Expand Down Expand Up @@ -176,7 +176,7 @@ public BatchJobPreparationTask setId(String id) {
* to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c
* MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use
* a relative path (relative to the Task working directory), or use the Batch provided environment variable
* (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables).
* (https://docs.microsoft.com/azure/batch/batch-compute-node-environment-variables).
*
* @return the commandLine value.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public final class BatchJobReleaseTask implements JsonSerializable<BatchJobRelea
* features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or
* "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path
* (relative to the Task working directory), or use the Batch provided environment variable
* (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables).
* (https://docs.microsoft.com/azure/batch/batch-compute-node-environment-variables).
*/
@Generated
private final String commandLine;
Expand Down Expand Up @@ -155,7 +155,7 @@ public BatchJobReleaseTask setId(String id) {
* to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c
* MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use
* a relative path (relative to the Task working directory), or use the Batch provided environment variable
* (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables).
* (https://docs.microsoft.com/azure/batch/batch-compute-node-environment-variables).
*
* @return the commandLine value.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStringField("onAllTasksComplete",
this.onAllTasksComplete == null ? null : this.onAllTasksComplete.toString());
jsonWriter.writeArrayField("metadata", this.metadata, (writer, element) -> writer.writeJson(element));
jsonWriter.writeJsonField("networkConfiguration", this.networkConfiguration);
return jsonWriter.writeEndObject();
}

Expand Down Expand Up @@ -321,11 +322,42 @@ public static BatchJobUpdateContent fromJson(JsonReader jsonReader) throws IOExc
} else if ("metadata".equals(fieldName)) {
List<MetadataItem> metadata = reader.readArray(reader1 -> MetadataItem.fromJson(reader1));
deserializedBatchJobUpdateContent.metadata = metadata;
} else if ("networkConfiguration".equals(fieldName)) {
deserializedBatchJobUpdateContent.networkConfiguration
= BatchJobNetworkConfiguration.fromJson(reader);
} else {
reader.skipChildren();
}
}
return deserializedBatchJobUpdateContent;
});
}

/*
* The network configuration for the Job.
*/
@Generated
private BatchJobNetworkConfiguration networkConfiguration;

/**
* Get the networkConfiguration property: The network configuration for the Job.
*
* @return the networkConfiguration value.
*/
@Generated
public BatchJobNetworkConfiguration getNetworkConfiguration() {
return this.networkConfiguration;
}

/**
* Set the networkConfiguration property: The network configuration for the Job.
*
* @param networkConfiguration the networkConfiguration value to set.
* @return the BatchJobUpdateContent object itself.
*/
@Generated
public BatchJobUpdateContent setNetworkConfiguration(BatchJobNetworkConfiguration networkConfiguration) {
this.networkConfiguration = networkConfiguration;
return this;
}
}
Loading