你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

ArmNetworkCloudModelFactory.NetworkAttachment 方法

定义

初始化 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

参数

attachedNetworkId
String

附加到虚拟机的关联网络的资源 ID。 它可以是 cloudServicesNetwork、l3Network、l2Network 或 trunkedNetwork 资源之一。

defaultGateway
Nullable<DefaultGateway>

指示此是否为默认网关的指示器。 只有一个附加网络 (包括单个计算机的 CloudServicesNetwork 附件) 可以指定为 True。

ipAllocationMethod
VirtualMachineIPAllocationMethod

虚拟机的 IP 分配机制。 Dynamic 和 Static 仅对 l3Network 有效,后者也可能指定 Disabled。 否则,Disabled 是唯一允许的值。

ipv4Address
String

虚拟机的 IPv4 地址。

仅当附加网络具有 IPV4 或 DualStack 的 IPAllocationType 时,才使用此字段。

如果 IPAllocationMethod 为:静态 - 此字段必须包含附加网络中指定的子网中的用户指定的 IPv4 地址。 动态 - 此字段是只读的,但将使用附加网络中指定的子网中的地址填充。 已禁用 - 此字段将为空。

ipv6Address
String

虚拟机的 IPv6 地址。

仅当附加网络具有 IPV6 或 DualStack 的 IPAllocationType 时,才使用此字段。

如果 IPAllocationMethod 为:静态 - 此字段必须包含附加网络中指定的范围内的 IPv6 地址范围。 动态 - 此字段是只读的,但将使用附加网络中指定的子网中的某个范围进行填充。 已禁用 - 此字段将为空。

macAddress
String

与此网络附件对应的虚拟机接口的 MAC 地址。

networkAttachmentName
String

关联网络的接口名称。 如果指定,则网络附件名称的最大长度为 15 个字符,并且必须对此虚拟机是唯一的。 如果用户未指定此值,将使用网络资源的默认接口名称。 对于 CloudServicesNetwork 资源,将忽略此名称。

返回

用于模拟的新 NetworkAttachment 实例。

适用于