菜单

29.连线模型类

下载

连线模型类

连线模型列表

  • 接口描述:传入分页要求,查询连线模型列表。

  • URL地址:http://ip:port /wapi/v1/devcatalog/links

  • 访问方法::Get

  • 请求参数:

    Parame参数

参数名 类型 示例值 必填 说明
skip integer 0 页码
take integer 1 一页大小
  • 响应示例:

{

"totalCount": 46,

"data": [

{

"num": 1,

"id": 27000000000249,

"description": "室外单模熔纤光缆96芯",

"vendor": "NWVDI",

"model": "OS2-96-OD clone",

"color": "#000000",

"favourite": true,

"enabled": true,

"htLinkType": "{\"linkType\":null,\"startArrowHead\":null,\"endArrowHead\":null,\"autoArrangement\":false}",

"thickness": 3.0,

"category": "通信光缆",

"linkStyle": "实线",

"mpc": null,

"propertyCount": 18,

"overridesCount": 0,

"instances": 23,

"strands": 96,

"unit": null,

"unitPrice": 0.0,

"origin": null

}

]

}

模型id和名称列表

  • 接口描述:获取系统内全部线缆模型的id和名称的列表。
  • URL地址:http://ip:port /wapi/v1/link_types/id_and_name
  • 访问方法::Get
  • 请求参数: null
  • 响应示例:

[

{

"id": 27000000000054,

"name": "设备内连线"

},

{

"id": 27000000000057,

"name": "Tray"

}

]

根据id获取模型

  • 接口描述:传入连线模型id,获取连线模型的详细信息。

  • URL地址:http://ip:port /wapi/v1/link_types/{linkTypeId}

  • 访问方法::Get

  • 请求参数:

    Path参数

参数名 类型 示例值 必填 说明
linkTypeId Long 27000000000057 连线模型id
  • 响应示例:

{

"id": 27000000000057,

"name": "Tray",

"color": "#868383",

"thickness": 2.0,

"linkStyle": 0,

"categoryId": 130005,

"snappedToEdge": false,

"matchingPortConnectors": true,

"useForAcraPatch": false,

"excludableFromAcra": false,

"mode": null,

"vendorId": 782,

"description": "网格桥架",

"background": "",

"htLinkType": "{\"linkType\":null,\"startArrowHead\":null,\"endArrowHead\":null,\"autoArrangement\":false}",

"topLeftX": null,

"topLeftY": null,

"bottomRightX": null,

"bottomRightY": null,

"enabled": true,

"system": false,

"favourite": false

}

根据id删除模型

  • 接口描述:传入连线模型id,删除对应线缆模型。

  • URL地址:http://ip:port /wapi/v1/link_types/{linkTypeId}

  • 访问方法::Delete

  • 请求参数:

    Path参数

参数名 类型 示例值 必填 说明
linkTypeId Long 27000000000057 连线模型id
  • 响应示例:

{

"code": 200

}

根据id列表删除模型

  • 接口描述:传入连线模型id列表,删除所有对应线缆模型。

  • URL地址:http://ip:port /wapi/v1/link_types/linkTypesIdList/{linkTypeIdList}

  • 访问方法::Delete

  • 请求参数:

    Path参数

参数名 类型 示例值 必填 说明
linkTypeIdList Long [27000000000057] 模型id列表
  • 响应示例:

{

"code": 200

}

创建连线模型

  • 接口描述:传入连线模型名称、品牌、描述、分类、是否启用、是否收藏、颜色、粗细,创建连线模型。

  • URL地址:http://ip:port /wapi/v1/link_types

  • 访问方法::Post

  • 请求参数:

    Body参数

参数名 类型 示例值 必填 说明
model String testlinktype02 型号名称
vendor String 3Com 品牌名称
description String testcreat 型号描述
category String 管理跳线 模型分类
enable Boolean true 是否启用
favourite Boolean true 是否收藏
thickness Integer 3 模型粗细
color String #000000 模型颜色
  • 响应示例:

{

"code": 200,

"data": {

"id": 27000000000251,

"name": "testlinktype02",

"color": "#000000",

"thickness": 3,

"linkStyle": 0,

"categoryId": 130000,

"snappedToEdge": true,

"matchingPortConnectors": null,

"useForAcraPatch": null,

"excludableFromAcra": true,

"mode": null,

"vendorId": 307,

"description": "testcreat",

"background": null,

"htLinkType": null,

"topLeftX": null,

"topLeftY": null,

"bottomRightX": null,

"bottomRightY": null,

"enabled": true,

"system": false,

"favourite": true

}

}

修改连线模型

  • 接口描述:传入连线模型id和要修改的属性,对连线模型进行修改。

  • URL地址:http://ip:port /wapi/v1/link_types/{linkTypeId}

  • 访问方法::Put

  • 请求参数:

    Path参数

参数名 类型 示例值 必填 说明
linkTypeId Long 27000000000251 型号id

Body参数

参数名 类型 示例值 必填 说明
model String testlinktype02 型号名称
vendor String 3Com 品牌名称
description String testcreat 型号描述
category String 管理跳线 模型分类
enable Boolean true 是否启用
favourite Boolean true 是否收藏
thickness Integer 3 模型粗细
color String #f50000 模型颜色
  • 响应示例:

