Class NetworkRule
java.lang.Object
com.azure.resourcemanager.network.models.FirewallPolicyRule
com.azure.resourcemanager.network.models.NetworkRule
- All Implemented Interfaces:
com.azure.json.JsonSerializable<FirewallPolicyRule>
Rule of type network.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the destinationAddresses property: List of destination IP addresses or Service Tags.Get the destinationFqdns property: List of destination FQDNs.Get the destinationIpGroups property: List of destination IpGroups for this rule.Get the destinationPorts property: List of destination ports.static NetworkRulefromJson(com.azure.json.JsonReader jsonReader) Reads an instance of NetworkRule from the JsonReader.Get the ipProtocols property: Array of FirewallPolicyRuleNetworkProtocols.ruleType()Get the ruleType property: Rule Type.Get the sourceAddresses property: List of source IP addresses for this rule.Get the sourceIpGroups property: List of source IpGroups for this rule.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) voidvalidate()Validates the instance.withDescription(String description) Set the description property: Description of the rule.withDestinationAddresses(List<String> destinationAddresses) Set the destinationAddresses property: List of destination IP addresses or Service Tags.withDestinationFqdns(List<String> destinationFqdns) Set the destinationFqdns property: List of destination FQDNs.withDestinationIpGroups(List<String> destinationIpGroups) Set the destinationIpGroups property: List of destination IpGroups for this rule.withDestinationPorts(List<String> destinationPorts) Set the destinationPorts property: List of destination ports.withIpProtocols(List<FirewallPolicyRuleNetworkProtocol> ipProtocols) Set the ipProtocols property: Array of FirewallPolicyRuleNetworkProtocols.Set the name property: Name of the rule.withSourceAddresses(List<String> sourceAddresses) Set the sourceAddresses property: List of source IP addresses for this rule.withSourceIpGroups(List<String> sourceIpGroups) Set the sourceIpGroups property: List of source IpGroups for this rule.Methods inherited from class FirewallPolicyRule
description, nameMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
NetworkRule
public NetworkRule()Creates an instance of NetworkRule class.
-
-
Method Details
-
ruleType
Get the ruleType property: Rule Type.- Overrides:
ruleTypein classFirewallPolicyRule- Returns:
- the ruleType value.
-
ipProtocols
Get the ipProtocols property: Array of FirewallPolicyRuleNetworkProtocols.- Returns:
- the ipProtocols value.
-
withIpProtocols
Set the ipProtocols property: Array of FirewallPolicyRuleNetworkProtocols.- Parameters:
ipProtocols- the ipProtocols value to set.- Returns:
- the NetworkRule object itself.
-
sourceAddresses
-
withSourceAddresses
Set the sourceAddresses property: List of source IP addresses for this rule.- Parameters:
sourceAddresses- the sourceAddresses value to set.- Returns:
- the NetworkRule object itself.
-
destinationAddresses
-
withDestinationAddresses
Set the destinationAddresses property: List of destination IP addresses or Service Tags.- Parameters:
destinationAddresses- the destinationAddresses value to set.- Returns:
- the NetworkRule object itself.
-
destinationPorts
-
withDestinationPorts
Set the destinationPorts property: List of destination ports.- Parameters:
destinationPorts- the destinationPorts value to set.- Returns:
- the NetworkRule object itself.
-
sourceIpGroups
-
withSourceIpGroups
Set the sourceIpGroups property: List of source IpGroups for this rule.- Parameters:
sourceIpGroups- the sourceIpGroups value to set.- Returns:
- the NetworkRule object itself.
-
destinationIpGroups
-
withDestinationIpGroups
Set the destinationIpGroups property: List of destination IpGroups for this rule.- Parameters:
destinationIpGroups- the destinationIpGroups value to set.- Returns:
- the NetworkRule object itself.
-
destinationFqdns
-
withDestinationFqdns
Set the destinationFqdns property: List of destination FQDNs.- Parameters:
destinationFqdns- the destinationFqdns value to set.- Returns:
- the NetworkRule object itself.
-
withName
Set the name property: Name of the rule.- Overrides:
withNamein classFirewallPolicyRule- Parameters:
name- the name value to set.- Returns:
- the FirewallPolicyRule object itself.
-
withDescription
Set the description property: Description of the rule.- Overrides:
withDescriptionin classFirewallPolicyRule- Parameters:
description- the description value to set.- Returns:
- the FirewallPolicyRule object itself.
-
validate
public void validate()Validates the instance.- Overrides:
validatein classFirewallPolicyRule- Throws:
IllegalArgumentException- thrown if the instance is not valid.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<FirewallPolicyRule>- Overrides:
toJsonin classFirewallPolicyRule- Throws:
IOException
-
fromJson
Reads an instance of NetworkRule from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of NetworkRule 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 NetworkRule.
-