Closed da-ekchajzer closed 2 years ago
We should generate one JSON files per line of a CSV file.
Example of CSV : https://docs.google.com/spreadsheets/d/1DqYgQnEDLQVQm5acMAhLgHLD8xXCG9BIrk-_Nv6jF3k/edit#gid=1494701657
Example of JSON :
{
"model":
{
"manufacturer": "AMAZON",
"name": "a1-4xlarge",
"type": "rack",
"year": 2020
},
"configuration":
{
"cpu":
{
"units": 2,
"core_units": 24,
},
"ram":
[
{
"units": 12,
"capacity": 32,
"density": 1.79
}
],
"disk":
[
{
"units": 1,
"type": "ssd",
"capacity": 400,
}
],
"power_supply":
{
"units": 2,
"unit_weight": 2.99
}
},
"usage": {
"instance_per_server": 1,
"max_power": 510,
"hours_use_time": 1,
"workload": {
"10": {
"power": 0.325
},
"50": {
"power": 0.7235
}
"idle": {
"power": 0.2
}
}
}
}
Done here : https://github.com/Boavizta/Tools-API/blob/main/boaviztapi/utils/csv_to_dto.py PR : #60
Problem
Users might have multiple server to assess in CSV format. Having a little script to translate CSV into JSON POST request would help some users.
When creating multiple archetype, having a CSV to fill is much easier. Having a little script to translate CSV into JSON archetype would avoid manual conversion.
Solution
A script converting CSV to JSON server for each CSV line.
Additional context or elements
@bertrandkeller I think you have done a very similar work. It could be very easy to implement with a generalization of your work if you're ok to share ?