{"size": 964, "ext": "js", "max_stars_repo_path": "src/api/k8s/publish.js", "max_stars_repo_name": "fakegit/codo", "max_stars_repo_stars_event_min_datetime": "2018-12-25T07:55:10.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-04T09:00:12.000Z", "max_issues_repo_path": "src/api/k8s/publish.js", "max_issues_repo_name": "fakegit/codo", "max_issues_repo_issues_event_min_datetime": "2019-06-28T04:42:15.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-27T21:21:55.000Z", "max_forks_repo_path": "src/api/k8s/publish.js", "max_forks_repo_name": "fakegit/codo", "max_forks_repo_forks_event_min_datetime": "2019-01-24T01:46:52.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-19T16:53:53.000Z"}
{"max_stars_count": 208, "max_issues_count": 11, "max_forks_count": 136, "avg_line_length": 17.2142857143, "max_line_length": 45, "alphanum_fraction": 0.5726141079}
import axios from '@/libs/api.request'

// 获取所有发布信息
export const getTableData = () => {
  return axios.request({
    url: '/k8s/v1/k8s/publish/',
    method: 'get'
  })
}

// 获取发布详情
export const getPublishDetail = (pid) => {
  return axios.request({
    url: `/k8s/v1/k8s/publish/${pid}/`,
    method: 'get'
  })
}

// 对发布任务进行操作
export const publishAction = (pid, data) => {
  return axios.request({
    url: `/k8s/v1/k8s/publish/${pid}/`,
    method: 'patch',
    data: data
  })
}

// 新建发布
export const addPublish = (data) => {
  return axios.request({
    url: '/k8s/v1/k8s/publish/',
    method: 'post',
    data
  })
}

// 执行发布任务
export const exeJob = (jid) => {
  return axios.request({
    url: `/k8s/v1/k8s/job/exec/${jid}/`,
    method: 'post'
  })
}

// 获取日志信息
export const getLog = (project, jid) => {
  return axios.request({
    url: '/k8s/v1/k8s/job/log/',
    method: 'get',
    params: {
      project_name: project,
      job_id: jid
    }
  })
}
