Skip to content

Commit

Permalink
Merge pull request #215 from civo/placementrules
Browse files Browse the repository at this point in the history
Add placement rule into the request and response
  • Loading branch information
vishalanarase authored Sep 30, 2024
2 parents 46c541d + b51866f commit 1ab480f
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 1ab480f

Please sign in to comment.