From b26475052882458c9c88786eda622cfe66e73eb5 Mon Sep 17 00:00:00 2001 From: patrapritish1 <59195856+patrapritish1@users.noreply.github.com> Date: Thu, 12 Oct 2023 14:07:23 +0530 Subject: [PATCH 1/2] Update common.go --- service/ocean/providers/azure_np/common.go | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/service/ocean/providers/azure_np/common.go b/service/ocean/providers/azure_np/common.go index 9dee1476..701e01b0 100644 --- a/service/ocean/providers/azure_np/common.go +++ b/service/ocean/providers/azure_np/common.go @@ -309,13 +309,14 @@ 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"` forceSendFields []string nullFields []string @@ -393,4 +394,11 @@ 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, "ExcludeSeries") + } + return o +} + //end region From 5c0facd95c3cbb21e4ad500d12d4df47aa517414 Mon Sep 17 00:00:00 2001 From: patrapritish1 <59195856+patrapritish1@users.noreply.github.com> Date: Fri, 13 Oct 2023 11:11:08 +0530 Subject: [PATCH 2/2] akss 2.0 --- .../ocean/providers/azure_np/create/main.go | 10 ++++ .../azure_np/nodegroup/create/main.go | 10 ++++ service/ocean/providers/azure_np/common.go | 50 ++++++++++++++++++- 3 files changed, 69 insertions(+), 1 deletion(-) diff --git a/examples/service/ocean/providers/azure_np/create/main.go b/examples/service/ocean/providers/azure_np/create/main.go index edfd1192..c142eb0e 100644 --- a/examples/service/ocean/providers/azure_np/create/main.go +++ b/examples/service/ocean/providers/azure_np/create/main.go @@ -132,6 +132,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), }, }, }, diff --git a/examples/service/ocean/providers/azure_np/nodegroup/create/main.go b/examples/service/ocean/providers/azure_np/nodegroup/create/main.go index 526e1efc..d281f8bb 100644 --- a/examples/service/ocean/providers/azure_np/nodegroup/create/main.go +++ b/examples/service/ocean/providers/azure_np/nodegroup/create/main.go @@ -90,6 +90,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), }, }, }, diff --git a/service/ocean/providers/azure_np/common.go b/service/ocean/providers/azure_np/common.go index 701e01b0..b6370761 100644 --- a/service/ocean/providers/azure_np/common.go +++ b/service/ocean/providers/azure_np/common.go @@ -317,6 +317,12 @@ type Filters struct { 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 @@ -396,7 +402,49 @@ func (o *Filters) SetExcludeSeries(v []string) *Filters { func (o *Filters) SetAcceleratedNetworking(v *string) *Filters { if o.AcceleratedNetworking = v; o.AcceleratedNetworking == nil { - o.nullFields = append(o.nullFields, "ExcludeSeries") + 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 }