Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

infer data from device reports to populate hardware product #1089

Merged
merged 7 commits into from
Jan 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion cpanfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ requires 'YAML::PP';
requires 'next::XS';

# mojolicious and networking
requires 'Mojolicious', '8.36';
requires 'Mojolicious', '8.50';
requires 'Mojo::Pg';
requires 'Mojo::JWT';
requires 'Mojolicious::Plugin::Util::RandomString', '0.07'; # memory leak: https://rt.cpan.org/Ticket/Display.html?id=125981
Expand Down
8 changes: 7 additions & 1 deletion docs/json-schema/device_report.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$comment" : "NOTE: This file is for human reference ONLY. For programmatic use, use the GET '/json_schema/device_report/$schema_name' endpoints, or within conch itself, json-schema/device_report.yaml.",
"$defs" : {
"DeviceReport_v3_0_0" : {
"DeviceReport_v3_2_0" : {
"$comment" : "the contents of a posted device report from relays and reporters",
"additionalProperties" : true,
"properties" : {
Expand Down Expand Up @@ -192,6 +192,11 @@
],
"type" : "object"
},
"report_version" : {
"$comment" : "future conch-api versions MAY be backwards-compatible to previous report versions, but this is not guaranteed",
"const" : "v3.2",
"type" : "string"
},
"serial_number" : {
"$ref" : "common.json#/$defs/device_serial_number"
},
Expand Down Expand Up @@ -227,6 +232,7 @@
}
},
"required" : [
"report_version",
"bios_version",
"product_name",
"sku",
Expand Down
93 changes: 61 additions & 32 deletions docs/json-schema/request.json
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@
"type" : "object"
},
"DeviceReport" : {
"$ref" : "device_report.json#/$defs/DeviceReport_v3_0_0"
"$ref" : "device_report.json#/$defs/DeviceReport_v3_2_0"
},
"DeviceSetting" : {
"$ref" : "#/$defs/DeviceSettings",
Expand All @@ -392,46 +392,75 @@
},
"HardwareProductCreate" : {
"$ref" : "#/$defs/HardwareProductUpdate",
"anyOf" : [
{
"required" : [
"name",
"sku",
"validation_plan_id",
"bios_firmware"
]
},
{
"required" : [
"device_report"
]
}
],
"required" : [
"name",
"alias",
"hardware_vendor_id",
"sku",
"rack_unit_size",
"validation_plan_id",
"purpose",
"bios_firmware",
"cpu_type"
"purpose"
]
},
"HardwareProductUpdate" : {
"additionalProperties" : false,
"default" : {
"cpu_num" : 0,
"dimms_num" : 0,
"nics_num" : 0,
"nvme_ssd_num" : 0,
"psu_total" : 0,
"raid_lun_num" : 0,
"ram_total" : 0,
"sas_hdd_num" : 0,
"sas_ssd_num" : 0,
"sata_hdd_num" : 0,
"sata_ssd_num" : 0,
"specification" : {},
"usb_num" : 0
},
"minProperties" : 1,
"properties" : {
"alias" : {
"$ref" : "common.json#/$defs/mojo_standard_placeholder",
"title" : "Alias"
},
"bios_firmware" : {
"$comment" : "this property will be moved into /specification in v3.2",
"$comment" : "this property will be moved into /specification in v3.4",
"deprecated" : true,
"title" : "BIOS Firmware",
"type" : "string"
},
"cpu_num" : {
"$comment" : "this property will be moved into /specification in v3.2",
"$comment" : "this property will be moved into /specification in v3.4",
"deprecated" : true,
"title" : "Number of CPUs",
"type" : "integer"
},
"cpu_type" : {
"$comment" : "this property will be moved into /specification in v3.2",
"$comment" : "this property will be moved into /specification in v3.4",
"deprecated" : true,
"title" : "CPU Type",
"type" : "string"
},
"device_report" : {
"$ref" : "device_report.json#/$defs/DeviceReport_v3_2_0",
"title" : "Sample passing device report"
},
"dimms_num" : {
"$comment" : "this property will be moved into /specification in v3.2",
"$comment" : "this property will be moved into /specification in v3.4",
"deprecated" : true,
"title" : "Number of DIMMs",
"type" : "integer"
Expand All @@ -445,7 +474,7 @@
"title" : "Hardware Vendor ID"
},
"hba_firmware" : {
"$comment" : "this property will be moved into /specification in v3.2",
"$comment" : "this property will be moved into /specification in v3.4",
"deprecated" : true,
"title" : "HBA Firmware",
"type" : [
Expand All @@ -469,19 +498,19 @@
"title" : "Name"
},
"nics_num" : {
"$comment" : "this property will be moved into /specification in v3.2",
"$comment" : "this property will be moved into /specification in v3.4",
"deprecated" : true,
"title" : "Number of NICs",
"type" : "integer"
},
"nvme_ssd_num" : {
"$comment" : "this property will be moved into /specification in v3.2",
"$comment" : "this property will be moved into /specification in v3.4",
"deprecated" : true,
"title" : "Number of NVME SSDs",
"type" : "integer"
},
"nvme_ssd_size" : {
"$comment" : "this property will be moved into /specification in v3.2",
"$comment" : "this property will be moved into /specification in v3.4",
"deprecated" : true,
"title" : "NVME SSD Size",
"type" : [
Expand All @@ -490,7 +519,7 @@
]
},
"nvme_ssd_slots" : {
"$comment" : "this property will be moved into /specification in v3.2",
"$comment" : "this property will be moved into /specification in v3.4",
"deprecated" : true,
"title" : "NVME SSD Slots",
"type" : [
Expand All @@ -510,7 +539,7 @@
"title" : "Prefix"
},
"psu_total" : {
"$comment" : "this property will be moved into /specification in v3.2",
"$comment" : "this property will be moved into /specification in v3.4",
"deprecated" : true,
"title" : "PSU Total",
"type" : "integer"
Expand All @@ -524,25 +553,25 @@
"title" : "Rack Unit Size (RU)"
},
"raid_lun_num" : {
"$comment" : "this property will be moved into /specification in v3.2",
"$comment" : "this property will be moved into /specification in v3.4",
"deprecated" : true,
"title" : "Number of RAID LUNs",
"type" : "integer"
},
"ram_total" : {
"$comment" : "this property will be moved into /specification in v3.2",
"$comment" : "this property will be moved into /specification in v3.4",
"deprecated" : true,
"title" : "RAM Total",
"type" : "integer"
},
"sas_hdd_num" : {
"$comment" : "this property will be moved into /specification in v3.2",
"$comment" : "this property will be moved into /specification in v3.4",
"deprecated" : true,
"title" : "Number of SAS HDDs",
"type" : "integer"
},
"sas_hdd_size" : {
"$comment" : "this property will be moved into /specification in v3.2",
"$comment" : "this property will be moved into /specification in v3.4",
"deprecated" : true,
"title" : "SAS HDD Size",
"type" : [
Expand All @@ -551,7 +580,7 @@
]
},
"sas_hdd_slots" : {
"$comment" : "this property will be moved into /specification in v3.2",
"$comment" : "this property will be moved into /specification in v3.4",
"deprecated" : true,
"title" : "SAS HDD Slots",
"type" : [
Expand All @@ -560,13 +589,13 @@
]
},
"sas_ssd_num" : {
"$comment" : "this property will be moved into /specification in v3.2",
"$comment" : "this property will be moved into /specification in v3.4",
"deprecated" : true,
"title" : "Number of SAS SSDs",
"type" : "integer"
},
"sas_ssd_size" : {
"$comment" : "this property will be moved into /specification in v3.2",
"$comment" : "this property will be moved into /specification in v3.4",
"deprecated" : true,
"title" : "SAS SSD Size",
"type" : [
Expand All @@ -575,7 +604,7 @@
]
},
"sas_ssd_slots" : {
"$comment" : "this property will be moved into /specification in v3.2",
"$comment" : "this property will be moved into /specification in v3.4",
"deprecated" : true,
"title" : "SAS SSD Slots",
"type" : [
Expand All @@ -584,13 +613,13 @@
]
},
"sata_hdd_num" : {
"$comment" : "this property will be moved into /specification in v3.2",
"$comment" : "this property will be moved into /specification in v3.4",
"deprecated" : true,
"title" : "Number of SATA HDDs",
"type" : "integer"
},
"sata_hdd_size" : {
"$comment" : "this property will be moved into /specification in v3.2",
"$comment" : "this property will be moved into /specification in v3.4",
"deprecated" : true,
"title" : "SATA HDD Size",
"type" : [
Expand All @@ -599,7 +628,7 @@
]
},
"sata_hdd_slots" : {
"$comment" : "this property will be moved into /specification in v3.2",
"$comment" : "this property will be moved into /specification in v3.4",
"deprecated" : true,
"title" : "SATA HDD Slots",
"type" : [
Expand All @@ -608,13 +637,13 @@
]
},
"sata_ssd_num" : {
"$comment" : "this property will be moved into /specification in v3.2",
"$comment" : "this property will be moved into /specification in v3.4",
"deprecated" : true,
"title" : "Number of SATA SSDs",
"type" : "integer"
},
"sata_ssd_size" : {
"$comment" : "this property will be moved into /specification in v3.2",
"$comment" : "this property will be moved into /specification in v3.4",
"deprecated" : true,
"title" : "SATA SSD Size",
"type" : [
Expand All @@ -623,7 +652,7 @@
]
},
"sata_ssd_slots" : {
"$comment" : "this property will be moved into /specification in v3.2",
"$comment" : "this property will be moved into /specification in v3.4",
"deprecated" : true,
"title" : "SATA SSD Slots",
"type" : [
Expand All @@ -641,7 +670,7 @@
"type" : "object"
},
"usb_num" : {
"$comment" : "this property will be moved into /specification in v3.2",
"$comment" : "this property will be moved into /specification in v3.4",
"deprecated" : true,
"title" : "Number of USBs",
"type" : "integer"
Expand Down