服务器列表
本文说明智简魔方 DCIM 系统中“服务器列表”相关的接口或函数信息,供开发人员在集成、调用和排查问题时参考。
概述
查询系统下的所有符合条件的服务器硬件信息
URL
/index.php?m=api&a=hardwareListing请求参数
| 字段名 | 变量名 | 必填 | 类型 | 描述 |
|---|---|---|---|---|
| 搜索类型 | search | 否 | string | 搜索类型(house:机房 ID,cabinet:机柜 ID,power:电源状态,key:IP 或者物理标签或者内部标签,highgrade:高级搜索,special:特殊搜索) |
| 搜索内容 | key | 否 | string | 对服务器硬件信息的搜索,搜索类型为 house 时,调用/index.php?m=api&a=getHouse 获取由 id(机房 ID)和 name(机房名称)组成的二维数组,选择传递 ID;搜索类型为 cabinet 时,调用/index.php?m=api&a=getCabinet 获取由 id(机柜 ID)和 name(机柜名称)组成的二维数组,选择传递 ID;搜索类型为电源状态时,选择(on:开机,off:关机,error:未知)其一传递; |
| 分页数量 | listpages | 否 | int | 每一页显示的数据的数量 |
| 排序类型 | orderby | 否 | string | 用来排序的字段 |
| 排序规则 | sorting | 否 | string | 升序 asc 降序 desc |
| 数据偏移量 | offset | 否 | int | 返回数据的偏移指针,与分页数量结合使用 |
| 服务器类型 | type | 否 | string | 搜索的服务器类型,(1:租用,2:自用,5:托管) |
| cpu | cpu | 否 | array | 高级/特殊搜索参数(search 的值为 highgrade 或 special 时使用),CPU 的 ID,调用/index.php?m=api&a=getCpu 获取由 id(CPU ID)和 name(CPU 名称)组成的二维数组 |
| cpu 数量 | cpu_num | 否 | int | 高级/特殊搜索参数(search 的值为 highgrade 或 special 时使用),CPU 数量 |
| 内存 | ram | 否 | arraysearch 为 special 时为二维数组 | 高级/特殊搜索参数(search 的值为 highgrade 或 special 时使用),内存 ID,调用/index.php?m=api&a=getRam 获取由 id(内存 ID)和 name(内存名称)组成的二维数组 |
| 内存数量 | ram_num | 否 | search为highgrade时为int search为special时为array | 高级/特殊搜索参数(search的值为highgrade或special时使用),内存数量 search为special时,ram数组和ram_num数组的值根据下标一一对应代表搜索x个a/c,y个b/d |
| 硬盘 | disk | 否 | arraysearch 为 special 时为二维数组 | 高级/特殊搜索参数(search 的值为 highgrade 或 special 时使用),硬盘 ID,调用/index.php?m=api&a=getDisk 获取由 id(硬盘 ID)和 name(硬盘名称)组成的二维数组 |
| 硬盘数量 | disk_num | 否 | search为highgrade时为int search为special时为array | 高级/特殊搜索参数(search的值为highgrade或special时使用),硬盘数量 search为special时,disk数组和disk_num数组的值根据下标一一对应代表搜索x个a/c,y个b/d |
| PCI | pci | 否 | arraysearch 为 special 时为二维数组 | 高级/特殊搜索参数(search 的值为 highgrade 或 special 时使用),PCI ID,调用/index.php?m=api&a=getPci 获取由 id(PCI ID)和 name(PCI 名称)组成的二维数组 |
| PCI数量 | pci_num | 否 | search为highgrade时为int search为special时为array | 高级/特殊搜索参数(search的值为highgrade或special时使用),硬盘数量 search为special时,pci数组和pci_num数组的值根据下标一一对应代表搜索x个a/c,y个b/d |
| ip | ip | 否 | string | 高级搜索参数(search 的值为 highgrade 时使用),IP 地址 |
| ip 数量 | ip_num | 否 | int | 高级搜索参数(search 的值为 highgrade 时使用),IP 数量 |
| 内存容量 | ram_capacity | 否 | int | 特殊搜索参数(search 的值为 special 时使用),内存容量 |
| 过滤规则 | filter | 否 | int | 特殊搜索参数(search 的值为 special 时使用),0:一致,1:包含 |
返回参数
| 字段名 | 变量名 | 类型 | 描述 |
|---|---|---|---|
| 服务器硬件列表 | listing | array id 服务器硬件id wltag 物理标签 nbtag 内部标签 cpu 一维数组(name:cpu名称,num:cpu数量) ram 二维数组(name:内存名称,num:内存数量)disk 二维数组(name:硬盘名称,num:硬盘数量)pci 二维数组(name:pci名称,num:pci数量)time 上架时间 serverid 服务器软件IDstype 类型(1租用,2自用,5托管,8机柜客户)power 电源状态(error:错误,on:开机,off:关机,nonsupport:不支持) intranet_id 内网IDlock 锁定mac(0:不锁定,1:锁定)mac mac地址ipmi_name ipmi用户名ipmi_pass ipmi密码power_msg 电源状态信息zhuip 主IPsubnetmask 子网掩码gateway 网关ipmi_ip IPMI IPvlan 连接交换机可用vlanswitch_id 连接交换机idswitch_num 连接交换机端口号switch_num_name 连接交换机端口号名称in_bw 连接交换机端口入口带宽out_bw 连接交换机端口出口带宽vlanid 连接交换机端口vlanport_mac 连接交换机端口mac地址(数组)mac_diff mac地址和交换机端口mac地址是否不同(0:相同。1:不同)typename 硬件型号名称pid 连接PDU设备ID pdu 连接PDU设备名称 pdu_num 连接PDU设备端口showtype pdu端口显示类型(0:数字,1:字母)ipmi_support 支持IPMI控制(true,false)cid 所属机柜ID cname 所属机柜名称house 机房idhouse_name 机房名称osname 操作系统os_id 操作系统idos_group_id 操作系统分组idosusername 系统账号ospassword 系统密码sum 分配ip总数ip 分配ip(数组) | 根据查询条件查询到的所有服务器硬件数据 |
| 服务器内网 | intranetServer | array id 服务器id wltag 服务器物理标签 | 服务器内网,数组下标为服务器软件ID |
| 服务器连接交换机 | switch | array sid 交换机ID sname 交换机名称 switch_num 交换机端口号 | 服务器连接交换机,数组下标为服务器硬件ID |
| 服务器总数 | sum | int | 系统内服务器硬件数据的总数 |
| 分页数量 | listpages | int | 每一页显示的数据的数量 |
| 搜索类型 | search | string | 搜索类型 |
| 搜索内容 | key | string | 自定义的搜索内容 |
| 排序类型 | orderby | string | 用来排序的字段 |
| 排序规则 | sorting | string | 升序 asc 降序 desc |
| 数据偏移量 | offset | int | 返回数据的偏移指针,与分页数量结合使用 |
| 服务器类型 | type | string | 搜索的服务器类型 |
| 状态 | status | string | success 成功 error 失败 |
0