Skip to content

Commit ae828fb

Browse files
authored
chore(server): add NIC model attribute to server related calls (#228)
* add nic_model attribute to server calls * fix typo * omit nic model if empty
1 parent 571123b commit ae828fb

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

upcloud/request/server.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ type CreateServerRequest struct {
144144
LoginUser *LoginUser `json:"login_user,omitempty"`
145145
MemoryAmount int `json:"memory_amount,omitempty"`
146146
Metadata upcloud.Boolean `json:"metadata"`
147+
NICModel string `json:"nic_model,omitempty"`
147148
Networking *CreateServerNetworking `json:"networking"`
148149
PasswordDelivery string `json:"password_delivery,omitempty"`
149150
Plan string `json:"plan,omitempty"`
@@ -320,6 +321,7 @@ type ModifyServerRequest struct {
320321
Labels *upcloud.LabelSlice `json:"labels,omitempty"`
321322
MemoryAmount int `json:"memory_amount,omitempty,string"`
322323
Metadata upcloud.Boolean `json:"metadata"`
324+
NICModel string `json:"nic_model,omitempty"`
323325
Plan string `json:"plan,omitempty"`
324326
SimpleBackup string `json:"simple_backup,omitempty"`
325327
TimeZone string `json:"timezone,omitempty"`

upcloud/request/server_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ func TestCreateServerRequest(t *testing.T) {
6767
},
6868
},
6969
Metadata: upcloud.True,
70+
NICModel: upcloud.NICModelVirtio,
7071
Networking: &CreateServerNetworking{
7172
Interfaces: []CreateServerInterface{
7273
{
@@ -143,6 +144,7 @@ func TestCreateServerRequest(t *testing.T) {
143144
]
144145
},
145146
"metadata":"yes",
147+
"nic_model":"virtio",
146148
"networking":{
147149
"interfaces":{
148150
"interface":[

0 commit comments

Comments
 (0)