joyent / conch-api

Datacenter build and management service
Mozilla Public License 2.0
22 stars 11 forks source link

Pull important fields out of the device report and into the database #551

Open sungo opened 5 years ago

sungo commented 5 years ago

We currently keep the device report JSON blobs around "just in case" we need some data out of them. There are an immense amount of problems with this approach but we can't avoid the current reality that there is data in that JSON that is not available in the API, data that our users are currently accessing.

So, we need to figure out what report data is missing in the database, add tables etc, and make it available in the API.

sungo commented 5 years ago

From @jemershaw

Server reports

Switch report

karenetheridge commented 5 years ago

As part of this task I will write a script that will (attempt to) stomp through all existing device reports on file and attempt to backfill additional data into the database that it can figure out. Results may be limited, depending on how much the report format has changed.

karenetheridge commented 5 years ago

Since this involves formalization of a lot of data that has been so far been fairly loose in device reports, we should spec this out and ensure that the device report and database schemas are consistent and sensible.

karenetheridge commented 5 years ago

For v3 we need to figure out which information we want to send in device reports. All information passed in reports should be used for creating the device and running validations. Some data may also be saved in the database (but only if there is an endpoint to return it later upon request). Some of the data above falls into these categories; some do not; those that are already present in v2 reports that we do not want to use should be removed.

karenetheridge commented 4 years ago

There have been no requests for additional APIs to access data buried in the reports. We can add APIs, and copy data from reports into the database, on a case by case basis as such needs are identified. For now all I can assume is that the API spec and report schemas are now fixed for 3.0.0.