Package com.azure.compute.batch.models
Class NetworkSecurityGroupRule
java.lang.Object
com.azure.compute.batch.models.NetworkSecurityGroupRule
- All Implemented Interfaces:
com.azure.json.JsonSerializable<NetworkSecurityGroupRule>
public final class NetworkSecurityGroupRule
extends Object
implements com.azure.json.JsonSerializable<NetworkSecurityGroupRule>
A network security group rule to apply to an inbound endpoint.
-
Constructor Summary
ConstructorsConstructorDescriptionNetworkSecurityGroupRule
(int priority, NetworkSecurityGroupRuleAccess access, String sourceAddressPrefix) Creates an instance of NetworkSecurityGroupRule class. -
Method Summary
Modifier and TypeMethodDescriptionstatic NetworkSecurityGroupRule
fromJson
(com.azure.json.JsonReader jsonReader) Reads an instance of NetworkSecurityGroupRule from the JsonReader.Get the access property: The action that should be taken for a specified IP address, subnet range or tag.int
Get the priority property: The priority for this rule.Get the sourceAddressPrefix property: The source address prefix or tag to match for the rule.Get the sourcePortRanges property: The source port ranges to match for the rule.setSourcePortRanges
(List<String> sourcePortRanges) Set the sourcePortRanges property: The source port ranges to match for the rule.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
-
NetworkSecurityGroupRule
public NetworkSecurityGroupRule(int priority, NetworkSecurityGroupRuleAccess access, String sourceAddressPrefix) Creates an instance of NetworkSecurityGroupRule class.- Parameters:
priority
- the priority value to set.access
- the access value to set.sourceAddressPrefix
- the sourceAddressPrefix value to set.
-
-
Method Details
-
getPriority
public int getPriority()Get the priority property: The priority for this rule. Priorities within a Pool must be unique and are evaluated in order of priority. The lower the number the higher the priority. For example, rules could be specified with order numbers of 150, 250, and 350. The rule with the order number of 150 takes precedence over the rule that has an order of 250. Allowed priorities are 150 to 4096. If any reserved or duplicate values are provided the request fails with HTTP status code 400.- Returns:
- the priority value.
-
getAccess
Get the access property: The action that should be taken for a specified IP address, subnet range or tag.- Returns:
- the access value.
-
getSourceAddressPrefix
Get the sourceAddressPrefix property: The source address prefix or tag to match for the rule. Valid values are a single IP address (i.e. 10.10.10.10), IP subnet (i.e. 192.168.1.0/24), default tag, or * (for all addresses). If any other values are provided the request fails with HTTP status code 400.- Returns:
- the sourceAddressPrefix value.
-
getSourcePortRanges
Get the sourcePortRanges property: The source port ranges to match for the rule. Valid values are '*' (for all ports 0 - 65535), a specific port (i.e. 22), or a port range (i.e. 100-200). The ports must be in the range of 0 to 65535. Each entry in this collection must not overlap any other entry (either a range or an individual port). If any other values are provided the request fails with HTTP status code 400. The default value is '*'.- Returns:
- the sourcePortRanges value.
-
setSourcePortRanges
Set the sourcePortRanges property: The source port ranges to match for the rule. Valid values are '*' (for all ports 0 - 65535), a specific port (i.e. 22), or a port range (i.e. 100-200). The ports must be in the range of 0 to 65535. Each entry in this collection must not overlap any other entry (either a range or an individual port). If any other values are provided the request fails with HTTP status code 400. The default value is '*'.- Parameters:
sourcePortRanges
- the sourcePortRanges value to set.- Returns:
- the NetworkSecurityGroupRule object itself.
-
toJson
- Specified by:
toJson
in interfacecom.azure.json.JsonSerializable<NetworkSecurityGroupRule>
- Throws:
IOException
-
fromJson
public static NetworkSecurityGroupRule fromJson(com.azure.json.JsonReader jsonReader) throws IOException Reads an instance of NetworkSecurityGroupRule from the JsonReader.- Parameters:
jsonReader
- The JsonReader being read.- Returns:
- An instance of NetworkSecurityGroupRule 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 NetworkSecurityGroupRule.
-