ArmNetworkCloudModelFactory.NetworkAttachment Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Initializes a new instance of NetworkAttachment.
public static Azure.ResourceManager.NetworkCloud.Models.NetworkAttachment NetworkAttachment (string attachedNetworkId = default, Azure.ResourceManager.NetworkCloud.Models.DefaultGateway? defaultGateway = default, Azure.ResourceManager.NetworkCloud.Models.VirtualMachineIPAllocationMethod ipAllocationMethod = default, string ipv4Address = default, string ipv6Address = default, string macAddress = default, string networkAttachmentName = default);
static member NetworkAttachment : string * Nullable<Azure.ResourceManager.NetworkCloud.Models.DefaultGateway> * Azure.ResourceManager.NetworkCloud.Models.VirtualMachineIPAllocationMethod * string * string * string * string -> Azure.ResourceManager.NetworkCloud.Models.NetworkAttachment
Public Shared Function NetworkAttachment (Optional attachedNetworkId As String = Nothing, Optional defaultGateway As Nullable(Of DefaultGateway) = Nothing, Optional ipAllocationMethod As VirtualMachineIPAllocationMethod = Nothing, Optional ipv4Address As String = Nothing, Optional ipv6Address As String = Nothing, Optional macAddress As String = Nothing, Optional networkAttachmentName As String = Nothing) As NetworkAttachment
Parameters
- attachedNetworkId
- String
The resource ID of the associated network attached to the virtual machine. It can be one of cloudServicesNetwork, l3Network, l2Network or trunkedNetwork resources.
- defaultGateway
- Nullable<DefaultGateway>
The indicator of whether this is the default gateway. Only one of the attached networks (including the CloudServicesNetwork attachment) for a single machine may be specified as True.
- ipAllocationMethod
- VirtualMachineIPAllocationMethod
The IP allocation mechanism for the virtual machine. Dynamic and Static are only valid for l3Network which may also specify Disabled. Otherwise, Disabled is the only permitted value.
- ipv4Address
- String
The IPv4 address of the virtual machine.
This field is used only if the attached network has IPAllocationType of IPV4 or DualStack.
If IPAllocationMethod is: Static - this field must contain a user specified IPv4 address from within the subnet specified in the attached network. Dynamic - this field is read-only, but will be populated with an address from within the subnet specified in the attached network. Disabled - this field will be empty.
- ipv6Address
- String
The IPv6 address of the virtual machine.
This field is used only if the attached network has IPAllocationType of IPV6 or DualStack.
If IPAllocationMethod is: Static - this field must contain an IPv6 address range from within the range specified in the attached network. Dynamic - this field is read-only, but will be populated with an range from within the subnet specified in the attached network. Disabled - this field will be empty.
- macAddress
- String
The MAC address of the interface for the virtual machine that corresponds to this network attachment.
- networkAttachmentName
- String
The associated network's interface name. If specified, the network attachment name has a maximum length of 15 characters and must be unique to this virtual machine. If the user doesn’t specify this value, the default interface name of the network resource will be used. For a CloudServicesNetwork resource, this name will be ignored.
Returns
A new NetworkAttachment instance for mocking.
Applies to
Azure SDK for .NET