/*
 * @Author: 赵伟
 * @Date: 2024-04-16 14:29:44
 * @Description: 镜像管理接口
 */
import { request } from '@umijs/max';

// 分页查询镜像列表
export function getMirrorListReq(params: any) {
  return request(`/api/mmp/image/`, {
    method: 'GET',
    params,
  });
}

// 查询镜像详情
export function getMirrorInfoReq(id: number) {
  return request(`/api/mmp/image/${id}`, {
    method: 'GET',
  });
}

// 查询镜像版本列表
export function getMirrorVersionListReq(params: any) {
  return request(`/api/mmp/imageVersion/`, {
    method: 'GET',
    params,
  });
}

// 创建镜像
export function createMirrorReq(data: any) {
  return request(`/api/mmp/image/addImageAndVersion`, {
    method: 'POST',
    data,
  });
}

// 删除镜像
export function deleteMirrorReq(id: number) {
  return request(`/api/mmp/image/${id}`, {
    method: 'DELETE',
  });
}

// 删除镜像版本
export function deleteMirrorVersionReq(id: number) {
  return request(`/api/mmp/imageVersion/${id}`, {
    method: 'DELETE',
  });
}
