iDrac6 NodeJS Library
A basic library to interact with an idrac6 remote managment system written in TypeScript for JavaScript and TypeScript usage.
JavaScript Example:
import { iDrac6 } from 'idrac6';
const idrac = new iDrac6({
username: "",
pasword: "",
address: "https://ip",
newAuth: true,
sessionOptions: {
saveSession: true,
path: "./session.json",
},
});
(async () => {
const powerState = await idrac.getPowerState();
if (powerState === iDrac6.POWER_STATES.ON) {
await idrac.sendPowerAction(iDrac6.POWER_ACTIONS.SHUTDOWN);
} else if (powerState === iDrac6.POWER_STATES.OFF) {
await idrac.sendPowerAction(iDrac6.POWER_ACTIONS.ON);
} else if (powerState === iDrac6.POWER_STATES.INVALID) {
await idrac.sendPowerAction(iDrac6.POWER_ACTIONS.OFF);
}
const temperature = await idrac.getTemperature();
})();
TypeScript Example
import { iDrac6, PowerActions, PowerState, iDracTemperature } from 'idrac6';
const idrac = new iDrac6({
username: "",
pasword: "",
address: "https://ip",
sessionOptions: {
saveSession: true,
path: "./session.json",
},
});
(async () => {
const powerState: PowerState = await idrac.getPowerState();
if (powerState === PowerState.ON) {
await idrac.sendPowerAction(PowerActions.SHUTDOWN);
} else if (powerState === PowerState.OFF) {
await idrac.sendPowerAction(PowerActions.ON);
} else if (powerState === PowerState.INVALID) {
await idrac.sendPowerAction(PowerActions.OFF);
}
const temperature: iDracTemperature = await idrac.getTemperature();
})();