NsgSecurityRule Class
- java.
lang. Object - com.
azure. resourcemanager. resourcemover. models. NsgSecurityRule
- com.
Implements
public final class NsgSecurityRule
implements JsonSerializable<NsgSecurityRule>
Security Rule data model for Network Security Groups.
Constructor Summary
| Constructor | Description |
|---|---|
| NsgSecurityRule() |
Creates an instance of Nsg |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
| String |
access()
Get the access property: Gets or sets whether network traffic is allowed or denied. |
| String |
description()
Get the description property: Gets or sets a description for this rule. |
| String |
destinationAddressPrefix()
Get the destination |
| String |
destinationPortRange()
Get the destination |
| String |
direction()
Get the direction property: Gets or sets the direction of the rule. |
|
static
Nsg |
fromJson(JsonReader jsonReader)
Reads an instance of Nsg |
| String |
name()
Get the name property: Gets or sets the Security rule name. |
| Integer |
priority()
Get the priority property: Gets or sets the priority of the rule. |
| String |
protocol()
Get the protocol property: Gets or sets Network protocol this rule applies to. |
| String |
sourceAddressPrefix()
Get the source |
| String |
sourcePortRange()
Get the source |
|
Json |
toJson(JsonWriter jsonWriter) |
| void |
validate()
Validates the instance. |
|
Nsg |
withAccess(String access)
Set the access property: Gets or sets whether network traffic is allowed or denied. |
|
Nsg |
withDescription(String description)
Set the description property: Gets or sets a description for this rule. |
|
Nsg |
withDestinationAddressPrefix(String destinationAddressPrefix)
Set the destination |
|
Nsg |
withDestinationPortRange(String destinationPortRange)
Set the destination |
|
Nsg |
withDirection(String direction)
Set the direction property: Gets or sets the direction of the rule. |
|
Nsg |
withName(String name)
Set the name property: Gets or sets the Security rule name. |
|
Nsg |
withPriority(Integer priority)
Set the priority property: Gets or sets the priority of the rule. |
|
Nsg |
withProtocol(String protocol)
Set the protocol property: Gets or sets Network protocol this rule applies to. |
|
Nsg |
withSourceAddressPrefix(String sourceAddressPrefix)
Set the source |
|
Nsg |
withSourcePortRange(String sourcePortRange)
Set the source |
Methods inherited from java.lang.Object
Constructor Details
NsgSecurityRule
public NsgSecurityRule()
Creates an instance of NsgSecurityRule class.
Method Details
access
public String access()
Get the access property: Gets or sets whether network traffic is allowed or denied. Possible values are “Allow” and “Deny”.
Returns:
description
public String description()
Get the description property: Gets or sets a description for this rule. Restricted to 140 chars.
Returns:
destinationAddressPrefix
public String destinationAddressPrefix()
Get the destinationAddressPrefix property: 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:
destinationPortRange
public String destinationPortRange()
Get the destinationPortRange property: Gets or sets Destination Port or Range. Integer or range between 0 and 65535. A “*” can also be used to match all ports.
Returns:
direction
public String direction()
Get the direction property: 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:
fromJson
public static NsgSecurityRule fromJson(JsonReader jsonReader)
Reads an instance of NsgSecurityRule from the JsonReader.
Parameters:
Returns:
Throws:
name
public String name()
Get the name property: Gets or sets the Security rule name.
Returns:
priority
public Integer priority()
Get the priority property: 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:
protocol
public String protocol()
Get the protocol property: Gets or sets Network protocol this rule applies to. Can be Tcp, Udp or All(*).
Returns:
sourceAddressPrefix
public String sourceAddressPrefix()
Get the sourceAddressPrefix property: 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:
sourcePortRange
public String sourcePortRange()
Get the sourcePortRange property: Gets or sets Source Port or Range. Integer or range between 0 and 65535. A “*” can also be used to match all ports.
Returns:
toJson
validate
public void validate()
Validates the instance.
withAccess
public NsgSecurityRule withAccess(String access)
Set the access property: Gets or sets whether network traffic is allowed or denied. Possible values are “Allow” and “Deny”.
Parameters:
Returns:
withDescription
public NsgSecurityRule withDescription(String description)
Set the description property: Gets or sets a description for this rule. Restricted to 140 chars.
Parameters:
Returns:
withDestinationAddressPrefix
public NsgSecurityRule withDestinationAddressPrefix(String destinationAddressPrefix)
Set the destinationAddressPrefix property: 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:
Returns:
withDestinationPortRange
public NsgSecurityRule withDestinationPortRange(String destinationPortRange)
Set the destinationPortRange property: Gets or sets Destination Port or Range. Integer or range between 0 and 65535. A “*” can also be used to match all ports.
Parameters:
Returns:
withDirection
public NsgSecurityRule withDirection(String direction)
Set the direction property: 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:
Returns:
withName
public NsgSecurityRule withName(String name)
Set the name property: Gets or sets the Security rule name.
Parameters:
Returns:
withPriority
public NsgSecurityRule withPriority(Integer priority)
Set the priority property: 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:
Returns:
withProtocol
public NsgSecurityRule withProtocol(String protocol)
Set the protocol property: Gets or sets Network protocol this rule applies to. Can be Tcp, Udp or All(*).
Parameters:
Returns:
withSourceAddressPrefix
public NsgSecurityRule withSourceAddressPrefix(String sourceAddressPrefix)
Set the sourceAddressPrefix property: 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:
Returns:
withSourcePortRange
public NsgSecurityRule withSourcePortRange(String sourcePortRange)
Set the sourcePortRange property: Gets or sets Source Port or Range. Integer or range between 0 and 65535. A “*” can also be used to match all ports.
Parameters:
Returns: