Class BatchPoolSpecification

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

public final class BatchPoolSpecification extends Object implements com.azure.json.JsonSerializable<BatchPoolSpecification>
Specification for creating a new Pool.
  • Constructor Details

    • BatchPoolSpecification

      public BatchPoolSpecification(String vmSize)
      Creates an instance of BatchPoolSpecification class.
      Parameters:
      vmSize - the vmSize value to set.
  • Method Details

    • getDisplayName

      public String getDisplayName()
      Get the displayName property: The display name for the Pool. The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024.
      Returns:
      the displayName value.
    • setDisplayName

      public BatchPoolSpecification setDisplayName(String displayName)
      Set the displayName property: The display name for the Pool. The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024.
      Parameters:
      displayName - the displayName value to set.
      Returns:
      the BatchPoolSpecification object itself.
    • getVmSize

      public String getVmSize()
      Get the vmSize property: The size of the virtual machines in the Pool. All virtual machines in a Pool are the same size. For information about available sizes of virtual machines in Pools, see Choose a VM size for Compute Nodes in an Azure Batch Pool (https://learn.microsoft.com/azure/batch/batch-pool-vm-sizes).
      Returns:
      the vmSize value.
    • getVirtualMachineConfiguration

      public VirtualMachineConfiguration getVirtualMachineConfiguration()
      Get the virtualMachineConfiguration property: The virtual machine configuration for the Pool. This property must be specified.
      Returns:
      the virtualMachineConfiguration value.
    • setVirtualMachineConfiguration

      public BatchPoolSpecification setVirtualMachineConfiguration(VirtualMachineConfiguration virtualMachineConfiguration)
      Set the virtualMachineConfiguration property: The virtual machine configuration for the Pool. This property must be specified.
      Parameters:
      virtualMachineConfiguration - the virtualMachineConfiguration value to set.
      Returns:
      the BatchPoolSpecification object itself.
    • getTaskSlotsPerNode

      public Integer getTaskSlotsPerNode()
      Get the taskSlotsPerNode property: The number of task slots that can be used to run concurrent tasks on a single compute node in the pool. The default value is 1. The maximum value is the smaller of 4 times the number of cores of the vmSize of the pool or 256.
      Returns:
      the taskSlotsPerNode value.
    • setTaskSlotsPerNode

      public BatchPoolSpecification setTaskSlotsPerNode(Integer taskSlotsPerNode)
      Set the taskSlotsPerNode property: The number of task slots that can be used to run concurrent tasks on a single compute node in the pool. The default value is 1. The maximum value is the smaller of 4 times the number of cores of the vmSize of the pool or 256.
      Parameters:
      taskSlotsPerNode - the taskSlotsPerNode value to set.
      Returns:
      the BatchPoolSpecification object itself.
    • getTaskSchedulingPolicy

      public BatchTaskSchedulingPolicy getTaskSchedulingPolicy()
      Get the taskSchedulingPolicy property: How Tasks are distributed across Compute Nodes in a Pool. If not specified, the default is spread.
      Returns:
      the taskSchedulingPolicy value.
    • setTaskSchedulingPolicy

      public BatchPoolSpecification setTaskSchedulingPolicy(BatchTaskSchedulingPolicy taskSchedulingPolicy)
      Set the taskSchedulingPolicy property: How Tasks are distributed across Compute Nodes in a Pool. If not specified, the default is spread.
      Parameters:
      taskSchedulingPolicy - the taskSchedulingPolicy value to set.
      Returns:
      the BatchPoolSpecification object itself.
    • getResizeTimeout

      public Duration getResizeTimeout()
      Get the resizeTimeout property: The timeout for allocation of Compute Nodes to the Pool. This timeout applies only to manual scaling; it has no effect when enableAutoScale is set to true. The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service rejects the request with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).
      Returns:
      the resizeTimeout value.
    • setResizeTimeout

      public BatchPoolSpecification setResizeTimeout(Duration resizeTimeout)
      Set the resizeTimeout property: The timeout for allocation of Compute Nodes to the Pool. This timeout applies only to manual scaling; it has no effect when enableAutoScale is set to true. The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service rejects the request with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).
      Parameters:
      resizeTimeout - the resizeTimeout value to set.
      Returns:
      the BatchPoolSpecification object itself.
    • getResourceTags

      public String getResourceTags()
      Get the resourceTags property: The user-specified tags associated with the pool.The user-defined tags to be associated with the Azure Batch Pool. When specified, these tags are propagated to the backing Azure resources associated with the pool. This property can only be specified when the Batch account was created with the poolAllocationMode property set to 'UserSubscription'.
      Returns:
      the resourceTags value.
    • setResourceTags

      public BatchPoolSpecification setResourceTags(String resourceTags)
      Set the resourceTags property: The user-specified tags associated with the pool.The user-defined tags to be associated with the Azure Batch Pool. When specified, these tags are propagated to the backing Azure resources associated with the pool. This property can only be specified when the Batch account was created with the poolAllocationMode property set to 'UserSubscription'.
      Parameters:
      resourceTags - the resourceTags value to set.
      Returns:
      the BatchPoolSpecification object itself.
    • getTargetDedicatedNodes

      public Integer getTargetDedicatedNodes()
      Get the targetDedicatedNodes property: The desired number of dedicated Compute Nodes in the Pool. This property must not be specified if enableAutoScale is set to true. If enableAutoScale is set to false, then you must set either targetDedicatedNodes, targetLowPriorityNodes, or both.
      Returns:
      the targetDedicatedNodes value.
    • setTargetDedicatedNodes

      public BatchPoolSpecification setTargetDedicatedNodes(Integer targetDedicatedNodes)
      Set the targetDedicatedNodes property: The desired number of dedicated Compute Nodes in the Pool. This property must not be specified if enableAutoScale is set to true. If enableAutoScale is set to false, then you must set either targetDedicatedNodes, targetLowPriorityNodes, or both.
      Parameters:
      targetDedicatedNodes - the targetDedicatedNodes value to set.
      Returns:
      the BatchPoolSpecification object itself.
    • getTargetLowPriorityNodes

      public Integer getTargetLowPriorityNodes()
      Get the targetLowPriorityNodes property: The desired number of Spot/Low-priority Compute Nodes in the Pool. This property must not be specified if enableAutoScale is set to true. If enableAutoScale is set to false, then you must set either targetDedicatedNodes, targetLowPriorityNodes, or both.
      Returns:
      the targetLowPriorityNodes value.
    • setTargetLowPriorityNodes

      public BatchPoolSpecification setTargetLowPriorityNodes(Integer targetLowPriorityNodes)
      Set the targetLowPriorityNodes property: The desired number of Spot/Low-priority Compute Nodes in the Pool. This property must not be specified if enableAutoScale is set to true. If enableAutoScale is set to false, then you must set either targetDedicatedNodes, targetLowPriorityNodes, or both.
      Parameters:
      targetLowPriorityNodes - the targetLowPriorityNodes value to set.
      Returns:
      the BatchPoolSpecification object itself.
    • isEnableAutoScale

      public Boolean isEnableAutoScale()
      Get the enableAutoScale property: Whether the Pool size should automatically adjust over time. If false, at least one of targetDedicatedNodes and targetLowPriorityNodes must be specified. If true, the autoScaleFormula element is required. The Pool automatically resizes according to the formula. The default value is false.
      Returns:
      the enableAutoScale value.
    • setEnableAutoScale

      public BatchPoolSpecification setEnableAutoScale(Boolean enableAutoScale)
      Set the enableAutoScale property: Whether the Pool size should automatically adjust over time. If false, at least one of targetDedicatedNodes and targetLowPriorityNodes must be specified. If true, the autoScaleFormula element is required. The Pool automatically resizes according to the formula. The default value is false.
      Parameters:
      enableAutoScale - the enableAutoScale value to set.
      Returns:
      the BatchPoolSpecification object itself.
    • getAutoScaleFormula

      public String getAutoScaleFormula()
      Get the autoScaleFormula property: The formula for the desired number of Compute Nodes in the Pool. This property must not be specified if enableAutoScale is set to false. It is required if enableAutoScale is set to true. The formula is checked for validity before the Pool is created. If the formula is not valid, the Batch service rejects the request with detailed error information.
      Returns:
      the autoScaleFormula value.
    • setAutoScaleFormula

      public BatchPoolSpecification setAutoScaleFormula(String autoScaleFormula)
      Set the autoScaleFormula property: The formula for the desired number of Compute Nodes in the Pool. This property must not be specified if enableAutoScale is set to false. It is required if enableAutoScale is set to true. The formula is checked for validity before the Pool is created. If the formula is not valid, the Batch service rejects the request with detailed error information.
      Parameters:
      autoScaleFormula - the autoScaleFormula value to set.
      Returns:
      the BatchPoolSpecification object itself.
    • getAutoScaleEvaluationInterval

      public Duration getAutoScaleEvaluationInterval()
      Get the autoScaleEvaluationInterval property: The time interval at which to automatically adjust the Pool size according to the autoscale formula. The default value is 15 minutes. The minimum and maximum value are 5 minutes and 168 hours respectively. If you specify a value less than 5 minutes or greater than 168 hours, the Batch service rejects the request with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).
      Returns:
      the autoScaleEvaluationInterval value.
    • setAutoScaleEvaluationInterval

      public BatchPoolSpecification setAutoScaleEvaluationInterval(Duration autoScaleEvaluationInterval)
      Set the autoScaleEvaluationInterval property: The time interval at which to automatically adjust the Pool size according to the autoscale formula. The default value is 15 minutes. The minimum and maximum value are 5 minutes and 168 hours respectively. If you specify a value less than 5 minutes or greater than 168 hours, the Batch service rejects the request with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).
      Parameters:
      autoScaleEvaluationInterval - the autoScaleEvaluationInterval value to set.
      Returns:
      the BatchPoolSpecification object itself.
    • isEnableInterNodeCommunication

      public Boolean isEnableInterNodeCommunication()
      Get the enableInterNodeCommunication property: Whether the Pool permits direct communication between Compute Nodes. Enabling inter-node communication limits the maximum size of the Pool due to deployment restrictions on the Compute Nodes of the Pool. This may result in the Pool not reaching its desired size. The default value is false.
      Returns:
      the enableInterNodeCommunication value.
    • setEnableInterNodeCommunication

      public BatchPoolSpecification setEnableInterNodeCommunication(Boolean enableInterNodeCommunication)
      Set the enableInterNodeCommunication property: Whether the Pool permits direct communication between Compute Nodes. Enabling inter-node communication limits the maximum size of the Pool due to deployment restrictions on the Compute Nodes of the Pool. This may result in the Pool not reaching its desired size. The default value is false.
      Parameters:
      enableInterNodeCommunication - the enableInterNodeCommunication value to set.
      Returns:
      the BatchPoolSpecification object itself.
    • getNetworkConfiguration

      public NetworkConfiguration getNetworkConfiguration()
      Get the networkConfiguration property: The network configuration for the Pool.
      Returns:
      the networkConfiguration value.
    • setNetworkConfiguration

      public BatchPoolSpecification setNetworkConfiguration(NetworkConfiguration networkConfiguration)
      Set the networkConfiguration property: The network configuration for the Pool.
      Parameters:
      networkConfiguration - the networkConfiguration value to set.
      Returns:
      the BatchPoolSpecification object itself.
    • getStartTask

      public BatchStartTask getStartTask()
      Get the startTask property: A Task to run on each Compute Node as it joins the Pool. The Task runs when the Compute Node is added to the Pool or when the Compute Node is restarted.
      Returns:
      the startTask value.
    • setStartTask

      public BatchPoolSpecification setStartTask(BatchStartTask startTask)
      Set the startTask property: A Task to run on each Compute Node as it joins the Pool. The Task runs when the Compute Node is added to the Pool or when the Compute Node is restarted.
      Parameters:
      startTask - the startTask value to set.
      Returns:
      the BatchPoolSpecification object itself.
    • getCertificateReferences

      public List<BatchCertificateReference> getCertificateReferences()
      Get the certificateReferences property: For Windows Nodes, the Batch service installs the Certificates to the specified Certificate store and location. For Linux Compute Nodes, the Certificates are stored in a directory inside the Task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the Task to query for this location. For Certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and Certificates are placed in that directory. Warning: This property 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.
      Returns:
      the certificateReferences value.
    • setCertificateReferences

      public BatchPoolSpecification setCertificateReferences(List<BatchCertificateReference> certificateReferences)
      Set the certificateReferences property: For Windows Nodes, the Batch service installs the Certificates to the specified Certificate store and location. For Linux Compute Nodes, the Certificates are stored in a directory inside the Task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the Task to query for this location. For Certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and Certificates are placed in that directory. Warning: This property 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.
      Parameters:
      certificateReferences - the certificateReferences value to set.
      Returns:
      the BatchPoolSpecification object itself.
    • getApplicationPackageReferences

      public List<BatchApplicationPackageReference> getApplicationPackageReferences()
      Get the applicationPackageReferences property: The list of Packages to be installed on each Compute Node in the Pool. When creating a pool, the package's application ID must be fully qualified (/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}). Changes to Package references affect all new Nodes joining the Pool, but do not affect Compute Nodes that are already in the Pool until they are rebooted or reimaged. There is a maximum of 10 Package references on any given Pool.
      Returns:
      the applicationPackageReferences value.
    • setApplicationPackageReferences

      public BatchPoolSpecification setApplicationPackageReferences(List<BatchApplicationPackageReference> applicationPackageReferences)
      Set the applicationPackageReferences property: The list of Packages to be installed on each Compute Node in the Pool. When creating a pool, the package's application ID must be fully qualified (/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}). Changes to Package references affect all new Nodes joining the Pool, but do not affect Compute Nodes that are already in the Pool until they are rebooted or reimaged. There is a maximum of 10 Package references on any given Pool.
      Parameters:
      applicationPackageReferences - the applicationPackageReferences value to set.
      Returns:
      the BatchPoolSpecification object itself.
    • getUserAccounts

      public List<UserAccount> getUserAccounts()
      Get the userAccounts property: The list of user Accounts to be created on each Compute Node in the Pool.
      Returns:
      the userAccounts value.
    • setUserAccounts

      public BatchPoolSpecification setUserAccounts(List<UserAccount> userAccounts)
      Set the userAccounts property: The list of user Accounts to be created on each Compute Node in the Pool.
      Parameters:
      userAccounts - the userAccounts value to set.
      Returns:
      the BatchPoolSpecification object itself.
    • getMetadata

      public List<MetadataItem> getMetadata()
      Get the metadata property: A list of name-value pairs associated with the Pool as metadata. The Batch service does not assign any meaning to metadata; it is solely for the use of user code.
      Returns:
      the metadata value.
    • setMetadata

      public BatchPoolSpecification setMetadata(List<MetadataItem> metadata)
      Set the metadata property: A list of name-value pairs associated with the Pool as metadata. The Batch service does not assign any meaning to metadata; it is solely for the use of user code.
      Parameters:
      metadata - the metadata value to set.
      Returns:
      the BatchPoolSpecification object itself.
    • getMountConfiguration

      public List<MountConfiguration> getMountConfiguration()
      Get the mountConfiguration property: A list of file systems to mount on each node in the pool. This supports Azure Files, NFS, CIFS/SMB, and Blobfuse.
      Returns:
      the mountConfiguration value.
    • setMountConfiguration

      public BatchPoolSpecification setMountConfiguration(List<MountConfiguration> mountConfiguration)
      Set the mountConfiguration property: A list of file systems to mount on each node in the pool. This supports Azure Files, NFS, CIFS/SMB, and Blobfuse.
      Parameters:
      mountConfiguration - the mountConfiguration value to set.
      Returns:
      the BatchPoolSpecification object itself.
    • getTargetNodeCommunicationMode

      public BatchNodeCommunicationMode getTargetNodeCommunicationMode()
      Get the targetNodeCommunicationMode property: The desired node communication mode for the pool. If omitted, the default value is Default.
      Returns:
      the targetNodeCommunicationMode value.
    • setTargetNodeCommunicationMode

      public BatchPoolSpecification setTargetNodeCommunicationMode(BatchNodeCommunicationMode targetNodeCommunicationMode)
      Set the targetNodeCommunicationMode property: The desired node communication mode for the pool. If omitted, the default value is Default.
      Parameters:
      targetNodeCommunicationMode - the targetNodeCommunicationMode value to set.
      Returns:
      the BatchPoolSpecification object itself.
    • getUpgradePolicy

      public UpgradePolicy getUpgradePolicy()
      Get the upgradePolicy property: The upgrade policy for the Pool. Describes an upgrade policy - automatic, manual, or rolling.
      Returns:
      the upgradePolicy value.
    • setUpgradePolicy

      public BatchPoolSpecification setUpgradePolicy(UpgradePolicy upgradePolicy)
      Set the upgradePolicy property: The upgrade policy for the Pool. Describes an upgrade policy - automatic, manual, or rolling.
      Parameters:
      upgradePolicy - the upgradePolicy value to set.
      Returns:
      the BatchPoolSpecification object itself.
    • toJson

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

      public static BatchPoolSpecification fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of BatchPoolSpecification from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of BatchPoolSpecification 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 BatchPoolSpecification.