查询自定义机型部件信息

最近更新时间:2018-03-23 18:12:24

功能描述

DescribeHardwareSpecification接口用来获取自定义机型部件的配置信息。

接口访问域名:bm.api.qcloud.com

请求

请求示例

https://bm.api.qcloud.com/v2/index.php?
    Action=DescribeHardwareSpecification
    &<公共请求参数>

请求参数

正式调用时需要加上公共请求参数,此接口的Action字段为DescribeHardwareSpecification。

参数名称 必选 类型 描述
- - -

响应

响应示例

{
    "code": 0,
    "message": "",
    "codeDesc": "Success",
    "data": {
        "cpu": [{
            "cpuId": 1,
            "cpuDesc": "E5-2620v3 (6\u6838)  * 2",
            "series": "1",
            "haveRaidCard": [0,
            1]
        },
        {
            "cpuId": 3,
            "cpuDesc": "E5-2670v3 (12\u6838)  * 2",
            "series": "1",
            "haveRaidCard": [1]
        },
        {
            "cpuId": 4,
            "cpuDesc": "E5-2620v4 (8\u6838) * 2",
            "series": "2",
            "haveRaidCard": [0,
            1]
        },
        {
            "cpuId": 2,
            "cpuDesc": "E5-2680v4 (14\u6838)  * 2",
            "series": "2",
            "haveRaidCard": [0,
            1]
        }],
        "mem": [64,
        128,
        192,
        256,
        384,
        512],
        "disk": [{
            "diskTypeId": 1,
            "medium": "HDD",
            "interface": "SAS",
            "size": 300,
            "svrHeight": 1,
            "repr": "HDD-SAS-300G",
            "goodsCode": "bm_elastic_SAS_300G_10000RTM",
            "pid": 10933,
            "newGoodsCode": "bm_elastic_new_HDD-300G-SAS",
            "newPid": "11820",
            "order": "10",
            "priority": 40,
            "isUse": "1"
        },
        {
            "diskTypeId": 2,
            "medium": "HDD",
            "interface": "SAS",
            "size": 600,
            "svrHeight": 1,
            "repr": "HDD-SAS-600G",
            "goodsCode": "bm_elastic_SAS_600G_10000RTM",
            "pid": 10934,
            "newGoodsCode": "bm_elastic_new_HDD-600G-SAS",
            "newPid": "11821",
            "order": "20",
            "priority": 50,
            "isUse": "1"
        },
        {
            "diskTypeId": 3,
            "medium": "HDD",
            "interface": "SAS",
            "size": 1200,
            "svrHeight": 1,
            "repr": "HDD-SAS-1.2T",
            "goodsCode": "bm_elastic_SAS_1200G_10000RTM",
            "pid": 10935,
            "newGoodsCode": "bm_elastic_new_HDD-1200G-SAS",
            "newPid": "11822",
            "order": "30",
            "priority": 60,
            "isUse": "1"
        },
        {
            "diskTypeId": 4,
            "medium": "HDD",
            "interface": "SATA",
            "size": 2000,
            "svrHeight": 2,
            "repr": "HDD-SATA-2T",
            "goodsCode": "bm_elastic_SATA_2T_7200RTM",
            "pid": 10936,
            "newGoodsCode": "bm_elastic_new_HDD-2T-SATA",
            "newPid": "11823",
            "order": "40",
            "priority": 70,
            "isUse": "1"
        },
        {
            "diskTypeId": 5,
            "medium": "HDD",
            "interface": "SATA",
            "size": 4000,
            "svrHeight": 2,
            "repr": "HDD-SATA-4T",
            "goodsCode": "bm_elastic_SATA_4T_7200RTM",
            "pid": 10937,
            "newGoodsCode": "bm_elastic_new_HDD-4T-SATA",
            "newPid": "11824",
            "order": "50",
            "priority": 80,
            "isUse": "1"
        },
        {
            "diskTypeId": 6,
            "medium": "HDD",
            "interface": "SATA",
            "size": 8000,
            "svrHeight": 2,
            "repr": "HDD-SATA-8T",
            "goodsCode": "bm_elastic_SATA_8T_7200RTM",
            "pid": 11049,
            "newGoodsCode": "bm_elastic_new_HDD-8T-SATA",
            "newPid": "11825",
            "order": "60",
            "priority": 90,
            "isUse": "1"
        },
        {
            "diskTypeId": 7,
            "medium": "SSD",
            "interface": "SATA",
            "size": 240,
            "svrHeight": 1,
            "repr": "SSD-SATA-240G",
            "goodsCode": "bm_elastic_SSD_240g",
            "pid": 10938,
            "newGoodsCode": "bm_elastic_new_SSD-240G",
            "newPid": "11826",
            "order": "70",
            "priority": 10,
            "isUse": "1"
        },
        {
            "diskTypeId": 8,
            "medium": "SSD",
            "interface": "SATA",
            "size": 480,
            "svrHeight": 1,
            "repr": "SSD-SATA-480G",
            "goodsCode": "bm_elastic_SSD_480G",
            "pid": 10939,
            "newGoodsCode": "bm_elastic_new_SSD-480G",
            "newPid": "11827",
            "order": "80",
            "priority": 20,
            "isUse": "1"
        },
        {
            "diskTypeId": 9,
            "medium": "SSD",
            "interface": "SATA",
            "size": 800,
            "svrHeight": 1,
            "repr": "SSD-SATA-800G",
            "goodsCode": "bm_elastic_SSD_800G",
            "pid": 10940,
            "newGoodsCode": "bm_elastic_new_SSD-800G",
            "newPid": "11828",
            "order": "90",
            "priority": 30,
            "isUse": "1"
        },
        {
            "diskTypeId": 10,
            "medium": "SSD",
            "interface": "U.2",
            "size": 2000,
            "svrHeight": 1,
            "repr": "SSD-NVME-2T",
            "goodsCode": "bm_elastic_Nvme_SSD_2T",
            "pid": 11708,
            "newGoodsCode": "bm_elastic_new_NVME-SSD-2T",
            "newPid": "11829",
            "order": "100",
            "priority": 200,
            "isUse": "1"
        }],
        "special": []
    }
}

