Class InboundNatRule

java.lang.Object
com.azure.resourcemanager.devtestlabs.models.InboundNatRule
All Implemented Interfaces:
com.azure.json.JsonSerializable<InboundNatRule>

public final class InboundNatRule extends Object implements com.azure.json.JsonSerializable<InboundNatRule>
A rule for NAT - exposing a VM's port (backendPort) on the public IP address using a load balancer.
  • Constructor Details

    • InboundNatRule

      public InboundNatRule()
      Creates an instance of InboundNatRule class.
  • Method Details

    • transportProtocol

      public TransportProtocol transportProtocol()
      Get the transportProtocol property: The transport protocol for the endpoint.
      Returns:
      the transportProtocol value.
    • withTransportProtocol

      public InboundNatRule withTransportProtocol(TransportProtocol transportProtocol)
      Set the transportProtocol property: The transport protocol for the endpoint.
      Parameters:
      transportProtocol - the transportProtocol value to set.
      Returns:
      the InboundNatRule object itself.
    • frontendPort

      public Integer frontendPort()
      Get the frontendPort property: The external endpoint port of the inbound connection. Possible values range between 1 and 65535, inclusive. If unspecified, a value will be allocated automatically.
      Returns:
      the frontendPort value.
    • withFrontendPort

      public InboundNatRule withFrontendPort(Integer frontendPort)
      Set the frontendPort property: The external endpoint port of the inbound connection. Possible values range between 1 and 65535, inclusive. If unspecified, a value will be allocated automatically.
      Parameters:
      frontendPort - the frontendPort value to set.
      Returns:
      the InboundNatRule object itself.
    • backendPort

      public Integer backendPort()
      Get the backendPort property: The port to which the external traffic will be redirected.
      Returns:
      the backendPort value.
    • withBackendPort

      public InboundNatRule withBackendPort(Integer backendPort)
      Set the backendPort property: The port to which the external traffic will be redirected.
      Parameters:
      backendPort - the backendPort value to set.
      Returns:
      the InboundNatRule object itself.
    • validate

      public void validate()
      Validates the instance.
      Throws:
      IllegalArgumentException - thrown if the instance is not valid.
    • toJson

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

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