Comments (15)
I would suggest the following data model :
{
"model":{
"manufacturer": "Dell",
"name": "R740",
"type": "rack",
"year": 2020
},
"configuration": {
"cpu":{
"units": 2,
"core_units": 24
"die_size": 0.245,
"manufacturer": "Intel",
"manuf_date":"2018",
"model": "",
"cpu_family":
},
"ram": [
"0":{
"units":4,
"capacity": 32,
"density":"1.79",
"manufacturer": "Samsung",
"manuf_date":"2018",
"model": "",
"integrator": "Corsaire"
},
"1":{
"units":4,
"capacity": 16,
"density":"1.79",
"manufacturer": "Hynix",
"manuf_date":"2018",
"model": "",
"integrator": "Corsaire"
}
],
"disk":[
"0":{
"units":2,
"type":"ssd",
"capacity":400,
"density": 50.6,
"manufacturer": "Samsung",
"manuf_date":"2018",
"model": ""
},
"1":{
"units":2,
"type":"hdd",
"capacity":1000,
"manufacturer": "Seagate",
"manuf_date":"2016",
"model": ""
}
],
"power_supply":{
"units":2,
"unit_weight": 10
}
}
add-method:
add-date:
}
from boaviztapi.
Here is my suggestion as welll :
{
"model": {
"manufacturer": "Dell",
"name": "R740",
"type": "rack",
"year": 2020
},
"configuration": {
"cpu": {
"units": 2,
"core_units": 24,
"die_size": 0.245,
"manufacturer": "Intel",
"manuf_date": "2018",
"model": "",
"cpu_family": ""
},
"ram": [
{
"0": {
"units": 4,
"capacity": 32,
"density": "1.79",
"manufacturer": "Samsung",
"manuf_date": "2018",
"model": "",
"integrator": "Corsaire"
}
},
{
"1": {
"units": 4,
"capacity": 16,
"density": "1.79",
"manufacturer": "Hynix",
"manuf_date": "2018",
"model": "",
"integrator": "Corsaire"
}
}
],
"disk": [
{
"0": {
"units": 2,
"type": "ssd",
"capacity": 400,
"density": 50.6,
"manufacturer": "Samsung",
"manuf_date": "2018",
"model": ""
}
},
{
"1": {
"units": 2,
"type": "hdd",
"capacity": 1000,
"manufacturer": "Seagate",
"manuf_date": "2016",
"model": ""
}
}
],
"power_supply": {
"units": 2,
"unit_weight": 10
}
},
"add-method": "",
"add-date": ""
}
from boaviztapi.
New suggestion :
{
"model": {
"manufacturer": "Dell",
"name": "R740",
"type": "rack",
"year": 2020
},
"configuration": {
"cpu": {
"units": 2,
"core_units": 24,
"die_size": 0.245,
"manufacturer": "Intel",
"manuf_date": "2018",
"model": "",
"cpu_family": ""
},
"ram": [
{
"units": 4,
"capacity": 32,
"density": 1.79,
"manufacturer": "Samsung",
"manuf_date": "2018",
"model": "",
"integrator": "Corsaire"
},
{
"units": 4,
"capacity": 16,
"density": 1.79,
"manufacturer": "Hynix",
"manuf_date": "2018",
"model": "",
"integrator": "Corsaire"
}
],
"disk": [
{
"units": 2,
"type": "ssd",
"capacity": 400,
"density": 50.6,
"manufacturer": "Samsung",
"manuf_date": "2018",
"model": ""
},
{
"units": 2,
"type": "hdd",
"capacity": 1000,
"manufacturer": "Seagate",
"manuf_date": "2016",
"model": ""
}
],
"power_supply": {
"units": 2,
"unit_weight": 10
}
},
"add-method": "",
"add-date": ""
}
from boaviztapi.
useful for next time :
from boaviztapi.
JSON Schema:
{
"title": "Server",
"type": "object",
"properties": {
"model": {
"$ref": "#/definitions/ModelServer"
},
"configuration": {
"$ref": "#/definitions/ConfigurationServer"
},
"add_method": {
"title": "Add Method",
"type": "string"
},
"add_date": {
"title": "Add Date",
"type": "string"
}
},
"definitions": {
"ModelServer": {
"title": "ModelServer",
"type": "object",
"properties": {
"manufacturer": {
"title": "Manufacturer",
"type": "string"
},
"name": {
"title": "Name",
"type": "string"
},
"type": {
"title": "Type",
"type": "string"
},
"year": {
"title": "Year",
"type": "string"
}
}
},
"Cpu": {
"title": "Cpu",
"type": "object",
"properties": {
"units": {
"title": "Units",
"type": "integer"
},
"core_units": {
"title": "Core Units",
"type": "integer"
},
"die_size": {
"title": "Die Size",
"type": "number"
},
"die_size_per_core": {
"title": "Die Size Per Core",
"type": "number"
},
"process": {
"title": "Process",
"type": "number"
},
"manufacturer": {
"title": "Manufacturer",
"type": "string"
},
"manufacture_date": {
"title": "Manufacture Date",
"type": "string"
},
"model": {
"title": "Model",
"type": "string"
},
"family": {
"title": "Family",
"type": "string"
}
}
},
"Ram": {
"title": "Ram",
"type": "object",
"properties": {
"units": {
"title": "Units",
"type": "integer"
},
"capacity": {
"title": "Capacity",
"type": "integer"
},
"density": {
"title": "Density",
"type": "number"
},
"process": {
"title": "Process",
"type": "number"
},
"manufacturer": {
"title": "Manufacturer",
"type": "string"
},
"manufacture_date": {
"title": "Manufacture Date",
"type": "string"
},
"model": {
"title": "Model",
"type": "string"
},
"integrator": {
"title": "Integrator",
"type": "string"
}
}
},
"Disk": {
"title": "Disk",
"type": "object",
"properties": {
"units": {
"title": "Units",
"type": "integer"
},
"type": {
"title": "Type",
"type": "string"
},
"capacity": {
"title": "Capacity",
"type": "integer"
},
"density": {
"title": "Density",
"type": "number"
},
"manufacturer": {
"title": "Manufacturer",
"type": "string"
},
"manufacture_date": {
"title": "Manufacture Date",
"type": "string"
},
"model": {
"title": "Model",
"type": "string"
}
}
},
"PowerSupply": {
"title": "PowerSupply",
"type": "object",
"properties": {
"units": {
"title": "Units",
"type": "integer"
},
"unit_weight": {
"title": "Unit Weight",
"type": "number"
}
}
},
"ConfigurationServer": {
"title": "ConfigurationServer",
"type": "object",
"properties": {
"cpu": {
"$ref": "#/definitions/Cpu"
},
"ram": {
"title": "Ram",
"type": "array",
"items": {
"$ref": "#/definitions/Ram"
}
},
"disk": {
"title": "Disk",
"type": "array",
"items": {
"$ref": "#/definitions/Disk"
}
},
"power_supply": {
"$ref": "#/definitions/PowerSupply"
}
}
}
}
}
from boaviztapi.
J'essaye d'utiliser Eleventy pour constituer mon objet à exploiter.
Je ne sais pas comment stocker au mieux les fichiers "inventaire", je réfléchis pour le moment ça donne
server
└── nom-serveur-1.json
└── nom-serveur-2.json
from boaviztapi.
Surement la meilleure manière en effet.
On réfléchit à supporter des CSV en entré, mais ça sera sûrement quand on s'attaquera à une vue système d'information.
Si tu veux un exemple qui fonctionne sur la version qu'on sort cet aprem : #6 (comment)
L'exemple suit le modèle ci-dessus
from boaviztapi.
On peut aussi construire un CSV avec des intitulés sous cette forme : configuration:cpu:number
On peut utiliser ce package NPM pour convertir en format structuré :
https://www.npmjs.com/package/treeize
from boaviztapi.
Ce qui impliquerait quand même de travail en priorité sur un fichier unique avec plein de serveurs, plutôt que plein de fichiers éclatés.
Pour le CSV, ça donnerait un truc comme ça :
"model:brand","model:name","model:type","model:year","configuration:cpu:number","configuration:cpu:core_number","configuration:cpu:die","configuration:cpu:manufacturer","configuration:cpu:model","configuration:cpu:cpu_family","configuration:ram:capacity","configuration:ram:quantity","configuration:ram:die","configuration:ram:manufacturer","configuration:ram:model","configuration:ram:cpu_family","configuration:ssd:capacity","configuration:ssd:quantity","configuration:ssd:die","configuration:ssd:manufacturer","configuration:ssd:model","configuration:hdd:number","configuration:hdd:manufacturer","configuration:hdd:model","configuration:power_supply:weight","configuration:power_supply:quantity"
"Dell","R740","rack",2020,2,24,0.245,"Intel","",,32,12,1.79,"Samsung","","Corsaire",400,1,50.6,"Samsung","",0,"Samsung","",10,1
from boaviztapi.
Ma lib node n'a pas l'air d'aimer les double quote sur les champs. Donc, ça marche mieux sans double quote.
J'arrive à récupérer le JSON associé.
Si fichier json dans un répertoire, j'envoie le contenu de ce json pour la requête ;
Si csv présent dans le répertoire, je converti le csv, et je m'en sers pour la requête.
Mais l'accès au serveur de test a l'air de ne plus marcher.
model:brand,model:name,model:type,model:year,configuration:cpu:number,configuration:cpu:core_number,configuration:cpu:die,configuration:cpu:manufacturer,configuration:cpu:model,configuration:cpu:cpu_family,configuration:ram:capacity,configuration:ram:quantity,configuration:ram:die,configuration:ram:manufacturer,configuration:ram:model,configuration:ram:cpu_family,configuration:ssd:capacity,configuration:ssd:quantity,configuration:ssd:die,configuration:ssd:manufacturer,configuration:ssd:model,configuration:hdd:number,configuration:hdd:manufacturer,configuration:hdd:model,configuration:power_supply:weight,configuration:power_supply:quantity
Dell,R740,rack,2020,2,24,0.245,Intel,,,32,12,1.79,Samsung,,Corsaire,400,1,50.6,Samsung,,0,Samsung,,10,1
from boaviztapi.
Hum on a publié ce matin dessus la V0.
Si tu veux voir la doc tu as des exemples de JSON qui fonctionnent bien :
http://149.202.185.115/API/server_route/
from boaviztapi.
Tu as une issue dédié ici => #14
from boaviztapi.
Ok,
J'obtiens bien le résultat. Je continuerai la semaine prochaine.
J'ai donc script Node. Qui fonctionne avec eleventy et que je dois paramétrer pour fonctionner avec goHugo.
Il génère un objet pour eleventy ou peut écrire un fichier JSON pour Hugo.
Il faut ajouter une colonne au CSV pour avoir le nom de serveur. Ensuite. suffira de savoir ce que je fais avec ces données.
J'ai les informations en entrée que je peux exploiter ; plus celle de l’API que je peux afficher aussi.
Une petite liste de serveurs avec leur impact (plus le total :: la somme de tous).
C'est quoi exactement : gwp, pe, adp ?
from boaviztapi.
Quels sont les principaux indicateurs environnementaux considérés ? |
---|
Potentiel d’épuisement des ressources abiotiques : ADP (Abiotic Depletion Potential) évalue l'utilisation de minéraux et de matières premières fossiles. L’expression “ressources abiotiques” désigne des ressources non vivantes telles que le sol, l'eau, l'air et les minéraux.Unité : cet indicateur est exprimé en kg d'équivalents d'antimoine (kgSbeq). L'antimoine (symbole Sb) étant l’élément chimique utilisé comme unité de référence pour quantifier une consommation de matière première dans une analyse de cycle de vie.Certaines études différencient les impacts liés aux ressources minérales (ADPe ou ADPelement) et ceux liés aux ressources fossiles (ADPf ou ADPfossils) |
Potentiel de gaz à effet de serre : GWP (Global Warming Potential) évalue l'effet sur le réchauffement de la planèteUnité : cet indicateur est exprimé en kilogramme d'équivalents de dioxyde de carbone (kgCO2eq). |
Consommation de ressources énergétiques (renouvelables + non renouvelables) : PE (Primary Energy)Unité : cet indicateur est exprimé mégajoules (MJ) |
from boaviztapi.
je passe nos discussion sur => #14 pour avoir l'historique
from boaviztapi.
Related Issues (20)
- Internal server error when requesting https://api.boavizta.org/v1/server/ with archetypes dellR740 and mac2.metal HOT 5
- No CPU core units default for lots of archetypes HOT 3
- Remove 0.491 in CPU die calculation
- GWP use impact value is "not implemented" in last version for at least desktop and laptop HOT 2
- Integrate DC (technical environment en building) footprint estimation
- Extending AWS servers lifetime in servers.csv, to match new official AWS refresh policy ?
- Missing AWS platforms / servers for several instance references
- cloud/instance with is4gen.8xlarge leads to "ZeroDivisionError: float division by zero" HOT 3
- Instances referencing non existing "platform_aws_m1" platform, leads to 500 error / HOT 1
- The impact of RAM and CPU usage is counted twice
- Chore[CI]: update github actions that rely on Node16
- Compliance with ISO 21031/GSF Software Carbon Intensity
- Update electricity impact factors
- Verbose output of CPU and RAM use impact values are inconsistent with total use impact values
- RAM coefficient value - implementation vs. HotCarbon paper
- Add a API route that returns current version of the API
- Run python tests CI workflow on dependency update HOT 2
- Improve our security posture by allowing dependabot to open PR HOT 2
- Upgrade fastapi dependency HOT 3
- Upgrade to pydantic v2 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from boaviztapi.