Subnet Interface

Implements

public interface Subnet
extends HasInnerModel<SubnetInner>, ChildResource<Network>

A client-side representation of a subnet of a virtual network.

Method Summary

Modifier and Type Method and Description
abstract String addressPrefix()

Gets the address space prefix, in CIDR notation, assigned to this subnet.

abstract List<String> addressPrefixes()

Gets address space prefixes, in CIDR notation, assigned to this subnet.

abstract NetworkSecurityGroup getNetworkSecurityGroup()

Gets the network security group associated with this subnet.

abstract RouteTable getRouteTable()

Gets the route table associated with this subnet.

abstract String id()

Gets the ID of the subnet.

abstract Set<String> listAvailablePrivateIPAddresses()

List available private IP addresses within this subnet.

abstract Collection<NicIpConfiguration> listNetworkInterfaceIPConfigurations()

Gets network interface IP configurations that are associated with this subnet.

abstract String natGatewayId()

Gets the resource ID of the NAT gateway associated with this subnet.

abstract int networkInterfaceIPConfigurationCount()

Gets number of network interface IP configurations associated with this subnet.

abstract String networkSecurityGroupId()

Gets the resource ID of the network security group associated with this subnet.

abstract String routeTableId()

Gets the resource ID of the route table associated with this subnet.

abstract Map<ServiceEndpointType,List<Region>> servicesWithAccess()

Gets the services that has access to the subnet.

Method Details

addressPrefix

public abstract String addressPrefix()

Gets the address space prefix, in CIDR notation, assigned to this subnet.

Use Subnet#addressPrefixes if this subnet has multiple prefixes.

Returns:

the address space prefix, in CIDR notation, assigned to this subnet

addressPrefixes

public abstract List addressPrefixes()

Gets address space prefixes, in CIDR notation, assigned to this subnet.

Use Subnet#addressPrefix if this subnet is created/updated using that property.

Returns:

address space prefixes, in CIDR notation, assigned to this subnet

getNetworkSecurityGroup

public abstract NetworkSecurityGroup getNetworkSecurityGroup()

Gets the network security group associated with this subnet.

Returns:

the network security group associated with this subnet, if any

Note that this method will result in a call to Azure each time it is invoked.

getRouteTable

public abstract RouteTable getRouteTable()

Gets the route table associated with this subnet.

Returns:

the route table associated with this subnet, if any

Note that this method will result in a call to Azure each time it is invoked.

id

public abstract String id()

Gets the ID of the subnet.

Returns:

the ID of the subnet.

listAvailablePrivateIPAddresses

public abstract Set listAvailablePrivateIPAddresses()

List available private IP addresses within this subnet.

Starting IPs of the address prefixes are not returned, due to:
 1. They are usually reserved by platform(e.g. for gateway usage).
 2. For backward-compatibility.

Returns:

available private IP addresses within this network

listNetworkInterfaceIPConfigurations

public abstract Collection listNetworkInterfaceIPConfigurations()

Gets network interface IP configurations that are associated with this subnet.

Returns:

network interface IP configurations that are associated with this subnet

Note that this call may result in multiple calls to Azure to fetch all the referenced interfaces each time it is invoked.

natGatewayId

public abstract String natGatewayId()

Gets the resource ID of the NAT gateway associated with this subnet.

Returns:

the resource ID of the NAT gateway associated with this subnet, if any

networkInterfaceIPConfigurationCount

public abstract int networkInterfaceIPConfigurationCount()

Gets number of network interface IP configurations associated with this subnet.

Returns:

number of network interface IP configurations associated with this subnet

networkSecurityGroupId

public abstract String networkSecurityGroupId()

Gets the resource ID of the network security group associated with this subnet.

Returns:

the resource ID of the network security group associated with this subnet, if any

routeTableId

public abstract String routeTableId()

Gets the resource ID of the route table associated with this subnet.

Returns:

the resource ID of the route table associated with this subnet, if any

servicesWithAccess

public abstract Map> servicesWithAccess()

Gets the services that has access to the subnet.

Returns:

the services that has access to the subnet.

Applies to