2021-04-16 00:55:18 +03:00
|
|
|
import { get } from "../../utils/axios";
|
|
|
|
|
2021-04-17 03:21:43 +03:00
|
|
|
const apiUrl = `${process.env.REACT_APP_NETWORK_RESURRECTOR_API_URL}/network`;
|
|
|
|
const serverUrl = `${process.env.REACT_APP_NETWORK_RESURRECTOR_SERVER_URL}/resurrector`;
|
2021-04-16 00:55:18 +03:00
|
|
|
|
|
|
|
const readMachines = () => {
|
2021-04-17 03:21:43 +03:00
|
|
|
const machinesPromise = get(`${apiUrl}/machines`);
|
2021-04-16 00:55:18 +03:00
|
|
|
return machinesPromise;
|
|
|
|
};
|
|
|
|
|
2021-04-17 03:21:43 +03:00
|
|
|
const wakeMachine = macAddress => {
|
|
|
|
const promise = get(`${serverUrl}/wake`, { macAddress });
|
|
|
|
return promise;
|
|
|
|
};
|
|
|
|
|
|
|
|
const pingMachine = ipAddressOrMachineName => {
|
|
|
|
const promise = get(`${serverUrl}/ping`, { ipAddressOrMachineName });
|
|
|
|
return promise;
|
|
|
|
};
|
|
|
|
|
|
|
|
export { readMachines, wakeMachine, pingMachine };
|