fix(striker-ui-api): allow get anvil data from access daemon

main
Tsu-ba-me 2 years ago
parent b74d6a6d66
commit 27b11849e8
  1. 7
      striker-ui-api/src/lib/accessModule.ts
  2. 18
      striker-ui-api/src/types/GetAnvilDataFunction.d.ts

@ -250,6 +250,12 @@ const getData = async <T>(...keys: string[]) => {
return data;
};
const getAnvilData = async () => {
await subroutine('get_anvils');
return getData<AnvilDataAnvilListHash>('anvils');
};
const getFenceSpec = async () => {
await subroutine('get_fence_data', { pre: ['Striker'] });
@ -346,6 +352,7 @@ export {
anvilSyncShared,
refreshTimestamp as timestamp,
getData,
getAnvilData,
getFenceSpec,
getHostData,
getLocalHostName,

@ -2,6 +2,24 @@ interface AnvilDataStruct {
[key: string]: AnvilDataStruct | boolean;
}
type AnvilDataAnvilListHash = {
anvil_uuid: {
[uuid: string]: {
anvil_description: string;
anvil_node1_host_uuid: string;
anvil_node2_host_uuid: string;
query_time: number;
};
};
host_uuid: {
[uuid: string]: {
anvil_name: string;
anvil_uuid: string;
role: string;
};
};
};
type AnvilDataDatabaseHash = {
[hostUUID: string]: {
host: string;

Loading…
Cancel
Save