Class SecurityRuleInner
java.lang.Object
com.azure.core.management.SubResource
com.azure.resourcemanager.network.fluent.models.SecurityRuleInner
- All Implemented Interfaces:
com.azure.json.JsonSerializable<com.azure.core.management.SubResource>
public final class SecurityRuleInner
extends com.azure.core.management.SubResource
Network security rule.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaccess()Get the access property: The network traffic is allowed or denied.Get the description property: A description for this rule.Get the destinationAddressPrefix property: The destination address prefix.Get the destinationAddressPrefixes property: The destination address prefixes.Get the destinationApplicationSecurityGroups property: The application security group specified as destination.Get the destinationPortRange property: The destination port or range.Get the destinationPortRanges property: The destination port ranges.Get the direction property: The direction of the rule.etag()Get the etag property: A unique read-only string that changes whenever the resource is updated.static SecurityRuleInnerfromJson(com.azure.json.JsonReader jsonReader) Reads an instance of SecurityRuleInner from the JsonReader.name()Get the name property: The name of the resource that is unique within a resource group.priority()Get the priority property: The priority of the rule.protocol()Get the protocol property: Network protocol this rule applies to.Get the provisioningState property: The provisioning state of the security rule resource.Get the sourceAddressPrefix property: The CIDR or source IP range.Get the sourceAddressPrefixes property: The CIDR or source IP ranges.Get the sourceApplicationSecurityGroups property: The application security group specified as source.Get the sourcePortRange property: The source port or range.Get the sourcePortRanges property: The source port ranges.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) type()Get the type property: The type of the resource.voidvalidate()Validates the instance.withAccess(SecurityRuleAccess access) Set the access property: The network traffic is allowed or denied.withDescription(String description) Set the description property: A description for this rule.withDestinationAddressPrefix(String destinationAddressPrefix) Set the destinationAddressPrefix property: The destination address prefix.withDestinationAddressPrefixes(List<String> destinationAddressPrefixes) Set the destinationAddressPrefixes property: The destination address prefixes.withDestinationApplicationSecurityGroups(List<ApplicationSecurityGroupInner> destinationApplicationSecurityGroups) Set the destinationApplicationSecurityGroups property: The application security group specified as destination.withDestinationPortRange(String destinationPortRange) Set the destinationPortRange property: The destination port or range.withDestinationPortRanges(List<String> destinationPortRanges) Set the destinationPortRanges property: The destination port ranges.withDirection(SecurityRuleDirection direction) Set the direction property: The direction of the rule.Set the name property: The name of the resource that is unique within a resource group.withPriority(Integer priority) Set the priority property: The priority of the rule.withProtocol(SecurityRuleProtocol protocol) Set the protocol property: Network protocol this rule applies to.withSourceAddressPrefix(String sourceAddressPrefix) Set the sourceAddressPrefix property: The CIDR or source IP range.withSourceAddressPrefixes(List<String> sourceAddressPrefixes) Set the sourceAddressPrefixes property: The CIDR or source IP ranges.withSourceApplicationSecurityGroups(List<ApplicationSecurityGroupInner> sourceApplicationSecurityGroups) Set the sourceApplicationSecurityGroups property: The application security group specified as source.withSourcePortRange(String sourcePortRange) Set the sourcePortRange property: The source port or range.withSourcePortRanges(List<String> sourcePortRanges) Set the sourcePortRanges property: The source port ranges.Set the type property: The type of the resource.Methods inherited from class com.azure.core.management.SubResource
idMethods inherited from class java.lang.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
-
SecurityRuleInner
public SecurityRuleInner()Creates an instance of SecurityRuleInner class.
-
-
Method Details
-
name
Get the name property: The name of the resource that is unique within a resource group. This name can be used to access the resource.- Returns:
- the name value.
-
withName
Set the name property: The name of the resource that is unique within a resource group. This name can be used to access the resource.- Parameters:
name- the name value to set.- Returns:
- the SecurityRuleInner object itself.
-
etag
Get the etag property: A unique read-only string that changes whenever the resource is updated.- Returns:
- the etag value.
-
type
Get the type property: The type of the resource.- Returns:
- the type value.
-
withType
Set the type property: The type of the resource.- Parameters:
type- the type value to set.- Returns:
- the SecurityRuleInner object itself.
-
withId
- Overrides:
withIdin classcom.azure.core.management.SubResource
-
description
Get the description property: A description for this rule. Restricted to 140 chars.- Returns:
- the description value.
-
withDescription
Set the description property: A description for this rule. Restricted to 140 chars.- Parameters:
description- the description value to set.- Returns:
- the SecurityRuleInner object itself.
-
protocol
Get the protocol property: Network protocol this rule applies to.- Returns:
- the protocol value.
-
withProtocol
Set the protocol property: Network protocol this rule applies to.- Parameters:
protocol- the protocol value to set.- Returns:
- the SecurityRuleInner object itself.
-
sourcePortRange
Get the sourcePortRange property: The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.- Returns:
- the sourcePortRange value.
-
withSourcePortRange
Set the sourcePortRange property: The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.- Parameters:
sourcePortRange- the sourcePortRange value to set.- Returns:
- the SecurityRuleInner object itself.
-
destinationPortRange
Get the destinationPortRange property: The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.- Returns:
- the destinationPortRange value.
-
withDestinationPortRange
Set the destinationPortRange property: The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.- Parameters:
destinationPortRange- the destinationPortRange value to set.- Returns:
- the SecurityRuleInner object itself.
-
sourceAddressPrefix
Get the sourceAddressPrefix property: The CIDR or source IP range. Asterisk '*' 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.
-
withSourceAddressPrefix
Set the sourceAddressPrefix property: The CIDR or source IP range. Asterisk '*' 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 SecurityRuleInner object itself.
-
sourceAddressPrefixes
Get the sourceAddressPrefixes property: The CIDR or source IP ranges.- Returns:
- the sourceAddressPrefixes value.
-
withSourceAddressPrefixes
Set the sourceAddressPrefixes property: The CIDR or source IP ranges.- Parameters:
sourceAddressPrefixes- the sourceAddressPrefixes value to set.- Returns:
- the SecurityRuleInner object itself.
-
sourceApplicationSecurityGroups
Get the sourceApplicationSecurityGroups property: The application security group specified as source.- Returns:
- the sourceApplicationSecurityGroups value.
-
withSourceApplicationSecurityGroups
public SecurityRuleInner withSourceApplicationSecurityGroups(List<ApplicationSecurityGroupInner> sourceApplicationSecurityGroups) Set the sourceApplicationSecurityGroups property: The application security group specified as source.- Parameters:
sourceApplicationSecurityGroups- the sourceApplicationSecurityGroups value to set.- Returns:
- the SecurityRuleInner object itself.
-
destinationAddressPrefix
Get the destinationAddressPrefix property: The destination address prefix. CIDR or destination IP range. Asterisk '*' 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.
-
withDestinationAddressPrefix
Set the destinationAddressPrefix property: The destination address prefix. CIDR or destination IP range. Asterisk '*' 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 SecurityRuleInner object itself.
-
destinationAddressPrefixes
Get the destinationAddressPrefixes property: The destination address prefixes. CIDR or destination IP ranges.- Returns:
- the destinationAddressPrefixes value.
-
withDestinationAddressPrefixes
Set the destinationAddressPrefixes property: The destination address prefixes. CIDR or destination IP ranges.- Parameters:
destinationAddressPrefixes- the destinationAddressPrefixes value to set.- Returns:
- the SecurityRuleInner object itself.
-
destinationApplicationSecurityGroups
Get the destinationApplicationSecurityGroups property: The application security group specified as destination.- Returns:
- the destinationApplicationSecurityGroups value.
-
withDestinationApplicationSecurityGroups
public SecurityRuleInner withDestinationApplicationSecurityGroups(List<ApplicationSecurityGroupInner> destinationApplicationSecurityGroups) Set the destinationApplicationSecurityGroups property: The application security group specified as destination.- Parameters:
destinationApplicationSecurityGroups- the destinationApplicationSecurityGroups value to set.- Returns:
- the SecurityRuleInner object itself.
-
sourcePortRanges
Get the sourcePortRanges property: The source port ranges.- Returns:
- the sourcePortRanges value.
-
withSourcePortRanges
Set the sourcePortRanges property: The source port ranges.- Parameters:
sourcePortRanges- the sourcePortRanges value to set.- Returns:
- the SecurityRuleInner object itself.
-
destinationPortRanges
Get the destinationPortRanges property: The destination port ranges.- Returns:
- the destinationPortRanges value.
-
withDestinationPortRanges
Set the destinationPortRanges property: The destination port ranges.- Parameters:
destinationPortRanges- the destinationPortRanges value to set.- Returns:
- the SecurityRuleInner object itself.
-
access
Get the access property: The network traffic is allowed or denied.- Returns:
- the access value.
-
withAccess
Set the access property: The network traffic is allowed or denied.- Parameters:
access- the access value to set.- Returns:
- the SecurityRuleInner object itself.
-
priority
Get the priority property: 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.
-
withPriority
Set the priority property: 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 SecurityRuleInner object itself.
-
direction
Get the direction property: The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic.- Returns:
- the direction value.
-
withDirection
Set the direction property: The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic.- Parameters:
direction- the direction value to set.- Returns:
- the SecurityRuleInner object itself.
-
provisioningState
Get the provisioningState property: The provisioning state of the security rule resource.- Returns:
- the provisioningState value.
-
validate
public void validate()Validates the instance.- Throws:
IllegalArgumentException- thrown if the instance is not valid.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<com.azure.core.management.SubResource>- Overrides:
toJsonin classcom.azure.core.management.SubResource- Throws:
IOException
-
fromJson
Reads an instance of SecurityRuleInner from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of SecurityRuleInner 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 SecurityRuleInner.
-