Merge "Get storage recursively"
This commit is contained in:
commit
ae2a6b642f
@ -72,15 +72,15 @@ exports.getNodes = function(callback) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
exports.getStorage = function(callback) {
|
exports.getStorage = function(callback) {
|
||||||
var url = config.url + '/redfish/v1/Services/1/LogicalDrives';
|
var url = config.url + '/redfish/v1/Services';
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: url,
|
url: url,
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
cache: false,
|
cache: false,
|
||||||
success: function(resp) {
|
success: function(resp) {
|
||||||
var drives = this.listItems(resp['Members']);
|
var services = this.listItems(resp['Members']);
|
||||||
callback(drives);
|
util.getLogicalDrives(services, callback);
|
||||||
}.bind(this),
|
}.bind(this),
|
||||||
error: function(xhr, status, err) {
|
error: function(xhr, status, err) {
|
||||||
console.error(url, status, err.toString());
|
console.error(url, status, err.toString());
|
||||||
@ -88,6 +88,20 @@ exports.getStorage = function(callback) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
exports.getLogicalDrives = function(services, callback) {
|
||||||
|
var logicalDrives = [];
|
||||||
|
var logicalDrivesId;
|
||||||
|
var serviceLogicalDrives;
|
||||||
|
for (var i = 0; i < services.length; i++) {
|
||||||
|
logicalDrivesId = util.readAndReturn(services[i]['LogicalDrives']['@odata.id']);
|
||||||
|
serviceLogicalDrives = util.listItems(JSON.parse(logicalDrivesId)['Members']);
|
||||||
|
for (var j = 0; j < serviceLogicalDrives.length; j++) {
|
||||||
|
logicalDrives.push(serviceLogicalDrives[j]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
callback(logicalDrives);
|
||||||
|
};
|
||||||
|
|
||||||
exports.getProcessors = function(systems, callback) {
|
exports.getProcessors = function(systems, callback) {
|
||||||
var processors = [];
|
var processors = [];
|
||||||
var systemProcessorIds;
|
var systemProcessorIds;
|
||||||
|
Loading…
Reference in New Issue
Block a user