import request from '@/utils/request'
import qs from 'qs'

import { upcloud_base_strategy } from "@/config/serviceSettings";


export const api = {
  addItem: upcloud_base_strategy + '/registry/create',
  updateItem: upcloud_base_strategy + '/registry/update',
  delItem: upcloud_base_strategy + '/registry/delete'
}

export function addItem(parameter) {
  return request({
    method: 'post',
    url: api.addItem,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: qs.stringify(parameter)
  })
}

export function updateItem(parameter) {
  return request({
    method: 'put',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    url: api.updateItem,
    data: qs.stringify(parameter)
  })
}
export function delItem(parameter) {
  return request({
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    url: api.delItem,
    data: qs.stringify(parameter)
  })
}
