You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cvm/try/api.js

73 lines
1.1 KiB
JavaScript

"use strict";
require("@babel/register");
const Promise = require("bluebird");
const createAPI = require("../src/api");
// const query = {
// hardware: {
// drives: {
// path: true,
// smartHealth: true,
// size: true,
// rpm: true,
// serialNumber: true,
// model: true,
// modelFamily: true,
// firmwareVersion: true,
// blockDevice: {
// name: true
// },
// partitions: {
// $key: "allBlockDevices",
// name: true,
// size: true,
// mounts: {
// mountpoint: true
// },
// children: {
// $recurse: true,
// $recurseLimit: Infinity, // 3 by default
// }
// }
// }
// }
// };
const query = {
resources: {
lvm: {
physicalVolumes: {
path: true,
totalSpace: true,
freeSpace: true,
status: true,
volumeGroup: {
name: true,
totalSpace: true,
freeSpace: true,
logicalVolumeCount: true,
mode: true,
physicalVolumes: {
path: true
}
}
}
}
}
};
const api = createAPI();
return Promise.try(() => {
return api.query(query);
}).then((result) => {
console.dir(result, { depth: null });
});