设备录入接口

请求地址

名称 说明
请求地址 http://localhost:8083/api/osinstall/v1/device/add
编码 UTF-8
请求方式 POST
请求参数格式 application/json

请求参数

字段 类型 是否必填 描述
Sn string SN序列号
Hostname string 主机名
Ip string 应用IP
ManageIp string 管理IP
NetworkID int 应用网络资源表(networks)表ID
ManageNetworkID int 管理网络资源表(manage_networks)表ID
OsID int 操作系统表(os_configs)表ID
HardwareID int 硬件配置表(hardwares)表ID
SystemID int 系统模板表(system_configs)表ID
LocationID int 位置表(locations)表ID
AssetNumber string 财编
AccessToken string 调用登录API时,生成的授权AccessToken

请求参数示例

{
  "Sn": "test",
  "Hostname": "idcos-test",
  "Ip": "192.168.0.3",
  "ManageIp": "192.168.1.1",
  "NetworkID": 6,
  "ManageNetworkID": 1,
  "OsID": 2,
  "HardwareID": 1,
  "SystemID": 1,
  "LocationID": 33,
  "AssetNumber": "CB20151216001",
  "AccessToken": "097B55289D87C26FC33C2B0F7F80701D",
}

请求示例(PHP)

<?php
$data = array(
 "Sn" => "test",
 "Hostname" => "idcos-test",
 "Ip" => "192.168.0.3",
 "ManageIp" => "192.168.1.1",
 "NetworkID" => 6,
 "ManageNetworkID" => 1,
 "OsID" => 2,
 "HardwareID" => 1,
 "SystemID" => 1,
 "LocationID" => 33,
 "AssetNumber" => "CB20151216001",
 "AccessToken" => "097B55289D87C26FC33C2B0F7F80701D",
);
$str = json_encode($data);
$ch = curl_init('http://localhost:8083/api/osinstall/v1/device/add');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $str);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json',
    'Content-Length: ' . strlen($str))
);

$result = curl_exec($ch);
echo curl_error($ch);
echo $result;

返回参数

字段 说明
Status success/failure
Message 提示

返回参数示例

{
  "Message": "操作成功",
  "Status": "success"
}

results matching ""

    No results matching ""