Skip to content

Commit 1a283a0

Browse files
authored
Merge pull request #12 from tjdavis3/main
Add tags to VMs and containers
2 parents 5991497 + c7ae695 commit 1a283a0

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

nodes.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ type GetNodeQemuData struct {
144144
Status string `json:"status"`
145145
Uptime int `json:"uptime"`
146146
VMID IntOrString `json:"vmid"`
147+
Tags string `json:"tags"`
147148
}
148149

149150
// GetNodeQemu makes a GET request to the /nodes/{node}/qemu endpoint
@@ -187,6 +188,7 @@ type GetNodeLxcData struct {
187188
Type string `json:"type"`
188189
Uptime int `json:"uptime"`
189190
VMID IntOrString `json:"vmid"`
191+
Tags string `json:"tags"`
190192
}
191193

192194
// GetNodeLxc makes a GET request to the /nodes/{node}/lxc endpoint

nodes_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ func TestGetNodeLxc(t *testing.T) {
105105
Type: "lxc",
106106
Uptime: 0,
107107
VMID: IntOrString("103"),
108+
Tags: "tag3;tag4",
108109
},
109110
{
110111
CPU: 0,
@@ -164,6 +165,7 @@ func TestGetNodeQemu(t *testing.T) {
164165
Status: "running",
165166
Uptime: 28661,
166167
VMID: IntOrString("104"),
168+
Tags: "tag1;tag2",
167169
},
168170
},
169171
}

testdata/nodes/get_node_lxc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
"uptime":0,
1818
"diskread":0,
1919
"netout":0,
20-
"mem":0
20+
"mem":0,
21+
"tags": "tag3;tag4"
2122
},
2223
{
2324
"status":"stopped",

testdata/nodes/get_node_qemu.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"diskread":0,
1616
"disk":0,
1717
"cpu":0.0156071608339279,
18-
"maxmem":8589934592
18+
"maxmem":8589934592,
19+
"tags": "tag1;tag2"
1920
}
2021
]
2122
}

0 commit comments

Comments
 (0)