import request from '@/utils/request'
import { method } from 'lodash'

export function addTaskinstance(data) {
    return request({
        url: '/aima/taskinstance', 
        method: 'post',
        data: data
    })
}

export function getTaskinstanceList(params) {
    return request({
        url: '/aima/taskinstance/list', 
        method: 'get',
        params: params
    })
}

export function updateTaskinstance(data) {
    return request({
        url: '/aima/taskinstance', 
        method: 'put',
        data: data
    })
}

export function deleteTaskinstance(ids) {
    return request({
        url: `/aima/taskinstance/{ids}`, 
        method: 'delete'
    })
}

export function startTaskinstance(id) {
    return request({
        url: `/aima/taskinstance/start/${id}`,
        method: 'put'
    })
}

export function pauseTaskinstance(id) {
    return request({
        url: `/aima/taskinstance/pause/${id}`,
        method: 'put'
    })
}

export function stopTaskinstance(id) {
    return request({
        url: `/aima/taskinstance/stop/${id}`,
        method: 'put'
    })
}

export function resumeTaskinstance(id) {
    return request({
        url: `/aima/taskinstance/resume/${id}`,
        method: 'put'
    })
}

export function getTaskLogListApi(params) {
    return request({
        url: '/aima/testlog/list', 
        method: 'get',
        params: params
    })
}