Skip to content
Merged
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
76 changes: 76 additions & 0 deletions api/k8s/v1beta3/k8s_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,50 @@ func (enum *ListPoolsRequestOrderBy) UnmarshalJSON(data []byte) error {
return nil
}

type MaintenanceWindowDayOfTheWeek string

const (
// MaintenanceWindowDayOfTheWeekAny is [insert doc].
MaintenanceWindowDayOfTheWeekAny = MaintenanceWindowDayOfTheWeek("any")
// MaintenanceWindowDayOfTheWeekMonday is [insert doc].
MaintenanceWindowDayOfTheWeekMonday = MaintenanceWindowDayOfTheWeek("monday")
// MaintenanceWindowDayOfTheWeekTuesday is [insert doc].
MaintenanceWindowDayOfTheWeekTuesday = MaintenanceWindowDayOfTheWeek("tuesday")
// MaintenanceWindowDayOfTheWeekWednesday is [insert doc].
MaintenanceWindowDayOfTheWeekWednesday = MaintenanceWindowDayOfTheWeek("wednesday")
// MaintenanceWindowDayOfTheWeekThursday is [insert doc].
MaintenanceWindowDayOfTheWeekThursday = MaintenanceWindowDayOfTheWeek("thursday")
// MaintenanceWindowDayOfTheWeekFriday is [insert doc].
MaintenanceWindowDayOfTheWeekFriday = MaintenanceWindowDayOfTheWeek("friday")
// MaintenanceWindowDayOfTheWeekSaturday is [insert doc].
MaintenanceWindowDayOfTheWeekSaturday = MaintenanceWindowDayOfTheWeek("saturday")
// MaintenanceWindowDayOfTheWeekSunday is [insert doc].
MaintenanceWindowDayOfTheWeekSunday = MaintenanceWindowDayOfTheWeek("sunday")
)

func (enum MaintenanceWindowDayOfTheWeek) String() string {
if enum == "" {
// return default value if empty
return "any"
}
return string(enum)
}

func (enum MaintenanceWindowDayOfTheWeek) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`"%s"`, enum)), nil
}

func (enum *MaintenanceWindowDayOfTheWeek) UnmarshalJSON(data []byte) error {
tmp := ""

if err := json.Unmarshal(data, &tmp); err != nil {
return err
}

*enum = MaintenanceWindowDayOfTheWeek(MaintenanceWindowDayOfTheWeek(tmp).String())
return nil
}

type NodeStatus string

const (
Expand Down Expand Up @@ -363,6 +407,14 @@ type Cluster struct {
DashboardEnabled bool `json:"dashboard_enabled"`
// Ingress display which ingress is deployed
Ingress string `json:"ingress"`

AutoUpgrade *ClusterAutoUpgrade `json:"auto_upgrade"`
}

type ClusterAutoUpgrade struct {
Enabled bool `json:"enabled"`

MaintenanceWindow *MaintenanceWindow `json:"maintenance_window"`
}

type ClusterAutoscalerConfig struct {
Expand All @@ -381,6 +433,12 @@ type ClusterAutoscalerConfig struct {
ExpendablePodsPriorityCutoff int32 `json:"expendable_pods_priority_cutoff"`
}

type CreateClusterRequestAutoUpgrade struct {
Enable bool `json:"enable"`

MaintenanceWindow *MaintenanceWindow `json:"maintenance_window"`
}

type CreateClusterRequestAutoscalerConfig struct {
ScaleDownDisabled *bool `json:"scale_down_disabled"`

Expand Down Expand Up @@ -448,6 +506,14 @@ type ListVersionsResponse struct {
Versions []*Version `json:"versions"`
}

type MaintenanceWindow struct {
StartHour uint32 `json:"start_hour"`
// Day
//
// Default value: any
Day MaintenanceWindowDayOfTheWeek `json:"day"`
}

// Node node
type Node struct {
// ID display node unique ID
Expand Down Expand Up @@ -526,6 +592,12 @@ type Pool struct {
type ResetClusterAdminTokenResponse struct {
}

type UpdateClusterRequestAutoUpgrade struct {
Enable *bool `json:"enable"`

MaintenanceWindow *MaintenanceWindow `json:"maintenance_window"`
}

type UpdateClusterRequestAutoscalerConfig struct {
ScaleDownDisabled *bool `json:"scale_down_disabled"`

Expand Down Expand Up @@ -664,6 +736,8 @@ type CreateClusterRequest struct {
DefaultPoolConfig *CreateClusterRequestDefaultPoolConfig `json:"default_pool_config"`

AutoscalerConfig *CreateClusterRequestAutoscalerConfig `json:"autoscaler_config"`

AutoUpgrade *CreateClusterRequestAutoUpgrade `json:"auto_upgrade"`
}

// CreateCluster create a new cluster
Expand Down Expand Up @@ -760,6 +834,8 @@ type UpdateClusterRequest struct {
EnableDashboard *bool `json:"enable_dashboard"`
// Ingress select a Kubernetes Ingress Controller
Ingress *string `json:"ingress"`

AutoUpgrade *UpdateClusterRequestAutoUpgrade `json:"auto_upgrade"`
}

// UpdateCluster update an existing cluster
Expand Down