Mudanças entre as edições de "BMAPI POST api/v1/inventoryhardware/"
De MSTECH wiki
(→Request) |
(→Response) |
||
| (8 revisões intermediárias pelo mesmo usuário não estão sendo mostradas) | |||
| Linha 10: | Linha 10: | ||
{ | { | ||
| + | "id": null, | ||
| + | "k4":"123633793552315", | ||
"diskList":[ | "diskList":[ | ||
{ | { | ||
| − | "name":"/dev/ | + | "name":"/dev/sdaRuz2", |
"serial":"Z3TGYCRW", | "serial":"Z3TGYCRW", | ||
| + | "model":"ST500DM002-1BD142", | ||
"description":null, | "description":null, | ||
"size":500107862016, | "size":500107862016, | ||
| Linha 48: | Linha 51: | ||
}, | }, | ||
{ | { | ||
| − | "name":"/dev/ | + | "name":"/dev/sr0", |
"serial":"K5GD3IF3850", | "serial":"K5GD3IF3850", | ||
| + | "model":"HL-DT-STDVD-RAM_GHA2N", | ||
"description":null, | "description":null, | ||
"size":1073741312, | "size":1073741312, | ||
| − | "partitionList":[ | + | "partitionList":[ |
] | ] | ||
} | } | ||
], | ], | ||
"processor":{ | "processor":{ | ||
| − | "name":"Intel(R) Core(TM) i3-2120 CPU @ 3. | + | "name":"Intel(R) Core(TM) i3-2120 CPU @ 3.30GHz", |
"vendor":"GenuineIntel", | "vendor":"GenuineIntel", | ||
"model":"42", | "model":"42", | ||
| Linha 65: | Linha 69: | ||
"speed":3300000000, | "speed":3300000000, | ||
"id":"AFC1FBFF002006A7", | "id":"AFC1FBFF002006A7", | ||
| − | "uptime": | + | "uptime":1464 |
}, | }, | ||
"motherBoard":{ | "motherBoard":{ | ||
| Linha 73: | Linha 77: | ||
}, | }, | ||
"memory":{ | "memory":{ | ||
| − | "available": | + | "available":6579056640, |
"total":8202752000, | "total":8202752000, | ||
| − | "used": | + | "used":1623695360 |
}, | }, | ||
"network":{ | "network":{ | ||
| − | "host":"MS- | + | "host":"MS-D2819", |
| − | "ipv4Gateway":" | + | "ipv4Gateway":"", |
"ipv6Gateway":"", | "ipv6Gateway":"", | ||
"dns":"[192.168.250.1]", | "dns":"[192.168.250.1]", | ||
| Linha 85: | Linha 89: | ||
"networkInterfaceList":[ | "networkInterfaceList":[ | ||
{ | { | ||
| − | "name":" | + | "name":"eth0", |
"macAddress":"d4:3d:7e:7f:c9:2e", | "macAddress":"d4:3d:7e:7f:c9:2e", | ||
| − | "ipv4Address":"[192.168.13. | + | "ipv4Address":"[192.168.13.29]", |
"ipv6Address":"[fe80:0:0:0:d63d:7eff:fe7f:c92e]" | "ipv6Address":"[fe80:0:0:0:d63d:7eff:fe7f:c92e]" | ||
} | } | ||
| Linha 94: | Linha 98: | ||
"externalDeviceList":[ | "externalDeviceList":[ | ||
{ | { | ||
| − | "name":"EHCI Host | + | "name":"EHCI Host Controller", |
"serial":"0000:00:1a.0", | "serial":"0000:00:1a.0", | ||
"productId":"0002", | "productId":"0002", | ||
| Linha 136: | Linha 140: | ||
}, | }, | ||
{ | { | ||
| − | "name":"USB2.0 | + | "name":"USB2.0 WLAN", |
"serial":"12345", | "serial":"12345", | ||
"productId":"9271", | "productId":"9271", | ||
| Linha 142: | Linha 146: | ||
"vendorId":"0cf3" | "vendorId":"0cf3" | ||
} | } | ||
| − | ] | + | ], |
| + | "memoryBank":{ | ||
| + | "speed":"166MHz, 200MHz", | ||
| + | "description":"Memória 1, memória 2", | ||
| + | "capacity":"1 GB, 3 GB", | ||
| + | "model":"dim 1, dim 1", | ||
| + | "manufacturer":"Samsung, Seagate", | ||
| + | "caption":"Rótulo memória 1, rótulo memória 2", | ||
| + | "bankLabel":"[label banco 1, label banco 2]" | ||
| + | }, | ||
| + | "soundCard":{ | ||
| + | "name":"[6 Series/C200 Series Chipset Family High Definition Audio Controller]" | ||
| + | }, | ||
| + | "videoCard":{ | ||
| + | "name":"[2nd Generation Core Processor Family Integrated Graphics Controller]" | ||
| + | } | ||
} | } | ||
| + | |||
| Linha 161: | Linha 181: | ||
| 201 | | 201 | ||
| Created | | Created | ||
| − | | | + | | Registro criado com sucesso |
|- | |- | ||
| 412 | | 412 | ||
| PreConditionFailed | | PreConditionFailed | ||
| Entidade vazia | | Entidade vazia | ||
| + | |- | ||
| + | | 503 | ||
| + | | ServiceUnavailable | ||
| + | | Servidor ElasticSearch não encontrado | ||
| + | |- | ||
| + | | 500 | ||
| + | | InternalServerError | ||
| + | | Erro geral de servidor | ||
|} | |} | ||
| Linha 185: | Linha 213: | ||
|- | |- | ||
| _id | | _id | ||
| − | | Id do | + | | Id do inventário gravado no banco do BlueMonitor |
| − | | | + | | Unique Identitifier (GUID) |
|- | |- | ||
| _version | | _version | ||
| Linha 203: | Linha 231: | ||
'''Exemplo''' | '''Exemplo''' | ||
| − | + | { | |
"_index": "inventoryhardware", | "_index": "inventoryhardware", | ||
"_type": "inventoryhardwaremodel", | "_type": "inventoryhardwaremodel", | ||
| − | "_id": " | + | "_id": "c550659b-a297-4a7f-9365-4692e452cea7", |
"_version": 1, | "_version": 1, | ||
"created": true, | "created": true, | ||
"result": "created" | "result": "created" | ||
| − | + | } | |
Edição atual tal como às 15h17min de 31 de março de 2017
Request
Parâmetros
Não há parâmetros
Corpo
{
"id": null,
"k4":"123633793552315",
"diskList":[
{
"name":"/dev/sdaRuz2",
"serial":"Z3TGYCRW",
"model":"ST500DM002-1BD142",
"description":null,
"size":500107862016,
"partitionList":[
{
"name":"sda1",
"size":374276620288,
"type":"ntfs",
"mountPoint":"",
"label":null
},
{
"name":"sda2",
"size":1024,
"type":"partition",
"mountPoint":"",
"label":null
},
{
"name":"sda5",
"size":9998172160,
"type":"swap",
"mountPoint":"",
"label":null
},
{
"name":"sda6",
"size":115829899264,
"type":"ext4",
"mountPoint":"/",
"label":null
}
]
},
{
"name":"/dev/sr0",
"serial":"K5GD3IF3850",
"model":"HL-DT-STDVD-RAM_GHA2N",
"description":null,
"size":1073741312,
"partitionList":[
]
}
],
"processor":{
"name":"Intel(R) Core(TM) i3-2120 CPU @ 3.30GHz",
"vendor":"GenuineIntel",
"model":"42",
"serial":null,
"coreNumber":4,
"coresPerSocket":2,
"speed":3300000000,
"id":"AFC1FBFF002006A7",
"uptime":1464
},
"motherBoard":{
"serial":"",
"name":"unknown NO DPK",
"manufacturer":"LENOVO"
},
"memory":{
"available":6579056640,
"total":8202752000,
"used":1623695360
},
"network":{
"host":"MS-D2819",
"ipv4Gateway":"",
"ipv6Gateway":"",
"dns":"[192.168.250.1]",
"domain":"MS-D2819.mstech.com.br",
"networkInterfaceList":[
{
"name":"eth0",
"macAddress":"d4:3d:7e:7f:c9:2e",
"ipv4Address":"[192.168.13.29]",
"ipv6Address":"[fe80:0:0:0:d63d:7eff:fe7f:c92e]"
}
]
},
"externalDeviceList":[
{
"name":"EHCI Host Controller",
"serial":"0000:00:1a.0",
"productId":"0002",
"vendor":"Linux 3.16.0-4-amd64 ehci_hcd",
"vendorId":"1d6b"
},
{
"name":"8087:0024",
"serial":"",
"productId":"0024",
"vendor":"",
"vendorId":"8087"
},
{
"name":"Dell USB Entry Keyboard",
"serial":"",
"productId":"2107",
"vendor":"Dell",
"vendorId":"413c"
},
{
"name":"USB Optical Mouse",
"serial":"",
"productId":"c05a",
"vendor":"Logitech",
"vendorId":"046d"
},
{
"name":"EHCI Host Controller",
"serial":"0000:00:1d.0",
"productId":"0002",
"vendor":"Linux 3.16.0-4-amd64 ehci_hcd",
"vendorId":"1d6b"
},
{
"name":"8087:0024",
"serial":"",
"productId":"0024",
"vendor":"",
"vendorId":"8087"
},
{
"name":"USB2.0 WLAN",
"serial":"12345",
"productId":"9271",
"vendor":"ATHEROS",
"vendorId":"0cf3"
}
],
"memoryBank":{
"speed":"166MHz, 200MHz",
"description":"Memória 1, memória 2",
"capacity":"1 GB, 3 GB",
"model":"dim 1, dim 1",
"manufacturer":"Samsung, Seagate",
"caption":"Rótulo memória 1, rótulo memória 2",
"bankLabel":"[label banco 1, label banco 2]"
},
"soundCard":{
"name":"[6 Series/C200 Series Chipset Family High Definition Audio Controller]"
},
"videoCard":{
"name":"[2nd Generation Core Processor Family Integrated Graphics Controller]"
}
}
Exemplo
http://painelacessa.hominterna.fde.devedu.ms/BlueMonitorAPI/api/v1/inventoryhardware
Response
Http Status Code
| Código | Nome | Descrição |
|---|---|---|
| 201 | Created | Registro criado com sucesso |
| 412 | PreConditionFailed | Entidade vazia |
| 503 | ServiceUnavailable | Servidor ElasticSearch não encontrado |
| 500 | InternalServerError | Erro geral de servidor |
Corpo
| Nome | Descrição | Tipo |
|---|---|---|
| _index | Nome do índice Elastic | String |
| _type | Tipo do índice Elastic | String |
| _id | Id do inventário gravado no banco do BlueMonitor | Unique Identitifier (GUID) |
| _version | (Desconhecido. Pesquisar) | Int |
| created | Sinaliza se o registro foi criado com sucesso no ElasticSearch | Bool |
| result | Mensagem de retorno do ElasticSearch | String |
Exemplo
{
"_index": "inventoryhardware", "_type": "inventoryhardwaremodel", "_id": "c550659b-a297-4a7f-9365-4692e452cea7", "_version": 1, "created": true, "result": "created"
}