Class BatchJobNetworkConfiguration

java.lang.Object
com.azure.compute.batch.models.BatchJobNetworkConfiguration
All Implemented Interfaces:
com.azure.json.JsonSerializable<BatchJobNetworkConfiguration>

public final class BatchJobNetworkConfiguration extends Object implements com.azure.json.JsonSerializable<BatchJobNetworkConfiguration>
The network configuration for the Job.
  • Constructor Summary

    Constructors
    Constructor
    Description
    BatchJobNetworkConfiguration(String subnetId, boolean skipWithdrawFromVNet)
    Creates an instance of BatchJobNetworkConfiguration class.
  • Method Summary

    Modifier and Type
    Method
    Description
    fromJson(com.azure.json.JsonReader jsonReader)
    Reads an instance of BatchJobNetworkConfiguration from the JsonReader.
    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.
    boolean
    Get the skipWithdrawFromVNet property: Whether to withdraw Compute Nodes from the virtual network to DNC when the job is terminated or deleted.
    com.azure.json.JsonWriter
    toJson(com.azure.json.JsonWriter jsonWriter)

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.azure.json.JsonSerializable

    toJson, toJson, toJsonBytes, toJsonString
  • Constructor Details

    • BatchJobNetworkConfiguration

      public BatchJobNetworkConfiguration(String subnetId, boolean skipWithdrawFromVNet)
      Creates an instance of BatchJobNetworkConfiguration class.
      Parameters:
      subnetId - the subnetId value to set.
      skipWithdrawFromVNet - the skipWithdrawFromVNet value to set.
  • Method Details

    • getSubnetId

      public String getSubnetId()
      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. 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://learn.microsoft.com/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration.
      Returns:
      the subnetId value.
    • isSkipWithdrawFromVNet

      public boolean isSkipWithdrawFromVNet()
      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.
      Returns:
      the skipWithdrawFromVNet value.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<BatchJobNetworkConfiguration>
      Throws:
      IOException
    • fromJson

      public static BatchJobNetworkConfiguration fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of BatchJobNetworkConfiguration from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of BatchJobNetworkConfiguration if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
      Throws:
      IllegalStateException - If the deserialized JSON object was missing any required properties.
      IOException - If an error occurs while reading the BatchJobNetworkConfiguration.