Files
mayfly-go/mayfly_go_web/src/views/ops/machine/api.ts

59 lines
2.6 KiB
TypeScript
Raw Normal View History

2020-09-01 10:34:11 +08:00
import Api from '@/common/Api';
export const machineApi = {
// 获取权限列表
list: Api.newGet('/machines'),
tagList: Api.newGet('/machines/tags'),
getMachinePwd: Api.newGet('/machines/{id}/pwd'),
info: Api.newGet('/machines/{id}/sysinfo'),
stats: Api.newGet('/machines/{id}/stats'),
process: Api.newGet('/machines/{id}/process'),
2022-01-16 21:45:00 +08:00
// 终止进程
killProcess: Api.newDelete('/machines/{id}/process'),
closeCli: Api.newDelete('/machines/{id}/close-cli'),
testConn: Api.newPost('/machines/test-conn'),
2020-09-01 10:34:11 +08:00
// 保存按钮
saveMachine: Api.newPost('/machines'),
// 调整状态
changeStatus: Api.newPut('/machines/{id}/{status}'),
2020-09-01 10:34:11 +08:00
// 删除机器
del: Api.newDelete('/machines/{id}'),
scripts: Api.newGet('/machines/{machineId}/scripts'),
runScript: Api.newGet('/machines/{machineId}/scripts/{scriptId}/run'),
saveScript: Api.newPost('/machines/{machineId}/scripts'),
deleteScript: Api.newDelete('/machines/{machineId}/scripts/{scriptId}'),
2020-09-01 10:34:11 +08:00
// 获取配置文件列表
files: Api.newGet('/machines/{id}/files'),
lsFile: Api.newGet('/machines/{machineId}/files/{fileId}/read-dir'),
dirSize: Api.newGet('/machines/{machineId}/files/{fileId}/dir-size'),
fileStat: Api.newGet('/machines/{machineId}/files/{fileId}/file-stat'),
rmFile: Api.newDelete('/machines/{machineId}/files/{fileId}/remove'),
uploadFile: Api.newPost('/machines/{machineId}/files/{fileId}/upload?token={token}'),
fileContent: Api.newGet('/machines/{machineId}/files/{fileId}/read'),
createFile: Api.newPost('/machines/{machineId}/files/{id}/create-file'),
2020-09-01 10:34:11 +08:00
// 修改文件内容
updateFileContent: Api.newPost('/machines/{machineId}/files/{id}/write'),
2020-09-01 10:34:11 +08:00
// 添加文件or目录
addConf: Api.newPost('/machines/{machineId}/files'),
2020-09-01 10:34:11 +08:00
// 删除配置的文件or目录
delConf: Api.newDelete('/machines/{machineId}/files/{id}'),
terminal: Api.newGet('/api/machines/{id}/terminal'),
recDirNames: Api.newGet('/machines/rec/names'),
};
export const authCertApi = {
baseList: Api.newGet('/sys/authcerts/base'),
list: Api.newGet('/sys/authcerts'),
save: Api.newPost('/sys/authcerts'),
delete: Api.newDelete('/sys/authcerts/{id}'),
};
export const cronJobApi = {
list: Api.newGet('/machine-cronjobs'),
relateMachineIds: Api.newGet('/machine-cronjobs/machine-ids'),
relateCronJobIds: Api.newGet('/machine-cronjobs/cronjob-ids'),
save: Api.newPost('/machine-cronjobs'),
delete: Api.newDelete('/machine-cronjobs/{id}'),
execList: Api.newGet('/machine-cronjobs/execs'),
};