响应参数

响应参数部分包含两层结构,外层展示接口的响应结果,内层展示具体的接口内容,包括自定义机型部件的配置等信息。

参数名称 类型 描述
code Int 错误码,0:成功,其他值:失败,具体含义参见错误码
message String 错误信息。
data Object 数组元素为各个自定义机型部件的配置信息,其中包括CPU,内存,硬盘等信息。具体结构描述如data结构所示。

data结构

参数名称 类型 描述
cpu Array(Object) 对象数组,数组元素为CPU型号,具体结构描述如CPU结构。
mem Array(Int) 整型数组,数组元素为mem可取值,单位是G。例如:[64, 128, 256, 384, 512]。
disk Array(Object) 对象数组,数组元素为硬盘型号。具体结构描述如disk结构所示。

CPU结构

参数名称 类型 描述
cpuId Int CPU标识。
cpuDesc String CPU型号描述。
series Int 机型序列。
haveRaidCard Array(Int) 支持的RAID方式,0:有RAID卡,1:没有RAID卡。

disk结构

参数名称 类型 描述
diskTypeId Int 硬盘的整型标识
medium String 介质类型。
interface String 硬盘接口类型。
size Int 硬盘容量。
svrHeight Int 机型高度,1u或2u。
repr String 硬盘的型号描述。
goodsCode String 编号。
pid Int 计费ID(内部使用)。
order String 排序方式(内部使用)。
priority Int 磁盘顺序选择。
newGoodsCode String 新编号。
newPid String 新计费ID(内部使用)。
isUse String 是否展示(内部使用)。

错误码

错误码 英文提示 错误描述
9001 InternalError.DbError 操作数据库错误

实际案例

输入

https://bm.api.qcloud.com/v2/index.php?
    Action=DescribeHardwareSpecification
    &SecretId=AKID52SKw5uMEy3jhpMUBqSylEBJBby6E0KC
    &Nonce=48476
    &Timestamp=1476436689
    &Region=bj
    &Signature=afRlJQ0disdT97B7uIfVB4v2KWo%3D

输出

