diff --git a/castai/resource_rebalancing_schedule.go b/castai/resource_rebalancing_schedule.go index 38c9dc7c..9fa302ea 100644 --- a/castai/resource_rebalancing_schedule.go +++ b/castai/resource_rebalancing_schedule.go @@ -79,6 +79,12 @@ func resourceRebalancingSchedule() *schema.Resource { ValidateDiagFunc: validation.ToDiagFunc(validation.FloatAtLeast(0.0)), Description: "Defines the minimum percentage of savings expected.", }, + "ignore_savings": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "If true, the savings percentage will be ignored and the rebalancing will be triggered regardless of the savings percentage.", + }, }, }, }, @@ -261,6 +267,7 @@ func stateToSchedule(d *schema.ResourceData) (*sdk.ScheduledrebalancingV1Rebalan if triggerConditions := toSection(d, "trigger_conditions"); triggerConditions != nil { result.TriggerConditions = sdk.ScheduledrebalancingV1TriggerConditions{ SavingsPercentage: readOptionalNumber[float64, float32](triggerConditions, "savings_percentage"), + IgnoreSavings: readOptionalValue[bool](triggerConditions, "ignore_savings"), } } @@ -348,6 +355,7 @@ func scheduleToState(schedule *sdk.ScheduledrebalancingV1RebalancingSchedule, d triggerConditions := map[string]any{ "savings_percentage": toFloat64PtrTruncated(schedule.TriggerConditions.SavingsPercentage), + "ignore_savings": schedule.TriggerConditions.IgnoreSavings, } if err := d.Set("trigger_conditions", []map[string]any{triggerConditions}); err != nil { return err diff --git a/castai/sdk/api.gen.go b/castai/sdk/api.gen.go index b8209e1e..aad5b2ae 100644 --- a/castai/sdk/api.gen.go +++ b/castai/sdk/api.gen.go @@ -409,21 +409,23 @@ type CastaiInventoryV1beta1AzureReservationImport struct { // CPUPlatform describes the CPU platforms the instance type can be equipped with. type CastaiInventoryV1beta1CPUPlatform struct { - // All Core Turbo Frequency (GHz). + // All Core Turbo Frequency (GHz). Only available for GCP. AllCoreTurboFrequency *float64 `json:"allCoreTurboFrequency,omitempty"` // Base Frequency of the platform (GHz). BaseFrequency *float64 `json:"baseFrequency,omitempty"` - // Generation of the platform. + // Generation of the platform. Only available for GCP. Generation *string `json:"generation,omitempty"` - // Platform name. + // Platform name. Only available for GCP. Platform *string `json:"platform,omitempty"` - // Single Core Turbo Frequency (GHz). + // Processor name. + ProcessorName *string `json:"processorName,omitempty"` + + // Single Core Turbo Frequency (GHz). Only available for GCP. SingleCoreTurboFrequency *float64 `json:"singleCoreTurboFrequency,omitempty"` - Sku *string `json:"sku,omitempty"` } // CastaiInventoryV1beta1ClusterAggregatedUsage defines model for castai.inventory.v1beta1.ClusterAggregatedUsage. @@ -940,6 +942,9 @@ type CastaiSsoV1beta1CreateSSOConnection struct { // AzureAAD represents a Azure AAD connector. Aad *CastaiSsoV1beta1AzureAAD `json:"aad,omitempty"` + // Additional list of email domains assigned to SSO connection. + AdditionalEmailDomains *[]string `json:"additionalEmailDomains,omitempty"` + // EmailDomain is the email domain of the connection. EmailDomain string `json:"emailDomain"` @@ -1002,7 +1007,8 @@ type CastaiSsoV1beta1Okta struct { // SSOConnection represents a sso connection. type CastaiSsoV1beta1SSOConnection struct { // AzureAAD represents a Azure AAD connector. - Aad *CastaiSsoV1beta1AzureAAD `json:"aad,omitempty"` + Aad *CastaiSsoV1beta1AzureAAD `json:"aad,omitempty"` + AdditionalEmailDomains *[]string `json:"additionalEmailDomains,omitempty"` // CreatedAt is the time when the connection was created. CreatedAt *time.Time `json:"createdAt,omitempty"` @@ -1050,6 +1056,9 @@ type CastaiSsoV1beta1UpdateSSOConnection struct { // AzureAAD represents a Azure AAD connector. Aad *CastaiSsoV1beta1AzureAAD `json:"aad,omitempty"` + // Additional list of email domains assigned to SSO connection. + AdditionalEmailDomains *[]string `json:"additionalEmailDomains,omitempty"` + // EmailDomain is the email domain of the connection. EmailDomain *string `json:"emailDomain,omitempty"` @@ -2896,6 +2905,8 @@ type ScheduledrebalancingV1TimeZone struct { // ScheduledrebalancingV1TriggerConditions defines model for scheduledrebalancing.v1.TriggerConditions. type ScheduledrebalancingV1TriggerConditions struct { + // When true, the rebalancing job will be triggered regardless of the expected savings. + IgnoreSavings *bool `json:"ignoreSavings"` SavingsPercentage *float32 `json:"savingsPercentage,omitempty"` } diff --git a/docs/resources/rebalancing_schedule.md b/docs/resources/rebalancing_schedule.md index 68d35f5f..bacff6fe 100644 --- a/docs/resources/rebalancing_schedule.md +++ b/docs/resources/rebalancing_schedule.md @@ -118,6 +118,10 @@ Required: - `savings_percentage` (Number) Defines the minimum percentage of savings expected. +Optional: + +- `ignore_savings` (Boolean) If true, the savings percentage will be ignored and the rebalancing will be triggered regardless of the savings percentage. + ### Nested Schema for `timeouts`