硬件配置模板接口

请求地址

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

请求参数

字段 类型 是否必填 描述
Sn string SN序列号

请求参数示例

{
  "Sn": "test"
}

请求示例(PHP)

<?php
$data = array("Sn" => "test");
$str = json_encode($data);
$ch = curl_init('http://localhost:8083/api/osinstall/v1/device/getHardwareBySn');
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
Content.Compamy 厂商名称
Content.Product 产品名称
Content.ModelName 型号
Content.Hardware 硬件配置节点
Content.Hardware[].Name 节点名称
Content.Hardware[].Scripts 需要执行的脚本
Content.Hardware[].Scripts[].script 执行脚本,需要做base64decode处理
Message 提示

返回参数示例

{
  "Content": {
    "Company": "Dell",
    "Hardware": [
      {
        "Name": "RAID",
        "Scripts": [
          {
            "Name": "RAID",
            "Script": "L29wdC95dW5qaS9vc2luc3RhbGwvZGVsbC9yYWlkLnNoIC1jIC1sIDEw"
          }
        ]
      },
      {
        "Name": "OOB",
        "Scripts": [
          {
            "Name": "网络类型",
            "Script": "L29wdC95dW5qaS9vc2luc3RhbGwvZGVsbC9vb2Iuc2ggLW4gZGhjcA=="
          },
          {
            "Name": "用户名",
            "Script": "L29wdC95dW5qaS9vc2luc3RhbGwvZGVsbC9vb2Iuc2ggLXUgcm9vdA=="
          },
          {
            "Name": "密码",
            "Script": "L29wdC95dW5qaS9vc2luc3RhbGwvZGVsbC9vb2Iuc2ggLXAgY2Fsdmlu"
          }
        ]
      },
      {
        "Name": "BIOS",
        "Scripts": [
          {
            "Name": "VT",
            "Script": "L29wdC95dW5qaS9vc2luc3RhbGwvZGVsbC9iaW9zLnNoIC10IGVuYWJsZQ=="
          },
          {
            "Name": "C-States",
            "Script": "L29wdC95dW5qaS9vc2luc3RhbGwvZGVsbC9iaW9zLnNoIC1jIGRpc2FibGU="
          }
        ]
      }
    ],
    "ModelName": "R420",
    "Product": "PowerEdge"
  },
  "Message": "成功获取hardware信息",
  "Status": "success"
}

results matching ""

    No results matching ""