{
    "code": 0,
    "message": "",
    "codeDesc": "Success",
    "data": {
        "cpu": [{
            "cpuId": 1,
            "cpuDesc": "E5-2620v3 (6\u6838)  * 2",
            "series": "1",
            "haveRaidCard": [0,
            1]
        },
        {
            "cpuId": 3,
            "cpuDesc": "E5-2670v3 (12\u6838)  * 2",
            "series": "1",
            "haveRaidCard": [1]
        },
        {
            "cpuId": 4,
            "cpuDesc": "E5-2620v4 (8\u6838) * 2",
            "series": "2",
            "haveRaidCard": [0,
            1]
        },
        {
            "cpuId": 2,
            "cpuDesc": "E5-2680v4 (14\u6838)  * 2",
            "series": "2",
            "haveRaidCard": [0,
            1]
        }],
        "mem": [64,
        128,
        192,
        256,
        384,
        512],
        "disk": [{
            "diskTypeId": 1,
            "medium": "HDD",
            "interface": "SAS",
            "size": 300,
            "svrHeight": 1,
            "repr": "HDD-SAS-300G",
            "goodsCode": "bm_elastic_SAS_300G_10000RTM",
            "pid": 10933,
            "newGoodsCode": "bm_elastic_new_HDD-300G-SAS",
            "newPid": "11820",
            "order": "10",
            "priority": 40,
            "isUse": "1"
        },
        {
            "diskTypeId": 2,
            "medium": "HDD",
            "interface": "SAS",
            "size": 600,
            "svrHeight": 1,
            "repr": "HDD-SAS-600G",
            "goodsCode": "bm_elastic_SAS_600G_10000RTM",
            "pid": 10934,
            "newGoodsCode": "bm_elastic_new_HDD-600G-SAS",
            "newPid": "11821",
            "order": "20",
            "priority": 50,
            "isUse": "1"
        },
        {
            "diskTypeId": 3,
            "medium": "HDD",
            "interface": "SAS",
            "size": 1200,
            "svrHeight": 1,
            "repr": "HDD-SAS-1.2T",
            "goodsCode": "bm_elastic_SAS_1200G_10000RTM",
            "pid": 10935,
            "newGoodsCode": "bm_elastic_new_HDD-1200G-SAS",
            "newPid": "11822",
            "order": "30",
            "priority": 60,
            "isUse": "1"
        },
        {
            "diskTypeId": 4,
            "medium": "HDD",
            "interface": "SATA",
            "size": 2000,
            "svrHeight": 2,
            "repr": "HDD-SATA-2T",
            "goodsCode": "bm_elastic_SATA_2T_7200RTM",
            "pid": 10936,
            "newGoodsCode": "bm_elastic_new_HDD-2T-SATA",
            "newPid": "11823",
            "order": "40",
            "priority": 70,
            "isUse": "1"
        },
        {
            "diskTypeId": 5,
            "medium": "HDD",
            "interface": "SATA",
            "size": 4000,
            "svrHeight": 2,
            "repr": "HDD-SATA-4T",
            "goodsCode": "bm_elastic_SATA_4T_7200RTM",
            "pid": 10937,
            "newGoodsCode": "bm_elastic_new_HDD-4T-SATA",
            "newPid": "11824",
            "order": "50",
            "priority": 80,
            "isUse": "1"
        },
        {
            "diskTypeId": 6,
            "medium": "HDD",
            "interface": "SATA",
            "size": 8000,
            "svrHeight": 2,
            "repr": "HDD-SATA-8T",
            "goodsCode": "bm_elastic_SATA_8T_7200RTM",
            "pid": 11049,
            "newGoodsCode": "bm_elastic_new_HDD-8T-SATA",
            "newPid": "11825",
            "order": "60",
            "priority": 90,
            "isUse": "1"
        },
        {
            "diskTypeId": 7,
            "medium": "SSD",
            "interface": "SATA",
            "size": 240,
            "svrHeight": 1,
            "repr": "SSD-SATA-240G",
            "goodsCode": "bm_elastic_SSD_240g",
            "pid": 10938,
            "newGoodsCode": "bm_elastic_new_SSD-240G",
            "newPid": "11826",
            "order": "70",
            "priority": 10,
            "isUse": "1"
        },
        {
            "diskTypeId": 8,
            "medium": "SSD",
            "interface": "SATA",
            "size": 480,
            "svrHeight": 1,
            "repr": "SSD-SATA-480G",
            "goodsCode": "bm_elastic_SSD_480G",
            "pid": 10939,
            "newGoodsCode": "bm_elastic_new_SSD-480G",
            "newPid": "11827",
            "order": "80",
            "priority": 20,
            "isUse": "1"
        },
        {
            "diskTypeId": 9,
            "medium": "SSD",
            "interface": "SATA",
            "size": 800,
            "svrHeight": 1,
            "repr": "SSD-SATA-800G",
            "goodsCode": "bm_elastic_SSD_800G",
            "pid": 10940,
            "newGoodsCode": "bm_elastic_new_SSD-800G",
            "newPid": "11828",
            "order": "90",
            "priority": 30,
            "isUse": "1"
        },
        {
            "diskTypeId": 10,
            "medium": "SSD",
            "interface": "U.2",
            "size": 2000,
            "svrHeight": 1,
            "repr": "SSD-NVME-2T",
            "goodsCode": "bm_elastic_Nvme_SSD_2T",
            "pid": 11708,
            "newGoodsCode": "bm_elastic_new_NVME-SSD-2T",
            "newPid": "11829",
            "order": "100",
            "priority": 200,
            "isUse": "1"
        }],
        "special": []
    }
}