import { request } from '@/plugins/http-fetch';

/**
 * 查询网元版本列表
 * @param query 查询参数
 * @returns object
 */
export function listNeVersion(query: Record<string, any>) {
  return request({
    url: '/ne/version/list',
    method: 'GET',
    params: query,
    timeout: 60_000,
  });
}

/**
 * 查询网元版本详细
 * @param versionId 信息ID
 * @returns object
 */
export function getNeVersion(versionId: string | number) {
  return request({
    url: `/ne/version/${versionId}`,
    method: 'GET',
  });
}

/**
 * 网元版本操作
 * @param data {neType,neId,preinput:{参数},action:"upgrade"}
 * @returns object
 */
export function operateNeVersion(data: Record<string, any>) {
  return request({
    url: `/ne/version/operate`,
    method: 'POST',
    data: data,
    timeout: 180_000,
  });
}
