跳转到主要内容
资源中心/网络资源/VPC相关接口
POSTVPC Operations起始版本 2.3同步需要认证

创建VPC路由器

创建VPC路由器

调试可用性

在线调试

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

请求参数

请求体字段

  • paramsObject必填

    请求体参数结构

    • nameString必填

      资源名称

    • virtualRouterOfferingUuidString必填

      云路由规格

    • descriptionString

      资源的详细描述

    • resourceUuidString

      资源的UUID

    • zoneUuidString

      区域UUID

    • clusterUuidString

      集群UUID

    • hostUuidString

      物理机UUID

    • primaryStorageUuidForRootVolumeString

      主存储UUID。若指定,路由器的根云盘会在指定主存储创建

    • rootVolumeSystemTagsList

      路由器根盘所需要的系统标签

  • systemTagsList

    系统标签。

  • userTagsList

    用户标签。

响应状态

200 OK

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

  • successboolean必填

    操作是否成功。

  • errorErrorCode必填

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

    • codeString必填

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

    • descriptionString必填

      错误的概要描述

    • detailsString必填

      错误的详细信息

    • elaborationString必填

      保留字段,默认为null

    • opaqueLinkedHashMap必填

      保留字段,默认为null

    • causeErrorCode必填

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

  • inventoryVmInstanceInventory必填

    详情参考inventory

    • uuidString必填

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

    • nameString必填

      资源名称

    • descriptionString必填

      资源的详细描述

    • zoneUuidString必填

      区域UUID

    • clusterUuidString必填

      集群UUID

    • imageUuidString必填

      镜像UUID

    • hostUuidString必填

      物理机UUID

    • lastHostUuidString必填

      上一次运行路由器设备的物理机UUID

    • instanceOfferingUuidString必填

      计算规格UUID

    • rootVolumeUuidString必填

      根云盘UUID

    • platformString必填

      路由器设备运行平台

    • architectureString必填

      暂无描述。

    • defaultL3NetworkUuidString必填

      默认三层网络UUID

    • typeString必填

      路由器设备类型

    • hypervisorTypeString必填

      路由器设备的hypervisor类型

    • memorySizeLong必填

      内存大小

    • cpuNumInteger必填

      cpu数量

    • cpuSpeedLong必填

      cpu主频

    • allocatorStrategyString必填

      分配策略

    • createDateTimestamp必填

      创建时间

    • lastOpDateTimestamp必填

      最后一次修改时间

    • stateString必填

      路由器设备的可用状态

    • guestOsTypeString必填

      暂无描述。

    • vmNicsList必填

      详情参考vmNics

      • uuidString必填

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

      • vmInstanceUuidString必填

        云主机UUID

      • l3NetworkUuidString必填

        三层网络UUID

      • ipString必填

        ip地址

      • macString必填

        mac地址

      • hypervisorTypeString必填

        暂无描述。

      • netmaskString必填

        子网掩码

      • gatewayString必填

        网关

      • metaDataString必填

        内部使用的保留域

      • deviceIdInteger必填

        设备ID。

      • internalNameString必填

        内部名称。

      • deviceIdInteger必填

        设备ID。

      • typeString必填

        类型。

      • createDateTimestamp必填

        创建时间

      • lastOpDateTimestamp必填

        最后一次修改时间

      • usedIpsList必填

        详情参考usedIps

        • uuidString必填

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

        • ipRangeUuidString必填

          IP段UUID

        • l3NetworkUuidString必填

          三层网络UUID

        • ipVersionInteger必填

          IP版本。

        • ipString必填

          来源IP地址。

        • netmaskString必填

          暂无描述。

        • gatewayString必填

          暂无描述。

        • usedForString必填

          已使用用于。

        • ipInLonglong必填

          暂无描述。

        • vmNicUuidString必填

          云主机网卡UUID

        • createDateTimestamp必填

          创建时间

        • lastOpDateTimestamp必填

          最后一次修改时间

    • allVolumesList必填

      详情参考allVolumes

      • uuidString必填

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

      • nameString必填

        资源名称

      • descriptionString必填

        资源的详细描述

      • primaryStorageUuidString必填

        主存储UUID

      • vmInstanceUuidString必填

        云主机UUID

      • diskOfferingUuidString必填

        云盘规格UUID

      • rootImageUuidString必填

        根云盘镜像UUID

      • installPathString必填

        安装路径

      • typeString必填

        云盘类型

      • formatString必填

        云盘格式

      • sizeLong必填

        云盘虚拟容量

      • actualSizeLong必填

        云盘实际容量

      • deviceIdInteger必填

        设备ID

      • stateString必填

        云盘的可用状态

      • statusString必填

        云盘的连接状态

      • createDateTimestamp必填

        创建时间

      • lastOpDateTimestamp必填

        最后一次修改时间

      • volumeQosString必填

        暂无描述。

      • lastDetachDateTimestamp必填

        最近一次detach时间。

      • lastVmInstanceUuidString必填

        最近一次云主机实例UUID。

      • isShareableBoolean必填

        云盘是否共享

    • vmCdRomsList必填

      详情参考vmCdRoms

