NetworkRule Class

public final class NetworkRule
extends FirewallPolicyRule

Rule of type network.

Constructor Summary

Constructor Description
NetworkRule()

Creates an instance of NetworkRule class.

Method Summary

Modifier and Type Method and Description
List<String> destinationAddresses()

Get the destinationAddresses property: List of destination IP addresses or Service Tags.

List<String> destinationFqdns()

Get the destinationFqdns property: List of destination FQDNs.

List<String> destinationIpGroups()

Get the destinationIpGroups property: List of destination IpGroups for this rule.

List<String> destinationPorts()

Get the destinationPorts property: List of destination ports.

static NetworkRule fromJson(JsonReader jsonReader)

Reads an instance of NetworkRule from the JsonReader.

List<FirewallPolicyRuleNetworkProtocol> ipProtocols()

Get the ipProtocols property: Array of FirewallPolicyRuleNetworkProtocols.

FirewallPolicyRuleType ruleType()

Get the ruleType property: Rule Type.

List<String> sourceAddresses()

Get the sourceAddresses property: List of source IP addresses for this rule.

List<String> sourceIpGroups()

Get the sourceIpGroups property: List of source IpGroups for this rule.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

NetworkRule withDescription(String description)

Set the description property: Description of the rule.

NetworkRule withDestinationAddresses(List<String> destinationAddresses)

Set the destinationAddresses property: List of destination IP addresses or Service Tags.

NetworkRule withDestinationFqdns(List<String> destinationFqdns)

Set the destinationFqdns property: List of destination FQDNs.

NetworkRule withDestinationIpGroups(List<String> destinationIpGroups)

Set the destinationIpGroups property: List of destination IpGroups for this rule.

NetworkRule withDestinationPorts(List<String> destinationPorts)

Set the destinationPorts property: List of destination ports.

NetworkRule withIpProtocols(List<FirewallPolicyRuleNetworkProtocol> ipProtocols)

Set the ipProtocols property: Array of FirewallPolicyRuleNetworkProtocols.

NetworkRule withName(String name)

Set the name property: Name of the rule.

NetworkRule withSourceAddresses(List<String> sourceAddresses)

Set the sourceAddresses property: List of source IP addresses for this rule.

NetworkRule withSourceIpGroups(List<String> sourceIpGroups)

Set the sourceIpGroups property: List of source IpGroups for this rule.

Methods inherited from FirewallPolicyRule

Methods inherited from java.lang.Object

Constructor Details

NetworkRule

public NetworkRule()

Creates an instance of NetworkRule class.

Method Details

destinationAddresses

public List<String> destinationAddresses()

Get the destinationAddresses property: List of destination IP addresses or Service Tags.

Returns:

the destinationAddresses value.

destinationFqdns

public List<String> destinationFqdns()

Get the destinationFqdns property: List of destination FQDNs.

Returns:

the destinationFqdns value.

destinationIpGroups

public List<String> destinationIpGroups()

Get the destinationIpGroups property: List of destination IpGroups for this rule.

Returns:

the destinationIpGroups value.

destinationPorts

public List<String> destinationPorts()

Get the destinationPorts property: List of destination ports.

Returns:

the destinationPorts value.

fromJson

public static NetworkRule fromJson(JsonReader jsonReader)

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.

ipProtocols

public List<FirewallPolicyRuleNetworkProtocol> ipProtocols()

Get the ipProtocols property: Array of FirewallPolicyRuleNetworkProtocols.

Returns:

the ipProtocols value.

ruleType

public FirewallPolicyRuleType ruleType()

Get the ruleType property: Rule Type.

Overrides:

NetworkRule.ruleType()

Returns:

the ruleType value.

sourceAddresses

public List<String> sourceAddresses()

Get the sourceAddresses property: List of source IP addresses for this rule.

Returns:

the sourceAddresses value.

sourceIpGroups

public List<String> sourceIpGroups()

Get the sourceIpGroups property: List of source IpGroups for this rule.

Returns:

the sourceIpGroups value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Overrides:

NetworkRule.toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

Overrides:

NetworkRule.validate()

withDescription

public NetworkRule withDescription(String description)

Set the description property: Description of the rule.

Overrides:

NetworkRule.withDescription(String description)

Parameters:

description

withDestinationAddresses

public NetworkRule withDestinationAddresses(List<String> destinationAddresses)

Set the destinationAddresses property: List of destination IP addresses or Service Tags.

Parameters:

destinationAddresses - the destinationAddresses value to set.

Returns:

the NetworkRule object itself.

withDestinationFqdns

public NetworkRule withDestinationFqdns(List<String> destinationFqdns)

Set the destinationFqdns property: List of destination FQDNs.

Parameters:

destinationFqdns - the destinationFqdns value to set.

Returns:

the NetworkRule object itself.

withDestinationIpGroups

public NetworkRule withDestinationIpGroups(List<String> destinationIpGroups)

Set the destinationIpGroups property: List of destination IpGroups for this rule.

Parameters:

destinationIpGroups - the destinationIpGroups value to set.

Returns:

the NetworkRule object itself.

withDestinationPorts

public NetworkRule withDestinationPorts(List<String> destinationPorts)

Set the destinationPorts property: List of destination ports.

Parameters:

destinationPorts - the destinationPorts value to set.

Returns:

the NetworkRule object itself.

withIpProtocols

public NetworkRule withIpProtocols(List<FirewallPolicyRuleNetworkProtocol> ipProtocols)

Set the ipProtocols property: Array of FirewallPolicyRuleNetworkProtocols.

Parameters:

ipProtocols - the ipProtocols value to set.

Returns:

the NetworkRule object itself.

withName

public NetworkRule withName(String name)

Set the name property: Name of the rule.

Overrides:

NetworkRule.withName(String name)

Parameters:

name

withSourceAddresses

public NetworkRule withSourceAddresses(List<String> sourceAddresses)

Set the sourceAddresses property: List of source IP addresses for this rule.

Parameters:

sourceAddresses - the sourceAddresses value to set.

Returns:

the NetworkRule object itself.

withSourceIpGroups

public NetworkRule withSourceIpGroups(List<String> sourceIpGroups)

Set the sourceIpGroups property: List of source IpGroups for this rule.

Parameters:

sourceIpGroups - the sourceIpGroups value to set.

Returns:

the NetworkRule object itself.

Applies to