11.5. 子集合

11.5.1. 网络 VNIC 配置集子集合

VNIC(Virtual Network Interface Controller - 虚拟网络接口控制器)配置集,也被称为虚拟机接口配置集,它是一组应用于用户和组的自定义配置,可以被用来限制对网络带宽的使用。每个 vnicprofile 都包括以下项:

表 11.2. VNIC 配置集的项

元素类型描述
name字符串配置集的唯一标识。
description字符串配置集的描述信息。
network字符串应用配置集的逻辑网络 ID。
port_mirroring布尔值:truefalse默认值是 false

例 11.6. 网络 VNIC 配置集子集合的 XML 表述

<vnic_profile href= "/api/vnicprofiles/f9c2f9f1-3ae2-4100-a9a5-285ebb755c0d" id="f9c2f9f1-3ae2-4100-a9a5-285ebb755c0d">
	<name>Peanuts</name>
	<description>shelled</description>
	<network href= "/api/networks/00000000-0000-0000-0000-000000000009" id="00000000-0000-0000-0000-000000000009"/>
	<port_mirroring>false</port_mirroring>
	</vnic_profile>
</vnic_profiles>

11.5.2. 网络标签子集合

网络标签就是一个标签,它可以自动地把逻辑网络和物理主机网络接口进行关联。每个 label 都包括以下项:

表 11.3. 标签项

类型描述
network字符串标签被附加到的网络 hrefid

例 11.7. 网络标签子集合的 XML 表述

<labels>
  <label href="/api/networks/00000000-0000-0000-0000-000000000000/labels/eth0" id="eth0">
    <network href="/api/networks/00000000-0000-0000-0000-000000000000"
      id="00000000-0000-0000-0000-000000000000"/>
  </label>
</labels>

11.5.3. 方法

11.5.3.1. 为逻辑网络附加标签操作

您可以为网络附加一个标签,使用这个标签可以把逻辑网络和有相同标签的物理主机网络接口进行关联。

例 11.8. 为逻辑网络添加标签的操作

POST /api/networks/00000000-0000-0000-0000-000000000000/labels/ HTTP/1.1
Accept: application/xml
Content-type: application/xml

<label id="Label_001" />

11.5.3.2. 从逻辑网络中删除一个标签

从逻辑网络中删除一个标签需要一个 DELETE 请求。

例 11.9. 从逻辑网络中删除一个标签

DELETE /api/networks/00000000-0000-0000-0000-000000000000/labels/[label_id] HTTP/1.1

HTTP/1.1 204 No Content