2022-10-08 18:32:02 +08:00
|
|
|
import http from '@/api';
|
2022-10-09 16:17:15 +08:00
|
|
|
import { ResPage, ReqPage } from '../interface';
|
2022-10-08 18:32:02 +08:00
|
|
|
import { Container } from '../interface/container';
|
|
|
|
|
2022-10-11 14:20:51 +08:00
|
|
|
export const getContainerPage = (params: ReqPage) => {
|
2022-10-08 18:32:02 +08:00
|
|
|
return http.post<ResPage<Container.ContainerInfo>>(`/containers/search`, params);
|
|
|
|
};
|
|
|
|
|
|
|
|
export const getContainerLog = (params: Container.ContainerLogSearch) => {
|
|
|
|
return http.post<string>(`/containers/log`, params);
|
|
|
|
};
|
|
|
|
|
|
|
|
export const ContainerOperator = (params: Container.ContainerOperate) => {
|
|
|
|
return http.post(`/containers/operate`, params);
|
|
|
|
};
|
|
|
|
|
2022-10-11 19:47:16 +08:00
|
|
|
export const inspect = (params: Container.ContainerInspect) => {
|
|
|
|
return http.post<string>(`/containers/inspect`, params);
|
2022-10-08 18:32:02 +08:00
|
|
|
};
|
2022-10-09 16:17:15 +08:00
|
|
|
|
2022-10-10 15:14:49 +08:00
|
|
|
// image
|
|
|
|
export const getImagePage = (params: ReqPage) => {
|
|
|
|
return http.post<ResPage<Container.ImageInfo>>(`/containers/image/search`, params);
|
|
|
|
};
|
2022-10-11 14:20:51 +08:00
|
|
|
export const imageBuild = (params: Container.ImageBuild) => {
|
2022-10-12 13:42:58 +08:00
|
|
|
return http.post<string>(`/containers/image/build`, params);
|
2022-10-11 14:20:51 +08:00
|
|
|
};
|
2022-10-10 15:14:49 +08:00
|
|
|
export const imagePull = (params: Container.ImagePull) => {
|
2022-10-11 17:46:52 +08:00
|
|
|
return http.post(`/containers/image/pull`, params);
|
2022-10-10 15:14:49 +08:00
|
|
|
};
|
|
|
|
export const imagePush = (params: Container.ImagePush) => {
|
2022-10-11 17:46:52 +08:00
|
|
|
return http.post(`/containers/image/push`, params);
|
2022-10-10 15:14:49 +08:00
|
|
|
};
|
|
|
|
export const imageLoad = (params: Container.ImageLoad) => {
|
2022-10-11 17:46:52 +08:00
|
|
|
return http.post(`/containers/image/load`, params);
|
2022-10-10 15:14:49 +08:00
|
|
|
};
|
|
|
|
export const imageSave = (params: Container.ImageSave) => {
|
2022-10-11 17:46:52 +08:00
|
|
|
return http.post(`/containers/image/save`, params);
|
2022-10-10 15:14:49 +08:00
|
|
|
};
|
2022-10-11 17:46:52 +08:00
|
|
|
export const imageTag = (params: Container.ImageTag) => {
|
|
|
|
return http.post(`/containers/image/tag`, params);
|
|
|
|
};
|
|
|
|
export const imageRemove = (params: Container.BatchDelete) => {
|
2022-10-10 15:14:49 +08:00
|
|
|
return http.post(`/containers/image/remove`, params);
|
|
|
|
};
|
|
|
|
|
2022-10-11 14:20:51 +08:00
|
|
|
// network
|
|
|
|
export const getNetworkPage = (params: ReqPage) => {
|
|
|
|
return http.post<ResPage<Container.NetworkInfo>>(`/containers/network/search`, params);
|
|
|
|
};
|
|
|
|
export const deleteNetwork = (params: Container.BatchDelete) => {
|
|
|
|
return http.post(`/containers/network/del`, params);
|
|
|
|
};
|
|
|
|
export const createNetwork = (params: Container.NetworkCreate) => {
|
|
|
|
return http.post(`/containers/network`, params);
|
|
|
|
};
|
|
|
|
|
|
|
|
// volume
|
|
|
|
export const getVolumePage = (params: ReqPage) => {
|
|
|
|
return http.post<ResPage<Container.VolumeInfo>>(`/containers/volume/search`, params);
|
|
|
|
};
|
|
|
|
export const deleteVolume = (params: Container.BatchDelete) => {
|
|
|
|
return http.post(`/containers/volume/del`, params);
|
|
|
|
};
|
|
|
|
export const createVolume = (params: Container.VolumeCreate) => {
|
|
|
|
return http.post(`/containers/volume`, params);
|
|
|
|
};
|
|
|
|
|
2022-10-09 16:17:15 +08:00
|
|
|
// repo
|
|
|
|
export const getRepoPage = (params: ReqPage) => {
|
|
|
|
return http.post<ResPage<Container.RepoInfo>>(`/containers/repo/search`, params);
|
|
|
|
};
|
2022-10-10 15:14:49 +08:00
|
|
|
export const getRepoOption = () => {
|
|
|
|
return http.get<Container.RepoOptions>(`/containers/repo`);
|
|
|
|
};
|
2022-10-09 16:17:15 +08:00
|
|
|
export const repoCreate = (params: Container.RepoCreate) => {
|
|
|
|
return http.post(`/containers/repo`, params);
|
|
|
|
};
|
|
|
|
export const repoUpdate = (params: Container.RepoUpdate) => {
|
|
|
|
return http.put(`/containers/repo/${params.id}`, params);
|
|
|
|
};
|
|
|
|
export const deleteRepo = (params: { ids: number[] }) => {
|
|
|
|
return http.post(`/containers/repo/del`, params);
|
|
|
|
};
|