forked from Telmate/proxmox-api-go
-
Notifications
You must be signed in to change notification settings - Fork 1
/
nfs.go
64 lines (58 loc) · 1.62 KB
/
nfs.go
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
package storagesubtests
import (
"testing"
"github.com/ara-reddeer/proxmox-api-go/proxmox"
)
var NFSFull = proxmox.ConfigStorage{
Enable: true,
Nodes: []string{"pve"},
Type: "nfs",
NFS: &proxmox.ConfigStorageNFS{
Server: "10.20.1.1",
Export: "/exports",
Preallocation: proxmox.PointerString("full"),
Version: proxmox.PointerString("4"),
},
Content: &proxmox.ConfigStorageContent{
Backup: proxmox.PointerBool(true),
Container: proxmox.PointerBool(true),
DiskImage: proxmox.PointerBool(true),
Iso: proxmox.PointerBool(true),
Snippets: proxmox.PointerBool(true),
Template: proxmox.PointerBool(true),
},
BackupRetention: &proxmox.ConfigStorageBackupRetention{
Last: proxmox.PointerInt(6),
Hourly: proxmox.PointerInt(5),
Daily: proxmox.PointerInt(4),
Monthly: proxmox.PointerInt(3),
Weekly: proxmox.PointerInt(2),
Yearly: proxmox.PointerInt(1),
},
}
var NFSEmpty = proxmox.ConfigStorage{
Type: "nfs",
NFS: &proxmox.ConfigStorageNFS{
Server: "10.20.1.1",
Export: "/exports",
},
Content: &proxmox.ConfigStorageContent{
DiskImage: proxmox.PointerBool(true),
},
}
func NFSGetFull(name string, t *testing.T) {
s := CloneJson(NFSFull)
s.ID = name
Get(s, name, t)
}
func NFSGetEmpty(name string, t *testing.T) {
s := CloneJson(NFSEmpty)
s.ID = name
s.NFS.Preallocation = proxmox.PointerString("metadata")
s.Content.Backup = proxmox.PointerBool(false)
s.Content.Container = proxmox.PointerBool(false)
s.Content.Snippets = proxmox.PointerBool(false)
s.Content.Iso = proxmox.PointerBool(false)
s.Content.Template = proxmox.PointerBool(false)
Get(s, name, t)
}