Skip to content

Commit 55f9fb9

Browse files
Updated migrations field to be pointer (#639)
1 parent 94c3d40 commit 55f9fb9

File tree

5 files changed

+816
-782
lines changed

5 files changed

+816
-782
lines changed

placement_groups.go

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,26 +28,25 @@ type PlacementGroupMember struct {
2828

2929
// PlacementGroup represents a Linode placement group.
3030
type PlacementGroup struct {
31-
ID int `json:"id"`
32-
Label string `json:"label"`
33-
Region string `json:"region"`
34-
PlacementGroupType PlacementGroupType `json:"placement_group_type"`
35-
PlacementGroupPolicy PlacementGroupPolicy `json:"placement_group_policy"`
36-
IsCompliant bool `json:"is_compliant"`
37-
Members []PlacementGroupMember `json:"members"`
38-
Migrations PlacementGroupMigrations `json:"migrations"`
31+
ID int `json:"id"`
32+
Label string `json:"label"`
33+
Region string `json:"region"`
34+
PlacementGroupType PlacementGroupType `json:"placement_group_type"`
35+
PlacementGroupPolicy PlacementGroupPolicy `json:"placement_group_policy"`
36+
IsCompliant bool `json:"is_compliant"`
37+
Members []PlacementGroupMember `json:"members"`
38+
Migrations *PlacementGroupMigrations `json:"migrations"`
3939
}
4040

4141
// PlacementGroupMigrations represent the instances that are being migrated to or from the placement group.
4242
type PlacementGroupMigrations struct {
43-
Inbound []struct {
44-
// The unique identifier for a compute instance being migrated into the placement group.
45-
LinodeID int `json:"linode_id"`
46-
} `json:"inbound"`
47-
Outbound []struct {
48-
// The unique identifier for a compute instance being migrated out of the placement group.
49-
LinodeID int `json:"linode_id"`
50-
} `json:"outbound"`
43+
Inbound []PlacementGroupMigrationInstance `json:"inbound"`
44+
Outbound []PlacementGroupMigrationInstance `json:"outbound"`
45+
}
46+
47+
// PlacementGroupMigrationInstance represents the unique identifier for a compute instance being migrated to/from the placement group.
48+
type PlacementGroupMigrationInstance struct {
49+
LinodeID int `json:"linode_id"`
5150
}
5251

5352
// PlacementGroupCreateOptions represents the options to use

0 commit comments

Comments
 (0)