{

"code": 200,

"data": {

"id": 27000000000251,

"name": "testlinktype02",

"color": "#f50000",

"thickness": 3,

"linkStyle": 0,

"categoryId": 130000,

"snappedToEdge": true,

"matchingPortConnectors": null,

"useForAcraPatch": null,

"excludableFromAcra": true,

"mode": null,

"vendorId": 307,

"description": "testcreat",

"background": null,

"htLinkType": null,

"topLeftX": null,

"topLeftY": null,

"bottomRightX": null,

"bottomRightY": null,

"enabled": true,

"system": false,

"favourite": true

}

}

修改连线模型背景

  • 接口描述:传入连线模型id和要修改的属性,修改连线模型的背景。

  • URL地址:http://ip:port/wapi/v1/link_types/{linkTypeId}/set_background_image

  • 访问方法::Put

  • 请求参数:

    Path参数

参数名 类型 示例值 必填 说明
linkTypeId Long 27000000000251 型号id

Parame参数

参数名 类型 示例值 必填 说明
File file 一个png图片 背景图片
  • 响应示例:

{

"code": 200

}

复制连线模型

  • 接口描述:传入连线模型id,复制连线模型,复制内容包含名称(原名称+”clone”)、描述、品牌、分类、粗细、颜色、背景图片、纤芯、纤芯文字。

  • URL地址:http://ip:port/wapi/v1/link_types/{linkTypeId}/clone

  • 访问方法::Post

  • 请求参数:

    Path参数

参数名 类型 示例值 必填 说明
linkTypeId Long 27000000000251 型号id
  • 响应示例:

{

"code": 200

}

导入连线模型

  • 接口描述:传入连线模型导入文件,用导入的方式创建连线模型。

  • URL地址:http://ip:port/wapi/v1/link_types/import_model

  • 访问方法::Put

  • 请求参数:

    Parame参数

参数名 类型 示例值 必填 说明
File file 一个线缆模型文件 模型导入文件
  • 响应示例:

{

"code": 200

}

导出连线模型

  • 接口描述:传入连线模型id,将此模型按照nVisual可识别的方式导出。

  • URL地址:http://ip:port/wapi/v1/link_types/export_model/{linkTypeId}

  • 访问方法::Get

  • 请求参数:

    Path参数

参数名 类型 示例值 必填 说明
linkTypeId Long 27000000000251 型号id
  • 响应示例:

二进制文件流 是个zip文件

图形用户界面, 文本, 应用程序, 电子邮件 描述已自动生成

根据连线id查询模型

  • 接口描述:传入连线id,查询此id对应线缆的模型的信息。

  • URL地址:http://ip:port/wapi/v1/link_types/get_by_link_entity/{linkId}

  • 访问方法::Get

  • 请求参数:

    Path参数

参数名 类型 示例值 必填 说明
linkId Long 25000000126017 连线id
  • 响应示例:

{

"code": 200,

"data": {

"id": 27000000000000,

"name": "Link",

"color": "#000000",

"thickness": 1.0,

"linkStyle": 0,

"categoryId": 130007,

"snappedToEdge": false,

"matchingPortConnectors": false,

"useForAcraPatch": false,

"excludableFromAcra": false,

"mode": null,

"vendorId": 782,

"description": "系统保留",

"background": "",

"htLinkType": "{\"linkType\":null,\"startArrowHead\":null,\"endArrowHead\":null,\"autoArrangement\":false}",

"topLeftX": null,

"topLeftY": null,

"bottomRightX": null,

"bottomRightY": null,

"system": true,

"enabled": false,

"favourite": true

}

}

根据连线id修改模型

  • 接口描述:传入连线id,修改此id对应线缆的模型的信息。

  • URL地址:http://ip:port/wapi/v1/link_types/edit_by_link_entity/{linkId}

  • 访问方法::Put

  • 请求参数:

    Path参数

参数名 类型 示例值 必填 说明
linkId Long 25000000126017 连线id

Body参数

参数名 类型 示例值 必填 说明
color char #000000 线缆颜色
htLinkType char "{\"linkType\":null,\"startArrowHead\":\"arrowHead1\",\"endArrowHead\":null,\"autoArrangement\":false}" 连线类型
linkStyle char "实线" 线性
thickness int 3 粗细
  • 响应示例:

{

"code": 200,

"data": {

"id": 27000000000000,

"name": "Link",

"color": "#000000",

"thickness": 1.0,

"linkStyle": 0,

"categoryId": 130007,

"snappedToEdge": false,

"matchingPortConnectors": false,

"useForAcraPatch": false,

"excludableFromAcra": false,

"mode": null,

"vendorId": 782,

"description": "系统保留",

"background": "",

"htLinkType": "{\"linkType\":null,\"startArrowHead\":null,\"endArrowHead\":null,\"autoArrangement\":false}",

"topLeftX": null,

"topLeftY": null,

"bottomRightX": null,

"bottomRightY": null,

"system": true,

"enabled": false,

"favourite": true

}

}

最近修改: 2025-02-27