diff --git a/castai/resource_workload_scaling_policy.go b/castai/resource_workload_scaling_policy.go index f012b52f6..753788a40 100644 --- a/castai/resource_workload_scaling_policy.go +++ b/castai/resource_workload_scaling_policy.go @@ -45,6 +45,7 @@ const ( FieldRolloutBehavior = "rollout_behavior" FieldRolloutBehaviorType = "type" FieldRolloutBehaviorNoDisruptionType = "NO_DISRUPTION" + FieldRolloutBehaviorPreferOneByOneType = "prefer_one_by_one" FieldPredictiveScaling = "predictive_scaling" FieldConfidenceThreshold = "threshold" DeprecatedFieldApplyThreshold = "apply_threshold" @@ -291,11 +292,16 @@ It can be either: Schema: map[string]*schema.Schema{ FieldRolloutBehaviorType: { Type: schema.TypeString, - Required: true, + Optional: true, Description: `Defines the rollout type to be used when applying recommendations. - NO_DISRUPTION - pods are restarted without causing service disruption.`, ValidateDiagFunc: validation.ToDiagFunc(validation.StringInSlice([]string{FieldRolloutBehaviorNoDisruptionType}, false)), }, + FieldRolloutBehaviorPreferOneByOneType: { + Type: schema.TypeBool, + Optional: true, + Description: `Defines if pods should be restarted one by one to avoid service disruption.`, + }, }, }, }, @@ -1358,20 +1364,35 @@ func toRolloutBehavior(m map[string]any) *sdk.WorkloadoptimizationV1RolloutBehav if v, ok := m[FieldRolloutBehaviorType].(string); ok && v != "" { r.Type = lo.ToPtr(sdk.WorkloadoptimizationV1RolloutBehaviorType(v)) } + if v, ok := m[FieldRolloutBehaviorPreferOneByOneType].(bool); ok { + r.PreferOneByOne = lo.ToPtr(v) + } + + if r.Type == nil && r.PreferOneByOne == nil { + return nil + } return r } func toRolloutBehaviorMap(s *sdk.WorkloadoptimizationV1RolloutBehaviorSettings) []map[string]any { - if s == nil || s.Type == nil { + if s == nil { return nil } - return []map[string]any{ - { - FieldRolloutBehaviorType: string(*s.Type), - }, + if s.Type == nil && s.PreferOneByOne == nil { + return nil } + + m := map[string]any{} + if s.Type != nil { + m[FieldRolloutBehaviorType] = string(*s.Type) + } + if s.PreferOneByOne != nil { + m[FieldRolloutBehaviorPreferOneByOneType] = *s.PreferOneByOne + } + + return []map[string]any{m} } func getWorkloadScalingPolicyByName(ctx context.Context, client sdk.ClientWithResponsesInterface, clusterID, name string) (*sdk.WorkloadoptimizationV1WorkloadScalingPolicy, error) { diff --git a/castai/resource_workload_scaling_policy_test.go b/castai/resource_workload_scaling_policy_test.go index e86dc7c29..48b6ade81 100644 --- a/castai/resource_workload_scaling_policy_test.go +++ b/castai/resource_workload_scaling_policy_test.go @@ -582,6 +582,42 @@ func Test_toRolloutBehavior(t *testing.T) { Type: lo.ToPtr(sdk.NODISRUPTION), }, }, + "should return rollout behavior settings with prefer_one_by_one": { + args: map[string]any{ + FieldRolloutBehaviorType: FieldRolloutBehaviorNoDisruptionType, + FieldRolloutBehaviorPreferOneByOneType: true, + }, + exp: &sdk.WorkloadoptimizationV1RolloutBehaviorSettings{ + Type: lo.ToPtr(sdk.NODISRUPTION), + PreferOneByOne: lo.ToPtr(true), + }, + }, + "should return rollout behavior settings with prefer_one_by_one false": { + args: map[string]any{ + FieldRolloutBehaviorType: FieldRolloutBehaviorNoDisruptionType, + FieldRolloutBehaviorPreferOneByOneType: false, + }, + exp: &sdk.WorkloadoptimizationV1RolloutBehaviorSettings{ + Type: lo.ToPtr(sdk.NODISRUPTION), + PreferOneByOne: lo.ToPtr(false), + }, + }, + "should return rollout behavior settings with only prefer_one_by_one": { + args: map[string]any{ + FieldRolloutBehaviorPreferOneByOneType: true, + }, + exp: &sdk.WorkloadoptimizationV1RolloutBehaviorSettings{ + PreferOneByOne: lo.ToPtr(true), + }, + }, + "should return nil when only prefer_one_by_one is false": { + args: map[string]any{ + FieldRolloutBehaviorPreferOneByOneType: false, + }, + exp: &sdk.WorkloadoptimizationV1RolloutBehaviorSettings{ + PreferOneByOne: lo.ToPtr(false), + }, + }, "should return nil on empty map": { args: map[string]any{}, exp: nil, @@ -596,6 +632,83 @@ func Test_toRolloutBehavior(t *testing.T) { } } +func Test_toRolloutBehaviorMap(t *testing.T) { + tests := map[string]struct { + args *sdk.WorkloadoptimizationV1RolloutBehaviorSettings + exp []map[string]any + }{ + "should return rollout behavior map": { + args: &sdk.WorkloadoptimizationV1RolloutBehaviorSettings{ + Type: lo.ToPtr(sdk.NODISRUPTION), + }, + exp: []map[string]any{ + { + FieldRolloutBehaviorType: string(sdk.NODISRUPTION), + }, + }, + }, + "should return rollout behavior map with prefer_one_by_one": { + args: &sdk.WorkloadoptimizationV1RolloutBehaviorSettings{ + Type: lo.ToPtr(sdk.NODISRUPTION), + PreferOneByOne: lo.ToPtr(true), + }, + exp: []map[string]any{ + { + FieldRolloutBehaviorType: string(sdk.NODISRUPTION), + FieldRolloutBehaviorPreferOneByOneType: true, + }, + }, + }, + "should return rollout behavior map with prefer_one_by_one false": { + args: &sdk.WorkloadoptimizationV1RolloutBehaviorSettings{ + Type: lo.ToPtr(sdk.NODISRUPTION), + PreferOneByOne: lo.ToPtr(false), + }, + exp: []map[string]any{ + { + FieldRolloutBehaviorType: string(sdk.NODISRUPTION), + FieldRolloutBehaviorPreferOneByOneType: false, + }, + }, + }, + "should return rollout behavior map with only prefer_one_by_one": { + args: &sdk.WorkloadoptimizationV1RolloutBehaviorSettings{ + PreferOneByOne: lo.ToPtr(true), + }, + exp: []map[string]any{ + { + FieldRolloutBehaviorPreferOneByOneType: true, + }, + }, + }, + "should return rollout behavior map with only prefer_one_by_one false": { + args: &sdk.WorkloadoptimizationV1RolloutBehaviorSettings{ + PreferOneByOne: lo.ToPtr(false), + }, + exp: []map[string]any{ + { + FieldRolloutBehaviorPreferOneByOneType: false, + }, + }, + }, + "should return nil for nil input": { + args: nil, + exp: nil, + }, + "should return nil for empty settings": { + args: &sdk.WorkloadoptimizationV1RolloutBehaviorSettings{}, + exp: nil, + }, + } + for name, tt := range tests { + t.Run(name, func(t *testing.T) { + r := require.New(t) + got := toRolloutBehaviorMap(tt.args) + r.Equal(tt.exp, got) + }) + } +} + func Test_resourceWorkloadScalingPolicyCreate(t *testing.T) { organizationId := "63d2af53-9a42-4968-be1e-39316ebfd8d4" clusterId := "4e4cd9eb-82eb-407e-a926-e5fef81cab50" diff --git a/castai/sdk/api.gen.go b/castai/sdk/api.gen.go index 6a98c9f66..24d5f076d 100644 --- a/castai/sdk/api.gen.go +++ b/castai/sdk/api.gen.go @@ -4,6 +4,8 @@ package sdk import ( + "encoding/json" + "fmt" "time" ) @@ -578,6 +580,12 @@ const ( CommitmentsAPIImportAWSReservedInstancesParamsBehaviourOVERWRITE CommitmentsAPIImportAWSReservedInstancesParamsBehaviour = "OVERWRITE" ) +// Defines values for AuthTokenAPIListAuthTokensParamsOrganizations. +const ( + AuthTokenAPIListAuthTokensParamsOrganizationsALL AuthTokenAPIListAuthTokensParamsOrganizations = "ALL" + AuthTokenAPIListAuthTokensParamsOrganizationsORGANIZATIONSUNSPECIFIED AuthTokenAPIListAuthTokensParamsOrganizations = "ORGANIZATIONS_UNSPECIFIED" +) + // Defines values for AllocationGroupAPIGetAllocationGroupWorkloadCostsParamsSortOrder. const ( AllocationGroupAPIGetAllocationGroupWorkloadCostsParamsSortOrderASC AllocationGroupAPIGetAllocationGroupWorkloadCostsParamsSortOrder = "ASC" @@ -632,9 +640,9 @@ const ( // Defines values for RbacServiceAPIListRolesParamsType. const ( - ALL RbacServiceAPIListRolesParamsType = "ALL" - DEFAULT RbacServiceAPIListRolesParamsType = "DEFAULT" - ENTERPRISE RbacServiceAPIListRolesParamsType = "ENTERPRISE" + RbacServiceAPIListRolesParamsTypeALL RbacServiceAPIListRolesParamsType = "ALL" + RbacServiceAPIListRolesParamsTypeDEFAULT RbacServiceAPIListRolesParamsType = "DEFAULT" + RbacServiceAPIListRolesParamsTypeENTERPRISE RbacServiceAPIListRolesParamsType = "ENTERPRISE" ) // Defines values for CommitmentsAPIImportAzureReservationsParamsBehaviour. @@ -2055,6 +2063,7 @@ type CastaiRbacV1beta1Group struct { // OrganizationId OrganizationID is the unique identifier of the organization. OrganizationId *string `json:"organizationId,omitempty"` + SsoProvider *string `json:"ssoProvider,omitempty"` // UpdatedAt UpdatedAt is the timestamp when the group was last updated. UpdatedAt *time.Time `json:"updatedAt,omitempty"` @@ -2768,11 +2777,8 @@ type CastaiUsersV1beta1Membership struct { CreatedAt *time.Time `json:"createdAt,omitempty"` Groups *[]CastaiUsersV1beta1GroupRef `json:"groups,omitempty"` LoginAt *time.Time `json:"loginAt,omitempty"` - - // Role Deprecated: for RBACv2 user can be bound to multiple roles. - // Use https://docs.cast.ai/reference/rbacserviceapi instead. // Deprecated: - Role string `json:"role"` + Role *interface{} `json:"role,omitempty"` // User User represents a single system user. User CastaiUsersV1beta1User `json:"user"` @@ -2780,11 +2786,8 @@ type CastaiUsersV1beta1Membership struct { // CastaiUsersV1beta1NewMembership NewMembership contains data needed to create new membership in organization. type CastaiUsersV1beta1NewMembership struct { - // Role Deprecated: for RBACv2 user can be bound to multiple roles. - // Use https://docs.cast.ai/reference/rbacserviceapi instead. - // role of the new member. // Deprecated: - Role string `json:"role"` + Role *interface{} `json:"role,omitempty"` // UserId id of the user. UserId string `json:"userId"` @@ -2794,12 +2797,8 @@ type CastaiUsersV1beta1NewMembership struct { type CastaiUsersV1beta1NewMembershipByEmail struct { // GroupIds list of the group IDs for which new user should be added. GroupIds *[]string `json:"groupIds,omitempty"` - - // Role Deprecated: for RBACv2 user can be bound to multiple roles. - // Use https://docs.cast.ai/reference/rbacserviceapi instead. - // role of the invited person. // Deprecated: - Role *string `json:"role,omitempty"` + Role *interface{} `json:"role,omitempty"` // RoleBindings The role bindings the user will be bound to after the invitation is claimed. RoleBindings *[]CastaiUsersV1beta1InvitationRoleBinding `json:"roleBindings,omitempty"` @@ -2862,12 +2861,8 @@ type CastaiUsersV1beta1PendingInvitation struct { // InviteEmail email of the invited person. InviteEmail string `json:"inviteEmail"` - - // Role Deprecated: for RBACv2 user can be bound to multiple roles. - // Use https://docs.cast.ai/reference/rbacserviceapi instead. - // role of the invited person. // Deprecated: - Role string `json:"role"` + Role *interface{} `json:"role,omitempty"` // RoleBindings The role bindings the user will be bound to after the invitation is claimed. RoleBindings *[]CastaiUsersV1beta1InvitationRoleBinding `json:"roleBindings,omitempty"` @@ -3402,211 +3397,6 @@ type CostreportV1beta1GetCostAllocationGroupDataTransferWorkloadsResponseWorkloa WorkloadType *string `json:"workloadType,omitempty"` } -// CostreportV1beta1GetCostAllocationGroupSummaryResponse defines model for costreport.v1beta1.GetCostAllocationGroupSummaryResponse. -type CostreportV1beta1GetCostAllocationGroupSummaryResponse struct { - Items *[]CostreportV1beta1GetCostAllocationGroupSummaryResponseCostAllocationGroupItem `json:"items,omitempty"` -} - -// CostreportV1beta1GetCostAllocationGroupSummaryResponseCostAllocationGroupItem defines model for costreport.v1beta1.GetCostAllocationGroupSummaryResponse.CostAllocationGroupItem. -type CostreportV1beta1GetCostAllocationGroupSummaryResponseCostAllocationGroupItem struct { - GroupId *string `json:"groupId,omitempty"` - GroupName *string `json:"groupName,omitempty"` - Items *[]CostreportV1beta1GetCostAllocationGroupSummaryResponseCostItem `json:"items,omitempty"` - - // WorkloadCount Count of workloads for the given time period. - WorkloadCount *string `json:"workloadCount,omitempty"` -} - -// CostreportV1beta1GetCostAllocationGroupSummaryResponseCostItem Defines cost details for a given time. -type CostreportV1beta1GetCostAllocationGroupSummaryResponseCostItem struct { - // CpuCostOnDemand Average CPU cost of on-demand instances for the given time period. - CpuCostOnDemand *string `json:"cpuCostOnDemand,omitempty"` - - // CpuCostSpot Average CPU cost of spot instances for the given time period. - CpuCostSpot *string `json:"cpuCostSpot,omitempty"` - - // CpuCostSpotFallback Average CPU cost of spot-fallback instances for the given time period. - CpuCostSpotFallback *string `json:"cpuCostSpotFallback,omitempty"` - - // CpuCountOnDemand Average number of CPUs used on on-demand instances for the given time period. - CpuCountOnDemand *string `json:"cpuCountOnDemand,omitempty"` - - // CpuCountSpot Average number of CPUs used on spot instances for the given time period. - CpuCountSpot *string `json:"cpuCountSpot,omitempty"` - - // CpuCountSpotFallback Average number of CPUs used on spot-fallback instances for the given time period. - CpuCountSpotFallback *string `json:"cpuCountSpotFallback,omitempty"` - - // GpuCostOnDemand Average GPU cost of on-demand instances for the given time period. - GpuCostOnDemand *string `json:"gpuCostOnDemand,omitempty"` - - // GpuCostSpot Average GPU cost of spot instances for the given time period. - GpuCostSpot *string `json:"gpuCostSpot,omitempty"` - - // GpuCostSpotFallback Average GPU cost of spot-fallback instances for the given time period. - GpuCostSpotFallback *string `json:"gpuCostSpotFallback,omitempty"` - - // GpuCountOnDemand Average number of GPUs used on on-demand instances for the given time period. - GpuCountOnDemand *string `json:"gpuCountOnDemand,omitempty"` - - // GpuCountSpot Average number of GPUs used on spot instances for the given time period. - GpuCountSpot *string `json:"gpuCountSpot,omitempty"` - - // GpuCountSpotFallback Average number of GPUs used on spot-fallback instances for the given time period. - GpuCountSpotFallback *string `json:"gpuCountSpotFallback,omitempty"` - - // PodCountOnDemand Average amount of pods on on-demand instances for the given time period. - PodCountOnDemand *string `json:"podCountOnDemand,omitempty"` - - // PodCountSpot Average amount of pods on spot instances for the given time period. - PodCountSpot *string `json:"podCountSpot,omitempty"` - - // PodCountSpotFallback Average amount of pods on spot-fallback instances for the given time period. - PodCountSpotFallback *string `json:"podCountSpotFallback,omitempty"` - - // RamCostOnDemand Average RAM cost of on-demand instances for the given time period. - RamCostOnDemand *string `json:"ramCostOnDemand,omitempty"` - - // RamCostSpot Average RAM cost of spot instances for the given time period. - RamCostSpot *string `json:"ramCostSpot,omitempty"` - - // RamCostSpotFallback Average RAM cost of spot-fallback instances for the given time period. - RamCostSpotFallback *string `json:"ramCostSpotFallback,omitempty"` - - // RamGibOnDemand Average RAM GiB used on on-demand instances for the given time period. - RamGibOnDemand *string `json:"ramGibOnDemand,omitempty"` - - // RamGibSpot Average RAM GiB used on spot instances for the given time period. - RamGibSpot *string `json:"ramGibSpot,omitempty"` - - // RamGibSpotFallback Average RAM GiB used on spot-fallback instances for the given time period. - RamGibSpotFallback *string `json:"ramGibSpotFallback,omitempty"` - - // Timestamp Timestamp of entry. - Timestamp *time.Time `json:"timestamp,omitempty"` - - // TotalCostOnDemand Total cost of on-demand instances for the given time period. - TotalCostOnDemand *string `json:"totalCostOnDemand,omitempty"` - - // TotalCostSpot Total cost of spot instances for the given time period. - TotalCostSpot *string `json:"totalCostSpot,omitempty"` - - // TotalCostSpotFallback Total cost of spot-fallback instances for the given time period. - TotalCostSpotFallback *string `json:"totalCostSpotFallback,omitempty"` - - // WorkloadCount Number of workloads included in group. - WorkloadCount *string `json:"workloadCount,omitempty"` -} - -// CostreportV1beta1GetCostAllocationGroupWorkloadsResponse Defines cluster workload cost response. -type CostreportV1beta1GetCostAllocationGroupWorkloadsResponse struct { - GroupId *string `json:"groupId,omitempty"` - GroupName *string `json:"groupName,omitempty"` - - // Items Workload entries. - Items *[]CostreportV1beta1GetCostAllocationGroupWorkloadsResponseWorkloadItem `json:"items,omitempty"` -} - -// CostreportV1beta1GetCostAllocationGroupWorkloadsResponseClusterInfo defines model for costreport.v1beta1.GetCostAllocationGroupWorkloadsResponse.ClusterInfo. -type CostreportV1beta1GetCostAllocationGroupWorkloadsResponseClusterInfo struct { - Id *string `json:"id,omitempty"` -} - -// CostreportV1beta1GetCostAllocationGroupWorkloadsResponseWorkloadCostItem Defines a workloads cost for a given time. -type CostreportV1beta1GetCostAllocationGroupWorkloadsResponseWorkloadCostItem struct { - // CpuCostOnDemand Average CPU cost of the workload that are on-demand instances for the given time period. - CpuCostOnDemand *string `json:"cpuCostOnDemand,omitempty"` - - // CpuCostSpot Average CPU cost of the workload that are spot instances for the given time period. - CpuCostSpot *string `json:"cpuCostSpot,omitempty"` - - // CpuCostSpotFallback Average CPU cost of the workload that are spot-fallback instances for the given time period. - CpuCostSpotFallback *string `json:"cpuCostSpotFallback,omitempty"` - - // CpuCountOnDemand Average number of CPUs of the workload that is on on-demand instances for the given time period. - CpuCountOnDemand *string `json:"cpuCountOnDemand,omitempty"` - - // CpuCountSpot Average number of CPUs of the workload that is on spot instances for the given time period. - CpuCountSpot *string `json:"cpuCountSpot,omitempty"` - - // CpuCountSpotFallback Average number of CPUs of the workload that is on spot-fallback instances for the given time period. - CpuCountSpotFallback *string `json:"cpuCountSpotFallback,omitempty"` - - // GpuCostOnDemand Average GPU cost of the workload that is on on-demand instances for the given time period. - GpuCostOnDemand *string `json:"gpuCostOnDemand,omitempty"` - - // GpuCostSpot Average GPU cost of the workload that is on spot instances for the given time period. - GpuCostSpot *string `json:"gpuCostSpot,omitempty"` - - // GpuCostSpotFallback Average GPU cost of the workload that is on spot-fallback instances for the given time period. - GpuCostSpotFallback *string `json:"gpuCostSpotFallback,omitempty"` - - // GpuCountOnDemand Average number of GPUs of the workload that is on on-demand instances for the given time period. - GpuCountOnDemand *string `json:"gpuCountOnDemand,omitempty"` - - // GpuCountSpot Average number of GPUs of the workload that is on spot instances for the given time period. - GpuCountSpot *string `json:"gpuCountSpot,omitempty"` - - // GpuCountSpotFallback Average number of GPUs of the workload that is on spot-fallback instances for the given time period. - GpuCountSpotFallback *string `json:"gpuCountSpotFallback,omitempty"` - - // PodCountOnDemand Average amount of pods for the workload that are on on-demand instances for the given time period. - PodCountOnDemand *string `json:"podCountOnDemand,omitempty"` - - // PodCountSpot Average amount of pods for the workload that are on spot instances for the given time period. - PodCountSpot *string `json:"podCountSpot,omitempty"` - - // PodCountSpotFallback Average amount of pods for the workload that are on spot-fallback instances for the given time period. - PodCountSpotFallback *string `json:"podCountSpotFallback,omitempty"` - - // RamCostOnDemand Average RAM cost of the workload that are on-demand instances for the given time period. - RamCostOnDemand *string `json:"ramCostOnDemand,omitempty"` - - // RamCostSpot Average RAM cost of the workload that are spot instances for the given time period. - RamCostSpot *string `json:"ramCostSpot,omitempty"` - - // RamCostSpotFallback Average RAM cost of the workload that are spot-fallback instances for the given time period. - RamCostSpotFallback *string `json:"ramCostSpotFallback,omitempty"` - - // RamGibOnDemand Average RAM GiB used on on-demand instances for the given time period. - RamGibOnDemand *string `json:"ramGibOnDemand,omitempty"` - - // RamGibSpot Average RAM GiB of the workload that are on spot instances for the given time period. - RamGibSpot *string `json:"ramGibSpot,omitempty"` - - // RamGibSpotFallback Average RAM GiB of the workload that are on spot-fallback instances for the given time period. - RamGibSpotFallback *string `json:"ramGibSpotFallback,omitempty"` - - // Timestamp Timestamp of entry creation. - Timestamp *time.Time `json:"timestamp,omitempty"` - - // TotalCostOnDemand Total cost of the workload that is on on-demand instances for the given time period. - TotalCostOnDemand *string `json:"totalCostOnDemand,omitempty"` - - // TotalCostSpot Total cost of the workload that is on spot instances for the given time period. - TotalCostSpot *string `json:"totalCostSpot,omitempty"` - - // TotalCostSpotFallback Total cost of the workload that is on spot-fallback instances for the given time period. - TotalCostSpotFallback *string `json:"totalCostSpotFallback,omitempty"` -} - -// CostreportV1beta1GetCostAllocationGroupWorkloadsResponseWorkloadItem Defines a workload. -type CostreportV1beta1GetCostAllocationGroupWorkloadsResponseWorkloadItem struct { - Cluster *CostreportV1beta1GetCostAllocationGroupWorkloadsResponseClusterInfo `json:"cluster,omitempty"` - - // Items Cost metrics of the workload. - Items *[]CostreportV1beta1GetCostAllocationGroupWorkloadsResponseWorkloadCostItem `json:"items,omitempty"` - - // Namespace Namespace the workload is in. - Namespace *string `json:"namespace,omitempty"` - - // WorkloadName Name of the workload. - WorkloadName *string `json:"workloadName,omitempty"` - - // WorkloadType Type of the workload. - WorkloadType *string `json:"workloadType,omitempty"` -} - // CostreportV1beta1ListAllocationGroupsResponse defines model for costreport.v1beta1.ListAllocationGroupsResponse. type CostreportV1beta1ListAllocationGroupsResponse struct { Items *[]CostreportV1beta1AllocationGroup `json:"items,omitempty"` @@ -4008,6 +3798,11 @@ type ExternalclusterV1GetCleanupScriptResponse struct { Script *string `json:"script,omitempty"` } +// ExternalclusterV1GetConnectAndEnableCASTAICmdResponse GetConnectAndEnableCASTAICmdResponse is the result of GetConnectAndEnableCASTAICmdRequest. +type ExternalclusterV1GetConnectAndEnableCASTAICmdResponse struct { + Script *string `json:"script,omitempty"` +} + // ExternalclusterV1GetCredentialsScriptResponse GetCredentialsScriptResponse is the result of GetCredentialsScriptRequest. type ExternalclusterV1GetCredentialsScriptResponse struct { Script *string `json:"script,omitempty"` @@ -4399,6 +4194,178 @@ type ExternalclusterV1Zone struct { Name *string `json:"name,omitempty"` } +// GoogleApiHttpBody Message that represents an arbitrary HTTP body. It should only be used for +// payload formats that can't be represented as JSON, such as raw binary or +// an HTML page. +// +// This message can be used both in streaming and non-streaming API methods in +// the request as well as the response. +// +// It can be used as a top-level request field, which is convenient if one +// wants to extract parameters from either the URL or HTTP template into the +// request fields and also want access to the raw HTTP body. +// +// Example: +// +// message GetResourceRequest { +// // A unique request id. +// string request_id = 1; +// +// // The raw HTTP body is bound to this field. +// google.api.HttpBody http_body = 2; +// +// } +// +// service ResourceService { +// rpc GetResource(GetResourceRequest) +// returns (google.api.HttpBody); +// rpc UpdateResource(google.api.HttpBody) +// returns (google.protobuf.Empty); +// +// } +// +// Example with streaming methods: +// +// service CaldavService { +// rpc GetCalendar(stream google.api.HttpBody) +// returns (stream google.api.HttpBody); +// rpc UpdateCalendar(stream google.api.HttpBody) +// returns (stream google.api.HttpBody); +// +// } +// +// Use of this type only changes how the request and response bodies are +// handled, all other features will continue to work unchanged. +type GoogleApiHttpBody struct { + // ContentType The HTTP Content-Type header value specifying the content type of the body. + ContentType *string `json:"contentType,omitempty"` + + // Data The HTTP request/response body as raw binary. + Data *[]byte `json:"data,omitempty"` + + // Extensions Application specific response metadata. Must be set in the first response + // for streaming APIs. + Extensions *[]GoogleProtobufAny `json:"extensions,omitempty"` +} + +// GoogleProtobufAny `Any` contains an arbitrary serialized protocol buffer message along with a +// URL that describes the type of the serialized message. +// +// Protobuf library provides support to pack/unpack Any values in the form +// of utility functions or additional generated methods of the Any type. +// +// Example 1: Pack and unpack a message in C++. +// +// Foo foo = ...; +// Any any; +// any.PackFrom(foo); +// ... +// if (any.UnpackTo(&foo)) { +// ... +// } +// +// Example 2: Pack and unpack a message in Java. +// +// Foo foo = ...; +// Any any = Any.pack(foo); +// ... +// if (any.is(Foo.class)) { +// foo = any.unpack(Foo.class); +// } +// // or ... +// if (any.isSameTypeAs(Foo.getDefaultInstance())) { +// foo = any.unpack(Foo.getDefaultInstance()); +// } +// +// Example 3: Pack and unpack a message in Python. +// +// foo = Foo(...) +// any = Any() +// any.Pack(foo) +// ... +// if any.Is(Foo.DESCRIPTOR): +// any.Unpack(foo) +// ... +// +// Example 4: Pack and unpack a message in Go +// +// foo := &pb.Foo{...} +// any, err := anypb.New(foo) +// if err != nil { +// ... +// } +// ... +// foo := &pb.Foo{} +// if err := any.UnmarshalTo(foo); err != nil { +// ... +// } +// +// The pack methods provided by protobuf library will by default use +// 'type.googleapis.com/full.type.name' as the type URL and the unpack +// methods only use the fully qualified type name after the last '/' +// in the type URL, for example "foo.bar.com/x/y.z" will yield type +// name "y.z". +// +// JSON +// ==== +// The JSON representation of an `Any` value uses the regular +// representation of the deserialized, embedded message, with an +// additional field `@type` which contains the type URL. Example: +// +// package google.profile; +// message Person { +// string first_name = 1; +// string last_name = 2; +// } +// +// { +// "@type": "type.googleapis.com/google.profile.Person", +// "firstName": , +// "lastName": +// } +// +// If the embedded message type is well-known and has a custom JSON +// representation, that representation will be embedded adding a field +// `value` which holds the custom JSON in addition to the `@type` +// field. Example (for message [google.protobuf.Duration][]): +// +// { +// "@type": "type.googleapis.com/google.protobuf.Duration", +// "value": "1.212s" +// } +type GoogleProtobufAny struct { + // Type A URL/resource name that uniquely identifies the type of the serialized + // protocol buffer message. This string must contain at least + // one "/" character. The last segment of the URL's path must represent + // the fully qualified name of the type (as in + // `path/google.protobuf.Duration`). The name should be in a canonical form + // (e.g., leading "." is not accepted). + // + // In practice, teams usually precompile into the binary all types that they + // expect it to use in the context of Any. However, for URLs which use the + // scheme `http`, `https`, or no scheme, one can optionally set up a type + // server that maps type URLs to message definitions as follows: + // + // * If no scheme is provided, `https` is assumed. + // * An HTTP GET on the URL must yield a [google.protobuf.Type][] + // value in binary format, or produce an error. + // * Applications are allowed to cache lookup results based on the + // URL, or have them precompiled into a binary to avoid any + // lookup. Therefore, binary compatibility needs to be preserved + // on changes to types. (Use versioned type names to manage + // breaking changes.) + // + // Note: this functionality is not currently available in the official + // protobuf release, and it is not used for type URLs beginning with + // type.googleapis.com. As of May 2023, there are no widely used type server + // implementations and no plans to implement one. + // + // Schemes other than `http`, `https` (or the empty scheme) might be + // used with implementation specific semantics. + Type *string `json:"@type,omitempty"` + AdditionalProperties map[string]map[string]interface{} `json:"-"` +} + // K8sSelectorV1KubernetesNodeAffinity defines model for k8s_selector.v1.KubernetesNodeAffinity. type K8sSelectorV1KubernetesNodeAffinity struct { Key string `json:"key"` @@ -4951,6 +4918,7 @@ type NodetemplatesV1AvailableInstanceType struct { Cpu *string `json:"cpu,omitempty"` CpuCost *float64 `json:"cpuCost,omitempty"` CpuManufacturers *[]string `json:"cpuManufacturers,omitempty"` + Csp *string `json:"csp,omitempty"` CustomerSpecific *bool `json:"customerSpecific,omitempty"` Family *string `json:"family,omitempty"` IsBareMetal *bool `json:"isBareMetal,omitempty"` @@ -4958,6 +4926,7 @@ type NodetemplatesV1AvailableInstanceType struct { Memory *string `json:"memory,omitempty"` Name *string `json:"name,omitempty"` Os *NodetemplatesV1AvailableInstanceTypeOs `json:"os,omitempty"` + Region *string `json:"region,omitempty"` StorageOptimizedOption *NodetemplatesV1AvailableInstanceTypeStorageOptimizedOption `json:"storageOptimizedOption,omitempty"` } @@ -7085,6 +7054,9 @@ type WorkloadoptimizationV1Resources struct { // WorkloadoptimizationV1RolloutBehaviorSettings defines model for workloadoptimization.v1.RolloutBehaviorSettings. type WorkloadoptimizationV1RolloutBehaviorSettings struct { + // PreferOneByOne If true, prefer rolling out recommendations one pod at a time. + PreferOneByOne *bool `json:"preferOneByOne"` + // Type Defines workload recommendation rollout types. // NO_DISRUPTION - rollout shouldn't cause service disruption. Type *WorkloadoptimizationV1RolloutBehaviorType `json:"type,omitempty"` @@ -7215,10 +7187,11 @@ type WorkloadoptimizationV1VPAConfig struct { // ManagementOption Defines possible options for workload management. // READ_ONLY - workload watched (metrics collected), but no actions may be performed by CAST AI. // MANAGED - workload watched (metrics collected), CAST AI may perform actions on the workload. - ManagementOption WorkloadoptimizationV1ManagementOption `json:"managementOption"` - Memory WorkloadoptimizationV1ResourceConfig `json:"memory"` - MemoryEvent *WorkloadoptimizationV1MemoryEventSettings `json:"memoryEvent,omitempty"` - Startup *WorkloadoptimizationV1StartupSettings `json:"startup,omitempty"` + ManagementOption WorkloadoptimizationV1ManagementOption `json:"managementOption"` + Memory WorkloadoptimizationV1ResourceConfig `json:"memory"` + MemoryEvent *WorkloadoptimizationV1MemoryEventSettings `json:"memoryEvent,omitempty"` + PredictiveScaling *WorkloadoptimizationV1PredictiveScalingSettings `json:"predictiveScaling,omitempty"` + Startup *WorkloadoptimizationV1StartupSettings `json:"startup,omitempty"` } // WorkloadoptimizationV1VPAConfigUpdate defines model for workloadoptimization.v1.VPAConfigUpdate. @@ -7259,10 +7232,11 @@ type WorkloadoptimizationV1VerticalOverrides struct { // ManagementOption Defines possible options for workload management. // READ_ONLY - workload watched (metrics collected), but no actions may be performed by CAST AI. // MANAGED - workload watched (metrics collected), CAST AI may perform actions on the workload. - ManagementOption *WorkloadoptimizationV1ManagementOption `json:"managementOption,omitempty"` - Memory *WorkloadoptimizationV1ResourceConfigOverrides `json:"memory,omitempty"` - MemoryEvent *WorkloadoptimizationV1MemoryEventSettings `json:"memoryEvent,omitempty"` - Startup *WorkloadoptimizationV1StartupSettings `json:"startup,omitempty"` + ManagementOption *WorkloadoptimizationV1ManagementOption `json:"managementOption,omitempty"` + Memory *WorkloadoptimizationV1ResourceConfigOverrides `json:"memory,omitempty"` + MemoryEvent *WorkloadoptimizationV1MemoryEventSettings `json:"memoryEvent,omitempty"` + PredictiveScaling *WorkloadoptimizationV1PredictiveScalingSettings `json:"predictiveScaling,omitempty"` + Startup *WorkloadoptimizationV1StartupSettings `json:"startup,omitempty"` } // WorkloadoptimizationV1Workload defines model for workloadoptimization.v1.Workload. @@ -7490,8 +7464,17 @@ type CommitmentsAPIImportAWSReservedInstancesParamsBehaviour string type AuthTokenAPIListAuthTokensParams struct { // UserId User id to filter by, if this is set we will only return tokens that have this user id. UserId *string `form:"userId,omitempty" json:"userId,omitempty"` + + // Organizations Organizations controls whether to return tokens for all organizations the user belongs to or only the current one. + // + // - ORGANIZATIONS_UNSPECIFIED: ORGANIZATIONS_UNSPECIFIED is the default value and means only current organization. + // - ALL: ALL means all organizations the user belongs to. + Organizations *AuthTokenAPIListAuthTokensParamsOrganizations `form:"organizations,omitempty" json:"organizations,omitempty"` } +// AuthTokenAPIListAuthTokensParamsOrganizations defines parameters for AuthTokenAPIListAuthTokens. +type AuthTokenAPIListAuthTokensParamsOrganizations string + // AllocationGroupAPIGetAllocationGroupCostTimedSummariesParams defines parameters for AllocationGroupAPIGetAllocationGroupCostTimedSummaries. type AllocationGroupAPIGetAllocationGroupCostTimedSummariesParams struct { // StartTime Filter items to include from specified time. @@ -7581,18 +7564,6 @@ type AllocationGroupAPIGetAllocationGroupEfficiencySummaryParams struct { UseListingPrices *bool `form:"useListingPrices,omitempty" json:"useListingPrices,omitempty"` } -// AllocationGroupAPIGetCostAllocationGroupSummaryParams defines parameters for AllocationGroupAPIGetCostAllocationGroupSummary. -type AllocationGroupAPIGetCostAllocationGroupSummaryParams struct { - // StartTime Filter items to include from specified time. - StartTime time.Time `form:"startTime" json:"startTime"` - - // EndTime Filter items to include up to specified time. - EndTime time.Time `form:"endTime" json:"endTime"` - - // ClusterIds Cluster IDs for filtering. Leave empty for the full list. - ClusterIds *[]string `form:"clusterIds,omitempty" json:"clusterIds,omitempty"` -} - // AllocationGroupAPIGetCostAllocationGroupDataTransferWorkloadsParams defines parameters for AllocationGroupAPIGetCostAllocationGroupDataTransferWorkloads. type AllocationGroupAPIGetCostAllocationGroupDataTransferWorkloadsParams struct { // StartTime Filter items to include from specified time. @@ -7670,18 +7641,6 @@ type AllocationGroupAPIGetAllocationGroupWorkloadsEfficiencyParams struct { // AllocationGroupAPIGetAllocationGroupWorkloadsEfficiencyParamsSortOrder defines parameters for AllocationGroupAPIGetAllocationGroupWorkloadsEfficiency. type AllocationGroupAPIGetAllocationGroupWorkloadsEfficiencyParamsSortOrder string -// AllocationGroupAPIGetCostAllocationGroupWorkloadsParams defines parameters for AllocationGroupAPIGetCostAllocationGroupWorkloads. -type AllocationGroupAPIGetCostAllocationGroupWorkloadsParams struct { - // StartTime Filter items to include from specified time. - StartTime time.Time `form:"startTime" json:"startTime"` - - // EndTime Filter items to include up to specified time. - EndTime time.Time `form:"endTime" json:"endTime"` - - // ClusterIds Cluster IDs for filtering. Leave empty for the full list. - ClusterIds *[]string `form:"clusterIds,omitempty" json:"clusterIds,omitempty"` -} - // InventoryAPIListInstanceTypeNamesParams defines parameters for InventoryAPIListInstanceTypeNames. type InventoryAPIListInstanceTypeNamesParams struct { CloudServiceProviders *[]string `form:"cloudServiceProviders,omitempty" json:"cloudServiceProviders,omitempty"` @@ -7715,6 +7674,46 @@ type ScheduledRebalancingAPIListRebalancingJobsParams struct { RebalancingScheduleId *string `form:"rebalancingScheduleId,omitempty" json:"rebalancingScheduleId,omitempty"` } +// ExternalClusterAPIGetConnectAndEnableCASTAICmdParams defines parameters for ExternalClusterAPIGetConnectAndEnableCASTAICmd. +type ExternalClusterAPIGetConnectAndEnableCASTAICmdParams struct { + // ClusterName Customer cluster name. + ClusterName *string `form:"clusterName,omitempty" json:"clusterName,omitempty"` + + // Provider Provider: eks, gke, aks, etc. + Provider *string `form:"provider,omitempty" json:"provider,omitempty"` + + // NvidiaDevicePlugin Whether NVIDIA device plugin DaemonSet should be installed during Phase 2 on-boarding. + NvidiaDevicePlugin *bool `form:"nvidiaDevicePlugin,omitempty" json:"nvidiaDevicePlugin,omitempty"` + + // InstallSecurityAgent Whether CAST AI Security Insights agent should be installed. + InstallSecurityAgent *bool `form:"installSecurityAgent,omitempty" json:"installSecurityAgent,omitempty"` + + // InstallAutoscalerAgent Whether CAST AI Autoscaler components should be installed. + // To enable backwards compatibility, when the field is omitted, it is defaulted to true. + InstallAutoscalerAgent *bool `form:"installAutoscalerAgent,omitempty" json:"installAutoscalerAgent,omitempty"` + + // InstallGpuMetricsExporter Whether CAST AI GPU metrics exporter should be installed. + InstallGpuMetricsExporter *bool `form:"installGpuMetricsExporter,omitempty" json:"installGpuMetricsExporter,omitempty"` + + // InstallAiOptimizerProxy Whether CAST AI AI-Optimizer Proxy should be installed. + InstallAiOptimizerProxy *bool `form:"installAiOptimizerProxy,omitempty" json:"installAiOptimizerProxy,omitempty"` + + // GcpSaImpersonate Whether GCP SA Impersonate feature should be enabled. + GcpSaImpersonate *bool `form:"gcpSaImpersonate,omitempty" json:"gcpSaImpersonate,omitempty"` + + // InstallNetflowExporter Whether Netflow network exporter should be installed. + InstallNetflowExporter *bool `form:"installNetflowExporter,omitempty" json:"installNetflowExporter,omitempty"` + + // InstallWorkloadAutoscaler Whether CAST AI Workload Autoscaler should be installed. + InstallWorkloadAutoscaler *bool `form:"installWorkloadAutoscaler,omitempty" json:"installWorkloadAutoscaler,omitempty"` + + // InstallPodMutator Whether CAST AI Pod Mutator should be installed. + InstallPodMutator *bool `form:"installPodMutator,omitempty" json:"installPodMutator,omitempty"` + + // InstallOmni Whether cluster should be onboarded with CAST AI Omni. + InstallOmni *bool `form:"installOmni,omitempty" json:"installOmni,omitempty"` +} + // ExternalClusterAPIGetCredentialsScriptParams defines parameters for ExternalClusterAPIGetCredentialsScript. type ExternalClusterAPIGetCredentialsScriptParams struct { // CrossRole Whether an AWS CrossRole should be used for authentication. @@ -8328,6 +8327,7 @@ type WorkloadOptimizationAPIGetWorkloadsSummaryMetricsParams struct { // WorkloadOptimizationAPIGetWorkloadParams defines parameters for WorkloadOptimizationAPIGetWorkload. type WorkloadOptimizationAPIGetWorkloadParams struct { IncludeMetrics *bool `form:"includeMetrics,omitempty" json:"includeMetrics,omitempty"` + IncludeCosts *bool `form:"includeCosts,omitempty" json:"includeCosts,omitempty"` FromTime *time.Time `form:"fromTime,omitempty" json:"fromTime,omitempty"` ToTime *time.Time `form:"toTime,omitempty" json:"toTime,omitempty"` } @@ -8569,3 +8569,71 @@ type WorkloadOptimizationAPIPatchWorkloadV2JSONRequestBody = WorkloadOptimizatio // WorkloadOptimizationAPIUpdateWorkloadV2JSONRequestBody defines body for WorkloadOptimizationAPIUpdateWorkloadV2 for application/json ContentType. type WorkloadOptimizationAPIUpdateWorkloadV2JSONRequestBody = WorkloadoptimizationV1UpdateWorkloadV2 + +// Getter for additional properties for GoogleProtobufAny. Returns the specified +// element and whether it was found +func (a GoogleProtobufAny) Get(fieldName string) (value map[string]interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for GoogleProtobufAny +func (a *GoogleProtobufAny) Set(fieldName string, value map[string]interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for GoogleProtobufAny to handle AdditionalProperties +func (a *GoogleProtobufAny) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["@type"]; found { + err = json.Unmarshal(raw, &a.Type) + if err != nil { + return fmt.Errorf("error reading '@type': %w", err) + } + delete(object, "@type") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal map[string]interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for GoogleProtobufAny to handle AdditionalProperties +func (a GoogleProtobufAny) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.Type != nil { + object["@type"], err = json.Marshal(a.Type) + if err != nil { + return nil, fmt.Errorf("error marshaling '@type': %w", err) + } + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} diff --git a/castai/sdk/client.gen.go b/castai/sdk/client.gen.go index fd81e706d..ba2fa7a1c 100644 --- a/castai/sdk/client.gen.go +++ b/castai/sdk/client.gen.go @@ -156,9 +156,6 @@ type ClientInterface interface { // AllocationGroupAPIGetAllocationGroupEfficiencySummary request AllocationGroupAPIGetAllocationGroupEfficiencySummary(ctx context.Context, params *AllocationGroupAPIGetAllocationGroupEfficiencySummaryParams, reqEditors ...RequestEditorFn) (*http.Response, error) - // AllocationGroupAPIGetCostAllocationGroupSummary request - AllocationGroupAPIGetCostAllocationGroupSummary(ctx context.Context, params *AllocationGroupAPIGetCostAllocationGroupSummaryParams, reqEditors ...RequestEditorFn) (*http.Response, error) - // AllocationGroupAPIGetCostAllocationGroupDataTransferWorkloads request AllocationGroupAPIGetCostAllocationGroupDataTransferWorkloads(ctx context.Context, groupId string, params *AllocationGroupAPIGetCostAllocationGroupDataTransferWorkloadsParams, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -168,9 +165,6 @@ type ClientInterface interface { // AllocationGroupAPIGetAllocationGroupWorkloadsEfficiency request AllocationGroupAPIGetAllocationGroupWorkloadsEfficiency(ctx context.Context, groupId string, params *AllocationGroupAPIGetAllocationGroupWorkloadsEfficiencyParams, reqEditors ...RequestEditorFn) (*http.Response, error) - // AllocationGroupAPIGetCostAllocationGroupWorkloads request - AllocationGroupAPIGetCostAllocationGroupWorkloads(ctx context.Context, groupId string, params *AllocationGroupAPIGetCostAllocationGroupWorkloadsParams, reqEditors ...RequestEditorFn) (*http.Response, error) - // AllocationGroupAPIDeleteAllocationGroup request AllocationGroupAPIDeleteAllocationGroup(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -304,6 +298,9 @@ type ClientInterface interface { // ExternalClusterAPIGetListNodesFilters request ExternalClusterAPIGetListNodesFilters(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + // ExternalClusterAPIGetConnectAndEnableCASTAICmd request + ExternalClusterAPIGetConnectAndEnableCASTAICmd(ctx context.Context, params *ExternalClusterAPIGetConnectAndEnableCASTAICmdParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // OperationsAPIGetOperation request OperationsAPIGetOperation(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -623,6 +620,9 @@ type ClientInterface interface { // CommitmentsAPIGetGCPCommitmentsScriptTemplate request CommitmentsAPIGetGCPCommitmentsScriptTemplate(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + // ExternalClusterAPIGetConnectAndEnableCASTAIScript request + ExternalClusterAPIGetConnectAndEnableCASTAIScript(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + // ExternalClusterAPIGetCleanupScriptTemplate request ExternalClusterAPIGetCleanupScriptTemplate(ctx context.Context, provider string, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -1142,18 +1142,6 @@ func (c *Client) AllocationGroupAPIGetAllocationGroupEfficiencySummary(ctx conte return c.Client.Do(req) } -func (c *Client) AllocationGroupAPIGetCostAllocationGroupSummary(ctx context.Context, params *AllocationGroupAPIGetCostAllocationGroupSummaryParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewAllocationGroupAPIGetCostAllocationGroupSummaryRequest(c.Server, params) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - func (c *Client) AllocationGroupAPIGetCostAllocationGroupDataTransferWorkloads(ctx context.Context, groupId string, params *AllocationGroupAPIGetCostAllocationGroupDataTransferWorkloadsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewAllocationGroupAPIGetCostAllocationGroupDataTransferWorkloadsRequest(c.Server, groupId, params) if err != nil { @@ -1190,18 +1178,6 @@ func (c *Client) AllocationGroupAPIGetAllocationGroupWorkloadsEfficiency(ctx con return c.Client.Do(req) } -func (c *Client) AllocationGroupAPIGetCostAllocationGroupWorkloads(ctx context.Context, groupId string, params *AllocationGroupAPIGetCostAllocationGroupWorkloadsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewAllocationGroupAPIGetCostAllocationGroupWorkloadsRequest(c.Server, groupId, params) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - func (c *Client) AllocationGroupAPIDeleteAllocationGroup(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewAllocationGroupAPIDeleteAllocationGroupRequest(c.Server, id) if err != nil { @@ -1790,6 +1766,18 @@ func (c *Client) ExternalClusterAPIGetListNodesFilters(ctx context.Context, reqE return c.Client.Do(req) } +func (c *Client) ExternalClusterAPIGetConnectAndEnableCASTAICmd(ctx context.Context, params *ExternalClusterAPIGetConnectAndEnableCASTAICmdParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewExternalClusterAPIGetConnectAndEnableCASTAICmdRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) OperationsAPIGetOperation(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewOperationsAPIGetOperationRequest(c.Server, id) if err != nil { @@ -3182,6 +3170,18 @@ func (c *Client) CommitmentsAPIGetGCPCommitmentsScriptTemplate(ctx context.Conte return c.Client.Do(req) } +func (c *Client) ExternalClusterAPIGetConnectAndEnableCASTAIScript(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewExternalClusterAPIGetConnectAndEnableCASTAIScriptRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) ExternalClusterAPIGetCleanupScriptTemplate(ctx context.Context, provider string, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewExternalClusterAPIGetCleanupScriptTemplateRequest(c.Server, provider) if err != nil { @@ -4564,6 +4564,22 @@ func NewAuthTokenAPIListAuthTokensRequest(server string, params *AuthTokenAPILis } + if params.Organizations != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "organizations", runtime.ParamLocationQuery, *params.Organizations); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + queryURL.RawQuery = queryValues.Encode() } @@ -5312,79 +5328,6 @@ func NewAllocationGroupAPIGetAllocationGroupEfficiencySummaryRequest(server stri return req, nil } -// NewAllocationGroupAPIGetCostAllocationGroupSummaryRequest generates requests for AllocationGroupAPIGetCostAllocationGroupSummary -func NewAllocationGroupAPIGetCostAllocationGroupSummaryRequest(server string, params *AllocationGroupAPIGetCostAllocationGroupSummaryParams) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/v1/cost-reports/allocation-groups/summary") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "startTime", runtime.ParamLocationQuery, params.StartTime); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "endTime", runtime.ParamLocationQuery, params.EndTime); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - if params.ClusterIds != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "clusterIds", runtime.ParamLocationQuery, *params.ClusterIds); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - // NewAllocationGroupAPIGetCostAllocationGroupDataTransferWorkloadsRequest generates requests for AllocationGroupAPIGetCostAllocationGroupDataTransferWorkloads func NewAllocationGroupAPIGetCostAllocationGroupDataTransferWorkloadsRequest(server string, groupId string, params *AllocationGroupAPIGetCostAllocationGroupDataTransferWorkloadsParams) (*http.Request, error) { var err error @@ -5769,86 +5712,6 @@ func NewAllocationGroupAPIGetAllocationGroupWorkloadsEfficiencyRequest(server st return req, nil } -// NewAllocationGroupAPIGetCostAllocationGroupWorkloadsRequest generates requests for AllocationGroupAPIGetCostAllocationGroupWorkloads -func NewAllocationGroupAPIGetCostAllocationGroupWorkloadsRequest(server string, groupId string, params *AllocationGroupAPIGetCostAllocationGroupWorkloadsParams) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "groupId", runtime.ParamLocationPath, groupId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/v1/cost-reports/allocation-groups/%s/workloads", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "startTime", runtime.ParamLocationQuery, params.StartTime); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "endTime", runtime.ParamLocationQuery, params.EndTime); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - if params.ClusterIds != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "clusterIds", runtime.ParamLocationQuery, *params.ClusterIds); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - // NewAllocationGroupAPIDeleteAllocationGroupRequest generates requests for AllocationGroupAPIDeleteAllocationGroup func NewAllocationGroupAPIDeleteAllocationGroupRequest(server string, id string) (*http.Request, error) { var err error @@ -7381,9 +7244,234 @@ func NewExternalClusterAPIGetListNodesFiltersRequest(server string) (*http.Reque operationPath = "." + operationPath } - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewExternalClusterAPIGetConnectAndEnableCASTAICmdRequest generates requests for ExternalClusterAPIGetConnectAndEnableCASTAICmd +func NewExternalClusterAPIGetConnectAndEnableCASTAICmdRequest(server string, params *ExternalClusterAPIGetConnectAndEnableCASTAICmdParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/kubernetes/external-clusters/onboarding/connect-and-enable-castai-cmd") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.ClusterName != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "clusterName", runtime.ParamLocationQuery, *params.ClusterName); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Provider != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "provider", runtime.ParamLocationQuery, *params.Provider); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.NvidiaDevicePlugin != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "nvidiaDevicePlugin", runtime.ParamLocationQuery, *params.NvidiaDevicePlugin); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.InstallSecurityAgent != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "installSecurityAgent", runtime.ParamLocationQuery, *params.InstallSecurityAgent); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.InstallAutoscalerAgent != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "installAutoscalerAgent", runtime.ParamLocationQuery, *params.InstallAutoscalerAgent); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.InstallGpuMetricsExporter != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "installGpuMetricsExporter", runtime.ParamLocationQuery, *params.InstallGpuMetricsExporter); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.InstallAiOptimizerProxy != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "installAiOptimizerProxy", runtime.ParamLocationQuery, *params.InstallAiOptimizerProxy); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.GcpSaImpersonate != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "gcpSaImpersonate", runtime.ParamLocationQuery, *params.GcpSaImpersonate); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.InstallNetflowExporter != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "installNetflowExporter", runtime.ParamLocationQuery, *params.InstallNetflowExporter); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.InstallWorkloadAutoscaler != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "installWorkloadAutoscaler", runtime.ParamLocationQuery, *params.InstallWorkloadAutoscaler); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.InstallPodMutator != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "installPodMutator", runtime.ParamLocationQuery, *params.InstallPodMutator); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.InstallOmni != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "installOmni", runtime.ParamLocationQuery, *params.InstallOmni); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() } req, err := http.NewRequest("GET", queryURL.String(), nil) @@ -11863,6 +11951,33 @@ func NewCommitmentsAPIGetGCPCommitmentsScriptTemplateRequest(server string) (*ht return req, nil } +// NewExternalClusterAPIGetConnectAndEnableCASTAIScriptRequest generates requests for ExternalClusterAPIGetConnectAndEnableCASTAIScript +func NewExternalClusterAPIGetConnectAndEnableCASTAIScriptRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/scripts/connect-and-enable-castai.sh") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + // NewExternalClusterAPIGetCleanupScriptTemplateRequest generates requests for ExternalClusterAPIGetCleanupScriptTemplate func NewExternalClusterAPIGetCleanupScriptTemplateRequest(server string, provider string) (*http.Request, error) { var err error @@ -15608,6 +15723,22 @@ func NewWorkloadOptimizationAPIGetWorkloadRequest(server string, clusterId strin } + if params.IncludeCosts != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "includeCosts", runtime.ParamLocationQuery, *params.IncludeCosts); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + if params.FromTime != nil { if queryFrag, err := runtime.StyleParamWithLocation("form", true, "fromTime", runtime.ParamLocationQuery, *params.FromTime); err != nil { @@ -16151,9 +16282,6 @@ type ClientWithResponsesInterface interface { // AllocationGroupAPIGetAllocationGroupEfficiencySummary request AllocationGroupAPIGetAllocationGroupEfficiencySummaryWithResponse(ctx context.Context, params *AllocationGroupAPIGetAllocationGroupEfficiencySummaryParams) (*AllocationGroupAPIGetAllocationGroupEfficiencySummaryResponse, error) - // AllocationGroupAPIGetCostAllocationGroupSummary request - AllocationGroupAPIGetCostAllocationGroupSummaryWithResponse(ctx context.Context, params *AllocationGroupAPIGetCostAllocationGroupSummaryParams) (*AllocationGroupAPIGetCostAllocationGroupSummaryResponse, error) - // AllocationGroupAPIGetCostAllocationGroupDataTransferWorkloads request AllocationGroupAPIGetCostAllocationGroupDataTransferWorkloadsWithResponse(ctx context.Context, groupId string, params *AllocationGroupAPIGetCostAllocationGroupDataTransferWorkloadsParams) (*AllocationGroupAPIGetCostAllocationGroupDataTransferWorkloadsResponse, error) @@ -16163,9 +16291,6 @@ type ClientWithResponsesInterface interface { // AllocationGroupAPIGetAllocationGroupWorkloadsEfficiency request AllocationGroupAPIGetAllocationGroupWorkloadsEfficiencyWithResponse(ctx context.Context, groupId string, params *AllocationGroupAPIGetAllocationGroupWorkloadsEfficiencyParams) (*AllocationGroupAPIGetAllocationGroupWorkloadsEfficiencyResponse, error) - // AllocationGroupAPIGetCostAllocationGroupWorkloads request - AllocationGroupAPIGetCostAllocationGroupWorkloadsWithResponse(ctx context.Context, groupId string, params *AllocationGroupAPIGetCostAllocationGroupWorkloadsParams) (*AllocationGroupAPIGetCostAllocationGroupWorkloadsResponse, error) - // AllocationGroupAPIDeleteAllocationGroup request AllocationGroupAPIDeleteAllocationGroupWithResponse(ctx context.Context, id string) (*AllocationGroupAPIDeleteAllocationGroupResponse, error) @@ -16299,6 +16424,9 @@ type ClientWithResponsesInterface interface { // ExternalClusterAPIGetListNodesFilters request ExternalClusterAPIGetListNodesFiltersWithResponse(ctx context.Context) (*ExternalClusterAPIGetListNodesFiltersResponse, error) + // ExternalClusterAPIGetConnectAndEnableCASTAICmd request + ExternalClusterAPIGetConnectAndEnableCASTAICmdWithResponse(ctx context.Context, params *ExternalClusterAPIGetConnectAndEnableCASTAICmdParams) (*ExternalClusterAPIGetConnectAndEnableCASTAICmdResponse, error) + // OperationsAPIGetOperation request OperationsAPIGetOperationWithResponse(ctx context.Context, id string) (*OperationsAPIGetOperationResponse, error) @@ -16618,6 +16746,9 @@ type ClientWithResponsesInterface interface { // CommitmentsAPIGetGCPCommitmentsScriptTemplate request CommitmentsAPIGetGCPCommitmentsScriptTemplateWithResponse(ctx context.Context) (*CommitmentsAPIGetGCPCommitmentsScriptTemplateResponse, error) + // ExternalClusterAPIGetConnectAndEnableCASTAIScript request + ExternalClusterAPIGetConnectAndEnableCASTAIScriptWithResponse(ctx context.Context) (*ExternalClusterAPIGetConnectAndEnableCASTAIScriptResponse, error) + // ExternalClusterAPIGetCleanupScriptTemplate request ExternalClusterAPIGetCleanupScriptTemplateWithResponse(ctx context.Context, provider string) (*ExternalClusterAPIGetCleanupScriptTemplateResponse, error) @@ -17397,36 +17528,6 @@ func (r AllocationGroupAPIGetAllocationGroupEfficiencySummaryResponse) GetBody() // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type AllocationGroupAPIGetCostAllocationGroupSummaryResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *CostreportV1beta1GetCostAllocationGroupSummaryResponse -} - -// Status returns HTTPResponse.Status -func (r AllocationGroupAPIGetCostAllocationGroupSummaryResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r AllocationGroupAPIGetCostAllocationGroupSummaryResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -// Body returns body of byte array -func (r AllocationGroupAPIGetCostAllocationGroupSummaryResponse) GetBody() []byte { - return r.Body -} - -// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 - type AllocationGroupAPIGetCostAllocationGroupDataTransferWorkloadsResponse struct { Body []byte HTTPResponse *http.Response @@ -17517,36 +17618,6 @@ func (r AllocationGroupAPIGetAllocationGroupWorkloadsEfficiencyResponse) GetBody // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -type AllocationGroupAPIGetCostAllocationGroupWorkloadsResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *CostreportV1beta1GetCostAllocationGroupWorkloadsResponse -} - -// Status returns HTTPResponse.Status -func (r AllocationGroupAPIGetCostAllocationGroupWorkloadsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r AllocationGroupAPIGetCostAllocationGroupWorkloadsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 -// Body returns body of byte array -func (r AllocationGroupAPIGetCostAllocationGroupWorkloadsResponse) GetBody() []byte { - return r.Body -} - -// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 - type AllocationGroupAPIDeleteAllocationGroupResponse struct { Body []byte HTTPResponse *http.Response @@ -18597,6 +18668,36 @@ func (r ExternalClusterAPIGetListNodesFiltersResponse) GetBody() []byte { // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 +type ExternalClusterAPIGetConnectAndEnableCASTAICmdResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ExternalclusterV1GetConnectAndEnableCASTAICmdResponse +} + +// Status returns HTTPResponse.Status +func (r ExternalClusterAPIGetConnectAndEnableCASTAICmdResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ExternalClusterAPIGetConnectAndEnableCASTAICmdResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 +// Body returns body of byte array +func (r ExternalClusterAPIGetConnectAndEnableCASTAICmdResponse) GetBody() []byte { + return r.Body +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 + type OperationsAPIGetOperationResponse struct { Body []byte HTTPResponse *http.Response @@ -21208,6 +21309,36 @@ func (r CommitmentsAPIGetGCPCommitmentsScriptTemplateResponse) GetBody() []byte // TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 +type ExternalClusterAPIGetConnectAndEnableCASTAIScriptResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *GoogleApiHttpBody +} + +// Status returns HTTPResponse.Status +func (r ExternalClusterAPIGetConnectAndEnableCASTAIScriptResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ExternalClusterAPIGetConnectAndEnableCASTAIScriptResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 +// Body returns body of byte array +func (r ExternalClusterAPIGetConnectAndEnableCASTAIScriptResponse) GetBody() []byte { + return r.Body +} + +// TODO: to have common interface. https://github.com/deepmap/oapi-codegen/issues/240 + type ExternalClusterAPIGetCleanupScriptTemplateResponse struct { Body []byte HTTPResponse *http.Response @@ -23275,15 +23406,6 @@ func (c *ClientWithResponses) AllocationGroupAPIGetAllocationGroupEfficiencySumm return ParseAllocationGroupAPIGetAllocationGroupEfficiencySummaryResponse(rsp) } -// AllocationGroupAPIGetCostAllocationGroupSummaryWithResponse request returning *AllocationGroupAPIGetCostAllocationGroupSummaryResponse -func (c *ClientWithResponses) AllocationGroupAPIGetCostAllocationGroupSummaryWithResponse(ctx context.Context, params *AllocationGroupAPIGetCostAllocationGroupSummaryParams) (*AllocationGroupAPIGetCostAllocationGroupSummaryResponse, error) { - rsp, err := c.AllocationGroupAPIGetCostAllocationGroupSummary(ctx, params) - if err != nil { - return nil, err - } - return ParseAllocationGroupAPIGetCostAllocationGroupSummaryResponse(rsp) -} - // AllocationGroupAPIGetCostAllocationGroupDataTransferWorkloadsWithResponse request returning *AllocationGroupAPIGetCostAllocationGroupDataTransferWorkloadsResponse func (c *ClientWithResponses) AllocationGroupAPIGetCostAllocationGroupDataTransferWorkloadsWithResponse(ctx context.Context, groupId string, params *AllocationGroupAPIGetCostAllocationGroupDataTransferWorkloadsParams) (*AllocationGroupAPIGetCostAllocationGroupDataTransferWorkloadsResponse, error) { rsp, err := c.AllocationGroupAPIGetCostAllocationGroupDataTransferWorkloads(ctx, groupId, params) @@ -23311,15 +23433,6 @@ func (c *ClientWithResponses) AllocationGroupAPIGetAllocationGroupWorkloadsEffic return ParseAllocationGroupAPIGetAllocationGroupWorkloadsEfficiencyResponse(rsp) } -// AllocationGroupAPIGetCostAllocationGroupWorkloadsWithResponse request returning *AllocationGroupAPIGetCostAllocationGroupWorkloadsResponse -func (c *ClientWithResponses) AllocationGroupAPIGetCostAllocationGroupWorkloadsWithResponse(ctx context.Context, groupId string, params *AllocationGroupAPIGetCostAllocationGroupWorkloadsParams) (*AllocationGroupAPIGetCostAllocationGroupWorkloadsResponse, error) { - rsp, err := c.AllocationGroupAPIGetCostAllocationGroupWorkloads(ctx, groupId, params) - if err != nil { - return nil, err - } - return ParseAllocationGroupAPIGetCostAllocationGroupWorkloadsResponse(rsp) -} - // AllocationGroupAPIDeleteAllocationGroupWithResponse request returning *AllocationGroupAPIDeleteAllocationGroupResponse func (c *ClientWithResponses) AllocationGroupAPIDeleteAllocationGroupWithResponse(ctx context.Context, id string) (*AllocationGroupAPIDeleteAllocationGroupResponse, error) { rsp, err := c.AllocationGroupAPIDeleteAllocationGroup(ctx, id) @@ -23747,6 +23860,15 @@ func (c *ClientWithResponses) ExternalClusterAPIGetListNodesFiltersWithResponse( return ParseExternalClusterAPIGetListNodesFiltersResponse(rsp) } +// ExternalClusterAPIGetConnectAndEnableCASTAICmdWithResponse request returning *ExternalClusterAPIGetConnectAndEnableCASTAICmdResponse +func (c *ClientWithResponses) ExternalClusterAPIGetConnectAndEnableCASTAICmdWithResponse(ctx context.Context, params *ExternalClusterAPIGetConnectAndEnableCASTAICmdParams) (*ExternalClusterAPIGetConnectAndEnableCASTAICmdResponse, error) { + rsp, err := c.ExternalClusterAPIGetConnectAndEnableCASTAICmd(ctx, params) + if err != nil { + return nil, err + } + return ParseExternalClusterAPIGetConnectAndEnableCASTAICmdResponse(rsp) +} + // OperationsAPIGetOperationWithResponse request returning *OperationsAPIGetOperationResponse func (c *ClientWithResponses) OperationsAPIGetOperationWithResponse(ctx context.Context, id string) (*OperationsAPIGetOperationResponse, error) { rsp, err := c.OperationsAPIGetOperation(ctx, id) @@ -24762,6 +24884,15 @@ func (c *ClientWithResponses) CommitmentsAPIGetGCPCommitmentsScriptTemplateWithR return ParseCommitmentsAPIGetGCPCommitmentsScriptTemplateResponse(rsp) } +// ExternalClusterAPIGetConnectAndEnableCASTAIScriptWithResponse request returning *ExternalClusterAPIGetConnectAndEnableCASTAIScriptResponse +func (c *ClientWithResponses) ExternalClusterAPIGetConnectAndEnableCASTAIScriptWithResponse(ctx context.Context) (*ExternalClusterAPIGetConnectAndEnableCASTAIScriptResponse, error) { + rsp, err := c.ExternalClusterAPIGetConnectAndEnableCASTAIScript(ctx) + if err != nil { + return nil, err + } + return ParseExternalClusterAPIGetConnectAndEnableCASTAIScriptResponse(rsp) +} + // ExternalClusterAPIGetCleanupScriptTemplateWithResponse request returning *ExternalClusterAPIGetCleanupScriptTemplateResponse func (c *ClientWithResponses) ExternalClusterAPIGetCleanupScriptTemplateWithResponse(ctx context.Context, provider string) (*ExternalClusterAPIGetCleanupScriptTemplateResponse, error) { rsp, err := c.ExternalClusterAPIGetCleanupScriptTemplate(ctx, provider) @@ -25954,32 +26085,6 @@ func ParseAllocationGroupAPIGetAllocationGroupEfficiencySummaryResponse(rsp *htt return response, nil } -// ParseAllocationGroupAPIGetCostAllocationGroupSummaryResponse parses an HTTP response from a AllocationGroupAPIGetCostAllocationGroupSummaryWithResponse call -func ParseAllocationGroupAPIGetCostAllocationGroupSummaryResponse(rsp *http.Response) (*AllocationGroupAPIGetCostAllocationGroupSummaryResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) - defer rsp.Body.Close() - if err != nil { - return nil, err - } - - response := &AllocationGroupAPIGetCostAllocationGroupSummaryResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest CostreportV1beta1GetCostAllocationGroupSummaryResponse - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - } - - return response, nil -} - // ParseAllocationGroupAPIGetCostAllocationGroupDataTransferWorkloadsResponse parses an HTTP response from a AllocationGroupAPIGetCostAllocationGroupDataTransferWorkloadsWithResponse call func ParseAllocationGroupAPIGetCostAllocationGroupDataTransferWorkloadsResponse(rsp *http.Response) (*AllocationGroupAPIGetCostAllocationGroupDataTransferWorkloadsResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) @@ -26058,32 +26163,6 @@ func ParseAllocationGroupAPIGetAllocationGroupWorkloadsEfficiencyResponse(rsp *h return response, nil } -// ParseAllocationGroupAPIGetCostAllocationGroupWorkloadsResponse parses an HTTP response from a AllocationGroupAPIGetCostAllocationGroupWorkloadsWithResponse call -func ParseAllocationGroupAPIGetCostAllocationGroupWorkloadsResponse(rsp *http.Response) (*AllocationGroupAPIGetCostAllocationGroupWorkloadsResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) - defer rsp.Body.Close() - if err != nil { - return nil, err - } - - response := &AllocationGroupAPIGetCostAllocationGroupWorkloadsResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest CostreportV1beta1GetCostAllocationGroupWorkloadsResponse - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - } - - return response, nil -} - // ParseAllocationGroupAPIDeleteAllocationGroupResponse parses an HTTP response from a AllocationGroupAPIDeleteAllocationGroupWithResponse call func ParseAllocationGroupAPIDeleteAllocationGroupResponse(rsp *http.Response) (*AllocationGroupAPIDeleteAllocationGroupResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) @@ -26994,6 +27073,32 @@ func ParseExternalClusterAPIGetListNodesFiltersResponse(rsp *http.Response) (*Ex return response, nil } +// ParseExternalClusterAPIGetConnectAndEnableCASTAICmdResponse parses an HTTP response from a ExternalClusterAPIGetConnectAndEnableCASTAICmdWithResponse call +func ParseExternalClusterAPIGetConnectAndEnableCASTAICmdResponse(rsp *http.Response) (*ExternalClusterAPIGetConnectAndEnableCASTAICmdResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &ExternalClusterAPIGetConnectAndEnableCASTAICmdResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest ExternalclusterV1GetConnectAndEnableCASTAICmdResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + // ParseOperationsAPIGetOperationResponse parses an HTTP response from a OperationsAPIGetOperationWithResponse call func ParseOperationsAPIGetOperationResponse(rsp *http.Response) (*OperationsAPIGetOperationResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) @@ -29257,6 +29362,32 @@ func ParseCommitmentsAPIGetGCPCommitmentsScriptTemplateResponse(rsp *http.Respon return response, nil } +// ParseExternalClusterAPIGetConnectAndEnableCASTAIScriptResponse parses an HTTP response from a ExternalClusterAPIGetConnectAndEnableCASTAIScriptWithResponse call +func ParseExternalClusterAPIGetConnectAndEnableCASTAIScriptResponse(rsp *http.Response) (*ExternalClusterAPIGetConnectAndEnableCASTAIScriptResponse, error) { + bodyBytes, err := ioutil.ReadAll(rsp.Body) + defer rsp.Body.Close() + if err != nil { + return nil, err + } + + response := &ExternalClusterAPIGetConnectAndEnableCASTAIScriptResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest GoogleApiHttpBody + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + // ParseExternalClusterAPIGetCleanupScriptTemplateResponse parses an HTTP response from a ExternalClusterAPIGetCleanupScriptTemplateWithResponse call func ParseExternalClusterAPIGetCleanupScriptTemplateResponse(rsp *http.Response) (*ExternalClusterAPIGetCleanupScriptTemplateResponse, error) { bodyBytes, err := ioutil.ReadAll(rsp.Body) diff --git a/castai/sdk/mock/client.go b/castai/sdk/mock/client.go index 8188cdb54..fe0754602 100644 --- a/castai/sdk/mock/client.go +++ b/castai/sdk/mock/client.go @@ -315,46 +315,6 @@ func (mr *MockClientInterfaceMockRecorder) AllocationGroupAPIGetCostAllocationGr return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AllocationGroupAPIGetCostAllocationGroupDataTransferWorkloads", reflect.TypeOf((*MockClientInterface)(nil).AllocationGroupAPIGetCostAllocationGroupDataTransferWorkloads), varargs...) } -// AllocationGroupAPIGetCostAllocationGroupSummary mocks base method. -func (m *MockClientInterface) AllocationGroupAPIGetCostAllocationGroupSummary(ctx context.Context, params *sdk.AllocationGroupAPIGetCostAllocationGroupSummaryParams, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { - m.ctrl.T.Helper() - varargs := []interface{}{ctx, params} - for _, a := range reqEditors { - varargs = append(varargs, a) - } - ret := m.ctrl.Call(m, "AllocationGroupAPIGetCostAllocationGroupSummary", varargs...) - ret0, _ := ret[0].(*http.Response) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// AllocationGroupAPIGetCostAllocationGroupSummary indicates an expected call of AllocationGroupAPIGetCostAllocationGroupSummary. -func (mr *MockClientInterfaceMockRecorder) AllocationGroupAPIGetCostAllocationGroupSummary(ctx, params interface{}, reqEditors ...interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{ctx, params}, reqEditors...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AllocationGroupAPIGetCostAllocationGroupSummary", reflect.TypeOf((*MockClientInterface)(nil).AllocationGroupAPIGetCostAllocationGroupSummary), varargs...) -} - -// AllocationGroupAPIGetCostAllocationGroupWorkloads mocks base method. -func (m *MockClientInterface) AllocationGroupAPIGetCostAllocationGroupWorkloads(ctx context.Context, groupId string, params *sdk.AllocationGroupAPIGetCostAllocationGroupWorkloadsParams, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { - m.ctrl.T.Helper() - varargs := []interface{}{ctx, groupId, params} - for _, a := range reqEditors { - varargs = append(varargs, a) - } - ret := m.ctrl.Call(m, "AllocationGroupAPIGetCostAllocationGroupWorkloads", varargs...) - ret0, _ := ret[0].(*http.Response) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// AllocationGroupAPIGetCostAllocationGroupWorkloads indicates an expected call of AllocationGroupAPIGetCostAllocationGroupWorkloads. -func (mr *MockClientInterfaceMockRecorder) AllocationGroupAPIGetCostAllocationGroupWorkloads(ctx, groupId, params interface{}, reqEditors ...interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{ctx, groupId, params}, reqEditors...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AllocationGroupAPIGetCostAllocationGroupWorkloads", reflect.TypeOf((*MockClientInterface)(nil).AllocationGroupAPIGetCostAllocationGroupWorkloads), varargs...) -} - // AllocationGroupAPIListAllocationGroups mocks base method. func (m *MockClientInterface) AllocationGroupAPIListAllocationGroups(ctx context.Context, params *sdk.AllocationGroupAPIListAllocationGroupsParams, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { m.ctrl.T.Helper() @@ -1595,6 +1555,46 @@ func (mr *MockClientInterfaceMockRecorder) ExternalClusterAPIGetCluster(ctx, clu return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExternalClusterAPIGetCluster", reflect.TypeOf((*MockClientInterface)(nil).ExternalClusterAPIGetCluster), varargs...) } +// ExternalClusterAPIGetConnectAndEnableCASTAICmd mocks base method. +func (m *MockClientInterface) ExternalClusterAPIGetConnectAndEnableCASTAICmd(ctx context.Context, params *sdk.ExternalClusterAPIGetConnectAndEnableCASTAICmdParams, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, params} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ExternalClusterAPIGetConnectAndEnableCASTAICmd", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ExternalClusterAPIGetConnectAndEnableCASTAICmd indicates an expected call of ExternalClusterAPIGetConnectAndEnableCASTAICmd. +func (mr *MockClientInterfaceMockRecorder) ExternalClusterAPIGetConnectAndEnableCASTAICmd(ctx, params interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, params}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExternalClusterAPIGetConnectAndEnableCASTAICmd", reflect.TypeOf((*MockClientInterface)(nil).ExternalClusterAPIGetConnectAndEnableCASTAICmd), varargs...) +} + +// ExternalClusterAPIGetConnectAndEnableCASTAIScript mocks base method. +func (m *MockClientInterface) ExternalClusterAPIGetConnectAndEnableCASTAIScript(ctx context.Context, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ExternalClusterAPIGetConnectAndEnableCASTAIScript", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ExternalClusterAPIGetConnectAndEnableCASTAIScript indicates an expected call of ExternalClusterAPIGetConnectAndEnableCASTAIScript. +func (mr *MockClientInterfaceMockRecorder) ExternalClusterAPIGetConnectAndEnableCASTAIScript(ctx interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExternalClusterAPIGetConnectAndEnableCASTAIScript", reflect.TypeOf((*MockClientInterface)(nil).ExternalClusterAPIGetConnectAndEnableCASTAIScript), varargs...) +} + // ExternalClusterAPIGetCredentialsScript mocks base method. func (m *MockClientInterface) ExternalClusterAPIGetCredentialsScript(ctx context.Context, clusterId string, params *sdk.ExternalClusterAPIGetCredentialsScriptParams, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { m.ctrl.T.Helper() @@ -6078,76 +6078,6 @@ func (mr *MockClientWithResponsesInterfaceMockRecorder) AllocationGroupAPIGetCos return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AllocationGroupAPIGetCostAllocationGroupDataTransferWorkloadsWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).AllocationGroupAPIGetCostAllocationGroupDataTransferWorkloadsWithResponse), ctx, groupId, params) } -// AllocationGroupAPIGetCostAllocationGroupSummary mocks base method. -func (m *MockClientWithResponsesInterface) AllocationGroupAPIGetCostAllocationGroupSummary(ctx context.Context, params *sdk.AllocationGroupAPIGetCostAllocationGroupSummaryParams, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { - m.ctrl.T.Helper() - varargs := []interface{}{ctx, params} - for _, a := range reqEditors { - varargs = append(varargs, a) - } - ret := m.ctrl.Call(m, "AllocationGroupAPIGetCostAllocationGroupSummary", varargs...) - ret0, _ := ret[0].(*http.Response) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// AllocationGroupAPIGetCostAllocationGroupSummary indicates an expected call of AllocationGroupAPIGetCostAllocationGroupSummary. -func (mr *MockClientWithResponsesInterfaceMockRecorder) AllocationGroupAPIGetCostAllocationGroupSummary(ctx, params interface{}, reqEditors ...interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{ctx, params}, reqEditors...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AllocationGroupAPIGetCostAllocationGroupSummary", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).AllocationGroupAPIGetCostAllocationGroupSummary), varargs...) -} - -// AllocationGroupAPIGetCostAllocationGroupSummaryWithResponse mocks base method. -func (m *MockClientWithResponsesInterface) AllocationGroupAPIGetCostAllocationGroupSummaryWithResponse(ctx context.Context, params *sdk.AllocationGroupAPIGetCostAllocationGroupSummaryParams) (*sdk.AllocationGroupAPIGetCostAllocationGroupSummaryResponse, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "AllocationGroupAPIGetCostAllocationGroupSummaryWithResponse", ctx, params) - ret0, _ := ret[0].(*sdk.AllocationGroupAPIGetCostAllocationGroupSummaryResponse) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// AllocationGroupAPIGetCostAllocationGroupSummaryWithResponse indicates an expected call of AllocationGroupAPIGetCostAllocationGroupSummaryWithResponse. -func (mr *MockClientWithResponsesInterfaceMockRecorder) AllocationGroupAPIGetCostAllocationGroupSummaryWithResponse(ctx, params interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AllocationGroupAPIGetCostAllocationGroupSummaryWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).AllocationGroupAPIGetCostAllocationGroupSummaryWithResponse), ctx, params) -} - -// AllocationGroupAPIGetCostAllocationGroupWorkloads mocks base method. -func (m *MockClientWithResponsesInterface) AllocationGroupAPIGetCostAllocationGroupWorkloads(ctx context.Context, groupId string, params *sdk.AllocationGroupAPIGetCostAllocationGroupWorkloadsParams, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { - m.ctrl.T.Helper() - varargs := []interface{}{ctx, groupId, params} - for _, a := range reqEditors { - varargs = append(varargs, a) - } - ret := m.ctrl.Call(m, "AllocationGroupAPIGetCostAllocationGroupWorkloads", varargs...) - ret0, _ := ret[0].(*http.Response) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// AllocationGroupAPIGetCostAllocationGroupWorkloads indicates an expected call of AllocationGroupAPIGetCostAllocationGroupWorkloads. -func (mr *MockClientWithResponsesInterfaceMockRecorder) AllocationGroupAPIGetCostAllocationGroupWorkloads(ctx, groupId, params interface{}, reqEditors ...interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{ctx, groupId, params}, reqEditors...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AllocationGroupAPIGetCostAllocationGroupWorkloads", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).AllocationGroupAPIGetCostAllocationGroupWorkloads), varargs...) -} - -// AllocationGroupAPIGetCostAllocationGroupWorkloadsWithResponse mocks base method. -func (m *MockClientWithResponsesInterface) AllocationGroupAPIGetCostAllocationGroupWorkloadsWithResponse(ctx context.Context, groupId string, params *sdk.AllocationGroupAPIGetCostAllocationGroupWorkloadsParams) (*sdk.AllocationGroupAPIGetCostAllocationGroupWorkloadsResponse, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "AllocationGroupAPIGetCostAllocationGroupWorkloadsWithResponse", ctx, groupId, params) - ret0, _ := ret[0].(*sdk.AllocationGroupAPIGetCostAllocationGroupWorkloadsResponse) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// AllocationGroupAPIGetCostAllocationGroupWorkloadsWithResponse indicates an expected call of AllocationGroupAPIGetCostAllocationGroupWorkloadsWithResponse. -func (mr *MockClientWithResponsesInterfaceMockRecorder) AllocationGroupAPIGetCostAllocationGroupWorkloadsWithResponse(ctx, groupId, params interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AllocationGroupAPIGetCostAllocationGroupWorkloadsWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).AllocationGroupAPIGetCostAllocationGroupWorkloadsWithResponse), ctx, groupId, params) -} - // AllocationGroupAPIListAllocationGroups mocks base method. func (m *MockClientWithResponsesInterface) AllocationGroupAPIListAllocationGroups(ctx context.Context, params *sdk.AllocationGroupAPIListAllocationGroupsParams, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { m.ctrl.T.Helper() @@ -8318,6 +8248,76 @@ func (mr *MockClientWithResponsesInterfaceMockRecorder) ExternalClusterAPIGetClu return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExternalClusterAPIGetClusterWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).ExternalClusterAPIGetClusterWithResponse), ctx, clusterId) } +// ExternalClusterAPIGetConnectAndEnableCASTAICmd mocks base method. +func (m *MockClientWithResponsesInterface) ExternalClusterAPIGetConnectAndEnableCASTAICmd(ctx context.Context, params *sdk.ExternalClusterAPIGetConnectAndEnableCASTAICmdParams, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, params} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ExternalClusterAPIGetConnectAndEnableCASTAICmd", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ExternalClusterAPIGetConnectAndEnableCASTAICmd indicates an expected call of ExternalClusterAPIGetConnectAndEnableCASTAICmd. +func (mr *MockClientWithResponsesInterfaceMockRecorder) ExternalClusterAPIGetConnectAndEnableCASTAICmd(ctx, params interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, params}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExternalClusterAPIGetConnectAndEnableCASTAICmd", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).ExternalClusterAPIGetConnectAndEnableCASTAICmd), varargs...) +} + +// ExternalClusterAPIGetConnectAndEnableCASTAICmdWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) ExternalClusterAPIGetConnectAndEnableCASTAICmdWithResponse(ctx context.Context, params *sdk.ExternalClusterAPIGetConnectAndEnableCASTAICmdParams) (*sdk.ExternalClusterAPIGetConnectAndEnableCASTAICmdResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ExternalClusterAPIGetConnectAndEnableCASTAICmdWithResponse", ctx, params) + ret0, _ := ret[0].(*sdk.ExternalClusterAPIGetConnectAndEnableCASTAICmdResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ExternalClusterAPIGetConnectAndEnableCASTAICmdWithResponse indicates an expected call of ExternalClusterAPIGetConnectAndEnableCASTAICmdWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) ExternalClusterAPIGetConnectAndEnableCASTAICmdWithResponse(ctx, params interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExternalClusterAPIGetConnectAndEnableCASTAICmdWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).ExternalClusterAPIGetConnectAndEnableCASTAICmdWithResponse), ctx, params) +} + +// ExternalClusterAPIGetConnectAndEnableCASTAIScript mocks base method. +func (m *MockClientWithResponsesInterface) ExternalClusterAPIGetConnectAndEnableCASTAIScript(ctx context.Context, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ExternalClusterAPIGetConnectAndEnableCASTAIScript", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ExternalClusterAPIGetConnectAndEnableCASTAIScript indicates an expected call of ExternalClusterAPIGetConnectAndEnableCASTAIScript. +func (mr *MockClientWithResponsesInterfaceMockRecorder) ExternalClusterAPIGetConnectAndEnableCASTAIScript(ctx interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExternalClusterAPIGetConnectAndEnableCASTAIScript", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).ExternalClusterAPIGetConnectAndEnableCASTAIScript), varargs...) +} + +// ExternalClusterAPIGetConnectAndEnableCASTAIScriptWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) ExternalClusterAPIGetConnectAndEnableCASTAIScriptWithResponse(ctx context.Context) (*sdk.ExternalClusterAPIGetConnectAndEnableCASTAIScriptResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ExternalClusterAPIGetConnectAndEnableCASTAIScriptWithResponse", ctx) + ret0, _ := ret[0].(*sdk.ExternalClusterAPIGetConnectAndEnableCASTAIScriptResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ExternalClusterAPIGetConnectAndEnableCASTAIScriptWithResponse indicates an expected call of ExternalClusterAPIGetConnectAndEnableCASTAIScriptWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) ExternalClusterAPIGetConnectAndEnableCASTAIScriptWithResponse(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExternalClusterAPIGetConnectAndEnableCASTAIScriptWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).ExternalClusterAPIGetConnectAndEnableCASTAIScriptWithResponse), ctx) +} + // ExternalClusterAPIGetCredentialsScript mocks base method. func (m *MockClientWithResponsesInterface) ExternalClusterAPIGetCredentialsScript(ctx context.Context, clusterId string, params *sdk.ExternalClusterAPIGetCredentialsScriptParams, reqEditors ...sdk.RequestEditorFn) (*http.Response, error) { m.ctrl.T.Helper() diff --git a/docs/resources/workload_scaling_policy.md b/docs/resources/workload_scaling_policy.md index 5d71de2f5..fec01de7c 100644 --- a/docs/resources/workload_scaling_policy.md +++ b/docs/resources/workload_scaling_policy.md @@ -341,8 +341,9 @@ Required: ### Nested Schema for `rollout_behavior` -Required: +Optional: +- `prefer_one_by_one` (Boolean) Defines if pods should be restarted one by one to avoid service disruption. - `type` (String) Defines the rollout type to be used when applying recommendations. - NO_DISRUPTION - pods are restarted without causing service disruption.