Skip to content

Commit bcf24f9

Browse files
committed
add tag attribute to servers.Network
Closes #2192.
1 parent 5a7ac65 commit bcf24f9

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

openstack/compute/v2/servers/requests.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,13 @@ type Network struct {
128128

129129
// FixedIP specifies a fixed IPv4 address to be used on this network.
130130
FixedIP string
131+
132+
// Tag may contain an optional device role tag for the server's virtual
133+
// network interface. This can be used to identify network interfaces when
134+
// multiple networks are connected to one server.
135+
//
136+
// Requires microversion 2.32 through 2.36 or 2.42 or later.
137+
Tag string
131138
}
132139

133140
// Personality is an array of files that are injected into the server at launch.
@@ -261,6 +268,9 @@ func (opts CreateOpts) ToServerCreateMap() (map[string]interface{}, error) {
261268
if net.FixedIP != "" {
262269
networks[i]["fixed_ip"] = net.FixedIP
263270
}
271+
if net.Tag != "" {
272+
networks[i]["tag"] = net.Tag
273+
}
264274
}
265275
b["networks"] = networks
266276
}

0 commit comments

Comments
 (0)