Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spotaut 16164 vm filters aks #268

Merged
merged 4 commits into from
Oct 13, 2023
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
10 changes: 10 additions & 0 deletions examples/service/ocean/providers/azure_np/create/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,16 @@ func main() {
"F",
"E v4",
},
AcceleratedNetworking: spotinst.String("Enabled"),
DiskPerformance: spotinst.String("Premium"),
MinGpu: spotinst.Float64(1),
MaxGpu: spotinst.Float64(2),
MinNICs: spotinst.Int(1),
VmTypes: []string{
"generalPurpose",
"GPU",
},
MinData: spotinst.Int(2),
},
},
},
Expand Down
10 changes: 10 additions & 0 deletions examples/service/ocean/providers/azure_np/nodegroup/create/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,16 @@ func main() {
"Bs",
"Da v4",
},
AcceleratedNetworking: spotinst.String("Enabled"),
DiskPerformance: spotinst.String("Premium"),
MinGpu: spotinst.Float64(1),
MaxGpu: spotinst.Float64(2),
MinNICs: spotinst.Int(1),
VmTypes: []string{
"generalPurpose",
"GPU",
},
MinData: spotinst.Int(2),
},
},
},
Expand Down
70 changes: 63 additions & 7 deletions service/ocean/providers/azure_np/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,13 +325,20 @@ type VmSizes struct {
}

type Filters struct {
MinVcpu *int `json:"minVCpu,omitempty"`
MaxVcpu *int `json:"maxVCpu,omitempty"`
MinMemoryGiB *float64 `json:"minMemoryGiB,omitempty"`
MaxMemoryGiB *float64 `json:"maxMemoryGiB,omitempty"`
Series []string `json:"series,omitempty"`
Architectures []string `json:"architectures,omitempty"`
ExcludeSeries []string `json:"excludeSeries,omitempty"`
MinVcpu *int `json:"minVCpu,omitempty"`
MaxVcpu *int `json:"maxVCpu,omitempty"`
MinMemoryGiB *float64 `json:"minMemoryGiB,omitempty"`
MaxMemoryGiB *float64 `json:"maxMemoryGiB,omitempty"`
Series []string `json:"series,omitempty"`
Architectures []string `json:"architectures,omitempty"`
ExcludeSeries []string `json:"excludeSeries,omitempty"`
AcceleratedNetworking *string `json:"acceleratedNetworking,omitempty"`
DiskPerformance *string `json:"diskPerformance,omitempty"`
MinGpu *float64 `json:"minGpu,omitempty"`
MaxGpu *float64 `json:"maxGpu,omitempty"`
MinNICs *int `json:"minNICs,omitempty"`
VmTypes []string `json:"vmTypes,omitempty"`
MinData *int `json:"minData,omitempty"`

forceSendFields []string
nullFields []string
Expand Down Expand Up @@ -409,4 +416,53 @@ func (o *Filters) SetExcludeSeries(v []string) *Filters {
return o
}

func (o *Filters) SetAcceleratedNetworking(v *string) *Filters {
if o.AcceleratedNetworking = v; o.AcceleratedNetworking == nil {
o.nullFields = append(o.nullFields, "AcceleratedNetworking")
}
return o
}

func (o *Filters) SetDiskPerformance(v *string) *Filters {
if o.DiskPerformance = v; o.DiskPerformance == nil {
o.nullFields = append(o.nullFields, "DiskPerformance")
}
return o
}

func (o *Filters) SetMinGpu(v *float64) *Filters {
if o.MinGpu = v; o.MinGpu == nil {
o.nullFields = append(o.nullFields, "MinGpu")
}
return o
}

func (o *Filters) SetMaxGpu(v *float64) *Filters {
if o.MaxGpu = v; o.MaxGpu == nil {
o.nullFields = append(o.nullFields, "MaxGpu")
}
return o
}

func (o *Filters) SetMinNICs(v *int) *Filters {
if o.MinNICs = v; o.MinNICs == nil {
o.nullFields = append(o.nullFields, "MinNICs")
}
return o
}

func (o *Filters) SetVmTypes(v []string) *Filters {
if o.VmTypes = v; o.VmTypes == nil {
o.nullFields = append(o.nullFields, "VmTypes")
}
return o
}

func (o *Filters) SetMinData(v *int) *Filters {
if o.MinData = v; o.MinData == nil {
o.nullFields = append(o.nullFields, "MinData")
}
return o
}

//end region
Loading