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

36 lines
1.0 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>>;
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() {
return axios.get<HostKeyQueryResponse>('/asset/authorized-data/current-host-key');
}
/**
*
*/
export function getCurrentAuthorizedHostIdentity() {
return axios.get<HostIdentityQueryResponse>('/asset/authorized-data/current-host-identity');
}