Share via


NsgSecurityRule Class

  • java.lang.Object
    • com.microsoft.azure.management.resourcemover.v2021_01_01.NsgSecurityRule

public class NsgSecurityRule

Security Rule data model for Network Security Groups.

Constructor Summary

Constructor Description
NsgSecurityRule()

Method Summary

Modifier and Type Method and Description
java.lang.String access()

Get gets or sets whether network traffic is allowed or denied.

java.lang.String description()

Get gets or sets a description for this rule.

java.lang.String destinationAddressPrefix()

Get gets or sets destination address prefix.

java.lang.String destinationPortRange()

Get gets or sets Destination Port or Range.

java.lang.String direction()

Get gets or sets the direction of the rule.InBound or Outbound.

java.lang.String name()

Get gets or sets the Security rule name.

java.lang.Integer priority()

Get gets or sets the priority of the rule.

java.lang.String protocol()

Get gets or sets Network protocol this rule applies to.

java.lang.String sourceAddressPrefix()

Get gets or sets source address prefix.

java.lang.String sourcePortRange()

Get gets or sets Source Port or Range.

NsgSecurityRule withAccess(String access)

Set gets or sets whether network traffic is allowed or denied.

NsgSecurityRule withDescription(String description)

Set gets or sets a description for this rule.

NsgSecurityRule withDestinationAddressPrefix(String destinationAddressPrefix)

Set gets or sets destination address prefix.

NsgSecurityRule withDestinationPortRange(String destinationPortRange)

Set gets or sets Destination Port or Range.

NsgSecurityRule withDirection(String direction)

Set gets or sets the direction of the rule.InBound or Outbound.

NsgSecurityRule withName(String name)

Set gets or sets the Security rule name.

NsgSecurityRule withPriority(Integer priority)

Set gets or sets the priority of the rule.

NsgSecurityRule withProtocol(String protocol)

Set gets or sets Network protocol this rule applies to.

NsgSecurityRule withSourceAddressPrefix(String sourceAddressPrefix)

Set gets or sets source address prefix.

NsgSecurityRule withSourcePortRange(String sourcePortRange)

Set gets or sets Source Port or Range.

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

NsgSecurityRule

public NsgSecurityRule()

Method Details

access

public String access()

Get gets or sets whether network traffic is allowed or denied. Possible values are “Allow” and “Deny”.

Returns:

the access value

description

public String description()

Get gets or sets a description for this rule. Restricted to 140 chars.

Returns:

the description value

destinationAddressPrefix

public String destinationAddressPrefix()

Get gets or sets destination address prefix. CIDR or source IP range. A “*” can also be used to match all source IPs. Default tags such as ‘VirtualNetwork’, ‘AzureLoadBalancer’ and ‘Internet’ can also be used.

Returns:

the destinationAddressPrefix value

destinationPortRange

public String destinationPortRange()

Get gets or sets Destination Port or Range. Integer or range between 0 and 65535. A “*” can also be used to match all ports.

Returns:

the destinationPortRange value

direction

public String direction()

Get gets or sets the direction of the rule.InBound or Outbound. The direction specifies if rule will be evaluated on incoming or outgoing traffic.

Returns:

the direction value

name

public String name()

Get gets or sets the Security rule name.

Returns:

the name value

priority

public Integer priority()

Get gets or sets the priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.

Returns:

the priority value

protocol

public String protocol()

Get gets or sets Network protocol this rule applies to. Can be Tcp, Udp or All(*).

Returns:

the protocol value

sourceAddressPrefix

public String sourceAddressPrefix()

Get gets or sets source address prefix. CIDR or source IP range. A “*” can also be used to match all source IPs. Default tags such as ‘VirtualNetwork’, ‘AzureLoadBalancer’ and ‘Internet’ can also be used. If this is an ingress rule, specifies where network traffic originates from.

Returns:

the sourceAddressPrefix value

sourcePortRange

public String sourcePortRange()

Get gets or sets Source Port or Range. Integer or range between 0 and 65535. A “*” can also be used to match all ports.

Returns:

the sourcePortRange value

withAccess

public NsgSecurityRule withAccess(String access)

Set gets or sets whether network traffic is allowed or denied. Possible values are “Allow” and “Deny”.

Parameters:

access - the access value to set

Returns:

the NsgSecurityRule object itself.

withDescription

public NsgSecurityRule withDescription(String description)

Set gets or sets a description for this rule. Restricted to 140 chars.

Parameters:

description - the description value to set

Returns:

the NsgSecurityRule object itself.

withDestinationAddressPrefix

public NsgSecurityRule withDestinationAddressPrefix(String destinationAddressPrefix)

Set gets or sets destination address prefix. CIDR or source IP range. A “*” can also be used to match all source IPs. Default tags such as ‘VirtualNetwork’, ‘AzureLoadBalancer’ and ‘Internet’ can also be used.

Parameters:

destinationAddressPrefix - the destinationAddressPrefix value to set

Returns:

the NsgSecurityRule object itself.

withDestinationPortRange

public NsgSecurityRule withDestinationPortRange(String destinationPortRange)

Set gets or sets Destination Port or Range. Integer or range between 0 and 65535. A “*” can also be used to match all ports.

Parameters:

destinationPortRange - the destinationPortRange value to set

Returns:

the NsgSecurityRule object itself.

withDirection

public NsgSecurityRule withDirection(String direction)

Set gets or sets the direction of the rule.InBound or Outbound. The direction specifies if rule will be evaluated on incoming or outgoing traffic.

Parameters:

direction - the direction value to set

Returns:

the NsgSecurityRule object itself.

withName

public NsgSecurityRule withName(String name)

Set gets or sets the Security rule name.

Parameters:

name - the name value to set

Returns:

the NsgSecurityRule object itself.

withPriority

public NsgSecurityRule withPriority(Integer priority)

Set gets or sets the priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.

Parameters:

priority - the priority value to set

Returns:

the NsgSecurityRule object itself.

withProtocol

public NsgSecurityRule withProtocol(String protocol)

Set gets or sets Network protocol this rule applies to. Can be Tcp, Udp or All(*).

Parameters:

protocol - the protocol value to set

Returns:

the NsgSecurityRule object itself.

withSourceAddressPrefix

public NsgSecurityRule withSourceAddressPrefix(String sourceAddressPrefix)

Set gets or sets source address prefix. CIDR or source IP range. A “*” can also be used to match all source IPs. Default tags such as ‘VirtualNetwork’, ‘AzureLoadBalancer’ and ‘Internet’ can also be used. If this is an ingress rule, specifies where network traffic originates from.

Parameters:

sourceAddressPrefix - the sourceAddressPrefix value to set

Returns:

the NsgSecurityRule object itself.

withSourcePortRange

public NsgSecurityRule withSourcePortRange(String sourcePortRange)

Set gets or sets Source Port or Range. Integer or range between 0 and 65535. A “*” can also be used to match all ports.

Parameters:

sourcePortRange - the sourcePortRange value to set

Returns:

the NsgSecurityRule object itself.

Applies to