All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.computeoptimizer.model.AutoScalingGroupRecommendation Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Compute Optimizer module holds the client classes that are used for communicating with Compute Optimizer.

There is a newer version: 2.28.3
Show newest version
/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */

package software.amazon.awssdk.services.computeoptimizer.model;

import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Describes an Auto Scaling group recommendation. *

*/ @Generated("software.amazon.awssdk:codegen") public final class AutoScalingGroupRecommendation implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField ACCOUNT_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("accountId").getter(getter(AutoScalingGroupRecommendation::accountId)).setter(setter(Builder::accountId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("accountId").build()).build(); private static final SdkField AUTO_SCALING_GROUP_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("autoScalingGroupArn").getter(getter(AutoScalingGroupRecommendation::autoScalingGroupArn)) .setter(setter(Builder::autoScalingGroupArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("autoScalingGroupArn").build()) .build(); private static final SdkField AUTO_SCALING_GROUP_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("autoScalingGroupName").getter(getter(AutoScalingGroupRecommendation::autoScalingGroupName)) .setter(setter(Builder::autoScalingGroupName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("autoScalingGroupName").build()) .build(); private static final SdkField FINDING_FIELD = SdkField. builder(MarshallingType.STRING).memberName("finding") .getter(getter(AutoScalingGroupRecommendation::findingAsString)).setter(setter(Builder::finding)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("finding").build()).build(); private static final SdkField> UTILIZATION_METRICS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("utilizationMetrics") .getter(getter(AutoScalingGroupRecommendation::utilizationMetrics)) .setter(setter(Builder::utilizationMetrics)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("utilizationMetrics").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(UtilizationMetric::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField LOOK_BACK_PERIOD_IN_DAYS_FIELD = SdkField. builder(MarshallingType.DOUBLE) .memberName("lookBackPeriodInDays").getter(getter(AutoScalingGroupRecommendation::lookBackPeriodInDays)) .setter(setter(Builder::lookBackPeriodInDays)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("lookBackPeriodInDays").build()) .build(); private static final SdkField CURRENT_CONFIGURATION_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("currentConfiguration") .getter(getter(AutoScalingGroupRecommendation::currentConfiguration)).setter(setter(Builder::currentConfiguration)) .constructor(AutoScalingGroupConfiguration::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("currentConfiguration").build()) .build(); private static final SdkField CURRENT_INSTANCE_GPU_INFO_FIELD = SdkField. builder(MarshallingType.SDK_POJO) .memberName("currentInstanceGpuInfo").getter(getter(AutoScalingGroupRecommendation::currentInstanceGpuInfo)) .setter(setter(Builder::currentInstanceGpuInfo)).constructor(GpuInfo::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("currentInstanceGpuInfo").build()) .build(); private static final SdkField> RECOMMENDATION_OPTIONS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("recommendationOptions") .getter(getter(AutoScalingGroupRecommendation::recommendationOptions)) .setter(setter(Builder::recommendationOptions)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("recommendationOptions").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(AutoScalingGroupRecommendationOption::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField LAST_REFRESH_TIMESTAMP_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("lastRefreshTimestamp").getter(getter(AutoScalingGroupRecommendation::lastRefreshTimestamp)) .setter(setter(Builder::lastRefreshTimestamp)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("lastRefreshTimestamp").build()) .build(); private static final SdkField CURRENT_PERFORMANCE_RISK_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("currentPerformanceRisk").getter(getter(AutoScalingGroupRecommendation::currentPerformanceRiskAsString)) .setter(setter(Builder::currentPerformanceRisk)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("currentPerformanceRisk").build()) .build(); private static final SdkField EFFECTIVE_RECOMMENDATION_PREFERENCES_FIELD = SdkField . builder(MarshallingType.SDK_POJO) .memberName("effectiveRecommendationPreferences") .getter(getter(AutoScalingGroupRecommendation::effectiveRecommendationPreferences)) .setter(setter(Builder::effectiveRecommendationPreferences)) .constructor(EffectiveRecommendationPreferences::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("effectiveRecommendationPreferences") .build()).build(); private static final SdkField> INFERRED_WORKLOAD_TYPES_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("inferredWorkloadTypes") .getter(getter(AutoScalingGroupRecommendation::inferredWorkloadTypesAsStrings)) .setter(setter(Builder::inferredWorkloadTypesWithStrings)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("inferredWorkloadTypes").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.STRING) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ACCOUNT_ID_FIELD, AUTO_SCALING_GROUP_ARN_FIELD, AUTO_SCALING_GROUP_NAME_FIELD, FINDING_FIELD, UTILIZATION_METRICS_FIELD, LOOK_BACK_PERIOD_IN_DAYS_FIELD, CURRENT_CONFIGURATION_FIELD, CURRENT_INSTANCE_GPU_INFO_FIELD, RECOMMENDATION_OPTIONS_FIELD, LAST_REFRESH_TIMESTAMP_FIELD, CURRENT_PERFORMANCE_RISK_FIELD, EFFECTIVE_RECOMMENDATION_PREFERENCES_FIELD, INFERRED_WORKLOAD_TYPES_FIELD)); private static final long serialVersionUID = 1L; private final String accountId; private final String autoScalingGroupArn; private final String autoScalingGroupName; private final String finding; private final List utilizationMetrics; private final Double lookBackPeriodInDays; private final AutoScalingGroupConfiguration currentConfiguration; private final GpuInfo currentInstanceGpuInfo; private final List recommendationOptions; private final Instant lastRefreshTimestamp; private final String currentPerformanceRisk; private final EffectiveRecommendationPreferences effectiveRecommendationPreferences; private final List inferredWorkloadTypes; private AutoScalingGroupRecommendation(BuilderImpl builder) { this.accountId = builder.accountId; this.autoScalingGroupArn = builder.autoScalingGroupArn; this.autoScalingGroupName = builder.autoScalingGroupName; this.finding = builder.finding; this.utilizationMetrics = builder.utilizationMetrics; this.lookBackPeriodInDays = builder.lookBackPeriodInDays; this.currentConfiguration = builder.currentConfiguration; this.currentInstanceGpuInfo = builder.currentInstanceGpuInfo; this.recommendationOptions = builder.recommendationOptions; this.lastRefreshTimestamp = builder.lastRefreshTimestamp; this.currentPerformanceRisk = builder.currentPerformanceRisk; this.effectiveRecommendationPreferences = builder.effectiveRecommendationPreferences; this.inferredWorkloadTypes = builder.inferredWorkloadTypes; } /** *

* The Amazon Web Services account ID of the Auto Scaling group. *

* * @return The Amazon Web Services account ID of the Auto Scaling group. */ public final String accountId() { return accountId; } /** *

* The Amazon Resource Name (ARN) of the Auto Scaling group. *

* * @return The Amazon Resource Name (ARN) of the Auto Scaling group. */ public final String autoScalingGroupArn() { return autoScalingGroupArn; } /** *

* The name of the Auto Scaling group. *

* * @return The name of the Auto Scaling group. */ public final String autoScalingGroupName() { return autoScalingGroupName; } /** *

* The finding classification of the Auto Scaling group. *

*

* Findings for Auto Scaling groups include: *

*
    *
  • *

    * NotOptimized —An Auto Scaling group is considered not optimized when Compute Optimizer * identifies a recommendation that can provide better performance for your workload. *

    *
  • *
  • *

    * Optimized —An Auto Scaling group is considered optimized when Compute Optimizer determines * that the group is correctly provisioned to run your workload based on the chosen instance type. For optimized * resources, Compute Optimizer might recommend a new generation instance type. *

    *
  • *
*

* If the service returns an enum value that is not available in the current SDK version, {@link #finding} will * return {@link Finding#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #findingAsString}. *

* * @return The finding classification of the Auto Scaling group.

*

* Findings for Auto Scaling groups include: *

*
    *
  • *

    * NotOptimized —An Auto Scaling group is considered not optimized when Compute * Optimizer identifies a recommendation that can provide better performance for your workload. *

    *
  • *
  • *

    * Optimized —An Auto Scaling group is considered optimized when Compute Optimizer * determines that the group is correctly provisioned to run your workload based on the chosen instance * type. For optimized resources, Compute Optimizer might recommend a new generation instance type. *

    *
  • * @see Finding */ public final Finding finding() { return Finding.fromValue(finding); } /** *

    * The finding classification of the Auto Scaling group. *

    *

    * Findings for Auto Scaling groups include: *

    *
      *
    • *

      * NotOptimized —An Auto Scaling group is considered not optimized when Compute Optimizer * identifies a recommendation that can provide better performance for your workload. *

      *
    • *
    • *

      * Optimized —An Auto Scaling group is considered optimized when Compute Optimizer determines * that the group is correctly provisioned to run your workload based on the chosen instance type. For optimized * resources, Compute Optimizer might recommend a new generation instance type. *

      *
    • *
    *

    * If the service returns an enum value that is not available in the current SDK version, {@link #finding} will * return {@link Finding#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #findingAsString}. *

    * * @return The finding classification of the Auto Scaling group.

    *

    * Findings for Auto Scaling groups include: *

    *
      *
    • *

      * NotOptimized —An Auto Scaling group is considered not optimized when Compute * Optimizer identifies a recommendation that can provide better performance for your workload. *

      *
    • *
    • *

      * Optimized —An Auto Scaling group is considered optimized when Compute Optimizer * determines that the group is correctly provisioned to run your workload based on the chosen instance * type. For optimized resources, Compute Optimizer might recommend a new generation instance type. *

      *
    • * @see Finding */ public final String findingAsString() { return finding; } /** * For responses, this returns true if the service returned a value for the UtilizationMetrics property. This DOES * NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). * This is useful because the SDK will never return a null collection or map, but you may need to differentiate * between the service returning nothing (or null) and the service returning an empty collection or map. For * requests, this returns true if a value for the property was specified in the request builder, and false if a * value was not specified. */ public final boolean hasUtilizationMetrics() { return utilizationMetrics != null && !(utilizationMetrics instanceof SdkAutoConstructList); } /** *

      * An array of objects that describe the utilization metrics of the Auto Scaling group. *

      *

      * Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

      *

      * This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasUtilizationMetrics} method. *

      * * @return An array of objects that describe the utilization metrics of the Auto Scaling group. */ public final List utilizationMetrics() { return utilizationMetrics; } /** *

      * The number of days for which utilization metrics were analyzed for the Auto Scaling group. *

      * * @return The number of days for which utilization metrics were analyzed for the Auto Scaling group. */ public final Double lookBackPeriodInDays() { return lookBackPeriodInDays; } /** *

      * An array of objects that describe the current configuration of the Auto Scaling group. *

      * * @return An array of objects that describe the current configuration of the Auto Scaling group. */ public final AutoScalingGroupConfiguration currentConfiguration() { return currentConfiguration; } /** *

      * Describes the GPU accelerator settings for the current instance type of the Auto Scaling group. *

      * * @return Describes the GPU accelerator settings for the current instance type of the Auto Scaling group. */ public final GpuInfo currentInstanceGpuInfo() { return currentInstanceGpuInfo; } /** * For responses, this returns true if the service returned a value for the RecommendationOptions property. This * DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the * property). This is useful because the SDK will never return a null collection or map, but you may need to * differentiate between the service returning nothing (or null) and the service returning an empty collection or * map. For requests, this returns true if a value for the property was specified in the request builder, and false * if a value was not specified. */ public final boolean hasRecommendationOptions() { return recommendationOptions != null && !(recommendationOptions instanceof SdkAutoConstructList); } /** *

      * An array of objects that describe the recommendation options for the Auto Scaling group. *

      *

      * Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

      *

      * This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasRecommendationOptions} method. *

      * * @return An array of objects that describe the recommendation options for the Auto Scaling group. */ public final List recommendationOptions() { return recommendationOptions; } /** *

      * The timestamp of when the Auto Scaling group recommendation was last generated. *

      * * @return The timestamp of when the Auto Scaling group recommendation was last generated. */ public final Instant lastRefreshTimestamp() { return lastRefreshTimestamp; } /** *

      * The risk of the current Auto Scaling group not meeting the performance needs of its workloads. The higher the * risk, the more likely the current Auto Scaling group configuration has insufficient capacity and cannot meet * workload requirements. *

      *

      * If the service returns an enum value that is not available in the current SDK version, * {@link #currentPerformanceRisk} will return {@link CurrentPerformanceRisk#UNKNOWN_TO_SDK_VERSION}. The raw value * returned by the service is available from {@link #currentPerformanceRiskAsString}. *

      * * @return The risk of the current Auto Scaling group not meeting the performance needs of its workloads. The higher * the risk, the more likely the current Auto Scaling group configuration has insufficient capacity and * cannot meet workload requirements. * @see CurrentPerformanceRisk */ public final CurrentPerformanceRisk currentPerformanceRisk() { return CurrentPerformanceRisk.fromValue(currentPerformanceRisk); } /** *

      * The risk of the current Auto Scaling group not meeting the performance needs of its workloads. The higher the * risk, the more likely the current Auto Scaling group configuration has insufficient capacity and cannot meet * workload requirements. *

      *

      * If the service returns an enum value that is not available in the current SDK version, * {@link #currentPerformanceRisk} will return {@link CurrentPerformanceRisk#UNKNOWN_TO_SDK_VERSION}. The raw value * returned by the service is available from {@link #currentPerformanceRiskAsString}. *

      * * @return The risk of the current Auto Scaling group not meeting the performance needs of its workloads. The higher * the risk, the more likely the current Auto Scaling group configuration has insufficient capacity and * cannot meet workload requirements. * @see CurrentPerformanceRisk */ public final String currentPerformanceRiskAsString() { return currentPerformanceRisk; } /** *

      * An object that describes the effective recommendation preferences for the Auto Scaling group. *

      * * @return An object that describes the effective recommendation preferences for the Auto Scaling group. */ public final EffectiveRecommendationPreferences effectiveRecommendationPreferences() { return effectiveRecommendationPreferences; } /** *

      * The applications that might be running on the instances in the Auto Scaling group as inferred by Compute * Optimizer. *

      *

      * Compute Optimizer can infer if one of the following applications might be running on the instances: *

      *
        *
      • *

        * AmazonEmr - Infers that Amazon EMR might be running on the instances. *

        *
      • *
      • *

        * ApacheCassandra - Infers that Apache Cassandra might be running on the instances. *

        *
      • *
      • *

        * ApacheHadoop - Infers that Apache Hadoop might be running on the instances. *

        *
      • *
      • *

        * Memcached - Infers that Memcached might be running on the instances. *

        *
      • *
      • *

        * NGINX - Infers that NGINX might be running on the instances. *

        *
      • *
      • *

        * PostgreSql - Infers that PostgreSQL might be running on the instances. *

        *
      • *
      • *

        * Redis - Infers that Redis might be running on the instances. *

        *
      • *
      • *

        * Kafka - Infers that Kafka might be running on the instance. *

        *
      • *
      • *

        * SQLServer - Infers that SQLServer might be running on the instance. *

        *
      • *
      *

      * Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

      *

      * This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasInferredWorkloadTypes} method. *

      * * @return The applications that might be running on the instances in the Auto Scaling group as inferred by Compute * Optimizer.

      *

      * Compute Optimizer can infer if one of the following applications might be running on the instances: *

      *
        *
      • *

        * AmazonEmr - Infers that Amazon EMR might be running on the instances. *

        *
      • *
      • *

        * ApacheCassandra - Infers that Apache Cassandra might be running on the instances. *

        *
      • *
      • *

        * ApacheHadoop - Infers that Apache Hadoop might be running on the instances. *

        *
      • *
      • *

        * Memcached - Infers that Memcached might be running on the instances. *

        *
      • *
      • *

        * NGINX - Infers that NGINX might be running on the instances. *

        *
      • *
      • *

        * PostgreSql - Infers that PostgreSQL might be running on the instances. *

        *
      • *
      • *

        * Redis - Infers that Redis might be running on the instances. *

        *
      • *
      • *

        * Kafka - Infers that Kafka might be running on the instance. *

        *
      • *
      • *

        * SQLServer - Infers that SQLServer might be running on the instance. *

        *
      • */ public final List inferredWorkloadTypes() { return InferredWorkloadTypesCopier.copyStringToEnum(inferredWorkloadTypes); } /** * For responses, this returns true if the service returned a value for the InferredWorkloadTypes property. This * DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the * property). This is useful because the SDK will never return a null collection or map, but you may need to * differentiate between the service returning nothing (or null) and the service returning an empty collection or * map. For requests, this returns true if a value for the property was specified in the request builder, and false * if a value was not specified. */ public final boolean hasInferredWorkloadTypes() { return inferredWorkloadTypes != null && !(inferredWorkloadTypes instanceof SdkAutoConstructList); } /** *

        * The applications that might be running on the instances in the Auto Scaling group as inferred by Compute * Optimizer. *

        *

        * Compute Optimizer can infer if one of the following applications might be running on the instances: *

        *
          *
        • *

          * AmazonEmr - Infers that Amazon EMR might be running on the instances. *

          *
        • *
        • *

          * ApacheCassandra - Infers that Apache Cassandra might be running on the instances. *

          *
        • *
        • *

          * ApacheHadoop - Infers that Apache Hadoop might be running on the instances. *

          *
        • *
        • *

          * Memcached - Infers that Memcached might be running on the instances. *

          *
        • *
        • *

          * NGINX - Infers that NGINX might be running on the instances. *

          *
        • *
        • *

          * PostgreSql - Infers that PostgreSQL might be running on the instances. *

          *
        • *
        • *

          * Redis - Infers that Redis might be running on the instances. *

          *
        • *
        • *

          * Kafka - Infers that Kafka might be running on the instance. *

          *
        • *
        • *

          * SQLServer - Infers that SQLServer might be running on the instance. *

          *
        • *
        *

        * Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

        *

        * This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasInferredWorkloadTypes} method. *

        * * @return The applications that might be running on the instances in the Auto Scaling group as inferred by Compute * Optimizer.

        *

        * Compute Optimizer can infer if one of the following applications might be running on the instances: *

        *
          *
        • *

          * AmazonEmr - Infers that Amazon EMR might be running on the instances. *

          *
        • *
        • *

          * ApacheCassandra - Infers that Apache Cassandra might be running on the instances. *

          *
        • *
        • *

          * ApacheHadoop - Infers that Apache Hadoop might be running on the instances. *

          *
        • *
        • *

          * Memcached - Infers that Memcached might be running on the instances. *

          *
        • *
        • *

          * NGINX - Infers that NGINX might be running on the instances. *

          *
        • *
        • *

          * PostgreSql - Infers that PostgreSQL might be running on the instances. *

          *
        • *
        • *

          * Redis - Infers that Redis might be running on the instances. *

          *
        • *
        • *

          * Kafka - Infers that Kafka might be running on the instance. *

          *
        • *
        • *

          * SQLServer - Infers that SQLServer might be running on the instance. *

          *
        • */ public final List inferredWorkloadTypesAsStrings() { return inferredWorkloadTypes; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(accountId()); hashCode = 31 * hashCode + Objects.hashCode(autoScalingGroupArn()); hashCode = 31 * hashCode + Objects.hashCode(autoScalingGroupName()); hashCode = 31 * hashCode + Objects.hashCode(findingAsString()); hashCode = 31 * hashCode + Objects.hashCode(hasUtilizationMetrics() ? utilizationMetrics() : null); hashCode = 31 * hashCode + Objects.hashCode(lookBackPeriodInDays()); hashCode = 31 * hashCode + Objects.hashCode(currentConfiguration()); hashCode = 31 * hashCode + Objects.hashCode(currentInstanceGpuInfo()); hashCode = 31 * hashCode + Objects.hashCode(hasRecommendationOptions() ? recommendationOptions() : null); hashCode = 31 * hashCode + Objects.hashCode(lastRefreshTimestamp()); hashCode = 31 * hashCode + Objects.hashCode(currentPerformanceRiskAsString()); hashCode = 31 * hashCode + Objects.hashCode(effectiveRecommendationPreferences()); hashCode = 31 * hashCode + Objects.hashCode(hasInferredWorkloadTypes() ? inferredWorkloadTypesAsStrings() : null); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof AutoScalingGroupRecommendation)) { return false; } AutoScalingGroupRecommendation other = (AutoScalingGroupRecommendation) obj; return Objects.equals(accountId(), other.accountId()) && Objects.equals(autoScalingGroupArn(), other.autoScalingGroupArn()) && Objects.equals(autoScalingGroupName(), other.autoScalingGroupName()) && Objects.equals(findingAsString(), other.findingAsString()) && hasUtilizationMetrics() == other.hasUtilizationMetrics() && Objects.equals(utilizationMetrics(), other.utilizationMetrics()) && Objects.equals(lookBackPeriodInDays(), other.lookBackPeriodInDays()) && Objects.equals(currentConfiguration(), other.currentConfiguration()) && Objects.equals(currentInstanceGpuInfo(), other.currentInstanceGpuInfo()) && hasRecommendationOptions() == other.hasRecommendationOptions() && Objects.equals(recommendationOptions(), other.recommendationOptions()) && Objects.equals(lastRefreshTimestamp(), other.lastRefreshTimestamp()) && Objects.equals(currentPerformanceRiskAsString(), other.currentPerformanceRiskAsString()) && Objects.equals(effectiveRecommendationPreferences(), other.effectiveRecommendationPreferences()) && hasInferredWorkloadTypes() == other.hasInferredWorkloadTypes() && Objects.equals(inferredWorkloadTypesAsStrings(), other.inferredWorkloadTypesAsStrings()); } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. */ @Override public final String toString() { return ToString.builder("AutoScalingGroupRecommendation").add("AccountId", accountId()) .add("AutoScalingGroupArn", autoScalingGroupArn()).add("AutoScalingGroupName", autoScalingGroupName()) .add("Finding", findingAsString()) .add("UtilizationMetrics", hasUtilizationMetrics() ? utilizationMetrics() : null) .add("LookBackPeriodInDays", lookBackPeriodInDays()).add("CurrentConfiguration", currentConfiguration()) .add("CurrentInstanceGpuInfo", currentInstanceGpuInfo()) .add("RecommendationOptions", hasRecommendationOptions() ? recommendationOptions() : null) .add("LastRefreshTimestamp", lastRefreshTimestamp()) .add("CurrentPerformanceRisk", currentPerformanceRiskAsString()) .add("EffectiveRecommendationPreferences", effectiveRecommendationPreferences()) .add("InferredWorkloadTypes", hasInferredWorkloadTypes() ? inferredWorkloadTypesAsStrings() : null).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "accountId": return Optional.ofNullable(clazz.cast(accountId())); case "autoScalingGroupArn": return Optional.ofNullable(clazz.cast(autoScalingGroupArn())); case "autoScalingGroupName": return Optional.ofNullable(clazz.cast(autoScalingGroupName())); case "finding": return Optional.ofNullable(clazz.cast(findingAsString())); case "utilizationMetrics": return Optional.ofNullable(clazz.cast(utilizationMetrics())); case "lookBackPeriodInDays": return Optional.ofNullable(clazz.cast(lookBackPeriodInDays())); case "currentConfiguration": return Optional.ofNullable(clazz.cast(currentConfiguration())); case "currentInstanceGpuInfo": return Optional.ofNullable(clazz.cast(currentInstanceGpuInfo())); case "recommendationOptions": return Optional.ofNullable(clazz.cast(recommendationOptions())); case "lastRefreshTimestamp": return Optional.ofNullable(clazz.cast(lastRefreshTimestamp())); case "currentPerformanceRisk": return Optional.ofNullable(clazz.cast(currentPerformanceRiskAsString())); case "effectiveRecommendationPreferences": return Optional.ofNullable(clazz.cast(effectiveRecommendationPreferences())); case "inferredWorkloadTypes": return Optional.ofNullable(clazz.cast(inferredWorkloadTypesAsStrings())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((AutoScalingGroupRecommendation) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

          * The Amazon Web Services account ID of the Auto Scaling group. *

          * * @param accountId * The Amazon Web Services account ID of the Auto Scaling group. * @return Returns a reference to this object so that method calls can be chained together. */ Builder accountId(String accountId); /** *

          * The Amazon Resource Name (ARN) of the Auto Scaling group. *

          * * @param autoScalingGroupArn * The Amazon Resource Name (ARN) of the Auto Scaling group. * @return Returns a reference to this object so that method calls can be chained together. */ Builder autoScalingGroupArn(String autoScalingGroupArn); /** *

          * The name of the Auto Scaling group. *

          * * @param autoScalingGroupName * The name of the Auto Scaling group. * @return Returns a reference to this object so that method calls can be chained together. */ Builder autoScalingGroupName(String autoScalingGroupName); /** *

          * The finding classification of the Auto Scaling group. *

          *

          * Findings for Auto Scaling groups include: *

          *
            *
          • *

            * NotOptimized —An Auto Scaling group is considered not optimized when Compute Optimizer * identifies a recommendation that can provide better performance for your workload. *

            *
          • *
          • *

            * Optimized —An Auto Scaling group is considered optimized when Compute Optimizer * determines that the group is correctly provisioned to run your workload based on the chosen instance type. * For optimized resources, Compute Optimizer might recommend a new generation instance type. *

            *
          • *
          * * @param finding * The finding classification of the Auto Scaling group.

          *

          * Findings for Auto Scaling groups include: *

          *
            *
          • *

            * NotOptimized —An Auto Scaling group is considered not optimized when Compute * Optimizer identifies a recommendation that can provide better performance for your workload. *

            *
          • *
          • *

            * Optimized —An Auto Scaling group is considered optimized when Compute Optimizer * determines that the group is correctly provisioned to run your workload based on the chosen instance * type. For optimized resources, Compute Optimizer might recommend a new generation instance type. *

            *
          • * @see Finding * @return Returns a reference to this object so that method calls can be chained together. * @see Finding */ Builder finding(String finding); /** *

            * The finding classification of the Auto Scaling group. *

            *

            * Findings for Auto Scaling groups include: *

            *
              *
            • *

              * NotOptimized —An Auto Scaling group is considered not optimized when Compute Optimizer * identifies a recommendation that can provide better performance for your workload. *

              *
            • *
            • *

              * Optimized —An Auto Scaling group is considered optimized when Compute Optimizer * determines that the group is correctly provisioned to run your workload based on the chosen instance type. * For optimized resources, Compute Optimizer might recommend a new generation instance type. *

              *
            • *
            * * @param finding * The finding classification of the Auto Scaling group.

            *

            * Findings for Auto Scaling groups include: *

            *
              *
            • *

              * NotOptimized —An Auto Scaling group is considered not optimized when Compute * Optimizer identifies a recommendation that can provide better performance for your workload. *

              *
            • *
            • *

              * Optimized —An Auto Scaling group is considered optimized when Compute Optimizer * determines that the group is correctly provisioned to run your workload based on the chosen instance * type. For optimized resources, Compute Optimizer might recommend a new generation instance type. *

              *
            • * @see Finding * @return Returns a reference to this object so that method calls can be chained together. * @see Finding */ Builder finding(Finding finding); /** *

              * An array of objects that describe the utilization metrics of the Auto Scaling group. *

              * * @param utilizationMetrics * An array of objects that describe the utilization metrics of the Auto Scaling group. * @return Returns a reference to this object so that method calls can be chained together. */ Builder utilizationMetrics(Collection utilizationMetrics); /** *

              * An array of objects that describe the utilization metrics of the Auto Scaling group. *

              * * @param utilizationMetrics * An array of objects that describe the utilization metrics of the Auto Scaling group. * @return Returns a reference to this object so that method calls can be chained together. */ Builder utilizationMetrics(UtilizationMetric... utilizationMetrics); /** *

              * An array of objects that describe the utilization metrics of the Auto Scaling group. *

              * This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.computeoptimizer.model.UtilizationMetric.Builder} avoiding the need to * create one manually via * {@link software.amazon.awssdk.services.computeoptimizer.model.UtilizationMetric#builder()}. * *

              * When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.computeoptimizer.model.UtilizationMetric.Builder#build()} is called * immediately and its result is passed to {@link #utilizationMetrics(List)}. * * @param utilizationMetrics * a consumer that will call methods on * {@link software.amazon.awssdk.services.computeoptimizer.model.UtilizationMetric.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #utilizationMetrics(java.util.Collection) */ Builder utilizationMetrics(Consumer... utilizationMetrics); /** *

              * The number of days for which utilization metrics were analyzed for the Auto Scaling group. *

              * * @param lookBackPeriodInDays * The number of days for which utilization metrics were analyzed for the Auto Scaling group. * @return Returns a reference to this object so that method calls can be chained together. */ Builder lookBackPeriodInDays(Double lookBackPeriodInDays); /** *

              * An array of objects that describe the current configuration of the Auto Scaling group. *

              * * @param currentConfiguration * An array of objects that describe the current configuration of the Auto Scaling group. * @return Returns a reference to this object so that method calls can be chained together. */ Builder currentConfiguration(AutoScalingGroupConfiguration currentConfiguration); /** *

              * An array of objects that describe the current configuration of the Auto Scaling group. *

              * This is a convenience method that creates an instance of the {@link AutoScalingGroupConfiguration.Builder} * avoiding the need to create one manually via {@link AutoScalingGroupConfiguration#builder()}. * *

              * When the {@link Consumer} completes, {@link AutoScalingGroupConfiguration.Builder#build()} is called * immediately and its result is passed to {@link #currentConfiguration(AutoScalingGroupConfiguration)}. * * @param currentConfiguration * a consumer that will call methods on {@link AutoScalingGroupConfiguration.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #currentConfiguration(AutoScalingGroupConfiguration) */ default Builder currentConfiguration(Consumer currentConfiguration) { return currentConfiguration(AutoScalingGroupConfiguration.builder().applyMutation(currentConfiguration).build()); } /** *

              * Describes the GPU accelerator settings for the current instance type of the Auto Scaling group. *

              * * @param currentInstanceGpuInfo * Describes the GPU accelerator settings for the current instance type of the Auto Scaling group. * @return Returns a reference to this object so that method calls can be chained together. */ Builder currentInstanceGpuInfo(GpuInfo currentInstanceGpuInfo); /** *

              * Describes the GPU accelerator settings for the current instance type of the Auto Scaling group. *

              * This is a convenience method that creates an instance of the {@link GpuInfo.Builder} avoiding the need to * create one manually via {@link GpuInfo#builder()}. * *

              * When the {@link Consumer} completes, {@link GpuInfo.Builder#build()} is called immediately and its result is * passed to {@link #currentInstanceGpuInfo(GpuInfo)}. * * @param currentInstanceGpuInfo * a consumer that will call methods on {@link GpuInfo.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #currentInstanceGpuInfo(GpuInfo) */ default Builder currentInstanceGpuInfo(Consumer currentInstanceGpuInfo) { return currentInstanceGpuInfo(GpuInfo.builder().applyMutation(currentInstanceGpuInfo).build()); } /** *

              * An array of objects that describe the recommendation options for the Auto Scaling group. *

              * * @param recommendationOptions * An array of objects that describe the recommendation options for the Auto Scaling group. * @return Returns a reference to this object so that method calls can be chained together. */ Builder recommendationOptions(Collection recommendationOptions); /** *

              * An array of objects that describe the recommendation options for the Auto Scaling group. *

              * * @param recommendationOptions * An array of objects that describe the recommendation options for the Auto Scaling group. * @return Returns a reference to this object so that method calls can be chained together. */ Builder recommendationOptions(AutoScalingGroupRecommendationOption... recommendationOptions); /** *

              * An array of objects that describe the recommendation options for the Auto Scaling group. *

              * This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.computeoptimizer.model.AutoScalingGroupRecommendationOption.Builder} * avoiding the need to create one manually via * {@link software.amazon.awssdk.services.computeoptimizer.model.AutoScalingGroupRecommendationOption#builder()} * . * *

              * When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.computeoptimizer.model.AutoScalingGroupRecommendationOption.Builder#build()} * is called immediately and its result is passed to {@link * #recommendationOptions(List)}. * * @param recommendationOptions * a consumer that will call methods on * {@link software.amazon.awssdk.services.computeoptimizer.model.AutoScalingGroupRecommendationOption.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #recommendationOptions(java.util.Collection) */ Builder recommendationOptions(Consumer... recommendationOptions); /** *

              * The timestamp of when the Auto Scaling group recommendation was last generated. *

              * * @param lastRefreshTimestamp * The timestamp of when the Auto Scaling group recommendation was last generated. * @return Returns a reference to this object so that method calls can be chained together. */ Builder lastRefreshTimestamp(Instant lastRefreshTimestamp); /** *

              * The risk of the current Auto Scaling group not meeting the performance needs of its workloads. The higher the * risk, the more likely the current Auto Scaling group configuration has insufficient capacity and cannot meet * workload requirements. *

              * * @param currentPerformanceRisk * The risk of the current Auto Scaling group not meeting the performance needs of its workloads. The * higher the risk, the more likely the current Auto Scaling group configuration has insufficient * capacity and cannot meet workload requirements. * @see CurrentPerformanceRisk * @return Returns a reference to this object so that method calls can be chained together. * @see CurrentPerformanceRisk */ Builder currentPerformanceRisk(String currentPerformanceRisk); /** *

              * The risk of the current Auto Scaling group not meeting the performance needs of its workloads. The higher the * risk, the more likely the current Auto Scaling group configuration has insufficient capacity and cannot meet * workload requirements. *

              * * @param currentPerformanceRisk * The risk of the current Auto Scaling group not meeting the performance needs of its workloads. The * higher the risk, the more likely the current Auto Scaling group configuration has insufficient * capacity and cannot meet workload requirements. * @see CurrentPerformanceRisk * @return Returns a reference to this object so that method calls can be chained together. * @see CurrentPerformanceRisk */ Builder currentPerformanceRisk(CurrentPerformanceRisk currentPerformanceRisk); /** *

              * An object that describes the effective recommendation preferences for the Auto Scaling group. *

              * * @param effectiveRecommendationPreferences * An object that describes the effective recommendation preferences for the Auto Scaling group. * @return Returns a reference to this object so that method calls can be chained together. */ Builder effectiveRecommendationPreferences(EffectiveRecommendationPreferences effectiveRecommendationPreferences); /** *

              * An object that describes the effective recommendation preferences for the Auto Scaling group. *

              * This is a convenience method that creates an instance of the * {@link EffectiveRecommendationPreferences.Builder} avoiding the need to create one manually via * {@link EffectiveRecommendationPreferences#builder()}. * *

              * When the {@link Consumer} completes, {@link EffectiveRecommendationPreferences.Builder#build()} is called * immediately and its result is passed to * {@link #effectiveRecommendationPreferences(EffectiveRecommendationPreferences)}. * * @param effectiveRecommendationPreferences * a consumer that will call methods on {@link EffectiveRecommendationPreferences.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #effectiveRecommendationPreferences(EffectiveRecommendationPreferences) */ default Builder effectiveRecommendationPreferences( Consumer effectiveRecommendationPreferences) { return effectiveRecommendationPreferences(EffectiveRecommendationPreferences.builder() .applyMutation(effectiveRecommendationPreferences).build()); } /** *

              * The applications that might be running on the instances in the Auto Scaling group as inferred by Compute * Optimizer. *

              *

              * Compute Optimizer can infer if one of the following applications might be running on the instances: *

              *
                *
              • *

                * AmazonEmr - Infers that Amazon EMR might be running on the instances. *

                *
              • *
              • *

                * ApacheCassandra - Infers that Apache Cassandra might be running on the instances. *

                *
              • *
              • *

                * ApacheHadoop - Infers that Apache Hadoop might be running on the instances. *

                *
              • *
              • *

                * Memcached - Infers that Memcached might be running on the instances. *

                *
              • *
              • *

                * NGINX - Infers that NGINX might be running on the instances. *

                *
              • *
              • *

                * PostgreSql - Infers that PostgreSQL might be running on the instances. *

                *
              • *
              • *

                * Redis - Infers that Redis might be running on the instances. *

                *
              • *
              • *

                * Kafka - Infers that Kafka might be running on the instance. *

                *
              • *
              • *

                * SQLServer - Infers that SQLServer might be running on the instance. *

                *
              • *
              * * @param inferredWorkloadTypes * The applications that might be running on the instances in the Auto Scaling group as inferred by * Compute Optimizer.

              *

              * Compute Optimizer can infer if one of the following applications might be running on the instances: *

              *
                *
              • *

                * AmazonEmr - Infers that Amazon EMR might be running on the instances. *

                *
              • *
              • *

                * ApacheCassandra - Infers that Apache Cassandra might be running on the instances. *

                *
              • *
              • *

                * ApacheHadoop - Infers that Apache Hadoop might be running on the instances. *

                *
              • *
              • *

                * Memcached - Infers that Memcached might be running on the instances. *

                *
              • *
              • *

                * NGINX - Infers that NGINX might be running on the instances. *

                *
              • *
              • *

                * PostgreSql - Infers that PostgreSQL might be running on the instances. *

                *
              • *
              • *

                * Redis - Infers that Redis might be running on the instances. *

                *
              • *
              • *

                * Kafka - Infers that Kafka might be running on the instance. *

                *
              • *
              • *

                * SQLServer - Infers that SQLServer might be running on the instance. *

                *
              • * @return Returns a reference to this object so that method calls can be chained together. */ Builder inferredWorkloadTypesWithStrings(Collection inferredWorkloadTypes); /** *

                * The applications that might be running on the instances in the Auto Scaling group as inferred by Compute * Optimizer. *

                *

                * Compute Optimizer can infer if one of the following applications might be running on the instances: *

                *
                  *
                • *

                  * AmazonEmr - Infers that Amazon EMR might be running on the instances. *

                  *
                • *
                • *

                  * ApacheCassandra - Infers that Apache Cassandra might be running on the instances. *

                  *
                • *
                • *

                  * ApacheHadoop - Infers that Apache Hadoop might be running on the instances. *

                  *
                • *
                • *

                  * Memcached - Infers that Memcached might be running on the instances. *

                  *
                • *
                • *

                  * NGINX - Infers that NGINX might be running on the instances. *

                  *
                • *
                • *

                  * PostgreSql - Infers that PostgreSQL might be running on the instances. *

                  *
                • *
                • *

                  * Redis - Infers that Redis might be running on the instances. *

                  *
                • *
                • *

                  * Kafka - Infers that Kafka might be running on the instance. *

                  *
                • *
                • *

                  * SQLServer - Infers that SQLServer might be running on the instance. *

                  *
                • *
                * * @param inferredWorkloadTypes * The applications that might be running on the instances in the Auto Scaling group as inferred by * Compute Optimizer.

                *

                * Compute Optimizer can infer if one of the following applications might be running on the instances: *

                *
                  *
                • *

                  * AmazonEmr - Infers that Amazon EMR might be running on the instances. *

                  *
                • *
                • *

                  * ApacheCassandra - Infers that Apache Cassandra might be running on the instances. *

                  *
                • *
                • *

                  * ApacheHadoop - Infers that Apache Hadoop might be running on the instances. *

                  *
                • *
                • *

                  * Memcached - Infers that Memcached might be running on the instances. *

                  *
                • *
                • *

                  * NGINX - Infers that NGINX might be running on the instances. *

                  *
                • *
                • *

                  * PostgreSql - Infers that PostgreSQL might be running on the instances. *

                  *
                • *
                • *

                  * Redis - Infers that Redis might be running on the instances. *

                  *
                • *
                • *

                  * Kafka - Infers that Kafka might be running on the instance. *

                  *
                • *
                • *

                  * SQLServer - Infers that SQLServer might be running on the instance. *

                  *
                • * @return Returns a reference to this object so that method calls can be chained together. */ Builder inferredWorkloadTypesWithStrings(String... inferredWorkloadTypes); /** *

                  * The applications that might be running on the instances in the Auto Scaling group as inferred by Compute * Optimizer. *

                  *

                  * Compute Optimizer can infer if one of the following applications might be running on the instances: *

                  *
                    *
                  • *

                    * AmazonEmr - Infers that Amazon EMR might be running on the instances. *

                    *
                  • *
                  • *

                    * ApacheCassandra - Infers that Apache Cassandra might be running on the instances. *

                    *
                  • *
                  • *

                    * ApacheHadoop - Infers that Apache Hadoop might be running on the instances. *

                    *
                  • *
                  • *

                    * Memcached - Infers that Memcached might be running on the instances. *

                    *
                  • *
                  • *

                    * NGINX - Infers that NGINX might be running on the instances. *

                    *
                  • *
                  • *

                    * PostgreSql - Infers that PostgreSQL might be running on the instances. *

                    *
                  • *
                  • *

                    * Redis - Infers that Redis might be running on the instances. *

                    *
                  • *
                  • *

                    * Kafka - Infers that Kafka might be running on the instance. *

                    *
                  • *
                  • *

                    * SQLServer - Infers that SQLServer might be running on the instance. *

                    *
                  • *
                  * * @param inferredWorkloadTypes * The applications that might be running on the instances in the Auto Scaling group as inferred by * Compute Optimizer.

                  *

                  * Compute Optimizer can infer if one of the following applications might be running on the instances: *

                  *
                    *
                  • *

                    * AmazonEmr - Infers that Amazon EMR might be running on the instances. *

                    *
                  • *
                  • *

                    * ApacheCassandra - Infers that Apache Cassandra might be running on the instances. *

                    *
                  • *
                  • *

                    * ApacheHadoop - Infers that Apache Hadoop might be running on the instances. *

                    *
                  • *
                  • *

                    * Memcached - Infers that Memcached might be running on the instances. *

                    *
                  • *
                  • *

                    * NGINX - Infers that NGINX might be running on the instances. *

                    *
                  • *
                  • *

                    * PostgreSql - Infers that PostgreSQL might be running on the instances. *

                    *
                  • *
                  • *

                    * Redis - Infers that Redis might be running on the instances. *

                    *
                  • *
                  • *

                    * Kafka - Infers that Kafka might be running on the instance. *

                    *
                  • *
                  • *

                    * SQLServer - Infers that SQLServer might be running on the instance. *

                    *
                  • * @return Returns a reference to this object so that method calls can be chained together. */ Builder inferredWorkloadTypes(Collection inferredWorkloadTypes); /** *

                    * The applications that might be running on the instances in the Auto Scaling group as inferred by Compute * Optimizer. *

                    *

                    * Compute Optimizer can infer if one of the following applications might be running on the instances: *

                    *
                      *
                    • *

                      * AmazonEmr - Infers that Amazon EMR might be running on the instances. *

                      *
                    • *
                    • *

                      * ApacheCassandra - Infers that Apache Cassandra might be running on the instances. *

                      *
                    • *
                    • *

                      * ApacheHadoop - Infers that Apache Hadoop might be running on the instances. *

                      *
                    • *
                    • *

                      * Memcached - Infers that Memcached might be running on the instances. *

                      *
                    • *
                    • *

                      * NGINX - Infers that NGINX might be running on the instances. *

                      *
                    • *
                    • *

                      * PostgreSql - Infers that PostgreSQL might be running on the instances. *

                      *
                    • *
                    • *

                      * Redis - Infers that Redis might be running on the instances. *

                      *
                    • *
                    • *

                      * Kafka - Infers that Kafka might be running on the instance. *

                      *
                    • *
                    • *

                      * SQLServer - Infers that SQLServer might be running on the instance. *

                      *
                    • *
                    * * @param inferredWorkloadTypes * The applications that might be running on the instances in the Auto Scaling group as inferred by * Compute Optimizer.

                    *

                    * Compute Optimizer can infer if one of the following applications might be running on the instances: *

                    *
                      *
                    • *

                      * AmazonEmr - Infers that Amazon EMR might be running on the instances. *

                      *
                    • *
                    • *

                      * ApacheCassandra - Infers that Apache Cassandra might be running on the instances. *

                      *
                    • *
                    • *

                      * ApacheHadoop - Infers that Apache Hadoop might be running on the instances. *

                      *
                    • *
                    • *

                      * Memcached - Infers that Memcached might be running on the instances. *

                      *
                    • *
                    • *

                      * NGINX - Infers that NGINX might be running on the instances. *

                      *
                    • *
                    • *

                      * PostgreSql - Infers that PostgreSQL might be running on the instances. *

                      *
                    • *
                    • *

                      * Redis - Infers that Redis might be running on the instances. *

                      *
                    • *
                    • *

                      * Kafka - Infers that Kafka might be running on the instance. *

                      *
                    • *
                    • *

                      * SQLServer - Infers that SQLServer might be running on the instance. *

                      *
                    • * @return Returns a reference to this object so that method calls can be chained together. */ Builder inferredWorkloadTypes(InferredWorkloadType... inferredWorkloadTypes); } static final class BuilderImpl implements Builder { private String accountId; private String autoScalingGroupArn; private String autoScalingGroupName; private String finding; private List utilizationMetrics = DefaultSdkAutoConstructList.getInstance(); private Double lookBackPeriodInDays; private AutoScalingGroupConfiguration currentConfiguration; private GpuInfo currentInstanceGpuInfo; private List recommendationOptions = DefaultSdkAutoConstructList.getInstance(); private Instant lastRefreshTimestamp; private String currentPerformanceRisk; private EffectiveRecommendationPreferences effectiveRecommendationPreferences; private List inferredWorkloadTypes = DefaultSdkAutoConstructList.getInstance(); private BuilderImpl() { } private BuilderImpl(AutoScalingGroupRecommendation model) { accountId(model.accountId); autoScalingGroupArn(model.autoScalingGroupArn); autoScalingGroupName(model.autoScalingGroupName); finding(model.finding); utilizationMetrics(model.utilizationMetrics); lookBackPeriodInDays(model.lookBackPeriodInDays); currentConfiguration(model.currentConfiguration); currentInstanceGpuInfo(model.currentInstanceGpuInfo); recommendationOptions(model.recommendationOptions); lastRefreshTimestamp(model.lastRefreshTimestamp); currentPerformanceRisk(model.currentPerformanceRisk); effectiveRecommendationPreferences(model.effectiveRecommendationPreferences); inferredWorkloadTypesWithStrings(model.inferredWorkloadTypes); } public final String getAccountId() { return accountId; } public final void setAccountId(String accountId) { this.accountId = accountId; } @Override public final Builder accountId(String accountId) { this.accountId = accountId; return this; } public final String getAutoScalingGroupArn() { return autoScalingGroupArn; } public final void setAutoScalingGroupArn(String autoScalingGroupArn) { this.autoScalingGroupArn = autoScalingGroupArn; } @Override public final Builder autoScalingGroupArn(String autoScalingGroupArn) { this.autoScalingGroupArn = autoScalingGroupArn; return this; } public final String getAutoScalingGroupName() { return autoScalingGroupName; } public final void setAutoScalingGroupName(String autoScalingGroupName) { this.autoScalingGroupName = autoScalingGroupName; } @Override public final Builder autoScalingGroupName(String autoScalingGroupName) { this.autoScalingGroupName = autoScalingGroupName; return this; } public final String getFinding() { return finding; } public final void setFinding(String finding) { this.finding = finding; } @Override public final Builder finding(String finding) { this.finding = finding; return this; } @Override public final Builder finding(Finding finding) { this.finding(finding == null ? null : finding.toString()); return this; } public final List getUtilizationMetrics() { List result = UtilizationMetricsCopier.copyToBuilder(this.utilizationMetrics); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setUtilizationMetrics(Collection utilizationMetrics) { this.utilizationMetrics = UtilizationMetricsCopier.copyFromBuilder(utilizationMetrics); } @Override public final Builder utilizationMetrics(Collection utilizationMetrics) { this.utilizationMetrics = UtilizationMetricsCopier.copy(utilizationMetrics); return this; } @Override @SafeVarargs public final Builder utilizationMetrics(UtilizationMetric... utilizationMetrics) { utilizationMetrics(Arrays.asList(utilizationMetrics)); return this; } @Override @SafeVarargs public final Builder utilizationMetrics(Consumer... utilizationMetrics) { utilizationMetrics(Stream.of(utilizationMetrics).map(c -> UtilizationMetric.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final Double getLookBackPeriodInDays() { return lookBackPeriodInDays; } public final void setLookBackPeriodInDays(Double lookBackPeriodInDays) { this.lookBackPeriodInDays = lookBackPeriodInDays; } @Override public final Builder lookBackPeriodInDays(Double lookBackPeriodInDays) { this.lookBackPeriodInDays = lookBackPeriodInDays; return this; } public final AutoScalingGroupConfiguration.Builder getCurrentConfiguration() { return currentConfiguration != null ? currentConfiguration.toBuilder() : null; } public final void setCurrentConfiguration(AutoScalingGroupConfiguration.BuilderImpl currentConfiguration) { this.currentConfiguration = currentConfiguration != null ? currentConfiguration.build() : null; } @Override public final Builder currentConfiguration(AutoScalingGroupConfiguration currentConfiguration) { this.currentConfiguration = currentConfiguration; return this; } public final GpuInfo.Builder getCurrentInstanceGpuInfo() { return currentInstanceGpuInfo != null ? currentInstanceGpuInfo.toBuilder() : null; } public final void setCurrentInstanceGpuInfo(GpuInfo.BuilderImpl currentInstanceGpuInfo) { this.currentInstanceGpuInfo = currentInstanceGpuInfo != null ? currentInstanceGpuInfo.build() : null; } @Override public final Builder currentInstanceGpuInfo(GpuInfo currentInstanceGpuInfo) { this.currentInstanceGpuInfo = currentInstanceGpuInfo; return this; } public final List getRecommendationOptions() { List result = AutoScalingGroupRecommendationOptionsCopier .copyToBuilder(this.recommendationOptions); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setRecommendationOptions( Collection recommendationOptions) { this.recommendationOptions = AutoScalingGroupRecommendationOptionsCopier.copyFromBuilder(recommendationOptions); } @Override public final Builder recommendationOptions(Collection recommendationOptions) { this.recommendationOptions = AutoScalingGroupRecommendationOptionsCopier.copy(recommendationOptions); return this; } @Override @SafeVarargs public final Builder recommendationOptions(AutoScalingGroupRecommendationOption... recommendationOptions) { recommendationOptions(Arrays.asList(recommendationOptions)); return this; } @Override @SafeVarargs public final Builder recommendationOptions( Consumer... recommendationOptions) { recommendationOptions(Stream.of(recommendationOptions) .map(c -> AutoScalingGroupRecommendationOption.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final Instant getLastRefreshTimestamp() { return lastRefreshTimestamp; } public final void setLastRefreshTimestamp(Instant lastRefreshTimestamp) { this.lastRefreshTimestamp = lastRefreshTimestamp; } @Override public final Builder lastRefreshTimestamp(Instant lastRefreshTimestamp) { this.lastRefreshTimestamp = lastRefreshTimestamp; return this; } public final String getCurrentPerformanceRisk() { return currentPerformanceRisk; } public final void setCurrentPerformanceRisk(String currentPerformanceRisk) { this.currentPerformanceRisk = currentPerformanceRisk; } @Override public final Builder currentPerformanceRisk(String currentPerformanceRisk) { this.currentPerformanceRisk = currentPerformanceRisk; return this; } @Override public final Builder currentPerformanceRisk(CurrentPerformanceRisk currentPerformanceRisk) { this.currentPerformanceRisk(currentPerformanceRisk == null ? null : currentPerformanceRisk.toString()); return this; } public final EffectiveRecommendationPreferences.Builder getEffectiveRecommendationPreferences() { return effectiveRecommendationPreferences != null ? effectiveRecommendationPreferences.toBuilder() : null; } public final void setEffectiveRecommendationPreferences( EffectiveRecommendationPreferences.BuilderImpl effectiveRecommendationPreferences) { this.effectiveRecommendationPreferences = effectiveRecommendationPreferences != null ? effectiveRecommendationPreferences .build() : null; } @Override public final Builder effectiveRecommendationPreferences( EffectiveRecommendationPreferences effectiveRecommendationPreferences) { this.effectiveRecommendationPreferences = effectiveRecommendationPreferences; return this; } public final Collection getInferredWorkloadTypes() { if (inferredWorkloadTypes instanceof SdkAutoConstructList) { return null; } return inferredWorkloadTypes; } public final void setInferredWorkloadTypes(Collection inferredWorkloadTypes) { this.inferredWorkloadTypes = InferredWorkloadTypesCopier.copy(inferredWorkloadTypes); } @Override public final Builder inferredWorkloadTypesWithStrings(Collection inferredWorkloadTypes) { this.inferredWorkloadTypes = InferredWorkloadTypesCopier.copy(inferredWorkloadTypes); return this; } @Override @SafeVarargs public final Builder inferredWorkloadTypesWithStrings(String... inferredWorkloadTypes) { inferredWorkloadTypesWithStrings(Arrays.asList(inferredWorkloadTypes)); return this; } @Override public final Builder inferredWorkloadTypes(Collection inferredWorkloadTypes) { this.inferredWorkloadTypes = InferredWorkloadTypesCopier.copyEnumToString(inferredWorkloadTypes); return this; } @Override @SafeVarargs public final Builder inferredWorkloadTypes(InferredWorkloadType... inferredWorkloadTypes) { inferredWorkloadTypes(Arrays.asList(inferredWorkloadTypes)); return this; } @Override public AutoScalingGroupRecommendation build() { return new AutoScalingGroupRecommendation(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy