Boavizta / boaviztapi

🛠 Giving access to BOAVIZTA reference data and methodologies trough a RESTful API
GNU Affero General Public License v3.0
66 stars 21 forks source link

Internal server error when requesting https://api.boavizta.org/v1/server/ with archetypes dellR740 and mac2.metal #268

Closed VincentVillet closed 5 months ago

VincentVillet commented 5 months ago

Bug description

This archetypes are on the archetype list returned by curl -X 'GET' \ 'https://api.boavizta.org/v1/server/archetypes' \ -H 'accept: application/json' but it is impossible to get their configuration

To Reproduce

curl -X 'GET' \ 'https://api.boavizta.org/v1/server/?archetype=dellR740&verbose=true&criteria=gwp&criteria=adp&criteria=pe' \ -H 'accept: application/json'

curl -X 'GET' \ 'https://api.boavizta.org/v1/server/?archetype=mac2.metal&verbose=true&criteria=gwp&criteria=adp&criteria=pe' \ -H 'accept: application/json'

Expected behavior

The same as for other archetypes, returning the config

da-ekchajzer commented 5 months ago

Thanks for this bug report. It should be a side effect of the latest release. Should be easy to fix. I'll add a test to avoid such errors in the future

da-ekchajzer commented 5 months ago

The same as for other archetypes, returning the config

You should use the route : http://api.boavizta.org/v1/server/archetype_config if you only wish to return the config. https://api.boavizta.org/v1/server should be used to retrieve the impacts of the server.

da-ekchajzer commented 5 months ago

Should be fix in https://github.com/Boavizta/boaviztapi/pull/269. You can test on the dev endpoint (dev.api.boavizta)

VincentVillet commented 5 months ago

Thank you for your answer David :) Indeed I was not looking for only the config but for the impacts.

VincentVillet commented 5 months ago

Works on dev, thanks for the fix !