Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/fixtures/hosts/dedicated_servers/update_response.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "xkazYeJ0",
"title": "example.aa",
"title": "new-title",
"location_id": 1,
"status": "active",
"configuration": "REMM R123",
Expand Down
5 changes: 3 additions & 2 deletions pkg/hosts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,15 @@ func TestHostsUpdateDedicatedServer(t *testing.T) {
ctx := context.TODO()

newLabels := map[string]string{"env": "new-test"}
newTitle := "new-title"

dedicatedServer, err := client.Hosts.UpdateDedicatedServer(ctx, serverID, DedicatedServerUpdateInput{Labels: newLabels})
dedicatedServer, err := client.Hosts.UpdateDedicatedServer(ctx, serverID, DedicatedServerUpdateInput{Labels: newLabels, Title: newTitle})

g.Expect(err).To(BeNil())
g.Expect(dedicatedServer).ToNot(BeNil())

g.Expect(dedicatedServer.ID).To(Equal(serverID))
g.Expect(dedicatedServer.Title).To(Equal("example.aa"))
g.Expect(dedicatedServer.Title).To(Equal(newTitle))
g.Expect(dedicatedServer.LocationID).To(Equal(int64(1)))
g.Expect(dedicatedServer.Status).To(Equal("active"))
g.Expect(dedicatedServer.Configuration).To(Equal("REMM R123"))
Expand Down
1 change: 1 addition & 0 deletions pkg/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,7 @@ type LoadBalancerCluster struct {
// DedicatedServerUpdateInput represents dedicated server update input
type DedicatedServerUpdateInput struct {
Labels map[string]string `json:"labels,omitempty"`
Title string `json:"title"`
}

// KubernetesBaremetalNodeUpdateInput represents kubernetes baremetal node update input
Expand Down
Loading