Files
orion-visor/orion-ops-ui/src/api/asset/asset-authorized-data.ts

37 lines
1.1 KiB
TypeScript
Raw Normal View History

2023-11-30 22:21:25 +08:00
import type { HostGroupQueryResponse } from '@/api/asset/host-group';
import type { HostQueryResponse } from './host';
import type { HostKeyQueryResponse } from './host-key';
import type { HostIdentityQueryResponse } from './host-identity';
import axios from 'axios';
/**
2023-12-04 14:35:18 +08:00
*
2023-11-30 22:21:25 +08:00
*/
2023-12-04 14:35:18 +08:00
export interface AuthorizedHostQueryResponse {
2023-11-30 22:21:25 +08:00
groupTree: Array<HostGroupQueryResponse>;
hostList: Array<HostQueryResponse>;
2023-12-04 14:35:18 +08:00
treeNodes: Record<string, Array<number>>;
2024-01-12 17:45:08 +08:00
latestHosts: Array<number>;
2023-11-30 22:21:25 +08:00
}
/**
2023-12-04 14:35:18 +08:00
*
2023-11-30 22:21:25 +08:00
*/
2023-12-04 14:35:18 +08:00
export function getCurrentAuthorizedHost() {
return axios.get<AuthorizedHostQueryResponse>('/asset/authorized-data/current-host');
2023-11-30 22:21:25 +08:00
}
/**
*
*/
export function getCurrentAuthorizedHostKey() {
2023-12-25 19:03:24 +08:00
return axios.get<Array<HostKeyQueryResponse>>('/asset/authorized-data/current-host-key');
2023-11-30 22:21:25 +08:00
}
/**
*
*/
export function getCurrentAuthorizedHostIdentity() {
2023-12-25 19:03:24 +08:00
return axios.get<Array<HostIdentityQueryResponse>>('/asset/authorized-data/current-host-identity');
2023-11-30 22:21:25 +08:00
}