1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

F #5698: Add filter option in oned.conf for FireEdge (#1742)

(cherry picked from commit fae6bcc92ff5c3f4fceefaa32a3f40f7a9d34eb9)
This commit is contained in:
Jorge Miguel Lobo Escalona 2022-02-02 11:45:40 +01:00 committed by Tino Vazquez
parent 1f21b0040b
commit ad03f736af
2 changed files with 20 additions and 2 deletions

View File

@ -51,6 +51,6 @@ export const systemService = {
if (!res?.id || res?.id !== httpCodes.ok.id) throw res?.data
return res?.data?.OPENNEBULA_CONFIGURATION
return res?.data
},
}

View File

@ -27,6 +27,15 @@ const { defaultEmptyFunction, httpMethod } = defaults
const { ok, internalServerError, badRequest } = httpCodes
const { GET } = httpMethod
const ALLOWED_KEYS_ONED_CONF = [
'DEFAULT_COST',
'DS_MAD_CONF',
'MARKET_MAD_CONF',
'VM_MAD',
'IM_MAD',
'AUTH_MAD',
]
/**
* Get system config.
*
@ -79,7 +88,16 @@ const getConfig = (
return
}
res.locals.httpCode = httpResponse(ok, value)
const filterData = {}
Object.entries(value.OPENNEBULA_CONFIGURATION).forEach(
([keyOned, valueOned]) => {
if (ALLOWED_KEYS_ONED_CONF.includes(keyOned)) {
filterData[keyOned] = valueOned
}
}
)
res.locals.httpCode = httpResponse(ok, filterData)
next()
}
)