Skip to content

Commit

Permalink
Added scheduling, suspensionHours and logging objects to ocean-…
Browse files Browse the repository at this point in the history
…aks-np

Added `scheduling`, `suspensionHours` and `logging` objects to ocean-aks-np
  • Loading branch information
chandra1-n committed Jan 14, 2025
1 parent 7028e4a commit 47a3b1e
Show file tree
Hide file tree
Showing 2 changed files with 159 additions and 3 deletions.
76 changes: 76 additions & 0 deletions service/ocean/providers/azure_np/cluster_np.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ type Cluster struct {
Health *Health `json:"health,omitempty"`
VirtualNodeGroupTemplate *VirtualNodeGroupTemplate `json:"virtualNodeGroupTemplate,omitempty"`
Scheduling *Scheduling `json:"scheduling,omitempty"`
Logging *Logging `json:"logging,omitempty"`

// Read-only fields.
CreatedAt *time.Time `json:"createdAt,omitempty"`
Expand Down Expand Up @@ -68,6 +69,28 @@ type VirtualNodeGroupTemplate struct {
Taints []*Taint `json:"taints,omitempty"`
AutoScale *AutoScale `json:"autoScale,omitempty"`
VmSizes *VmSizes `json:"vmSizes,omitempty"`
Scheduling *Scheduling `json:"scheduling,omitempty"`

forceSendFields []string
nullFields []string
}

type Logging struct {
Export *Export `json:"export,omitempty"`

forceSendFields []string
nullFields []string
}

type Export struct {
AzureBlob *AzureBlob `json:"azureBlob,omitempty"`

forceSendFields []string
nullFields []string
}

type AzureBlob struct {
Id *string `json:"id,omitempty"`

forceSendFields []string
nullFields []string
Expand Down Expand Up @@ -513,6 +536,13 @@ func (o *Cluster) SetScheduling(v *Scheduling) *Cluster {
return o
}

func (o *Cluster) SetLogging(v *Logging) *Cluster {
if o.Logging = v; o.Logging == nil {
o.nullFields = append(o.nullFields, "Logging")
}
return o
}

// endregion

// region AKS
Expand Down Expand Up @@ -744,6 +774,13 @@ func (o *VirtualNodeGroupTemplate) SetVmSizes(v *VmSizes) *VirtualNodeGroupTempl
return o
}

func (o *VirtualNodeGroupTemplate) SetScheduling(v *Scheduling) *VirtualNodeGroupTemplate {
if o.Scheduling = v; o.Scheduling == nil {
o.nullFields = append(o.nullFields, "Scheduling")
}
return o
}

// endregion

// region Health
Expand All @@ -761,6 +798,45 @@ func (o *Health) SetGracePeriod(v *int) *Health {
return o
}

func (o Logging) MarshalJSON() ([]byte, error) {
type noMethod Logging
raw := noMethod(o)
return jsonutil.MarshalJSON(raw, o.forceSendFields, o.nullFields)
}

func (o *Logging) SetExport(v *Export) *Logging {
if o.Export = v; o.Export == nil {
o.nullFields = append(o.nullFields, "Export")
}
return o
}

func (o Export) MarshalJSON() ([]byte, error) {
type noMethod Export
raw := noMethod(o)
return jsonutil.MarshalJSON(raw, o.forceSendFields, o.nullFields)
}

func (o *Export) SetAzureBlob(v *AzureBlob) *Export {
if o.AzureBlob = v; o.AzureBlob == nil {
o.nullFields = append(o.nullFields, "AzureBlob")
}
return o
}

func (o AzureBlob) MarshalJSON() ([]byte, error) {
type noMethod AzureBlob
raw := noMethod(o)
return jsonutil.MarshalJSON(raw, o.forceSendFields, o.nullFields)
}

func (o *AzureBlob) SetId(v *string) *AzureBlob {
if o.Id = v; o.Id == nil {
o.nullFields = append(o.nullFields, "Id")
}
return o
}

// region Import

type ImportCluster struct {
Expand Down
86 changes: 83 additions & 3 deletions service/ocean/providers/azure_np/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,9 @@ func (o *Headrooms) SetNumOfUnits(v *int) *Headrooms {
//region Scheduling

type Scheduling struct {
ShutdownHours *ShutdownHours `json:"shutdownHours,omitempty"`
Tasks []*Tasks `json:"tasks,omitempty"`
ShutdownHours *ShutdownHours `json:"shutdownHours,omitempty"`
Tasks []*Tasks `json:"tasks,omitempty"`
SuspensionHours *SuspensionHours `json:"suspensionHours,omitempty"`

forceSendFields []string
nullFields []string
Expand All @@ -319,6 +320,14 @@ type ShutdownHours struct {
nullFields []string
}

type SuspensionHours struct {
TimeWindows []string `json:"timeWindows,omitempty"`
IsEnabled *bool `json:"isEnabled,omitempty"`

forceSendFields []string
nullFields []string
}

type Tasks struct {
IsEnabled *bool `json:"isEnabled,omitempty"`
TaskType *string `json:"taskType,omitempty"`
Expand All @@ -330,7 +339,8 @@ type Tasks struct {
}

type Parameters struct {
ClusterRoll *ParameterClusterRoll `json:"clusterRoll,omitempty"`
ClusterRoll *ParameterClusterRoll `json:"clusterRoll,omitempty"`
UpgradeConfig *UpgradeConfig `json:"upgradeConfig,omitempty"`

forceSendFields []string
nullFields []string
Expand All @@ -348,6 +358,15 @@ type ParameterClusterRoll struct {
nullFields []string
}

type UpgradeConfig struct {
ApplyRoll *bool `json:"applyRoll,omitempty"`
ScopeVersion *string `json:"scopeVersion,omitempty"`
RollParameters *ParameterClusterRoll `json:"rollParameters,omitempty"`

forceSendFields []string
nullFields []string
}

func (o Scheduling) MarshalJSON() ([]byte, error) {
type noMethod Scheduling
raw := noMethod(o)
Expand All @@ -361,6 +380,13 @@ func (o *Scheduling) SetShutdownHours(v *ShutdownHours) *Scheduling {
return o
}

func (o *Scheduling) SetSuspensionHours(v *SuspensionHours) *Scheduling {
if o.SuspensionHours = v; o.SuspensionHours == nil {
o.nullFields = append(o.nullFields, "SuspensionHours")
}
return o
}

func (o ShutdownHours) MarshalJSON() ([]byte, error) {
type noMethod ShutdownHours
raw := noMethod(o)
Expand All @@ -381,6 +407,26 @@ func (o *ShutdownHours) SetIsEnabled(v *bool) *ShutdownHours {
return o
}

func (o SuspensionHours) MarshalJSON() ([]byte, error) {
type noMethod SuspensionHours
raw := noMethod(o)
return jsonutil.MarshalJSON(raw, o.forceSendFields, o.nullFields)
}

func (o *SuspensionHours) SetTimeWindows(v []string) *SuspensionHours {
if o.TimeWindows = v; o.TimeWindows == nil {
o.nullFields = append(o.nullFields, "TimeWindows")
}
return o
}

func (o *SuspensionHours) SetIsEnabled(v *bool) *SuspensionHours {
if o.IsEnabled = v; o.IsEnabled == nil {
o.nullFields = append(o.nullFields, "IsEnabled")
}
return o
}

// end region

// region vmSizes
Expand Down Expand Up @@ -605,6 +651,13 @@ func (o *Parameters) SetClusterRoll(v *ParameterClusterRoll) *Parameters {
return o
}

func (o *Parameters) SetUpgradeConfig(v *UpgradeConfig) *Parameters {
if o.UpgradeConfig = v; o.UpgradeConfig == nil {
o.nullFields = append(o.nullFields, "UpgradeConfig")
}
return o
}

func (o ParameterClusterRoll) MarshalJSON() ([]byte, error) {
type noMethod ParameterClusterRoll
raw := noMethod(o)
Expand Down Expand Up @@ -657,3 +710,30 @@ func (o *ParameterClusterRoll) SetVngIds(v []string) *ParameterClusterRoll {
}

// endregion

func (o UpgradeConfig) MarshalJSON() ([]byte, error) {
type noMethod UpgradeConfig
raw := noMethod(o)
return jsonutil.MarshalJSON(raw, o.forceSendFields, o.nullFields)
}

func (o *UpgradeConfig) SetApplyRoll(v *bool) *UpgradeConfig {
if o.ApplyRoll = v; o.ApplyRoll == nil {
o.nullFields = append(o.nullFields, "ApplyRoll")
}
return o
}

func (o *UpgradeConfig) SetScopeVersion(v *string) *UpgradeConfig {
if o.ScopeVersion = v; o.ScopeVersion == nil {
o.nullFields = append(o.nullFields, "ScopeVersion")
}
return o
}

func (o *UpgradeConfig) SetRollParameters(v *ParameterClusterRoll) *UpgradeConfig {
if o.RollParameters = v; o.RollParameters == nil {
o.nullFields = append(o.nullFields, "RollParameteres")
}
return o
}

0 comments on commit 47a3b1e

Please sign in to comment.