-
Notifications
You must be signed in to change notification settings - Fork 75
/
backup.js
executable file
·94 lines (83 loc) · 1.67 KB
/
backup.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
import { request } from '../utils'
export async function query(params) {
return request({
url: '/v1/backupvolumes',
method: 'get',
data: params,
})
}
export async function queryBackupList(name) {
return request({
url: `/v1/backupvolumes/${name}?action=backupList`,
method: 'post',
})
}
export async function createVolume(params) {
return request({
url: '/v1/volumes',
method: 'post',
data: params,
})
}
export async function syncBackupVolume(volumeName) {
return request({
url: `/v1/backupvolumes/${volumeName}?action=backupVolumeSync`,
method: 'post',
data: {
syncBackupVolume: true,
},
})
}
export async function syncAllBackupVolumes() {
return request({
url: '/v1/backupvolumes',
method: 'put',
data: {
syncAllBackupVolumes: true,
},
})
}
export async function execAction(url, params) {
return request({
url,
method: 'post',
data: params,
})
}
export async function restore(params) {
return request({
url: '/v1/volumes',
method: 'post',
data: {
...params,
staleReplicaTimeout: 20,
},
})
}
export async function deleteBackup(payload) {
return request({
url: `/v1/backupvolumes/${payload.volumeName}?action=backupDelete`,
method: 'post',
data: {
name: payload.name,
},
})
}
export async function deleteAllBackups(name) {
return request({
url: `/v1/backupvolumes/${name}`,
method: 'delete',
})
}
export async function getNodeTags() {
return request({
url: '/v1/nodetags',
method: 'get',
})
}
export async function getDiskTags() {
return request({
url: '/v1/disktags',
method: 'get',
})
}