跳转到主要内容
网络管理/网络资源/分布式交换机相关接口
POSTDistributed Switch Related Interfaces起始版本 4.1.0同步需要认证

新建分布式交换机

新建分布式交换机

调试可用性

在线调试

使用当前认证信息和示例参数提交 Mock 请求。

请求参数

请求体字段

  • paramsObject必填

    请求体参数结构

    • isDistributedBoolean

      是否为分布式

    • nameString必填

      资源名称

    • descriptionString

      资源的详细描述

    • zoneUuidString必填

      数据中心UUID

    • physicalInterfaceString必填

      物理网卡

    • typeString

      类型。

    • vSwitchTypeString

      虚拟交换机类型

    • resourceUuidString

      资源UUID

    • tagUuidsList

      标签UUID列表

  • systemTagsList

    系统标签

  • userTagsList

    用户标签

响应状态

200 OK

该 API 成功时返回以下响应结构。

  • successboolean必填

    操作是否成功。

  • inventoryL2VirtualSwitchNetworkInventory必填

    详情参考inventory

    • isDistributedBoolean必填

      是否为分布式

    • uuidString必填

      资源的UUID,唯一标示该资源

    • nameString必填

      资源名称

    • descriptionString必填

      资源的详细描述

    • zoneUuidString必填

      数据中心UUID

    • physicalInterfaceString必填

      物理网卡

    • typeString必填

      类型。

    • vSwitchTypeString必填

      虚拟交换机类型

    • virtualNetworkIdInteger必填

      虚拟网络ID

    • createDateTimestamp必填

      创建时间

    • lastOpDateTimestamp必填

      最后一次修改时间

    • attachedClusterUuidsList必填

      挂载集群的UUID列表

    • portGroupsList必填

      详情参考portGroups

      • vSwitchUuidString必填

        虚拟交换机UUID

      • vlanIdInteger必填

        暂无描述。

      • vlanRangesString必填

        VLAN范围

      • uuidString必填

        资源的UUID,唯一标示该资源

      • nameString必填

        资源名称

      • descriptionString必填

        资源的详细描述

      • zoneUuidString必填

        数据中心UUID

      • physicalInterfaceString必填

        物理网卡

      • typeString必填

        类型。

      • vSwitchTypeString必填

        虚拟交换机类型

      • virtualNetworkIdInteger必填

        虚拟网络ID

      • createDateTimestamp必填

        创建时间

      • lastOpDateTimestamp必填

        最后一次修改时间

      • attachedClusterUuidsList必填

        挂载集群的UUID列表

      • vlanModePortGroupVlanMode必填

        详情参考vlanMode

        • ACCESSPortGroupVlanMode必填

          访问。

        • TRUNKPortGroupVlanMode必填

          暂无描述。

        • PVLANPortGroupVlanMode必填

          暂无描述。

  • errorErrorCode必填

    错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error

    • codeString必填

      错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001

    • descriptionString必填

      错误的概要描述

    • detailsString必填

      错误的详细信息

    • elaborationString必填

      保留字段,默认为null

    • opaqueLinkedHashMap必填

      保留字段,默认为null

    • causeErrorCode必填

      根错误,引发当前错误的源错误,若无原错误,该字段为null

请求地址

POST/zstack/v1/l2-networks/virtual-switch

/zstack/v1/l2-networks/virtual-switch

操作 ID

CreateL2VirtualSwitch

永久链接

请求示例

curl -X POST 'http://{host}/zstack/v1/l2-networks/virtual-switch' -H 'Authorization: OAuth {sessionUuid}' -H 'Content-Type: application/json;charset=UTF-8' -d '{"params":{"isDistributed":true,"name":"<name>","description":"<description>","zoneUuid":"<zoneUuid>","physicalInterface":"<physicalInterface>","type":"<type>","vSwitchType":"<vSwitchType>","resourceUuid":"<resourceUuid>","tagUuids":["<tagUuids>"]},"systemTags":["<systemTags>"],"userTags":["<userTags>"]}'

响应示例

200
{ "inventory": { "isDistributed": true, "vSwitchIndex": 1, "name": "dvs-1", "description": "Test dvs", "zoneUuid": "4bc93f4e3a1c35b8948583951e56b5eb", "physicalInterface": "bond1", "type": "virtualSwitch" } }

变更历史

此 API 暂无变更历史记录。

查看全部变更历史