Skip to content

Commit

Permalink
Add placement rule into the request and response
Browse files Browse the repository at this point in the history
Signed-off-by: Vishal Anarase <[email protected]>
  • Loading branch information
vishalanarase committed Sep 30, 2024
1 parent 46c541d commit b51866f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ type Instance struct {
ReservedIP string `json:"reserved_ip,omitempty"`
Subnets []Subnet `json:"subnets,omitempty"`
AttachedVolumes []AttachedVolume `json:"attached_volumes,omitempty"`
PlacementRule PlacementRule `json:"placement_rule,omitempty"`
}

//"cpu_cores":1,"ram_mb":2048,"disk_gb":25
Expand Down Expand Up @@ -110,6 +111,20 @@ type InstanceConfig struct {
TagsList string `json:"tags"`
FirewallID string `json:"firewall_id"`
AttachedVolumes []AttachedVolume `json:"attached_volumes"`
PlacementRule PlacementRule `json:"placement_rule"`
}

// AffinityRule represents a affinity rule
type AffinityRule struct {
Type string `json:"type"`
Exclusive bool `json:"exclusive"`
Tags []string `json:"tags"`
}

// PlacementRule represents a placement rule
type PlacementRule struct {
AffinityRules []AffinityRule `json:"affinity_rules,omitempty"`
NodeSelector map[string]string `json:"node_selector,omitempty"`
}

// ListInstances returns a page of Instances owned by the calling API account
Expand Down

0 comments on commit b51866f

Please sign in to comment.