请求地址

POST/zstack/v1/vpc/virtual-routers

/zstack/v1/vpc/virtual-routers

操作 ID

CreateVpcVRouter

永久链接

请求示例

curl -X POST 'http://{host}/zstack/v1/vpc/virtual-routers' -H 'Authorization: OAuth {sessionUuid}' -H 'Content-Type: application/json;charset=UTF-8' -d '{"params":{"name":"<name>","virtualRouterOfferingUuid":"<virtualRouterOfferingUuid>","description":"<description>","resourceUuid":"<resourceUuid>","zoneUuid":"<zoneUuid>","clusterUuid":"<clusterUuid>","hostUuid":"<hostUuid>","primaryStorageUuidForRootVolume":"<primaryStorageUuidForRootVolume>","rootVolumeSystemTags":["<rootVolumeSystemTags>"]},"systemTags":["<systemTags>"],"userTags":["<userTags>"]}'

响应示例

200
{ "inventory": { "applianceVmType": "vpcvrouter", "managementNetworkUuid": "a01fad3eb1d14bd787b8830e1d287ee3", "status": "Connected", "agentPort": 7272.0, "uuid": "4de286dcb34343a0b5dedaea96307c06", "name": "TestVPC", "description": "this is a vpc for test", "zoneUuid": "88634bc51a1345b98058c1827999bd75", "clusterUuid": "5ebca05bc3cf4d5b970ddb32b10455c0", "imageUuid": "490043dfeb814b119f0f6c264ed6bb1e", "hostUuid": "a19572ae4fcc4b7d8a090d06c99067fa", "lastHostUuid": "d374797d2d01495cb4dedd9e452909d0", "instanceOfferingUuid": "8fcc3c2b5e1b41e586ed07ffece475e4", "rootVolumeUuid": "ed5b232109f64f0dbe3342ffa8924d14", "platform": "Linux", "defaultL3NetworkUuid": "2aedc4cd00f8495f8fc08c991dd7be4c", "type": "ApplianceVm", "hypervisorType": "KVM", "memorySize": 8.589934592E9, "cpuNum": 4.0, "allocatorStrategy": "LastHostPreferredAllocatorStrategy", "createDate": "Nov 9, 2017 4:20:39 PM", "lastOpDate": "Nov 9, 2017 4:20:39 PM", "state": "Running", "vmNics": [ { "uuid": "6c8b46eec225440bb7179b6c797937ed", "vmInstanceUuid": "4de286dcb34343a0b5dedaea96307c06", "usedIpUuid": "033b876b861f4b9abaf594a893c1c94f", "l3NetworkUuid": "49e2d31895c94bf0808372360ebcae31", "ip": "192.168.1.10", "mac": "00:0c:29:bd:99:fc", "netmask": "255.255.255.0", "gateway": "192.168.1.1", "deviceId": 0.0, "createDate": "Nov 9, 2017 4:20:39 PM", "lastOpDate": "Nov 9, 2017 4:20:39 PM" } ], "allVolumes": [ { "uuid": "ed5b232109f64f0dbe3342ffa8924d14", "name": "Root-Volume-For-VM-4de286dcb34343a0b5dedaea96307c06", "primaryStorageUuid": "c3f1cbaf9b014c1d8989ff940ed5593a", "vmInstanceUuid": "4de286dcb34343a0b5dedaea96307c06", "diskOfferingUuid": "93bfd802ebea486ab4ce071967235b76", "rootImageUuid": "490043dfeb814b119f0f6c264ed6bb1e", "installPath": "/Cloud_ps/rootVolumes/acct-36c27e8ff05c4780bf6d2fa65700f22e/vol-ed5b232109f64f0dbe3342ffa8924d14/ed5b232109f64f0dbe3342ffa8924d14.qcow2", "type": "Root", "format": "qcow2", "size": 1.073741824E11, "actualSize": 2.147483648E10, "deviceId": 0.0, "state": "Enabled", "status": "Ready", "createDate": "Nov 9, 2017 4:20:39 PM", "lastOpDate": "Nov 9, 2017 4:20:39 PM" } ] } }

变更历史

此 API 暂无变更历史记录。

查看全部变更历史