Update fetchNodes action to call detailed nodes list

Change-Id: Icbe79d693160ab4c18bbbe36a39e57807c3c41d2
This commit is contained in:
Jiri Tomasek 2017-01-24 10:49:00 +01:00
parent 116e98dee0
commit f3175b347d
2 changed files with 5 additions and 9 deletions

View File

@ -51,12 +51,8 @@ export default {
fetchNodes() {
return (dispatch, getState) => {
dispatch(this.requestNodes());
IronicApiService.getNodes().then((response) => {
return when.all(response.nodes.map((node) => {
return IronicApiService.getNode(node.uuid);
}));
}).then((nodes) => {
const normalizedNodes = normalize(nodes, arrayOf(nodeSchema)).entities.nodes || {};
IronicApiService.getNodes().then(response => {
const normalizedNodes = normalize(response.nodes, arrayOf(nodeSchema)).entities.nodes || {};
return when.map(Object.keys(normalizedNodes), nodeUUID => {
return IronicApiService.getNodePorts(nodeUUID).then(response => {
const macs = reduce(response.ports, (result, value) => {

View File

@ -23,11 +23,11 @@ class IronicApiService {
}
/**
* Ironic API: GET /v1/nodes
* @returns {array} of nodes.
* Ironic API: GET /v1/nodes/detail
* @returns {array} of nodes with complete details
*/
getNodes() {
return this.defaultRequest('/nodes');
return this.defaultRequest('/nodes/detail');
}
/**